diff --git a/Backgrounds/SunkenSeaBurrowsBG.cs b/Backgrounds/SunkenSeaBurrowsBG.cs index 838eda9488..e51c997ffb 100644 --- a/Backgrounds/SunkenSeaBurrowsBG.cs +++ b/Backgrounds/SunkenSeaBurrowsBG.cs @@ -56,6 +56,55 @@ namespace CalamityMod.Backgrounds } } } + if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))) + { + int drawLimitX = Main.screenWidth / 16; + int drawLimitY = Main.screenHeight / 16; + Point drawPoint = (Main.screenPosition / 16).ToPoint(); + for (int i = 0; i < drawLimitX; i++) + { + for (int j = 0; j < drawLimitY; j++) + { + Point pos = drawPoint + new Point(i, j); + if (!Main.tile[pos.X, pos.Y].HasTile && + Main.tile[pos.X, pos.Y].WallType == 0 && + Main.tile[pos.X, pos.Y].LiquidAmount == 0) + Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f); + } + } + } + if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))) + { + int drawLimitX = Main.screenWidth / 16; + int drawLimitY = Main.screenHeight / 16; + Point drawPoint = (Main.screenPosition / 16).ToPoint(); + for (int i = 0; i < drawLimitX; i++) + { + for (int j = 0; j < drawLimitY; j++) + { + Point pos = drawPoint + new Point(i, j); + if (!Main.tile[pos.X, pos.Y].HasTile && + Main.tile[pos.X, pos.Y].WallType == 0) + Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f); + } + } + } + if (!Main.dedServ && (Main.LocalPlayer.InModBiome(ModContent.GetInstance()))) + { + int drawLimitX = Main.screenWidth / 16; + int drawLimitY = Main.screenHeight / 16; + Point drawPoint = (Main.screenPosition / 16).ToPoint(); + for (int i = 0; i < drawLimitX; i++) + { + for (int j = 0; j < drawLimitY; j++) + { + Point pos = drawPoint + new Point(i, j); + if (!Main.tile[pos.X, pos.Y].HasTile && + Main.tile[pos.X, pos.Y].WallType == 0) + Lighting.AddLight(pos.X, pos.Y, TorchID.White, 0.2f); + } + } + } } private void DrawToTarget(On_Main.orig_CheckMonoliths orig) @@ -73,6 +122,7 @@ namespace CalamityMod.Backgrounds // Leaving this here for other programmers, in case I don't get to doing this myself. Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, SamplerState.LinearClamp, DepthStencilState.None, Main.Rasterizer, null, CalamityUtils.BackgroundMatrix); + DrawShoresBG(); DrawBurrowsBG(); Main.spriteBatch.End(); @@ -97,6 +147,7 @@ namespace CalamityMod.Backgrounds // rendering code if that setting is on. if (Main.WaveQuality > 0 || !CalamityClientConfig.Instance.SunkenSeaBackgroundDistortion) { + DrawShoresBG(); DrawBurrowsBG(); } else @@ -123,14 +174,103 @@ namespace CalamityMod.Backgrounds } public static float Transparency; - public static float TransitionSpeed => 0.02f; + private static void DrawShoresBG() + { + if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) + { + Transparency += 1f; + + if (Transparency > 1f) + Transparency = 1f; + } + else + { + // Make transparency immediately go down so it doesnt look weird, since vanilla underground backgrounds dont have the fade-in effect this background has. + Transparency -= 1f; + + if (Transparency < 0f) + Transparency = 0f; + } + + // Don't bother running any of the background drawing if the transparency is zero (meaning the background isnt actually active). + // Also do not run any of the background drawing if you have the vanilla background config option turned off. + if (Transparency > 0f && Main.BackgroundEnabled) + { + Vector2 vector = Main.screenPosition + new Vector2((Main.screenWidth >> 1), (Main.screenHeight >> 1)); + float num = (Main.GameViewMatrix.Zoom.Y - 1f) * 0.5f * 200f; + float Scale = 1.5f; + float playerDrawPosition = ((Main.LocalPlayer.Center.Y / 16f) - 90) * 16f; + + for (int Layers = 4; Layers >= 0; Layers--) + { + // Get each background texture. + Texture2D BGTexture = ModContent.Request("CalamityMod/Backgrounds/SunkenSeaShoresBG" + Layers).Value; + + Vector2 vector2 = new Vector2(BGTexture.Width, BGTexture.Height) * 0.5f; + float num2 = (Layers * 2 + 3f); + Vector2 vector3 = new Vector2(1f / num2); + Rectangle rectangle = new Rectangle(0, 0, BGTexture.Width, BGTexture.Height); + Vector2 zero = Vector2.Zero; + + switch (Layers) + { + case 0: + { + zero.Y += 200f; + break; + } + case 1: + { + zero.Y += 0f; + break; + } + case 2: + { + zero.Y += 0f; + break; + } + case 3: + { + zero.Y += 0f; + break; + } + case 4: + { + zero.Y += 0f; + break; + } + } + + vector2 *= Scale; + + zero.Y -= num; + float LoopWidth = Scale * rectangle.Width; + float LoopHeight = Scale * rectangle.Height; + int LoopX = (int)((vector.X * vector3.X - vector2.X + zero.X - (Main.screenWidth >> 1)) / LoopWidth); + int LoopY = (int)((vector.Y * vector3.Y - vector2.Y + zero.Y - (Main.screenWidth >> 1)) / LoopWidth); + + for (int i = LoopY - 2; i < LoopY + 4 + (int)(Main.screenWidth / LoopHeight); i++) + { + for (int j = LoopX - 2; j < LoopX + 4 + (int)(Main.screenWidth / LoopWidth); j++) + { + Vector2 drawPosition = (new Vector2(j * Scale * (rectangle.Width / vector3.X), playerDrawPosition) + vector2 - vector) * vector3 + vector - Main.screenPosition - vector2 + zero; + + var frame = rectangle; + var color = Color.White * Transparency; + + Main.spriteBatch.Draw(BGTexture, drawPosition, frame, color, 0f, Vector2.Zero, Scale, SpriteEffects.None, 0f); + } + } + } + } + } private static void DrawBurrowsBG() { if (Main.LocalPlayer.InModBiome(ModContent.GetInstance())) { - Transparency += TransitionSpeed; + Transparency += 1f; if (Transparency > 1f) Transparency = 1f; diff --git a/Backgrounds/SunkenSeaShoresBG0.png b/Backgrounds/SunkenSeaShoresBG0.png new file mode 100644 index 0000000000..272e84a3d0 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG0.png differ diff --git a/Backgrounds/SunkenSeaShoresBG1.png b/Backgrounds/SunkenSeaShoresBG1.png new file mode 100644 index 0000000000..0d7faa83b7 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG1.png differ diff --git a/Backgrounds/SunkenSeaShoresBG2.png b/Backgrounds/SunkenSeaShoresBG2.png new file mode 100644 index 0000000000..ddaffc2a82 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG2.png differ diff --git a/Backgrounds/SunkenSeaShoresBG3.png b/Backgrounds/SunkenSeaShoresBG3.png new file mode 100644 index 0000000000..e9668359e5 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG3.png differ diff --git a/Backgrounds/SunkenSeaShoresBG4.png b/Backgrounds/SunkenSeaShoresBG4.png new file mode 100644 index 0000000000..4922846eb0 Binary files /dev/null and b/Backgrounds/SunkenSeaShoresBG4.png differ diff --git a/Balancing/BalancingChangesManager.cs b/Balancing/BalancingChangesManager.cs index 1e5a5fe8b1..9cb5eb02f0 100644 --- a/Balancing/BalancingChangesManager.cs +++ b/Balancing/BalancingChangesManager.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Balancing { public sealed class BalancingChangesManager : ModSystem { - internal static List UniversalBalancingChanges = null; internal static List NPCSpecificBalancingChanges = null; // Balancing changes in this method are sorted based on place in progression, NPC name (from A-Z), and strength of resistance in ascending order, in that level of priority. @@ -37,6 +36,7 @@ namespace CalamityMod.Balancing public override void SetStaticDefaults() { // Dirty shorthand for true melee resists, because they're super common and other class resists aren't. + // If you add/change a true melee resist here, be sure to add/change the resist in CalamityGlobalNPC ModifyHitByItem as well. IBalancingRule ResistTrueMelee(float f) => new ClassResistBalancingRule(f, TrueMeleeDamageClass.Instance); // Declare specific filters. @@ -46,50 +46,12 @@ namespace CalamityMod.Balancing bool DragonRageFilter(Projectile p) => p.type == ProjectileType() || p.type == ProjectileType() || (p.type == ProjectileType() && p.CountsAsClass()); - // bool MonkStaffT3Filter(Projectile p) => - // p.type == ProjectileID.MonkStaffT3_AltShot || (p.type == ProjectileID.Electrosphere && Main.player[p.owner].ActiveItem().type == ItemID.MonkStaffT3); - - bool MushroomSpearFilter(Projectile p) => - p.type == ProjectileID.Mushroom && Main.player[p.owner].ActiveItem().type == ItemID.MushroomSpear; - - bool OrichalcumPetalFilter(Projectile p) => - p.type == ProjectileID.FlowerPetal && Main.player[p.owner].onHitPetal; - - bool SpectreMaskSetBonusFilter(Projectile p) => - p.type == ProjectileID.SpectreWrath && Main.player[p.owner].ghostHurt; - bool AotCThrowCombo(Projectile p) => p.type == ProjectileType() && (p.ai[0] == 2 || p.ai[0] == 3); bool HiveBeeFilter(Projectile p) => p.type == ProjectileType() && Main.player[p.owner].ActiveItem().type == ItemType(); - UniversalBalancingChanges = new List() - { - // Nerf Crystal bullet shards by 45% - // Currently crystal bullet projectiles deal 50% of the bullet's damage which is absurd in vanilla, this nerfs them to 27.5% - Do(new ProjectileResistBalancingRule(0.55f, ProjectileID.CrystalShard)), - - // Nerf Luminite Arrow trails by 50%. - Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.MoonlordArrowTrail)), - - // Nerf Seedler seeds by 25%. - Do(new ProjectileResistBalancingRule(0.75f, ProjectileID.SeedlerNut, ProjectileID.SeedlerThorn)), - - // Nerf Cursed Dart flames by 50%. - Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.CursedDartFlame)), - - // Nerf Mushroom Spear projectiles by 50%. - Do(new ProjectileSpecificRequirementBalancingRule(0.5f, MushroomSpearFilter)), - - // Nerf Orichalcum armor set bonus petals by 25%. - Do(new ProjectileSpecificRequirementBalancingRule(0.75f, OrichalcumPetalFilter)), - - // Nerf Spectre Mask set bonus projectiles by 50%. - Do(new ProjectileSpecificRequirementBalancingRule(0.5f, SpectreMaskSetBonusFilter)), - - }; - NPCSpecificBalancingChanges = new List(); #region Crabulon @@ -97,23 +59,23 @@ namespace CalamityMod.Balancing NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCType(), ResistTrueMelee(0.8f))); #endregion - #region Brain of Cthulhu: Creepers - // 50% resist to true melee. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.5f)))); - - // 50% resist to Demon Scythe. - NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); - #endregion - #region Eater of Worlds - // 50% resist to true melee. - NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.5f)))); - // 50% resist to Demon Scythe. NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); // 40% resist to Sky Glaze. NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); + + // 25% resist to true melee. + NPCSpecificBalancingChanges.AddRange(Bundle(EaterOfWorldsIDList.List, Do(ResistTrueMelee(0.75f)))); + #endregion + + #region Brain of Cthulhu: Creepers + // 50% resist to Demon Scythe. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(new ProjectileResistBalancingRule(0.5f, ProjectileID.DemonScythe)))); + + // 25% resist to true melee. + NPCSpecificBalancingChanges.Add(new NPCBalancingChange(NPCID.Creeper, Do(ResistTrueMelee(0.75f)))); #endregion #region The Perforators @@ -175,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 @@ -202,21 +167,18 @@ namespace CalamityMod.Balancing // 50% resist to Aegis Blade's explosions because the true melee resist ain't enough. NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); - // 50% resist to Icicle Arrows. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.5f, ProjectileType())))); + // 40% resist to Icicle Arrows. + NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.6f, ProjectileType())))); // 35% resist to Flying Dragon. NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.65f, ProjectileID.DD2SquireSonicBoom)))); - // 30% resist to Aurora Blazer. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); - - // 30% resist to Flak Kraken. - NPCSpecificBalancingChanges.AddRange(Bundle(RavagerIDList.List, Do(new ProjectileResistBalancingRule(0.7f, ProjectileType())))); - // 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 @@ -245,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 @@ -511,23 +473,12 @@ namespace CalamityMod.Balancing public override void Unload() { - UniversalBalancingChanges = null; NPCSpecificBalancingChanges = null; } public static void ApplyFromProjectile(NPC npc, ref NPC.HitModifiers modifiers, Projectile proj) { - // Apply universal balancing rules. - foreach (IBalancingRule[] balancingRules in UniversalBalancingChanges) - { - foreach (IBalancingRule balancingRule in balancingRules) - { - if (balancingRule.AppliesTo(npc, modifiers, proj)) - balancingRule.ApplyBalancingChange(npc, ref modifiers); - } - } - - // As well as rules specific to NPCs. + // Apply NPC-specific balancing rules. foreach (NPCBalancingChange balanceChange in NPCSpecificBalancingChanges) { if (npc.type != balanceChange.NPCType) diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 430de64677..2322303648 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -117,54 +117,22 @@ #endregion #region Life Steal - // Life steal cap + // Life steal cap (Maximum HP healed per instance of lifesteal) internal static readonly int LifeStealCap = 100; - - // Life steal accessories require a more strict cooldown due to their ease of use and global application - internal static readonly float LifeStealAccessoryCooldownMultiplier = 3f; - // Life steal cooldown multipliers used for armor set bonuses - internal static readonly float LifeStealSetBonusCooldownMultiplier = 2f; - internal static readonly float LifeStealReaverTankCooldownMultiplier = 4f; - - // The range was buffed in vanilla from 1200 to 3000 in 1.4.4, and I agree with that decision - internal static readonly float LifeStealRange = 3000f; - - // Life steal caps (aka, how much life steal the player is allowed before it goes on cooldown) - internal static readonly float LifeStealCap_Classic = 60f; - internal static readonly float LifeStealCap_Expert = 50f; - internal static readonly float LifeStealCap_Revengeance = 40f; - internal static readonly float LifeStealCap_Death = 30f; - - // Master nerfs the life steal cap by 10, resulting in 40 in non-Rev Master, 30 in Rev Master, and 20 in Death Master - internal static readonly float LifeStealCapReduction_Master = 10f; + // Base life steal caps from vanilla (aka, how much life steal the player is allowed before it goes on cooldown) + internal static readonly float LifeStealCap_Classic = 80f; + internal static readonly float LifeStealCap_Expert = 70f; // The base life steal cooldowns from vanilla internal static readonly float LifeStealRecoveryRate_Classic = 0.6f; internal static readonly float LifeStealRecoveryRate_Expert = 0.5f; - // The calculations below show the time (in frames) for 10 life steal cooldown to recover in each difficulty - // Classic: 10 / 0.2 = 50 - // Expert: 10 / 0.15 = 66.667 - // Revengeance: 10 / 0.125 = 80 - // Death: 10 / 0.1 = 100 - // Master: 10 / 0.1 = 100 - // Revengeance Master: 10 / 0.075 = 133.333 - // Death Master: 10 / 0.05 = 200 - // Nerfs the life steal recovery rate in Classic from 0.6/s to 0.2/s + // Nerfs the life steal recovery rate in Classic from 0.6 to 0.2 (36 HP/s to 12 HP/s) internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f; - // Nerfs the life steal recovery rate in Expert from 0.5/s to 0.15/s + // Nerfs the life steal recovery rate in Expert from 0.5 to 0.15 (30 HP/s to 9 HP/s) internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f; - - // Nerfs the life steal recovery rate in Revengeance from 0.5/s to 0.125/s - internal static readonly float LifeStealRecoveryRateReduction_Revengeance = 0.375f; - - // Nerfs the life steal recovery rate in Death from 0.5/s to 0.1/s - internal static readonly float LifeStealRecoveryRateReduction_Death = 0.4f; - - // Nerfs the life steal recovery rate in Master by 0.05/s, resulting in 0.1/s in non-Rev Master, 0.075/s in Rev Master, and 0.05/s in Death Master - internal static readonly float LifeStealRecoveryRateReduction_Master = 0.05f; #endregion #region Rogue Base Stats diff --git a/Buffs/CalamityGlobalBuff.cs b/Buffs/CalamityGlobalBuff.cs index 1a894e329a..dd0b8114cc 100644 --- a/Buffs/CalamityGlobalBuff.cs +++ b/Buffs/CalamityGlobalBuff.cs @@ -36,10 +36,6 @@ namespace CalamityMod.Buffs { player.arrowDamage *= 0.955f; } - else if (type == BuffID.Ironskin) - { - player.statDefense += CalamityUtils.GetScalingDefense(-1) - 8; - } else if (type == BuffID.MagicPower) { player.GetDamage() -= 0.1f; @@ -93,10 +89,6 @@ namespace CalamityMod.Buffs { player.Calamity().shine = true; } - else if (type == BuffID.IceBarrier) - { - player.endurance -= 0.1f; - } // Beetle Shell DR is a full compensation, as the vanilla multiplicative DR is removed entirely. else if (type >= BuffID.BeetleEndurance1 && type <= BuffID.BeetleEndurance3 && player.beetleDefense) @@ -115,6 +107,19 @@ namespace CalamityMod.Buffs else if (type == BuffID.Rabies) { player.GetDamage() -= 0.2f; + + // Reimplementation of random debuff infliction; now occurs on a consistent timer and with a different debuff list + if (player.buffTime[buffIndex] % 600 == 300) + { + int debuffType = Main.rand.Next(4) switch + { + 0 => BuffID.Weak, + 1 => BuffID.Bleeding, + 2 => BuffID.Darkness, + _ => BuffID.BrokenArmor, + }; + player.AddBuff(debuffType, Main.rand.Next(90, 211)); + } } else if (type == BuffID.Werewolf) { @@ -148,12 +153,6 @@ namespace CalamityMod.Buffs if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; } - else if (type == BuffID.Slow) - { - npc.Calamity().slowed = true; - if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; - } if (type == BuffID.Electrified) { npc.Calamity().electrified = true; @@ -201,10 +200,6 @@ namespace CalamityMod.Buffs tip = tip.Replace("25", "15"); break; - case BuffID.Ironskin: - tip = tip.Replace("8", CalamityUtils.GetScalingDefense(-1).ToString()); - break; - case BuffID.LeafCrystal: tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.LeafCrystal"); break; @@ -242,6 +237,10 @@ namespace CalamityMod.Buffs tip = tip.Replace("45", "22.5"); break; + case BuffID.Rabies: + tip = CalamityUtils.GetTextValue("Vanilla.BuffDescription.Rabies"); + break; + case BuffID.SugarRush: tip = tip.Replace("20", "10"); break; diff --git a/Buffs/PopoBuff.cs b/Buffs/PopoBuff.cs index f5d8e36d54..4b433f99ae 100644 --- a/Buffs/PopoBuff.cs +++ b/Buffs/PopoBuff.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Accessories.Vanity; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -18,11 +19,7 @@ namespace CalamityMod.Buffs public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.snowmanPrevious) - { - modPlayer.snowmanPower = true; - } - else + if (player.Transformation().Type != ModContent.ItemType()) { player.DelBuff(buffIndex); buffIndex--; diff --git a/Buffs/PopoNoselessBuff.cs b/Buffs/PopoNoselessBuff.cs index ed87c9db8d..fd284151e7 100644 --- a/Buffs/PopoNoselessBuff.cs +++ b/Buffs/PopoNoselessBuff.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Accessories.Vanity; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,11 +18,8 @@ namespace CalamityMod.Buffs public override void Update(Player player, ref int buffIndex) { CalamityPlayer modPlayer = player.Calamity(); - if (modPlayer.snowmanPrevious) - { - modPlayer.snowmanPower = true; + if (player.Transformation().Type == ModContent.ItemType()) modPlayer.snowmanNoseless = true; - } else { player.DelBuff(buffIndex); diff --git a/Buffs/Potions/ShadowBuff.png b/Buffs/Potions/ShadowBuff.png index ed4141070a..bb0b1ed058 100644 Binary files a/Buffs/Potions/ShadowBuff.png and b/Buffs/Potions/ShadowBuff.png differ diff --git a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs index e1757ba91c..68c5c642f7 100644 --- a/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs +++ b/Buffs/StatBuffs/AbyssalDivingSuitBuff.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Buffs.StatBuffs player.maxFallSpeed = 9f; player.gills = true; } - modPlayer.abyssalDivingSuitPower = true; modPlayer.depthCharm = true; modPlayer.jellyfishNecklace = true; modPlayer.anechoicPlating = true; diff --git a/Buffs/StatBuffs/AquaticHeartBuff.cs b/Buffs/StatBuffs/AquaticHeartBuff.cs index 344acacd15..5dde4436f3 100644 --- a/Buffs/StatBuffs/AquaticHeartBuff.cs +++ b/Buffs/StatBuffs/AquaticHeartBuff.cs @@ -20,14 +20,13 @@ namespace CalamityMod.Buffs.StatBuffs CalamityPlayer modPlayer = player.Calamity(); if (modPlayer.aquaticHeartPrevious) { - modPlayer.aquaticHeartPower = true; player.ignoreWater = NPC.downedBoss3; player.accFlipper = true; if (player.breath <= player.breathMax + 2 && !modPlayer.ZoneAbyss && NPC.downedBoss3) { player.breath = player.breathMax + 3; } - if (Main.myPlayer == player.whoAmI && player.wet && NPC.downedBoss3) + if (Main.myPlayer == player.whoAmI && player.Calamity().countsAsAnyWet && NPC.downedBoss3) { player.AddBuff(ModContent.BuffType(), 360); } diff --git a/Buffs/StatBuffs/BrutalCarnage.cs b/Buffs/StatBuffs/BrutalCarnage.cs deleted file mode 100644 index bcb31db8f7..0000000000 --- a/Buffs/StatBuffs/BrutalCarnage.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Terraria; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Buffs.StatBuffs -{ - public class BrutalCarnage : ModBuff - { - public static float MeleeDamageBoost = 0.2f; - public override LocalizedText Description => base.Description.WithFormatArgs(MeleeDamageBoost.ToPercent()); - - public override void SetStaticDefaults() - { - Main.debuff[Type] = false; - Main.pvpBuff[Type] = true; - Main.buffNoSave[Type] = true; - } - - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().brutalCarnage = true; - } - } -} diff --git a/Buffs/StatBuffs/BrutalCarnage.png b/Buffs/StatBuffs/BrutalCarnage.png deleted file mode 100644 index 9b3ce4f18a..0000000000 Binary files a/Buffs/StatBuffs/BrutalCarnage.png and /dev/null differ diff --git a/Buffs/StatBuffs/Mushy.cs b/Buffs/StatBuffs/Mushy.cs index 23ae4f785c..c5c5fc1aa8 100644 --- a/Buffs/StatBuffs/Mushy.cs +++ b/Buffs/StatBuffs/Mushy.cs @@ -8,7 +8,7 @@ namespace CalamityMod.Buffs.StatBuffs { public class Mushy : ModBuff { - public static int DefenseBoost = 8; + public static int DefenseBoost = 5; public static int RegenBoost = 2; public override LocalizedText Description => base.Description.WithFormatArgs(DefenseBoost, RegenBoost.ToRegenPerSecond()); diff --git a/Buffs/StatBuffs/SpiritDefense.cs b/Buffs/StatBuffs/SpiritDefense.cs index 664de50b2b..ad39d8d70d 100644 --- a/Buffs/StatBuffs/SpiritDefense.cs +++ b/Buffs/StatBuffs/SpiritDefense.cs @@ -7,7 +7,7 @@ namespace CalamityMod.Buffs.StatBuffs { public class SpiritDefense : ModBuff { - public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost, SpiritGlyph.DamageReductionBoost.ToPercent()); + public override LocalizedText Description => base.Description.WithFormatArgs(SpiritGlyph.DefenseBoost); public override void SetStaticDefaults() { @@ -20,7 +20,6 @@ namespace CalamityMod.Buffs.StatBuffs public override void Update(Player player, ref int buffIndex) { player.statDefense += SpiritGlyph.DefenseBoost; - player.endurance += SpiritGlyph.DamageReductionBoost; // TODO -- is this applied too late to be affected by the DR softcap? } } } diff --git a/Buffs/StatDebuffs/GlacialState.cs b/Buffs/StatDebuffs/GlacialState.cs index 4a6589b05f..bbb09eea38 100644 --- a/Buffs/StatDebuffs/GlacialState.cs +++ b/Buffs/StatDebuffs/GlacialState.cs @@ -18,31 +18,13 @@ namespace CalamityMod.Buffs.StatDebuffs BuffID.Sets.LongerExpertDebuff[Type] = true; } - public override void Update(Player player, ref int buffIndex) - { - player.Calamity().glacialState = true; - } - public override void Update(NPC npc, ref int buffIndex) { npc.Calamity().glacialState = true; if ((EnemyImmunitiesList.Includes(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0) - npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex]; - } - - internal static void DrawEffects(PlayerDrawSet drawInfo) - { - Player Player = drawInfo.drawPlayer; - - if (Main.rand.NextBool(4)) - { - Dust d = Dust.NewDustDirect(Player.Center - 10 * Vector2.One, 20, 20, DustID.IcyMerman); - d.noGravity = Main.rand.NextBool(); - d.noLight = false; - d.velocity *= 0.2f; - d.velocity.Y -= Main.rand.NextFloat(0.4f, 0.6f); - d.scale = Main.rand.NextFloat(0.4f, 0.7f); - } + npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().gState; + npc.DelBuff(buffIndex); + buffIndex--; } } } diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index cc28ad6e35..31f8327f87 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -21,6 +21,7 @@ using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Brimflame; using CalamityMod.Items.Armor.Daedalus; using CalamityMod.Items.Armor.Demonshade; +using CalamityMod.Items.Armor.DesertProwler; using CalamityMod.Items.Armor.Empyrean; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.OmegaBlue; @@ -28,7 +29,9 @@ using CalamityMod.Items.Armor.PlagueReaper; using CalamityMod.Items.Armor.Silva; using CalamityMod.Items.Armor.SnowRuffian; using CalamityMod.Items.Armor.Victide; +using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Dyes; +using CalamityMod.Items.Materials; using CalamityMod.Items.Mounts; using CalamityMod.Items.Mounts.Minecarts; using CalamityMod.Items.PermanentBoosters; @@ -176,6 +179,8 @@ namespace CalamityMod.CalPlayer /// A multiplier on the player's movement speed applied while using Momentum Capacitor. public float momentumCapacitorBoost = 0f; + public bool countsAsAnyWet => (Player.armor[0].type == ItemID.FishBowl || Player.wetCount > 0 || Player.wet || Player.honeyWet || Player.lavaWet); + public StatModifier TypelessDebuffMultiplier = new(); public StatModifier HeatDebuffMultiplier = new(); public StatModifier ColdDebuffMultiplier = new(); @@ -205,7 +210,6 @@ namespace CalamityMod.CalPlayer #region External variables -- Not used by Calamity, only via Mod.Call or reflection public int externalAbyssLight = 0; - public float externalBreathLossMultBoost = 0f; public float externalBreathTickBoost = 0f; public float externalFlightTimeMultBoost = 0f; @@ -284,6 +288,8 @@ namespace CalamityMod.CalPlayer public int evilSmasherBoost = 0; /// Cooldown variable for spawning Plague Tainted SMG's drones from left-click bullets. public int plagueTaintedSMGDroneCooldown = 0; + /// Cooldown variable which prevents using Firestorm Cannon or Spectralstorm Cannon during their overheat periods. + public int flareGunOverheat = 0; /// /// If true, this player's Brittle Star Staff minions are in their orbiting mode.
/// While in this mode, they orbit around the player, do not break on hits, and increase defense. @@ -309,6 +315,9 @@ namespace CalamityMod.CalPlayer public int furyFuelMax = 1800; public int furyFuel = 1800; public float furyRefuelTimer = 0; + /// Variable used to track if Auger can do a big slash + public bool buffedAuger = false; + public int rOfResilienceCooldown = 0; public int rOfResilienceEffect = 0; public int rOfResilienceOrbitOffset = 0; @@ -462,7 +471,7 @@ namespace CalamityMod.CalPlayer /// This is obtained from a formula derived from the player's current stealth, the weapon's use time, and the player's stealth generation boosts. ///
public float stealthDamage = 0f; - /// An additional damage multiplier applied to rogue stealth strikes. Used by Filthy Glove and its upgrades, and Rotten Dogtooth. + /// An additional damage multiplier applied to rogue stealth strikes. Used by Filthy Glove, Rotten Dogtooth and their upgrades. public double bonusStealthDamage = 0; public float rogueVelocity = 1f; #endregion @@ -667,8 +676,6 @@ namespace CalamityMod.CalPlayer #endregion #region Abyss - /// The amount of breath lost on each tick while in the Abyss. - public float abyssBreathLossStat = 0; /// The rate at which breath is lost while in the Abyss. public float abyssBreathLossRateStat = 0; /// The rate at which health is decreased after running out of breath while in the Abyss. @@ -725,8 +732,8 @@ namespace CalamityMod.CalPlayer public bool gladiatorSword = false; public int gladiatorTimer = 0; public bool unstableGraniteCore = false; - public bool regenator = false; - public float regenatorDamage = 0; + public bool regenerator = false; + public float regeneratorDamage = 0; public bool theBee = false; public bool arcFlashRing = false; public bool arcFlashRingVisual = false; @@ -964,6 +971,8 @@ namespace CalamityMod.CalPlayer public bool XykVisualsBlue = false; public bool XykVisualsOrange = false; public Color XykFXColor = Color.Black; + public int XykWingTimer = 0; + public Color lightRGB = Color.Black; public bool manaOverloader = false; /// Used for allowing Calamity slimes to be affected by Royal Gel. public bool royalGel = false; @@ -1068,6 +1077,8 @@ namespace CalamityMod.CalPlayer /// Calamity's Silver armor set bonus; taking over 20 damage heals 10 health if the player avoids damage for 2 seconds. public bool silverMedkit = false; public int silverMedkitTimer = 0; + /// Calamity's Tungsten armor set bonus; makes grappling hooks fly and retract faster. + public bool tungstenArmorHookBoost = false; /// Calamity's Gold armor set bonus; makes enemies drop Gold Coins. public bool goldArmorGoldDrops = false; /// Calamity's Mining armor set bonus; gives a chance for extra items to drop when mining ores. @@ -1150,8 +1161,6 @@ namespace CalamityMod.CalPlayer public int titanCooldown = 0; public bool umbraphileSet = false; public bool reaverSpeed = false; - public bool reaverRegen = false; - public int reaverRegenCooldown = 0; public bool reaverDefense = false; public bool reaverExplore = false; public bool fathomSwarmer = false; @@ -1269,7 +1278,6 @@ namespace CalamityMod.CalPlayer public bool plague = false; public bool holyFlames = false; public bool holyInferno = false; - public bool glacialState = false; public bool burningBlood = false; public bool brainRot = false; public bool heavybleeding = false; @@ -1326,7 +1334,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; @@ -1584,33 +1591,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; @@ -1619,8 +1612,6 @@ namespace CalamityMod.CalPlayer public bool omegaBlueTransformation; public bool omegaBlueTransformationForce; public bool omegaBlueTransformationPower; - public bool ghostBracelet; - public bool punchCard; #endregion #region Calamitas Enchant Effects @@ -2005,10 +1996,9 @@ namespace CalamityMod.CalPlayer public override void ResetEffects() { if (fleshKnuckles) - Player.statLifeMax2 += 45; + Player.statLifeMax2 += 25; int percentMaxLifeIncrease = 0; - // Blood Pact and Chalice of the Blood God stack their HP bonuses if you want to equip both if (bloodPact) percentMaxLifeIncrease += 25; @@ -2048,7 +2038,6 @@ namespace CalamityMod.CalPlayer DashID = string.Empty; externalAbyssLight = 0; - externalBreathLossMultBoost = 0f; externalBreathTickBoost = 0f; externalFlightTimeMultBoost = 0f; externalRageEnabled = externalAdrenalineEnabled = null; @@ -2179,7 +2168,7 @@ namespace CalamityMod.CalPlayer trinketOfChi = false; gladiatorSword = false; unstableGraniteCore = false; - regenator = false; + regenerator = false; deepDiver = false; theBee = false; arcFlashRing = false; @@ -2354,7 +2343,6 @@ namespace CalamityMod.CalPlayer avertorBonus = false; - reaverRegen = false; reaverSpeed = false; reaverDefense = false; reaverExplore = false; @@ -2386,6 +2374,7 @@ namespace CalamityMod.CalPlayer forbiddenCirclet = false; silverMedkit = false; + tungstenArmorHookBoost = false; goldArmorGoldDrops = false; miningSet = false; @@ -2487,7 +2476,6 @@ namespace CalamityMod.CalPlayer plague = false; holyFlames = false; holyInferno = false; - glacialState = false; burningBlood = false; brainRot = false; heavybleeding = false; @@ -2534,7 +2522,6 @@ namespace CalamityMod.CalPlayer xWrath = false; graxDefense = false; encased = false; - brutalCarnage = false; omniscience = false; zerg = false; zen = false; @@ -2740,29 +2727,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; @@ -2916,7 +2896,6 @@ namespace CalamityMod.CalPlayer demonSwordKillMode = false; externalAbyssLight = 0; - externalBreathLossMultBoost = 0f; externalBreathTickBoost = 0f; externalFlightTimeMultBoost = 0f; externalColdImmunity = externalHeatImmunity = false; @@ -2963,7 +2942,6 @@ namespace CalamityMod.CalPlayer plague = false; holyFlames = false; holyInferno = false; - glacialState = false; burningBlood = false; brainRot = false; heavybleeding = false; @@ -3043,7 +3021,6 @@ namespace CalamityMod.CalPlayer xWrath = false; graxDefense = false; encased = false; - brutalCarnage = false; omniscience = false; zerg = false; zen = false; @@ -3120,6 +3097,7 @@ namespace CalamityMod.CalPlayer #region Armor Set Bonuses silverMedkit = false; silverMedkitTimer = 0; + tungstenArmorHookBoost = false; goldArmorGoldDrops = false; miningSet = false; miningSetCooldown = 0; @@ -3161,8 +3139,6 @@ namespace CalamityMod.CalPlayer lunicCorpsSet = false; lunicCorpsLegs = false; reaverSpeed = false; - reaverRegen = false; - reaverRegenCooldown = 0; reaverDefense = false; reaverExplore = false; shadeRegen = false; @@ -3260,6 +3236,7 @@ namespace CalamityMod.CalPlayer ascendantTrail = false; evilSmasherBoost = 0; burningSeaBurnOut = 0; + flareGunOverheat = 0; hellbornShots = 0; searedPanCounter = 0; searedPanTimer = 0; @@ -3569,19 +3546,16 @@ namespace CalamityMod.CalPlayer { PlayerLoader.ArmorSetBonusActivated(Player); - if (CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap) + // Activate vanilla set bonuses + if (Player.setVortex && !Player.mount.Active) + Player.vortexStealthActive = !Player.vortexStealthActive; + + if (Player.setForbidden) { - // Activate vanilla set bonuses - if (Player.setVortex && !Player.mount.Active) - Player.vortexStealthActive = !Player.vortexStealthActive; + Player.MinionRestTargetAim(); - if (Player.setForbidden) - { - Player.MinionRestTargetAim(); - - if (!Player.setForbiddenCooldownLocked) - Player.CommandForbiddenStorm(); - } + if (!Player.setForbiddenCooldownLocked) + Player.CommandForbiddenStorm(); } } @@ -3794,10 +3768,6 @@ namespace CalamityMod.CalPlayer public override void ArmorSetBonusActivated() { - // Don't trigger set bonuses if the config is disabled and the double-tap hotkey was triggered - if (!(CalamityKeybinds.ArmorSetBonusHotKey.JustPressed || CalamityClientConfig.Instance.CalamityArmorSetBonusDoubleTap)) - return; - // TODO -- It would be nice if triggerable set bonuses used interfaces instead of having to go through this large if chain. if (brimflameSet && !Player.HasCooldown(BrimflameFrenzy.ID)) { @@ -3966,6 +3936,30 @@ namespace CalamityMod.CalPlayer } if (prismaticSet && !Player.HasCooldown(PrismaticLaser.ID) && prismaticLasers <= 0) prismaticLasers = CalamityUtils.SecondsToFrames(35f); + if (WulfrumHat.HasArmorSet(Player)) + { + //Only activate if no cooldown & available scrap. + if (cooldowns.TryGetValue(WulfrumBastion.ID, out CooldownInstance cd)) + { + // Quick dismount if activated again + if (cd.timeLeft > WulfrumHat.BastionCooldown && cd.timeLeft < WulfrumHat.BastionCooldown + WulfrumHat.BastionTime - 60 * 3) + { + cd.timeLeft = WulfrumHat.BastionCooldown + 1; + SyncCooldownDictionary(false); + } + } + + else if (Player.HasItem(ItemType())) + { + Player.ConsumeItem(ItemType()); + //I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right + Player.AddCooldown(WulfrumBastion.ID, WulfrumHat.BastionCooldown + WulfrumHat.BastionTime); + //Though do I need to sync that or is the player inventory auto synced? + WulfrumHat.DummyCannon.SetDefaults(ItemType()); + } + } + if (DesertProwlerHat.HasArmorSet(Player) && !Player.HasCooldown(SandsmokeBomb.ID)) + Player.AddCooldown(SandsmokeBomb.ID, DesertProwlerHat.SmokeCooldown + DesertProwlerHat.SmokeDuration); } #endregion @@ -4075,6 +4069,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) @@ -4105,7 +4104,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); @@ -4381,15 +4380,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { float baseRecoveryRate = Main.expertMode ? BalancingConstants.LifeStealRecoveryRate_Expert : BalancingConstants.LifeStealRecoveryRate_Classic; - - float lifeStealRecoveryRateReduction = - CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death : - CalamityWorld.revenge ? BalancingConstants.LifeStealRecoveryRateReduction_Revengeance : - Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : - BalancingConstants.LifeStealRecoveryRateReduction_Classic; - - if (Main.masterMode) - lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master; + float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic; float lifeStealRecoveryRate = baseRecoveryRate - lifeStealRecoveryRateReduction; if (Player.lifeSteal < -lifeStealRecoveryRate) @@ -4914,37 +4905,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 || @@ -4952,58 +4912,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); @@ -5018,26 +4928,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) { @@ -5047,7 +4938,7 @@ namespace CalamityMod.CalPlayer { if (!Player.mount.Active) { - Player.velocity.Y *= 0.9f; + Player.velocity.Y *= SnowRuffianMask.GlideFallSpeedMult; Player.wingFrame = 3; } Player.noFallDmg = true; @@ -5635,60 +5526,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 7d74c7a801..79fd508714 100644 --- a/CalPlayer/CalamityPlayerDrawEffects.cs +++ b/CalPlayer/CalamityPlayerDrawEffects.cs @@ -230,15 +230,6 @@ namespace CalamityMod.CalPlayer if (calamityPlayer.eutrophication && drawInfo.shadow == 0f) Eutrophication.DrawEffects(drawInfo); - if (calamityPlayer.glacialState && drawInfo.shadow == 0f) - { - // These lines cannot be moved to Glacial State's own file - r *= 0.13f; - g *= 0.66f; - - GlacialState.DrawEffects(drawInfo); - } - if (calamityPlayer.godSlayerInferno && drawInfo.shadow == 0f) GodSlayerInferno.DrawEffects(drawInfo); @@ -451,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/CalamityPlayerFishing.cs b/CalPlayer/CalamityPlayerFishing.cs index c965b451ff..a87dd8a9fb 100644 --- a/CalPlayer/CalamityPlayerFishing.cs +++ b/CalPlayer/CalamityPlayerFishing.cs @@ -370,7 +370,7 @@ namespace CalamityMod.CalPlayer if (ZoneAbyss || ZoneSulphur) canSulphurFish = true; - Item item = Player.ActiveItem(); + Item item = Player.HeldItem; if (!canSulphurFish || item.fishingPole <= 0 || item.holdStyle != 1) fishingLevel = -1; diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index cbf460a587..ccc22dae62 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -17,6 +17,7 @@ using CalamityMod.Items.Armor.Aerospec; using CalamityMod.Items.Armor.Demonshade; using CalamityMod.Items.Armor.LunicCorps; using CalamityMod.Items.Armor.Silva; +using CalamityMod.Items.Armor.Sulphurous; using CalamityMod.Items.Armor.Wulfrum; using CalamityMod.Items.Mounts; using CalamityMod.Items.Placeables.Furniture; @@ -31,6 +32,7 @@ using CalamityMod.NPCs.Other; using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.NPCs.SupremeCalamitas; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Ranged; @@ -485,7 +487,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 +637,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; @@ -885,7 +882,7 @@ namespace CalamityMod.CalPlayer contactDamageReduction *= (double)Crumbling.MultiplicativeDamageReductionPlayer; // Contact damage reduction is reduced by DR Damage, which itself is proportional to defense damage - // In GFB, as defense damage is uncapped, DR damage is also uncapped. + // In FTW, as defense damage is uncapped, DR damage is also uncapped. int currentDefense = Player.GetCurrentDefense(false); if (totalDefenseDamage > 0 && currentDefense > 0) { @@ -987,30 +984,23 @@ namespace CalamityMod.CalPlayer // Reduce damage from vanilla traps // Explosives - // 350 in normal, 450 in expert + // 350 damage if (proj.type == ProjectileID.Explosives) - modifiers.SourceDamage *= (Main.expertMode ? 0.225f : 0.35f); + modifiers.SourceDamage *= 0.7f; // Rolling Cacti - // 45 in normal, 65 in expert for cactus - // 30 in normal, 36 in expert for spikes + // 42 in normal, 84 in expert for cactus + // 36 in normal, 72 in expert for spikes else if (proj.type == ProjectileID.RollingCactus || proj.type == ProjectileID.RollingCactusSpike) - modifiers.SourceDamage *= (Main.expertMode ? 0.3f : 0.5f); + modifiers.SourceDamage *= 0.6f; - // Normal Boulders and Temple traps - if (Main.expertMode) + // Boulders + if (Main.expertMode && !areThereAnyDamnBosses) { - // 140 in normal, 182 in expert, 273 in master - if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder) - modifiers.SourceDamage *= 0.65f; - - // 80 in normal, 100 in expert, 150 in master - else if (proj.type == ProjectileID.SpikyBallTrap || proj.type == ProjectileID.FlamethrowerTrap || proj.type == ProjectileID.FlamesTrap || proj.type == ProjectileID.PoisonDartTrap) - modifiers.SourceDamage *= 0.625f; - - // 120 in normal, 144 in expert, 216 in master - else if (proj.type == ProjectileID.SpearTrap) - modifiers.SourceDamage *= 0.6f; + // 140 in normal, 210 in expert, 315 in master for boulder + // 104 in normal, 156 in expert, 234 in master for mini boulder + if (proj.type == ProjectileID.Boulder || proj.type == ProjectileID.MiniBoulder || proj.type == ProjectileID.BouncyBoulder || proj.type == ProjectileID.LifeCrystalBoulder) + modifiers.SourceDamage *= 0.75f; } bool isFallingBlock = (proj.type == ProjectileID.SandBallFalling) || (proj.type == ProjectileID.SiltBall) || (proj.type == ProjectileID.AshBallFalling) || @@ -1027,7 +1017,7 @@ namespace CalamityMod.CalPlayer if (Player.Calamity().trapProtection && isReducedTrap) modifiers.SourceDamage *= 0.35f; - // Reduce damage dealt by rainbow trails depending on how faded they are. + // Reduce damage dealt by rainbow trails if (proj.type == ProjectileID.HallowBossLastingRainbow) { // Find the oldPos of the projectile that is intersecting the player hitbox. @@ -1042,11 +1032,10 @@ namespace CalamityMod.CalPlayer hitbox.X = (int)trailHitbox.X; hitbox.Y = (int)trailHitbox.Y; - // Adjust damage based on what part of the trail intersected the player hitbox. if (hitbox.Intersects(Player.Hitbox)) { if (k > startOfDamageFalloff) - modifiers.SourceDamage *= MathHelper.Lerp(0.4f, 1f, 1f - (k - startOfDamageFalloff) / (float)(trailLength - startOfDamageFalloff)); + modifiers.SourceDamage *= EmpressofLightAI.EverlastingRainbowTrailDamageMult; break; } @@ -1312,7 +1301,7 @@ namespace CalamityMod.CalPlayer if (Main.npc[proj.Calamity().ParentNPCIndex].active) { if (sulphurSet) - Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, 60); + Main.npc[proj.Calamity().ParentNPCIndex].AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); if (ilSpark) Main.npc[proj.Calamity().ParentNPCIndex].Calamity().shocked = 120; } @@ -1375,90 +1364,10 @@ namespace CalamityMod.CalPlayer { Player.AddBuff(BuffID.BrokenArmor, 600); } - else if (proj.type == ProjectileID.DeathLaser || proj.type == ProjectileID.RocketSkeleton || proj.type == ProjectileID.BombSkeletronPrime) - { - Player.AddBuff(BuffID.OnFire, 180); - } - else if (proj.type == ProjectileID.Skull) - { - Player.AddBuff(BuffID.Weak, 180); - } - else if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire) - { - // Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds) - Player.AddBuff(BuffID.CursedInferno, 60); - } else if (proj.type == ProjectileID.DesertDjinnCurse) { Player.AddBuff(BuffID.Cursed, 180); } - else if (proj.type == ProjectileID.Stinger || proj.type == ProjectileID.QueenBeeStinger) - { - // 66.6% chance of Poison for 5 seconds, 2 guaranteed seconds of Poison otherwise (vanilla also has a 33.3% chance of Poison for 10 seconds) - if (Main.rand.Next(3) > 0) - Player.AddBuff(BuffID.Poisoned, 300); - else - Player.AddBuff(BuffID.Poisoned, 120); - } - else if (proj.type == ProjectileID.PoisonSeedPlantera) - { - // 75% chance of Poison for 3 to 5 seconds, guaranteed Poison for 2 seconds (vanilla also has a 50% chance of Poison for 3 to 7 seconds) - if (Main.rand.Next(4) > 0) - Player.AddBuff(BuffID.Poisoned, Main.rand.Next(180, 301)); - else - Player.AddBuff(BuffID.Poisoned, 120); - } - else if (proj.type == ProjectileID.ThornBall) - { - Player.AddBuff(BuffID.Poisoned, 420); - } - else if (proj.type == ProjectileID.CultistBossFireBall) - { - Player.AddBuff(ModContent.BuffType(), 180); - } - else if (proj.type == ProjectileID.CultistBossIceMist) - { - if (!Player.frozen) - Player.AddBuff(BuffID.Frozen, 60); - - Player.AddBuff(BuffID.Chilled, 180); - } - else if (proj.type == ProjectileID.CultistBossLightningOrbArc) - { - Player.AddBuff(BuffID.Electrified, 180); - } - else if (proj.type == ProjectileID.AncientDoomProjectile) - { - Player.AddBuff(ModContent.BuffType(), 120); - } - else if (proj.type == ProjectileID.CultistBossFireBallClone) - { - Player.AddBuff(ModContent.BuffType(), 180); - } - else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye) - { - Player.AddBuff(ModContent.BuffType(), 120); - } - else if (proj.type == ProjectileID.PhantasmalSphere) - { - Player.AddBuff(ModContent.BuffType(), 210); - } - else if (proj.type == ProjectileID.PhantasmalDeathray) - { - Player.AddBuff(ModContent.BuffType(), 300); - } - else if ((proj.type == ProjectileID.FairyQueenLance || proj.type == ProjectileID.HallowBossRainbowStreak || proj.type == ProjectileID.HallowBossSplitShotCore) && NPC.ShouldEmpressBeEnraged()) - { - Player.AddBuff(ModContent.BuffType(), 120); - } - else if (proj.type == ProjectileID.HallowBossLastingRainbow && NPC.ShouldEmpressBeEnraged()) - { - Player.AddBuff(ModContent.BuffType(), 210); - } - else if (proj.type == ProjectileID.FairyQueenSunDance && NPC.ShouldEmpressBeEnraged()) - { - Player.AddBuff(ModContent.BuffType(), 300); - } else if (proj.type == ProjectileID.BloodNautilusShot) { Player.AddBuff(ModContent.BuffType(), 240); @@ -1471,6 +1380,47 @@ namespace CalamityMod.CalPlayer { Player.AddBuff(ModContent.BuffType(), 600); } + + if (CalamityWorld.revenge) + { + if (proj.type == ProjectileID.CursedFlameHostile || proj.type == ProjectileID.EyeFire) + { + // Guaranteed Cursed Inferno for 1 second (vanilla also has a 68.75% chance of Cursed Inferno for 2 to 3 seconds) + Player.AddBuff(BuffID.CursedInferno, 60); + } + else if (proj.type == ProjectileID.ThornBall) + { + Player.AddBuff(BuffID.Venom, 120); + } + else if (proj.type == ProjectileID.CultistBossFireBall) + { + Player.AddBuff(ModContent.BuffType(), 180); + } + else if (proj.type == ProjectileID.CultistBossIceMist && proj.ai[1] == 1f) // Main ice mists only; no shards + { + Player.AddBuff(BuffID.Chilled, 180); + } + else if (proj.type == ProjectileID.CultistBossLightningOrbArc) + { + Player.AddBuff(BuffID.Electrified, 180); + } + else if (proj.type == ProjectileID.CultistBossFireBallClone) + { + Player.AddBuff(ModContent.BuffType(), 240); + } + else if (proj.type == ProjectileID.PhantasmalBolt || proj.type == ProjectileID.PhantasmalEye) + { + Player.AddBuff(ModContent.BuffType(), 120); + } + else if (proj.type == ProjectileID.PhantasmalSphere) + { + Player.AddBuff(ModContent.BuffType(), 180); + } + else if (proj.type == ProjectileID.PhantasmalDeathray) + { + Player.AddBuff(ModContent.BuffType(), 240); + } + } } // As these reflects do not cancel damage, they need to be in OnHit rather than ModifyHit @@ -1750,11 +1700,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 +1728,12 @@ namespace CalamityMod.CalPlayer SoundEngine.PlaySound(TheSponge.ShieldHurtSound, Player.Center); hurtSoundTimer = 20; } - else if (((pSoulArtifact && !profanedCrystal) || profanedCrystalBuffs) && pSoulShieldDurability > 0) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(ProfanedGuardianDefender.ShieldDeathSound); - hurtSoundTimer = 20; - } - else if ((profanedCrystal || profanedCrystalForce) && !profanedCrystalHide) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(Providence.HurtSound, Player.Center); - hurtSoundTimer = 20; - } - else if ((abyssalDivingSuitPower || abyssalDivingSuitForce) && !abyssalDivingSuitHide) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center); //metal hit noise - hurtSoundTimer = 10; - } - else if ((aquaticHeartPower || aquaticHeartForce) && !aquaticHeartHide) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(SoundID.FemaleHit, Player.Center); //female hit noise - hurtSoundTimer = 10; - } else if (titanHeartSet) { modifiers.DisableSound(); SoundEngine.PlaySound(NPCs.Astral.Atlas.HurtSound, Player.Center); hurtSoundTimer = 10; } - else if (Player.GetModPlayer().transformationActive) - { - modifiers.DisableSound(); - SoundEngine.PlaySound(SoundID.NPCHit4, Player.Center); - hurtSoundTimer = 10; - } else if (Player.GetModPlayer().wulfrumSet && (Player.name.ToLower() == "wagstaff" || Player.name.ToLower() == "john wulfrum")) { modifiers.DisableSound(); @@ -2304,8 +2230,8 @@ namespace CalamityMod.CalPlayer if (RageEnabled) rageCombatFrames = BalancingConstants.RageCombatDelayTime; - // Regenator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later) - if (regenator && false) + // Regenerator has been CANCLED on TWITTER.COM!!!! (Just keeping this here since it's a neat effect and I'll probably yoink it for something else later) + if (regenerator && false) { // Projectile damage and count is based on source damage of the hit float hitPower = (hurtInfo.SourceDamage / (Player.statLifeMax2 * 0.5f)); @@ -2622,13 +2548,13 @@ namespace CalamityMod.CalPlayer if (!canTriggerHitEffects) return; - if (aeroSet && hurtInfo.Damage > 25) + if (aeroSet && hurtInfo.Damage > AerospecBreastplate.SetBonusHurtDamageThreshold) { // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_OnHurt(hurtInfo.DamageSource, AerospecBreastplate.FeatherEntitySourceContext); for (int n = 0; n < 4; n++) { - int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(30); + int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(AerospecBreastplate.SetBonusFeatherDamage); CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), featherDamage, 1f, Player.whoAmI); } @@ -2702,15 +2628,20 @@ namespace CalamityMod.CalPlayer } if (inkBomb && !abyssalMirror && !eclipseMirror) { - var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - if (Player.whoAmI == Main.myPlayer && !Player.HasCooldown(Cooldowns.InkBomb.ID)) + if (Player.whoAmI == Main.myPlayer) { - Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20)); - rogueStealth += 0.5f; + if (!Player.HasCooldown(Cooldowns.InkBomb.ID)) + { + Player.AddCooldown(Cooldowns.InkBomb.ID, CalamityUtils.SecondsToFrames(20)); + rogueStealth += 0.5f; + SoundEngine.PlaySound(SoundID.NPCDeath28 with { Volume = 2f }, Player.Center); + } + + var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); + SoundEngine.PlaySound(SoundID.Item1, Player.Center); for (int i = 0; i < 3; i++) { - SoundEngine.PlaySound(SoundID.Item61, Player.Center); - int ink = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-3f, 3f), Main.rand.NextFloat(-0f, -4f), ModContent.ProjectileType(), 0, 0, Player.whoAmI); + int ink = Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 2f, ModContent.ProjectileType(), 0, 0, Player.whoAmI); if (ink.WithinBounds(Main.maxProjectiles)) Main.projectile[ink].DamageType = DamageClass.Generic; } @@ -2742,7 +2673,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { - for (int i = 0; i < 16; i++) + for (int i = 0; i < 10; i++) { Vector2 circleVel = (MathHelper.TwoPi * i / 16f).ToRotationVector2() * Main.rand.NextFloat(5f, 8f); int shard = Projectile.NewProjectile(source, Player.Center, circleVel, ProjectileID.CrystalShard, sDamage, 1f, Player.whoAmI); diff --git a/CalPlayer/CalamityPlayerLifeRegen.cs b/CalPlayer/CalamityPlayerLifeRegen.cs index 48515d1261..7051c34c81 100644 --- a/CalPlayer/CalamityPlayerLifeRegen.cs +++ b/CalPlayer/CalamityPlayerLifeRegen.cs @@ -106,37 +106,37 @@ namespace CalamityMod.CalPlayer ApplyDoTDebuff(weakBrimstoneFlames, 7); ApplyDoTDebuff(burningBlood, 8, purity); ApplyDoTDebuff(brainRot, 8, purity); - ApplyDoTDebuff(heavybleeding, 16, purity); - ApplyDoTDebuff(laceration, 24, purity); ApplyDoTDebuff(vaporfied, 8, purity); int staticDoT = ((Player.controlLeft || Player.controlRight) ? 12 : 3) / (eleResist ? 2 : 1); ApplyDoTDebuff(staticDischarge, staticDoT, purity); - ApplyDoTDebuff(brimstoneFlames, abaddon ? 10 : 20, purity); - ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player - ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 15 : 30, purity); - ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 15 : 30, purity); - ApplyDoTDebuff(holyFlames, 24, purity); - ApplyDoTDebuff(voidfrost, 30, purity); - ApplyDoTDebuff(vHex, 24); - ApplyDoTDebuff(trueVHex, 36); - ApplyDoTDebuff(crushDepth, 15, purity); - ApplyDoTDebuff(astralInfection, 18, infectedJewel || hideOfDeus || purity); - ApplyDoTDebuff(hadopelagicPressure, 30, purity); - ApplyDoTDebuff(plague, alchFlask ? 12 : 24, purity); - ApplyDoTDebuff(searingLava, 30); // Being literally submerged in crags lava should do more than brimstone flames + ApplyDoTDebuff(heavybleeding, 16, purity); + ApplyDoTDebuff(crushDepth, 18, purity); + ApplyDoTDebuff(astralInfection, 24, infectedJewel || hideOfDeus || purity); ApplyDoTDebuff(shadowflame, 30, purity); - ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player - ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player + ApplyDoTDebuff(brimstoneFlames, abaddon ? 15 : 30, purity); + ApplyDoTDebuff(plague, alchFlask ? 15 : 30, purity); + ApplyDoTDebuff(vHex, 30); // Has other effects + ApplyDoTDebuff(cragsLava, 30); + ApplyDoTDebuff(demonicFlames, 33, purity); // Never inflicted on the player + ApplyDoTDebuff(laceration, 36, purity); + ApplyDoTDebuff(daybroken, reducedDaybrokenDamage ? 20 : 40, purity); + ApplyDoTDebuff(nightwither, reducedNightwitherDamage ? 20 : 40, purity); + ApplyDoTDebuff(holyFlames, 40, purity); + ApplyDoTDebuff(voidfrost, 40, purity); + ApplyDoTDebuff(hadopelagicPressure, 40, purity); // Profaned Soul Crystal turns you into Providence, a God, and you take more damage from God Slayer Inferno - ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 45 : 35); + ApplyDoTDebuff(godSlayerInferno, profanedCrystalBuffs ? 50 : 40); int fluxDoT = ((Player.controlLeft || Player.controlRight) ? 50 : 10) / (eleResist ? 2 : 1); ApplyDoTDebuff(vermillionFlux, fluxDoT); - int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 240 : 40) / (dynamoStemCells ? 2 : 1); + ApplyDoTDebuff(elementalMix, 50, purity); // Never inflicted on the player + ApplyDoTDebuff(trueVHex, 50); + int dragonfireDoT = ((Player.name == "JFL" || Player.name == "MrJFL") ? 200 : 50) / (dynamoStemCells ? 2 : 1); ApplyDoTDebuff(dragonFire, dragonfireDoT); - int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 75 : 15) / (eleResist ? 2 : 1); + ApplyDoTDebuff(miracleBlight, 60); + ApplyDoTDebuff(banishingFire, 60); // Never inflicted on the player + int rebukeDoT = ((Player.controlLeft || Player.controlRight) ? 80 : 16) / (eleResist ? 2 : 1); ApplyDoTDebuff(auricRebuke, rebukeDoT); - ApplyDoTDebuff(miracleBlight, 50); // Slowly increase the sulphuric water poisoning effect. Once it's high enough, the player takes damage and the meter resets. bool nearSafeZone = false; @@ -381,8 +381,8 @@ namespace CalamityMod.CalPlayer // Permafrost's Concoction increases life regen while afflicted with a fire debuff if (permafrostsConcoction && Player.buffType.Any(FireDebuffsList.Includes)) { - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; Player.lifeRegen += 6; } @@ -419,10 +419,10 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % healFrameCadence == healFrameCadence - 1) Player.Heal(1); - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; - intendedPurityDefense = 20 + (currentDebuffs - 1) * 8; + intendedPurityDefense = 15 + (currentDebuffs - 1) * 5; if (jewelBonusDefense < intendedPurityDefense) jewelBonusDefense = intendedPurityDefense; @@ -461,10 +461,10 @@ namespace CalamityMod.CalPlayer if (currentDebuffs > 0) { Player.lifeRegen += 4; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; - intendedJewelDefense = 16 + (currentDebuffs - 1) * 5; + intendedJewelDefense = 12 + (currentDebuffs - 1) * 4; if (jewelBonusDefense < intendedJewelDefense) jewelBonusDefense = intendedJewelDefense; } @@ -487,8 +487,8 @@ namespace CalamityMod.CalPlayer if (Player.buffType.Any(DebuffsList.List.Contains)) { Player.lifeRegen += 3; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; } } #endregion @@ -625,6 +625,9 @@ namespace CalamityMod.CalPlayer Player.lifeRegen += Main.eclipse ? 2 : 4; } + if (silvaSet) + Player.lifeRegen += 6; + if (phantomicHeartRegen <= 720 && phantomicHeartRegen >= 600) { Player.lifeRegen += PhantomicArtifact.RegenBoost; @@ -673,8 +676,8 @@ namespace CalamityMod.CalPlayer { Player.lifeRegen += 7; - if (Player.lifeRegenTime < 1800) - Player.lifeRegenTime = 1800; + if (Player.lifeRegenTime < 900) + Player.lifeRegenTime = 900; Player.lifeRegenTime += 4; } @@ -693,14 +696,6 @@ namespace CalamityMod.CalPlayer else pinkCandleHealFraction = 0D; - if (reaverRegen && reaverRegenCooldown >= 60) - { - reaverRegenCooldown = 0; - - if (Player.statLife != Player.statLifeMax2 && !noLifeRegen) - Player.HealPlayer(1, HealTextType.None); - } - if (BloomStoneRegen) { float dayTimeCompletion = !Main.dayTime ? 1f : (float)(Main.time / Main.dayLength); @@ -753,9 +748,9 @@ namespace CalamityMod.CalPlayer if (turboRegenPower > 0) { - // After a brief delay determined by your form of standing still regen, min-cap life regen time at 1800 / 3600. - if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 1800f) - Player.lifeRegenTime = 1800f; + // After a brief delay determined by your form of standing still regen, min-cap life regen time at 900 / 3600. + if (Player.lifeRegenTime > regenTimeNeededForTurboRegen && Player.lifeRegenTime < 900f) + Player.lifeRegenTime = 900f; Player.lifeRegen += turboRegenPower; Player.lifeRegenTime += turboRegenPower; @@ -766,48 +761,7 @@ namespace CalamityMod.CalPlayer } #endregion - // Life regen soft cap. - if (Player.statLife < actualMaxLife) - { - // The soft cap doesn't apply if the player is not moving and not using a weapon while having any of the following: - // Shiny Stone, Cosmic Freeze buff from the Cosmic Discharge, Demonshade Armor, Regenator, or The Camper. - int baseLifeRegenBoost = 4; - bool noLifeRegenCap = (Player.shinyStone || cFreeze || shadeRegen || camper || regenator) && - Player.StandingStill() && Player.itemAnimation == 0; - - if (!noLifeRegenCap) - { - // Calculate the % of HP the player has left. - float maxLifeRatio = Player.statLife / (float)actualMaxLife; - - // Calculate the ratio of the player's current max life relative to the starting HP of 100. - // This makes the soft cap far less harsh at lower amounts of max life. - // Ranges from 20 (at 100 max life) to 4 (at 500 max life) to 2 (at 1000 max life) to 1 (at greater than 2000 max life). - int lifeRegenSoftCapMax = 20; - int lifeRegenSoftCapMin = (int)Math.Round(100f / actualMaxLife * lifeRegenSoftCapMax); - - // The soft cap for life regen which ranges from 20 (at less than 5% HP) to 1 (at greater than or equal to 95% HP). - // This value is capped at a min and max amount. - int lifeRegenSoftCap = (int)MathHelper.Clamp((int)Math.Round((1f - maxLifeRatio) * lifeRegenSoftCapMax), lifeRegenSoftCapMin, lifeRegenSoftCapMax); - - // If life regen is greater than the calculated soft cap, reduce it. - if (Player.lifeRegen - baseLifeRegenBoost > lifeRegenSoftCap) - { - // The scalar used to calculate how much the life regen stat should be reduced by. - // Ranges from 1 (at 0% HP) to 2 (at 100% HP). - float lifeRegenScalar = 1f + maxLifeRatio; - - // Calculate the amount of life regen the player should get according to the soft cap and their current % HP remaining. - // The higher the player's % HP remaining the less life regen they get and vice versa. - int defLifeRegen = (int)((Player.lifeRegen - baseLifeRegenBoost) / lifeRegenScalar); - - // Set the player's life regen to the scaled amount. - Player.lifeRegen = baseLifeRegenBoost + defLifeRegen; - } - } - } - - if (regenator) // Gives special regen of it's own, but disables all regular life regen + if (regenerator) // Gives special regen of it's own, but disables all regular life regen { if (Player.miscCounter % 7 == 0 && Player.statLife < (int)(Player.statLifeMax2 * 0.5f)) Player.HealPlayer(1, HealTextType.None); @@ -818,7 +772,7 @@ namespace CalamityMod.CalPlayer Player.lifeRegenTime += 10; } else - regenatorDamage = 0; + regeneratorDamage = 0; if (toxicHeart) // Since it needs to know your life regen, it must be placed here { @@ -873,8 +827,8 @@ namespace CalamityMod.CalPlayer } } - // Regenator trades all positive regen for damage, and caps your health gain at 50% - if (regenator) + // Regenerator trades all positive regen for damage, and caps your health gain at 50% + if (regenerator) { int finalRegen = Player.lifeRegen + (int)Math.Round(regen * (Player.statLifeMax2 / 400f * 0.85f + 0.15f)); finalRegen = (int)Math.Max(finalRegen, 0); @@ -884,8 +838,8 @@ namespace CalamityMod.CalPlayer if (Player.palladiumRegen) finalRegen += 4; - regenatorDamage = (finalRegen * 1.75f) * 0.01f; - Player.GetDamage() += regenatorDamage; + regeneratorDamage = (finalRegen * 1.75f) * 0.01f; + Player.GetDamage() += regeneratorDamage; if (Player.lifeRegen > 0) Player.lifeRegen = 0; diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 78d6383086..90eb86c2be 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -17,6 +17,7 @@ using CalamityMod.ExtraTextures; using CalamityMod.Items; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; +using CalamityMod.Items.Armor.Aerospec; using CalamityMod.Items.Armor.Bloodflare; using CalamityMod.Items.Armor.Brimflame; using CalamityMod.Items.Armor.DesertProwler; @@ -221,11 +222,6 @@ namespace CalamityMod.CalPlayer // Apply stealth damage to rogue. Player.GetDamage() += stealthDamage; - //Slow the player down after any other speed modifiers might have been applied. - //Todo - Move this back to the wulfrum set class whenever statmodifiers are implemented for stats other than damage - if (WulfrumHat.PowerModeEngaged(Player, out _)) - Player.moveSpeed *= 0.8f; - if ((XykVisualsBlue || XykVisualsOrange)) { bool Orange = XykVisualsOrange; @@ -254,12 +250,21 @@ namespace CalamityMod.CalPlayer foreach (Projectile p in Main.ActiveProjectiles) if (p.type == ModContent.ProjectileType() && p.owner == Player.whoAmI && p.ai[1] == 0) numOfActiveWings++; - bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && !(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0; + bool spawnWings = numOfActiveWings < maxWingPieces && !Player.dead && Player.wingsLogic > 0 && ((!(Player.wingTime == Player.wingTimeMax && Player.velocity.Y == 0) && Player.wingTime > 0) || XykWingTimer >= 3); if (spawnWings) { - int wingCount = numOfActiveWings; - Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Player.whoAmI, wingCount); + if (XykWingTimer >= 3) + { + int wingCount = numOfActiveWings; + Projectile wings = Projectile.NewProjectileDirect(Player.GetSource_FromThis(), Player.Center, Vector2.Zero, ModContent.ProjectileType(), 0, 0f, Player.whoAmI, wingCount); + if (numOfActiveWings + 1 == maxWingPieces) + XykWingTimer = 0; + } + else + XykWingTimer++; } + else + XykWingTimer = 0; } // First Frame dash effects @@ -470,13 +475,17 @@ namespace CalamityMod.CalPlayer IsFirstDashFrame = false; else IsFirstDashFrame = true; - + // THIS MUST BE NEAR THE END OF PostUpdateMiscEffects SO ALL OTHER RUN SPEED IS DONE FIRST. DO NOT PUT ANY RUN SPEED AFTER THIS - + // Multiplies movement speed by 1.5x so that you don't feel like a snail in the early game. // This applies to movement speed boosts as well as base speed to ensure they are actually worth their listed value compared to base speed + // // Disabled while Overhaul is enabled, because Overhaul does very similar things to make movement more snappy - if (ExternalMods.overhaul is null && CalamityServerConfig.Instance.FasterBaseSpeed) + // 22JUN2025: Ozzatron: Disabled while Remnants is enabled, because Remnants has its own move speed reworks. + + bool ignoreSpeedConfig = ExternalMods.overhaul is not null || ExternalMods.remnants is not null; + if (!ignoreSpeedConfig && CalamityServerConfig.Instance.FasterBaseSpeed) Player.moveSpeed *= BalancingConstants.DefaultMoveSpeedBoost; // This is used to increase horizontal velocity based on the player's movement speed stat. @@ -497,8 +506,8 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < Player.MaxBuffs; l++) { int hasBuff = Player.buffType[l]; - if (Player.buffTime[l] > 360 && hasBuff == BuffID.ShadowDodge) - Player.buffTime[l] = 360; + if (Player.buffTime[l] > 600 && hasBuff == BuffID.ShadowDodge) + Player.buffTime[l] = 600; } } @@ -568,6 +577,22 @@ namespace CalamityMod.CalPlayer if (heldGaelsLastFrame) rageDiff += rageMax * GaelsGreatsword.RagePerSecond / 60f; + float rate = Main.GlobalTimeWrappedHourly * 29; + List eColors = new List() + { + Color.PaleVioletRed, + Color.Coral, + Color.Khaki, + Color.PaleGreen, + Color.Turquoise, + Color.Violet + }; + + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + lightRGB = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + // Calculate and grant proximity rage. // Regular enemies can give up to 1x proximity rage. Bosses can give up to 3x. Multiple regular enemies don't stack. // Proximity rage is maxed out when within 10 blocks (160 pixels) of the enemy's hitbox. @@ -1099,34 +1124,11 @@ namespace CalamityMod.CalPlayer } } - // Life Steal nerf in difficulties above Expert - // Reduces the max possible life steal before the cooldown occurs (this mostly just nerfs how much life steal the player can get in bursts) - // Master Mode nerfs this by an additional 10 - float lifeStealCap = - CalamityWorld.death ? BalancingConstants.LifeStealCap_Death : - CalamityWorld.revenge ? BalancingConstants.LifeStealCap_Revengeance : - Main.expertMode ? BalancingConstants.LifeStealCap_Expert : - BalancingConstants.LifeStealCap_Classic; - - if (Main.masterMode) - lifeStealCap -= BalancingConstants.LifeStealCapReduction_Master; - - if (Player.lifeSteal > lifeStealCap) - Player.lifeSteal = lifeStealCap; - - // Normal Mode life steal recovery rate is 0.2/s - // Expert Mode life steal recovery rate is 0.15/s - // Revengeance Mode life steal recovery rate is 0.125/s - // Death Mode life steal recovery rate is 0.1/s - // Master Mode life steal recovery rate is nerfed by an additional 0.05/s - float lifeStealRecoveryRateReduction = - CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death : - CalamityWorld.revenge ? BalancingConstants.LifeStealRecoveryRateReduction_Revengeance : - Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : - BalancingConstants.LifeStealRecoveryRateReduction_Classic; - - if (Main.masterMode) - lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master; + // Reduce the rate of recovery of the Lifesteal variable + // Classic Mode: 36 HP/s to 12 HP/s + // Expert Mode: 30 HP/s to 9 HP/s + float lifeStealRecoveryRateReduction = Main.expertMode ? BalancingConstants.LifeStealRecoveryRateReduction_Expert : BalancingConstants.LifeStealRecoveryRateReduction_Classic; + float lifeStealCap = Main.expertMode ? BalancingConstants.LifeStealCap_Expert : BalancingConstants.LifeStealCap_Classic; if (Player.lifeSteal < lifeStealCap) Player.lifeSteal -= lifeStealRecoveryRateReduction; @@ -1294,7 +1296,7 @@ namespace CalamityMod.CalPlayer if (!Player.wet) { if (aeroSet) - Player.maxFallSpeed = 15f; + Player.maxFallSpeed = AerospecBreastplate.SetBonusFallSpeed; if (Player.PortalPhysicsEnabled) Player.maxFallSpeed = 20f; } @@ -1805,7 +1807,7 @@ namespace CalamityMod.CalPlayer { if (dOfTheDeepDefenseBuffTimer > 0) { - int maxDefense = 15; + int maxDefense = 10; int givenDefense = (int)Utils.Remap(dOfTheDeepDefenseBuffTimer, 0, dOfTheDeepDefenseBuffMax * 0.5f, 0, maxDefense); Player.statDefense += givenDefense; dOfTheDeepDefenseBuffTimer--; @@ -1992,7 +1994,7 @@ namespace CalamityMod.CalPlayer SyncCooldownRemoval(Main.dedServ, expiredCooldowns); // Grant the player 5 seconds of immunity to immobilizing debuffs after an immobilizing debuff wears off. - if (Player.stoned || Player.frozen || Player.webbed || glacialState) + if (Player.stoned || Player.frozen || Player.webbed) { ImmobilityDebuffImmunityTimer = ImmobilityDebuffImmunityTimerMax; } @@ -2002,7 +2004,6 @@ namespace CalamityMod.CalPlayer Player.buffImmune[BuffID.Stoned] = true; Player.buffImmune[BuffID.Frozen] = true; Player.buffImmune[BuffID.Webbed] = true; - Player.buffImmune[ModContent.BuffType()] = true; } if (arsenalCooldown > 0) @@ -2027,6 +2028,8 @@ namespace CalamityMod.CalPlayer --fullRageSoundCountdownTimer; if (plagueTaintedSMGDroneCooldown > 0) plagueTaintedSMGDroneCooldown--; + if (flareGunOverheat > 0) + flareGunOverheat--; if (momentumCapacitorTime > 0) --momentumCapacitorTime; if (phantomicHeartRegen > 0 && phantomicHeartRegen < 1000) @@ -2207,10 +2210,6 @@ namespace CalamityMod.CalPlayer canFireGodSlayerRangedProjectile = true; canFireBloodflareRangedProjectile = true; } - if (reaverRegenCooldown < 60 && reaverRegen) - reaverRegenCooldown++; - else - reaverRegenCooldown = 0; if (auralisAurora > 0) auralisAurora--; if (auralisAuroraCooldown > 0) @@ -2520,7 +2519,7 @@ namespace CalamityMod.CalPlayer if (Player.isNearFairy()) { Player.lifeRegen += 4; - Player.statDefense += 10; + Player.statDefense += 6; Player.moveSpeed += 0.1f; } } @@ -2544,7 +2543,7 @@ namespace CalamityMod.CalPlayer if (affliction || afflicted) { Player.endurance += 0.07f; - Player.statDefense += 13; + Player.statDefense += 9; Player.GetDamage() += 0.1f; } @@ -2584,7 +2583,7 @@ namespace CalamityMod.CalPlayer // Permafrost's Concoction bonuses/debuffs if (permafrostsConcoction) { - Player.manaCost *= 0.85f; + Player.manaCost -= 0.15f; Player.statManaMax2 += 50; } @@ -2601,7 +2600,6 @@ namespace CalamityMod.CalPlayer Player.buffImmune[BuffID.Frozen] = true; Player.buffImmune[BuffID.Chilled] = true; - Player.buffImmune[ModContent.BuffType()] = true; } // Cosmic Discharge Cosmic Freeze buff, gives surrounding enemies the Glacial State debuff @@ -2714,23 +2712,19 @@ namespace CalamityMod.CalPlayer // Plagued Fuel Pack and Blunder Booster effects if (jetPackDash > 0 && Player.whoAmI == Main.myPlayer) { - int velocityAmt = blunderBooster ? 35 : 25; - int velocityMult = jetPackDash > 1 ? velocityAmt : 5; - Player.velocity = new Vector2(jetPackDirection, -1) * velocityMult; + int velocityMult = (int)((blunderBooster ? 35 : 25) * Utils.GetLerpValue(-4, 5, jetPackDash, true)); + Player.velocity = new Vector2(jetPackDirection, -1f) * velocityMult; if (blunderBooster) { - int lightningCount = Main.rand.Next(5, 7); + int lightningCount = 4; var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); for (int i = 0; i < lightningCount; i++) { - Vector2 lightningVel = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); - lightningVel.Normalize(); - lightningVel *= Main.rand.NextFloat(1f, 2f); - int damage = (int)Player.GetTotalDamage().ApplyTo(30); + Vector2 lightningVel = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(7f, 10f); + int damage = (int)Player.GetTotalDamage().ApplyTo(35); int projectile = Projectile.NewProjectile(source, Player.Center, lightningVel, ModContent.ProjectileType(), damage, 0, Player.whoAmI, Main.rand.Next(2), 0f); - Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -2745,17 +2739,14 @@ namespace CalamityMod.CalPlayer } else if (plaguedFuelPack) { - int numClouds = Main.rand.Next(8, 10); + int numClouds = 3; var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); for (int i = 0; i < numClouds; i++) { - Vector2 cloudVelocity = new Vector2(Main.rand.NextFloat(-1, 1), Main.rand.NextFloat(-1, 1)); - cloudVelocity.Normalize(); - cloudVelocity *= Main.rand.NextFloat(0f, 1f); - int damage = (int)Player.GetTotalDamage().ApplyTo(20); + Vector2 cloudVelocity = Player.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.3f) * Main.rand.NextFloat(5f, 7f); + int damage = (int)Player.GetTotalDamage().ApplyTo(30); int projectile = Projectile.NewProjectile(source, Player.Center, cloudVelocity, ModContent.ProjectileType(), damage, 0, Player.whoAmI, 0, 0); - Main.projectile[projectile].timeLeft = Main.rand.Next(180, 240); if (projectile.WithinBounds(Main.maxProjectiles)) Main.projectile[projectile].DamageType = DamageClass.Generic; } @@ -2935,36 +2926,7 @@ namespace CalamityMod.CalPlayer } // Breath lost while at zero breath - double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D) : (point.Y > abyssLevel1 ? 50D * depthRatioFromAbyssLayer1 : 0D); - - // Breath Loss Multiplier, depending on gear - // 27AUG2024: Ozzatron: fixed this being subtractive like mining speed. now doesn't stack exponentially - // It is now a multiplier for the time it takes to lose any unit amount of breath - double breathLossTimeMult = 1D + - (Player.gills ? 0.2 : 0D) + // 1.2 - (oceanCrest ? 0.2 : 0D) + // 1.2 - (victideSet ? 0.2 : 0D) + // 1.2 - (Player.accDivingHelm ? 0.25 : 0D) + // 1.25 - (Player.arcticDivingGear ? 0.25 : 0D) + // 1.25 - (aquaticEmblem ? 0.25 : 0D) + // 1.25 - (Player.accMerman ? 0.3 : 0D) + // 1.3 - (reaverExplore ? 0.3 : 0D) + // 1.3 - ((aquaticHeart && NPC.downedBoss3) ? 0.3 : 0D) + // 1.3 - (abyssalDivingSuit ? 0.3 : 0D) + // 1.3 - externalBreathLossMultBoost; - - // Invert the breath loss time multiplier, to get the multiplier for the speed at which breath is actually lost - double breathLossMult = 1D / breathLossTimeMult; - - // Limit the multiplier to 5% - if (breathLossMult < 0.05) - breathLossMult = 0.05; - - // Reduce breath lost while at zero breath, depending on gear - breathLoss *= breathLossTimeMult; - - // Record the final breath loss for the stat meter - abyssBreathLossStat = (float)breathLoss; + double breathLoss = Main.remixWorld ? (point.Y < abyssLevel1 ? 1D : 0D) : (point.Y > abyssLevel1 ? 1D : 0D); // Defense loss int defenseLoss = (int)(120D * depthRatio); @@ -2985,24 +2947,8 @@ namespace CalamityMod.CalPlayer // Record the final defense reduction for the stat meter abyssDefenseLossStat = defenseLoss; - // Bleed effect based on abyss layer - if (ZoneAbyssLayer4) - { - Player.bleed = true; - } - else if (ZoneAbyssLayer3) - { - if (!abyssalDivingSuit) - Player.bleed = true; - } - else if (ZoneAbyssLayer2) - { - if (!depthCharm) - Player.bleed = true; - } - // Ticks (frames) until breath is deducted from the breath meter - double tick = 12D * (1D - depthRatio); + double tick = 10D * (1D - depthRatio); // Prevent 0 if (tick < 1D) @@ -3010,16 +2956,16 @@ namespace CalamityMod.CalPlayer // Tick (frame) multiplier, depending on gear double tickMult = 1D + - (Player.gills ? 4D : 0D) + // 5 - (oceanCrest ? 4D : 0D) + // 5 - (Player.ignoreWater ? 5D : 0D) + // 10 - (Player.accDivingHelm ? 10D : 0D) + // 20 - (Player.arcticDivingGear ? 10D : 0D) + // 30 - (aquaticEmblem ? 10D : 0D) + // 40 - (Player.accMerman ? 15D : 0D) + // 55 - (victideSet ? 5D : 0D) + // 60 - ((aquaticHeart && NPC.downedBoss3) ? 15D : 0D) + // 75 - (abyssalDivingSuit ? 15D : 0D) + // 90 + (Player.gills ? 2D : 0D) + + (oceanCrest ? 2D : 0D) + + (Player.ignoreWater ? 3D : 0D) + + (Player.accDivingHelm ? 5D : 0D) + + (Player.arcticDivingGear ? 5D : 0D) + + (aquaticEmblem ? 5D : 0D) + + (Player.accMerman ? 8D : 0D) + + (victideSet ? 2D : 0D) + + ((aquaticHeart && NPC.downedBoss3) ? 8D : 0D) + + (abyssalDivingSuit ? 8D : 0D) + externalBreathTickBoost; // Limit the multiplier to 50 @@ -3033,6 +2979,8 @@ namespace CalamityMod.CalPlayer abyssBreathLossRateStat = (float)tick; float resistanceSlowdownFactor = 1f; + if (hPressure) + resistanceSlowdownFactor -= abyssalDivingSuit ? 0.2f : 0.5f; // Reduce breath over ticks (frames) abyssBreathCD++; @@ -3045,16 +2993,13 @@ namespace CalamityMod.CalPlayer if (Player.breath > 0) { Player.breath -= (int)(crushDepth && !depthCharm ? breathLoss + 1D : breathLoss); - - if (hadopelagicPressure) - resistanceSlowdownFactor -= (int)(!abyssalDivingSuit ? 1.2f : 0.5f); } } // If breath is greater than 0 and player has gills or is merfolk, balance out the effects by reducing breath if (Player.breath > 0) { - if (Player.gills || Player.merman) + if (Player.gills || Player.merman || Player.accMerman) Player.breath -= 3; } @@ -3063,8 +3008,8 @@ namespace CalamityMod.CalPlayer // Resistance to life loss at zero breath int lifeLossAtZeroBreathResist = 0 + - (depthCharm ? 3 : 0) + - (abyssalDivingSuit ? 6 : 0); + (depthCharm ? 4 : 0) + + (abyssalDivingSuit ? 5 : 0); // Reduce life loss, depending on gear lifeLossAtZeroBreath -= lifeLossAtZeroBreathResist; @@ -3097,7 +3042,7 @@ namespace CalamityMod.CalPlayer abyssDeath = false; // Signus headcrab darkness - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { if (CalamityGlobalNPC.signus != -1) { @@ -3188,7 +3133,7 @@ namespace CalamityMod.CalPlayer // Aquatic Emblem bonus if (aquaticEmblem) { - if (Player.IsUnderwater() && Player.wet && !Player.lavaWet && !Player.honeyWet && + if (countsAsAnyWet && !Player.lavaWet && !Player.honeyWet && !Player.mount.Active) { if (aquaticBoost > 0f) @@ -3211,7 +3156,7 @@ namespace CalamityMod.CalPlayer aquaticBoost = aquaticBoostMax; } - Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 50f); + Player.statDefense += (int)((1f - aquaticBoost * 0.0001f) * 20f); Player.moveSpeed -= (1f - aquaticBoost * 0.0001f) * 0.1f; } else @@ -3343,12 +3288,12 @@ namespace CalamityMod.CalPlayer if (AdamantiteSet) Player.statDefense += AdamantiteSetDefenseBoost; - // Warmth makes Chilled, Frozen, and Glacial State tick down 3x as fast + // Warmth makes Chilled and Frozen tick down 3x as fast if (Player.HasBuff(BuffID.Warmth)) { for (int b = 0; b < Player.MaxBuffs; b++) { - if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen || Player.buffType[b] == ModContent.BuffType()) + if (Player.buffType[b] == BuffID.Chilled || Player.buffType[b] == BuffID.Frozen) { if (Player.buffTime[b] > 3) { @@ -3388,11 +3333,6 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += Grax.DamageBoost; } - if (brutalCarnage) - { - Player.GetDamage() += BrutalCarnage.MeleeDamageBoost; - } - // Trinket of Chi bonus if (trinketOfChi) { @@ -3410,7 +3350,7 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += 0.12f; Player.GetKnockback() += 1.2f; if (Main.eclipse || !Main.dayTime) - Player.statDefense += Main.eclipse ? 10 : 20; + Player.statDefense += Main.eclipse ? 8 : 16; } if (AbsorberRegen) @@ -3457,7 +3397,7 @@ namespace CalamityMod.CalPlayer if (tortShellPostHit > 0) { - Player.statDefense -= 8; + Player.statDefense -= 6; tortShellPostHit--; } else @@ -3575,7 +3515,7 @@ namespace CalamityMod.CalPlayer if (starBeamRye) { Player.GetDamage() += StarBeamRye.MagicDamageBoost; - Player.manaCost *= (1f - StarBeamRye.ManaCostReduction); + Player.manaCost -= StarBeamRye.ManaCostReduction; Player.statManaMax2 += StarBeamRye.MaxManaBoost; } @@ -3713,23 +3653,11 @@ namespace CalamityMod.CalPlayer } if (tarraSet) - { - if (!tarraMelee) - Player.calmed = true; Player.lifeMagnet = true; - } if (whisperingDeath && !laudanum && !purity) Player.GetDamage() -= 0.2f; - if (astralInfection && !(infectedJewel || hideOfDeus || purity)) - Player.GetDamage() -= 0.1f; - - if (plague && !purity) - { - Player.GetDamage() -= 0.1f; - } - if (armorCrunch && !laudanum && !purity) { Player.statDefense -= ArmorCrunch.DefenseReduction; @@ -3741,14 +3669,6 @@ namespace CalamityMod.CalPlayer Player.statDefense -= RemsRevenge.WitherDefenseReduction; } - if (glacialState) - { - Player.velocity.X *= 0.5f; - Player.velocity.Y += 0.05f; - if (Player.velocity.Y > 15f) - Player.velocity.Y = 15f; - } - if (eutrophication && !purity) Player.velocity = Vector2.Zero; @@ -3800,20 +3720,30 @@ namespace CalamityMod.CalPlayer Player.GetDamage() += 0.1f; } + // While making the rogue update verify if we should allow these to stack again - Shade if (filthyGlove) { bonusStealthDamage += nanotech ? 0.05f : 0.08f; } + if (rottenDogTooth && !nanotech) + { + bonusStealthDamage += 0.08f; + } + if (sandsWindBuff) { Player.GetDamage() += PrimordialEarth.BuffDamageBoost; Player.statDefense += PrimordialEarth.BuffDefenseBoost; + Player.manaRegenDelayBonus += 1; + Player.manaRegenBonus += 50 + (int)(400 * (float)Math.Pow((1 - ((float)Player.statMana / (float)Player.statManaMax2)), 2)); } if (aeolianEarthBuff) { Player.GetDamage() += PrimordialAncient.BuffDamageBoost; Player.endurance += PrimordialAncient.BuffDamageReductionBoost; + Player.manaRegenDelayBonus += 1; + Player.manaRegenBonus += 75 + (int)(600 * (float)Math.Pow((1 - ((float)Player.statMana / (float)Player.statManaMax2)), 2)); } if (frostFlare) @@ -3826,7 +3756,7 @@ namespace CalamityMod.CalPlayer if (Player.statLife > (int)(Player.statLifeMax2 * 0.5)) Player.GetDamage() += 0.1f; if (Player.statLife <= (int)(Player.statLifeMax2 * 0.5)) - Player.statDefense += 20; + Player.statDefense += 15; } if (vexation) @@ -4047,7 +3977,7 @@ namespace CalamityMod.CalPlayer if (eArtifact) { - Player.manaCost *= 0.75f; + Player.manaCost -= 0.25f; Player.maxMinions++; } @@ -4453,7 +4383,7 @@ namespace CalamityMod.CalPlayer // Also gives acceleration, which is done in PostUpdateRunSpeeds break; case BuffID.Ichor: - Player.statDefense += 40; // +25 net defense + Player.statDefense += 20; // +10 net defense break; case BuffID.Bleeding: Player.bleed = false; @@ -4471,7 +4401,7 @@ namespace CalamityMod.CalPlayer case BuffID.Weak: Player.GetDamage() += 0.051f; // Cancel melee damage nerf, add 10% all damage Player.GetDamage() += 0.1f; - Player.statDefense += 14; // +10 net defense + Player.statDefense += 10; // +6 net defense Player.moveSpeed += 0.25f; // +15% net move speed break; case BuffID.Slow: @@ -4480,7 +4410,7 @@ namespace CalamityMod.CalPlayer break; case BuffID.Confused: Player.confused = false; - Player.statDefense += 50; + Player.statDefense += 15; break; case BuffID.Cursed: Player.cursed = false; @@ -4898,7 +4828,7 @@ namespace CalamityMod.CalPlayer } if (DesertProwlerHat.ShroudedInSmoke(Player, out _)) - Player.statDefense -= (int)(Player.statDefense * 0.75); + Player.statDefense -= (int)(Player.statDefense * DesertProwlerHat.SmokeDefenseMult); } #endregion diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index bdc581dea1..7a15c4b1b1 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -8,7 +8,10 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Cooldowns; using CalamityMod.Dusts; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Astral; using CalamityMod.Items.Armor.Reaver; +using CalamityMod.Items.Armor.SnowRuffian; +using CalamityMod.Items.Armor.Sulphurous; using CalamityMod.Items.Fishing.AstralCatches; using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; @@ -103,7 +106,7 @@ namespace CalamityMod.CalPlayer break; case ItemID.FieryGreatsword: - target.AddBuff(BuffID.OnFire3, 180); + target.AddBuff(BuffID.OnFire3, 90); break; case ItemID.IceSickle: @@ -138,7 +141,7 @@ namespace CalamityMod.CalPlayer ItemLifesteal(target, item, damageDone); ItemOnHit(item, damageDone, target.Center, hit.Crit, target.IsAnEnemy(false, true), targetIsDummy); - NPCDebuffs(target, item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass()); + NPCDebuffs(target, item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), item.CountsAsClass(), hit.Crit); // Ursa Sergeant slash cooldown is reset on kill if (ursaSergeant && target.life <= 0 && target.realLife == -1) @@ -193,13 +196,14 @@ namespace CalamityMod.CalPlayer // Arc Flash Ring lightning strike (Remember to change the one for projectile hits if applicable when you change this one!) // This one has a lot less limits than the projectile one, but that's because vanilla broadsword code is limiting (wow so surprising) - if (arcFlashRing && (Main.rand.Next(0, 100) < 6)) + bool spawnChance = (Main.rand.Next(0, 100) < 6); + if (arcFlashRing && spawnChance) { var source = item.GetSource_FromThis(); - int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits) - Vector2 position = target.Center + new Vector2(0, -750); + int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline) - Projectile.NewProjectile(source, position, new Vector2(0, 10), ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI); + Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI); + bolt.DamageType = hit.DamageType; } // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). @@ -383,22 +387,20 @@ namespace CalamityMod.CalPlayer CalamityGlobalProjectile globalProj = proj.Calamity(); // Arc Flash Ring lightning strike (Remember to change the one for item hits if applicable when you change this one!) - // Minions ignore the chance penalty on penetration - bool spawnChance = (Main.rand.Next(0, 100) < MathHelper.Clamp(6 - proj.numHits, (proj.minion ? 6 : 1), 6)); - if (arcFlashRing && spawnChance && proj.type != ProjectileType() && globalProj.spawnArcFlash) + bool spawnChance = (Main.rand.Next(0, 100) < 6); + if (arcFlashRing && spawnChance && proj.type != ProjectileType()) { proj.active = true; // Okay so if a projectile manually kills itself on hit, it totally breaks the bolts. to prevent this we set them to active var source = proj.GetSource_FromThis(); - int damage = (int)((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)); // 400% damage (uneffected by crits) - Vector2 position = target.Center + new Vector2(0, -750); + int damage = (int)(((hit.Damage * 4f) * (hit.Crit ? 0.5f : 1)) / (Player.Calamity().adrenalineModeActive ? Player.Calamity().GetAdrenalineDamage() + 1 : 1)); // 400% damage (uneffected by crits and adrenaline) - Projectile bolt = Projectile.NewProjectileDirect(source, position, new Vector2(0, 10), ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI); + Projectile bolt = Projectile.NewProjectileDirect(source, target.Center, Vector2.Zero, ProjectileType(), damage, 0f, Player.whoAmI, target.whoAmI, (globalProj.showArcFlash ? 0 : 1)); bolt.DamageType = hit.DamageType; - globalProj.spawnArcFlash = false; - // This is really only used for long lasting projectiles and contact damage minions - globalProj.arcFlashCooldown = 90; + globalProj.showArcFlash = false; + // This is really only used for piercing and long lasting projectiles so they dont flood the screen with bolts + globalProj.arcFlashCooldown = 30; } if (!proj.npcProj && !proj.trap && proj.friendly) @@ -561,11 +563,7 @@ namespace CalamityMod.CalPlayer GeneralParticleHandler.SpawnParticle(orb); } - int heal = (int)Math.Round(hit.Damage * 0.035); - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(hit.Damage * 0.035)); } if ((cgp.betterLifeBullet1 || cgp.betterLifeBullet2) && proj.numHits == 0) @@ -581,13 +579,9 @@ namespace CalamityMod.CalPlayer GeneralParticleHandler.SpawnParticle(orb); } - int heal = (int)Math.Round(hit.Damage * 0.01); - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - for (int i = 0; i <= 2; i++) { - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Main.player[proj.owner], heal, ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(hit.Damage * 0.01), 0.75f); } } @@ -595,7 +589,7 @@ namespace CalamityMod.CalPlayer ProjLifesteal(target, proj, damageDone, hit.Crit); ProjOnHit(proj, target.Center, hit.Crit, target.IsAnEnemy(false), targetIsDummy); - NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), true, proj.noEnchantments); + NPCDebuffs(target, proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), proj.CountsAsClass(), hit.Crit, true, proj.noEnchantments); // Shattered Community tracks all damage dealt with Rage Mode (ignoring dummies). if (targetIsDummy) @@ -614,9 +608,6 @@ namespace CalamityMod.CalPlayer if (!item.CountsAsClass() && Player.meleeEnchant == 7) Projectile.NewProjectile(source, position, Player.velocity, ProjectileID.ConfettiMelee, 0, 0f, Player.whoAmI); - if (reaverDefense) - Player.lifeRegenTime += 1; - if (npcCheck) { if (item.CountsAsClass() && hideOfDeus && hideOfDeusTimer == 0) @@ -629,7 +620,7 @@ namespace CalamityMod.CalPlayer } if (astralStarRain && crit && astralStarRainCooldown <= 0) { - astralStarRainCooldown = 60; + astralStarRainCooldown = AstralHelm.StarRainCooldown; for (int n = 0; n < 3; n++) { int projectileType = Utils.SelectRandom(Main.rand, new int[] @@ -640,7 +631,7 @@ namespace CalamityMod.CalPlayer ProjectileID.StarCannonStar }); - int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); + int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 12f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -695,14 +686,11 @@ namespace CalamityMod.CalPlayer if (theBee && lifeAndShieldCondition) SoundEngine.PlaySound(SoundID.Item110, proj.Center); - if (reaverDefense) - Player.lifeRegenTime += 1; - if (npcCheck) { if (astralStarRain && crit && astralStarRainCooldown <= 0) { - astralStarRainCooldown = 60; + astralStarRainCooldown = AstralHelm.StarRainCooldown; for (int n = 0; n < 3; n++) { int projectileType = Utils.SelectRandom(Main.rand, new int[] @@ -713,7 +701,7 @@ namespace CalamityMod.CalPlayer ProjectileID.StarCannonStar }); - int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); + int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(AstralHelm.StarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 25f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -825,8 +813,9 @@ namespace CalamityMod.CalPlayer if (dynamoStemCells && MiniSwarmerCooldown <= 0 && proj.CountsAsClass()) { MiniSwarmerCooldown = DynamoStemCells.MiniSwarmerCooldown; - - Vector2 velocity = proj.velocity.SafeNormalize(Vector2.UnitY) * 19; + Vector2 directionToMouse = Main.MouseWorld - Player.Center; + directionToMouse.Normalize(); + Vector2 velocity = directionToMouse * 19; int MiniSwamerDamage = (int)Player.GetTotalDamage().ApplyTo(DynamoStemCells.MiniSwamerDamage); Projectile.NewProjectile(source, Player.Center, velocity, ProjectileType(), MiniSwamerDamage, 2f, proj.owner); } @@ -1135,9 +1124,9 @@ namespace CalamityMod.CalPlayer Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), damage, proj.knockBack, proj.owner, 1f, 0f); SoundEngine.PlaySound(SoundID.Item14, proj.Center); - for (int dustexplode = 0; dustexplode < 180; dustexplode++) + for (int dustexplode = 0; dustexplode < 120; dustexplode++) { - Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 2)) * 1.7f; + Vector2 dustd = Vector2.One.RotatedBy(MathHelper.ToRadians(dustexplode * 3)) * 1.7f; Dust dust = Dust.NewDustPerfect(proj.Center, Main.rand.NextBool() ? DustType() : DustType(), dustd, Alpha: 100); dust.noGravity = true; } @@ -1147,6 +1136,7 @@ namespace CalamityMod.CalPlayer if (raiderTalisman && modProj.stealthStrike) { raiderCritLifespan = CalamityUtils.SecondsToFrames(RaidersTalisman.RaiderCooldown); + // TO DO: Add nanotech here Player.AddCooldown(RaiderBoost.ID, raiderCritLifespan, true, vampiricTalisman ? "Bloodfeast" : "default"); if (raiderSoundCooldown <= 0) { @@ -1187,7 +1177,7 @@ namespace CalamityMod.CalPlayer #endregion #region Debuffs - public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool proj = false, bool noFlask = false) + public void NPCDebuffs(NPC target, bool melee, bool ranged, bool magic, bool summon, bool rogue, bool whip, bool crit, bool proj = false, bool noFlask = false) { if (melee && !noFlask) // Prevents Deep Sea Dumbell from snagging true melee debuff memes { @@ -1293,8 +1283,8 @@ namespace CalamityMod.CalPlayer if (omegaBlueChestplate) target.AddBuff(BuffType(), 180); if (sulphurSet) - target.AddBuff(BuffID.Poisoned, 60); - if (ilSpark && Player.IsUnderwater()) + target.AddBuff(BuffID.Poisoned, SulphurousHelmet.SetBonusPoisonDuration); + if (ilSpark && Player.Calamity().countsAsAnyWet) { int duration = 60; target.AddBuff(BuffType(), duration); @@ -1309,7 +1299,11 @@ namespace CalamityMod.CalPlayer } if (vexation) { - target.AddBuff(BuffID.Venom, 120, false); + target.AddBuff(BuffID.Venom, 120, false); + } + if (snowRuffianSet && ranged && crit) + { + target.AddBuff(BuffID.Frostburn, SnowRuffianMask.SetBonusFrostburnDuration, false); } } #endregion @@ -1318,148 +1312,56 @@ namespace CalamityMod.CalPlayer public void ProjLifesteal(NPC target, Projectile proj, int damage, bool crit) { CalamityGlobalProjectile modProj = proj.Calamity(); - - if (bloodflareSet && !target.IsAnEnemy(false) && !Player.moonLeech && target.lifeMax > 5) + if (target.IsAnEnemy(false)) { - if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) + if (bloodflareSet && !Player.moonLeech) { - bloodflareHeartTimer = 300; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); - } - } - - if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) - { - float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); - target.Calamity().gladiatorOnKill = false; - if (healPower >= 1) - { - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); - gladiatorTimer = 300; - } - } - - if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5) - { - // Increases the degree to which Spectre Healing set contributes to the lifesteal cap - if (Player.ghostHeal && proj.CountsAsClass()) - { - // This doesn't use Math.Round because it doesn't in vanilla - float cooldownMult = 0.2f; - cooldownMult -= proj.numHits * 0.05f; - if (cooldownMult < 0f) - cooldownMult = 0f; - - float cooldown = damage * cooldownMult; - Main.LocalPlayer.lifeSteal -= cooldown; - } - - if (vampiricTalisman && proj.CountsAsClass() && crit) - { - int heal = (int)Math.Round(damage * (Main.zenithWorld ? 0.01 : 0.008)); - if (proj.Calamity().stealthStrike) + if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { - heal /= 2; //stealth strikes heal half due to generally dealing far more dmg - - if (Main.zenithWorld) - heal *= -2; // IT YEARNS FOR MORE BLOOD + bloodflareHeartTimer = 300; + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); } - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - // Heals more if the ability is active - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile((raiderCritLifespan > 0) ? 1.5f : 1f, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); } - if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); - - if (target.IsAnEnemy(false)) + if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill) { - if (bloodflareThrowing && proj.CountsAsClass() && crit) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - - if (bloodflareMelee && proj.IsTrueMelee()) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, 2, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); + float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); + target.Calamity().gladiatorOnKill = false; + if (healPower >= 1) + { + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); + gladiatorTimer = 300; + } } + if (vampiricTalisman && proj.CountsAsClass() && crit && proj.numHits <1) + { + int heal = (int)Math.Round(damage * 0.008); + if (heal > 2) + heal = 2; + + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, (raiderCritLifespan > 0 && !proj.Calamity().stealthStrike) ? 1.3f : 1.6f); + } + + if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike && proj.numHits < 1) + //Nanotech has the same heal as Electrician's glove + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, electricianGlove ? 10 : 5, 2f); + + if (bloodflareThrowing && proj.CountsAsClass() && crit) + Projectile.NewProjectile(proj.GetSource_OnHit(target), proj.Center, proj.velocity.SafeNormalize(Vector2.Zero) * Math.Min(((proj.velocity.Length() * proj.MaxUpdates) / 4f), 4f) * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 4, 0f, proj.owner); + if (proj.CountsAsClass() && Player.ActiveItem().CountsAsClass()) { if (manaOverloader) { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.25; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); + double healMult = 0.1D - proj.numHits * 0.025D; + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.5f); } - } - if (silvaSet) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - } - else if (proj.CountsAsClass() && Player.ActiveItem().CountsAsClass()) - { - if (tarraMage) + if (ataxiaMage) { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - } - else if (ataxiaMage) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); - } - } - - if (reaverDefense) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealReaverTankCooldownMultiplier); - } - - if (proj.CountsAsClass()) - { - if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType()] < 3 && Player.ownedProjectileCounts[ProjectileType()] < 3) - { - double healMult = 0.1; - healMult -= proj.numHits * healMult * 0.5; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (CalamityGlobalProjectile.CanSpawnLifeStealProjectile(healMult, heal)) - CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealSetBonusCooldownMultiplier); + double healMult = 0.1D - proj.numHits * 0.05D; + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.25f); } } } @@ -1467,89 +1369,25 @@ namespace CalamityMod.CalPlayer public void ItemLifesteal(NPC target, Item item, int damage) { - if (bloodflareSet && target.IsAnEnemy(false) && target.lifeMax > 5) + if (target.IsAnEnemy(false)) { - if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) + if (bloodflareSet) { - bloodflareHeartTimer = 300; - Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); - } - } - - if (bloodflareMelee && item.CountsAsClass() && target.lifeMax > 5) - { - if (target.IsAnEnemy(false) && Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech) - { - int heal = 4; - if (!Main.LocalPlayer.moonLeech) + if ((target.life < target.lifeMax * 0.5) && bloodflareHeartTimer <= 0) { - Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealSetBonusCooldownMultiplier; - - float lowestHealthCheck = 0f; - int healTarget = Player.whoAmI; - foreach (Player otherPlayer in Main.ActivePlayers) - { - if (!otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team)) - { - float playerDist = Vector2.Distance(target.Center, otherPlayer.Center); - if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) - { - lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; - healTarget = otherPlayer.whoAmI; - } - } - } - - // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list - var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileID.VampireHeal, 0, 0f, Player.whoAmI, healTarget, heal); + bloodflareHeartTimer = 300; + Item.NewItem(target.GetSource_Loot(), target.Hitbox, ItemID.Heart); } } - } - if (gladiatorSword && target.IsAnEnemy(false) && target.life <= 0 && target.Calamity().gladiatorOnKill && target.lifeMax > 5) - { - float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); - target.Calamity().gladiatorOnKill = false; - if (healPower >= 1) + if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill) { - Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); - gladiatorTimer = 300; - } - } - - if (reaverDefense) - { - if (Main.LocalPlayer.lifeSteal > 0f && !Player.moonLeech && target.lifeMax > 5) - { - double healMult = 0.1; - int heal = (int)Math.Round(damage * healMult); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (heal > 0 && !Main.LocalPlayer.moonLeech) + float healPower = 10 * Utils.GetLerpValue(300, 0, gladiatorTimer, true); + target.Calamity().gladiatorOnKill = false; + if (healPower >= 1) { - Main.LocalPlayer.lifeSteal -= heal * BalancingConstants.LifeStealReaverTankCooldownMultiplier; - - float lowestHealthCheck = 0f; - int healTarget = Player.whoAmI; - for (int i = 0; i < Main.maxPlayers; i++) - { - Player otherPlayer = Main.player[i]; - if (otherPlayer.active && !otherPlayer.dead && ((!Player.hostile && !otherPlayer.hostile) || Player.team == otherPlayer.team)) - { - float playerDist = Vector2.Distance(target.Center, otherPlayer.Center); - if (playerDist < BalancingConstants.LifeStealRange && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) - { - lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; - healTarget = otherPlayer.whoAmI; - } - } - } - - // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list - var source = Player.GetSource_FromThis(ReaverHeadTank.HealOrbEntitySourceContext); - Projectile.NewProjectile(source, target.Center, Vector2.Zero, ProjectileType(), 0, 0f, Player.whoAmI, healTarget, heal); + Projectile.NewProjectile(Player.GetSource_FromThis(), target.Center, target.velocity * 0.5f, ProjectileType(), 0, 0, -1, (int)healPower); + gladiatorTimer = 300; } } } diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index 108819e310..f14b13f223 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -61,8 +61,7 @@ namespace CalamityMod.CalPlayer.Dashes // Constantly update the player's velocity direction. Vector2 dashVel = Main.MouseWorld - player.Center; - dashVel = dashVel.SafeNormalize(Vector2.UnitX) * CalculateDashSpeed(player); - player.velocity = dashVel; + player.velocity = player.velocity.ToRotation().AngleTowards(dashVel.ToRotation(), 0.175f).ToRotationVector2() * CalculateDashSpeed(player); // Fall way, way, faster than usual. player.maxFallSpeed = 50f; diff --git a/CalPlayer/DrawLayers/CombHairSparkleLayer.cs b/CalPlayer/DrawLayers/CombHairSparkleLayer.cs index 18ca428d85..e2525ac081 100644 --- a/CalPlayer/DrawLayers/CombHairSparkleLayer.cs +++ b/CalPlayer/DrawLayers/CombHairSparkleLayer.cs @@ -60,10 +60,14 @@ namespace CalamityMod.CalPlayer.DrawLayers { for (int j = TopRange; j <= BottomRange; j++) { + Tile tile = Main.tile[i, j]; + if (!tile.HasTile || !TileID.Sets.IsAContainer[tile.TileType] || TileID.Sets.BasicDresser[tile.TileType]) + continue; + int PotentialChest = Chest.FindChestByGuessing(i, j); - if (PotentialChest != -1 && !TileID.Sets.BasicDresser[Main.tile[i, j].TileType]) + if (PotentialChest != -1) { - // Adjust position ot the center of the chest + // Adjust position to the center of the chest Chest chest = Main.chest[PotentialChest]; Vector2 chestCenter = new Vector2(chest.x + 1, chest.y + 1) * 16f; float distance = Vector2.Distance(chestCenter, drawPlayer.MountedCenter); diff --git a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs index d5a92f8bfc..74577bfced 100644 --- a/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs +++ b/CalPlayer/DrawLayers/HeldItemGlowMaskLayer.cs @@ -35,6 +35,8 @@ namespace CalamityMod.CalPlayer.DrawLayers if (itemType < ItemID.Count) return; + Color color = new Color(250, 250, 250, heldItem.alpha); + // This is ugly and I don't give a fuck. // If you want it to look better, do it yourself. Texture2D glowMask = default; @@ -62,8 +64,6 @@ namespace CalamityMod.CalPlayer.DrawLayers glowMask = ModContent.Request("CalamityMod/Items/Weapons/Summon/EtherealSubjugatorGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/ExcelsusGlow").Value; - else if (itemType == ModContent.ItemType()) - glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/IridescentExcaliburGlow").Value; else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/FatesRevealGlow").Value; else if (itemType == ModContent.ItemType()) @@ -75,7 +75,10 @@ namespace CalamityMod.CalPlayer.DrawLayers else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/SummonItems/NecroplasmicBeaconGlow").Value; else if (itemType == ModContent.ItemType()) + { + color = Color.Lerp(Color.White, drawPlayer.Calamity().lightRGB, 0.75f) with { A = 0 }; glowMask = ModContent.Request("CalamityMod/Items/Weapons/Melee/OrderbringerGlow").Value; + } else if (itemType == ModContent.ItemType()) glowMask = ModContent.Request("CalamityMod/Items/Weapons/Magic/PhotosynthesisGlow").Value; else if (itemType == ModContent.ItemType()) @@ -140,7 +143,6 @@ namespace CalamityMod.CalPlayer.DrawLayers if (drawInfo.shadow != 0f || drawPlayer.frozen || !(inUse || visuallyHeld) || itemType <= 0 || drawPlayer.dead || heldItem.noUseGraphic || (drawPlayer.wet && heldItem.noWet) || (drawPlayer.happyFunTorchTime && drawPlayer.inventory[drawPlayer.selectedItem].createTile == TileID.Torches && drawPlayer.itemAnimation == 0)) return; - Color color = new Color(250, 250, 250, heldItem.alpha); Vector2 originOffset = Vector2.Zero; // Use to adjust glow mask draw offset and color. diff --git a/CalamityConditions.cs b/CalamityConditions.cs index b402f2a872..8fdfb0d11e 100644 --- a/CalamityConditions.cs +++ b/CalamityConditions.cs @@ -21,7 +21,6 @@ namespace CalamityMod public static readonly Condition PlayerHasRogueArmor = Create("HasRogueArmor", () => Main.LocalPlayer.Calamity().rogueStealthMax > 0f && Main.LocalPlayer.Calamity().wearingRogueArmor); public static readonly Condition PlayerHasWings = Create("HasWings", () => Main.LocalPlayer.wingTimeMax > 0); - public static readonly Condition PlayerAlcoholPoisoned = Create("AlcoholPoison", () => Main.LocalPlayer.Calamity().alcoholPoisoning); // // Calamity Event Flag conditions diff --git a/CalamityConfig.cs b/CalamityConfig.cs index 50d1ea2d39..e56acc7a3f 100644 --- a/CalamityConfig.cs +++ b/CalamityConfig.cs @@ -1,6 +1,7 @@ using System.ComponentModel; using System.Reflection; using System.Runtime.Serialization; +using CalamityMod.Enums; using CalamityMod.UI; using CalamityMod.UI.DraedonsArsenal; using CalamityMod.UI.Rippers; @@ -27,36 +28,6 @@ namespace CalamityMod ParticleLimit = (int)Utils.Clamp(ParticleLimit, MinParticleLimit, MaxParticleLimit); } - internal static void SaveConfig() - { - // There is no current way to manually save a mod configuration file in tModLoader. - // The method which saves mod config files is private in ConfigManager, so reflection is used to invoke it. - try - { - MethodInfo saveMethodInfo = typeof(ConfigManager).GetMethod("Save", BindingFlags.Static | BindingFlags.NonPublic); - if (saveMethodInfo is not null) - saveMethodInfo.Invoke(null, [Instance]); - else - CalamityMod.Instance.Logger.Error("TML ConfigManager.Save reflection failed. Method signature has changed. Notify Calamity Devs if you see this in your log."); - } - catch - { - CalamityMod.Instance.Logger.Error("An error occurred while manually saving Calamity mod configuration. This may be due to a complex mod conflict. It is safe to ignore this error."); - } - } - - #region Multi-Threading Settings - [Header("Multithreading")] - - [BackgroundColor(192, 54, 64, 192)] - [SliderColor(224, 165, 56, 128)] - [Range(0f, 2f)] - [DefaultValue(0f)] - [Increment(1f)] - [DrawTicks] - public float SunkenSeaMultiThreading { get; set; } - #endregion - #region Graphics Changes [Header("Graphics")] @@ -299,8 +270,10 @@ namespace CalamityMod public bool FasterFallHotkey { get; set; } [BackgroundColor(192, 54, 64, 192)] - [DefaultValue(true)] - public bool CalamityArmorSetBonusDoubleTap { get; set; } + [SliderColor(224, 165, 56, 128)] + [DrawTicks] + [DefaultValue(SetBonusDoubleTapOptions.Auto)] + public SetBonusDoubleTapOptions SetBonusDoubleTap { get; set; } [BackgroundColor(192, 54, 64, 192)] [DefaultValue(false)] diff --git a/CalamityMod.cs b/CalamityMod.cs index 6a5df844d4..88ad657958 100644 --- a/CalamityMod.cs +++ b/CalamityMod.cs @@ -34,7 +34,7 @@ namespace CalamityMod public override void Load() { // Initialize the EnemyStats struct as early as it is safe to do so - NPCStats.Load(); + NPCStats.LoadDebuffs(); // Initialize Calamity Balance, since it is tightly coupled with the remaining systems CalamityGlobalItem.LoadTweaks(); @@ -58,7 +58,7 @@ namespace CalamityMod #region Unload public override void Unload() { - NPCStats.Unload(); + NPCStats.UnloadDebuffs(); CalamityGlobalItem.UnloadTweaks(); CalamityGlobalProjectile.UnloadTweaks(); diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index 683b8a49b1..8c36c52d84 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -508,11 +508,7 @@ namespace CalamityMod.DataStructures { if (Procced) { - if (!player.moonLeech) - { - player.HealPlayer(OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal); - } - + player.DoLifestealDirect(null, OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal); Procced = false; } } diff --git a/DataStructures/NPCStats.cs b/DataStructures/NPCStats.cs deleted file mode 100644 index 18cef5a312..0000000000 --- a/DataStructures/NPCStats.cs +++ /dev/null @@ -1,880 +0,0 @@ -using System; -using System.Collections.Generic; -using CalamityMod.NPCs.AcidRain; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crabulon; -using CalamityMod.NPCs.Cryogen; -using CalamityMod.NPCs.DesertScourge; -using CalamityMod.NPCs.DevourerofGods; -using CalamityMod.NPCs.ExoMechs.Apollo; -using CalamityMod.NPCs.ExoMechs.Ares; -using CalamityMod.NPCs.ExoMechs.Artemis; -using CalamityMod.NPCs.ExoMechs.Thanatos; -using CalamityMod.NPCs.HiveMind; -using CalamityMod.NPCs.Leviathan; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.Perforator; -using CalamityMod.NPCs.PlaguebringerGoliath; -using CalamityMod.NPCs.Polterghast; -using CalamityMod.NPCs.PrimordialWyrm; -using CalamityMod.NPCs.ProfanedGuardians; -using CalamityMod.NPCs.Providence; -using CalamityMod.NPCs.Ravager; -using CalamityMod.NPCs.Signus; -using CalamityMod.NPCs.SlimeGod; -using CalamityMod.NPCs.StormWeaver; -using CalamityMod.NPCs.SupremeCalamitas; -using CalamityMod.NPCs.Yharon; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.World; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod -{ - // TODO -- This can be made into a ModSystem with simple OnModLoad and Unload hooks. - public static partial class NPCStats - { - private const double ExpertContactVanillaMultiplier = 2D; - private const double MasterContactVanillaMultiplier = 3D; - private const double NormalProjectileVanillaMultiplier = 2D; - private const double ExpertProjectileVanillaMultiplier = 4D; - private const double MasterProjectileVanillaMultiplier = 6D; - - #region Enemy Stats Container Struct - internal partial struct EnemyStats - { - public static SortedDictionary ExpertDamageMultiplier; - public static SortedDictionary ContactDamageValues; - public static SortedDictionary, int[]> ProjectileDamageValues; - }; - #endregion - - #region Stat Retrieval Methods - public static void GetNPCDamage(this NPC npc) - { - double damageAdjustment = GetExpertDamageMultiplier(npc) * (Main.masterMode ? MasterContactVanillaMultiplier : ExpertContactVanillaMultiplier); - - // Safety check: If for some reason the contact damage array is not initialized yet, set the NPC's damage to 1. - bool exists = EnemyStats.ContactDamageValues.TryGetValue(npc.type, out int[] contactDamage); - if (!exists) - npc.damage = 1; - - int normalDamage = contactDamage[0]; - int expertDamage = contactDamage[1] == -1 ? -1 : (int)Math.Round(contactDamage[1] / damageAdjustment); - int revengeanceDamage = contactDamage[2] == -1 ? -1 : (int)Math.Round(contactDamage[2] / damageAdjustment); - int deathDamage = contactDamage[3] == -1 ? -1 : (int)Math.Round(contactDamage[3] / damageAdjustment); - int masterDamage = contactDamage[4] == -1 ? -1 : (int)Math.Round(contactDamage[4] / damageAdjustment); - - // If the assigned value would be -1, don't actually assign it. This allows for conditionally disabling the system. - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage; - if (damageToUse != -1) - npc.damage = damageToUse; - } - - // Gets the amount of damage a given projectile should do from this NPC. - // Automatically compensates for Terraria's internal spaghetti scaling. - public static int GetProjectileDamage(this NPC npc, int projType) - { - double damageAdjustment = Main.masterMode ? MasterProjectileVanillaMultiplier : Main.expertMode ? ExpertProjectileVanillaMultiplier : NormalProjectileVanillaMultiplier; - - // Safety check: If for some reason the projectile damage array is not initialized yet, return 1. - bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple(npc.type, projType), out int[] projectileDamage); - if (!exists) - return 1; - - int normalDamage = (int)Math.Round(projectileDamage[0] / damageAdjustment); - int expertDamage = (int)Math.Round(projectileDamage[1] / damageAdjustment); - int revengeanceDamage = (int)Math.Round(projectileDamage[2] / damageAdjustment); - int deathDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment); - int masterDamage = (int)Math.Round(projectileDamage[4] / damageAdjustment); - - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage; - - return damageToUse; - } - - // Gets the amount of damage this projectile should do from a given NPC. - // Automatically compensates for Terraria's internal spaghetti scaling. - public static int GetProjectileDamage(this Projectile projectile, int npcType) - { - double damageAdjustment = Main.masterMode ? MasterProjectileVanillaMultiplier : Main.expertMode ? ExpertProjectileVanillaMultiplier : NormalProjectileVanillaMultiplier; - - // Safety check: If for some reason the projectile damage array is not initialized yet, return 1. - bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple(npcType, projectile.type), out int[] projectileDamage); - if (!exists) - return 1; - - int normalDamage = (int)Math.Round(projectileDamage[0] / damageAdjustment); - int expertDamage = (int)Math.Round(projectileDamage[1] / damageAdjustment); - int revengeanceDamage = (int)Math.Round(projectileDamage[2] / damageAdjustment); - int deathDamage = (int)Math.Round(projectileDamage[3] / damageAdjustment); - int masterDamage = (int)Math.Round(projectileDamage[4] / damageAdjustment); - - int damageToUse = Main.masterMode ? masterDamage : CalamityWorld.death ? deathDamage : CalamityWorld.revenge ? revengeanceDamage : Main.expertMode ? expertDamage : normalDamage; - - return damageToUse; - } - - // Gets the raw amount of damage a projectile should do from this NPC. - // That is, this doesn't adjust the value to compensate for Terraria's internal spaghetti scaling. - public static int GetProjectileDamageNoScaling(this NPC npc, int projType) - { - bool exists = EnemyStats.ProjectileDamageValues.TryGetValue(new Tuple(npc.type, projType), out int[] projectileDamage); - return !exists ? 1 // Base case for safety, in case the array is not initialized yet. - : Main.masterMode ? projectileDamage[4] - : CalamityWorld.death ? projectileDamage[3] - : CalamityWorld.revenge ? projectileDamage[2] - : Main.expertMode ? projectileDamage[1] - : projectileDamage[0]; - } - - /// - /// Gets the Expert/Master Mode damage multiplier for the specified boss NPC. - /// Useful for determining the base damage a boss NPC should have prior to being run through the Expert/Master scaling code. - /// - /// The NPC you want to get the damage multiplier for - /// Whether Master Mode is enabled or not - /// - public static double GetExpertDamageMultiplier(this NPC npc, bool? master = null) - { - bool exists = EnemyStats.ExpertDamageMultiplier.TryGetValue(npc.type, out double damageMult); - return exists ? damageMult : 1D; - } - #endregion - - #region Load/Unload - internal static void Load() - { - LoadEnemyStats(); - LoadDebuffs(); - } - internal static void Unload() - { - UnloadEnemyStats(); - UnloadDebuffs(); - } - - // A static function, called exactly once, which initializes the EnemyStats struct at a predictable time. - // This is necessary to ensure this dictionary is populated as early as possible. - internal static void LoadEnemyStats() - { - EnemyStats.ExpertDamageMultiplier = new SortedDictionary - { - { NPCID.KingSlime, 0.8 }, - - { ModContent.NPCType(), 1.1 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.EaterofWorldsHead, 1.1 }, - { NPCID.EaterofWorldsBody, 0.8 }, - { NPCID.EaterofWorldsTail, 0.8 }, - - { NPCID.BrainofCthulhu, 0.9 }, - - { ModContent.NPCType(), 0.9 }, - - { ModContent.NPCType(), 0.9 }, - - { NPCID.QueenBee, 0.9 }, - { NPCID.Bee, 0.6 }, - { NPCID.BeeSmall, 0.6 }, - - { NPCID.SkeletronHead, 1.1 }, - { NPCID.SkeletronHand, 1.1 }, - - { NPCID.WallofFlesh, 1.5 }, - { NPCID.WallofFleshEye, 1.5 }, - - { ModContent.NPCType(), 1.15 }, - - { NPCID.Spazmatism, 0.85 }, - { NPCID.Retinazer, 0.85 }, - { ModContent.NPCType(), 0.85 }, - - { ModContent.NPCType(), 1.1 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { NPCID.TheDestroyer, 2 }, - { NPCID.TheDestroyerBody, 0.85 }, - { NPCID.TheDestroyerTail, 0.85 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.SkeletronPrime, 0.85 }, - { ModContent.NPCType(), 0.85 }, - { NPCID.PrimeCannon, 0.85 }, - { NPCID.PrimeLaser, 0.85 }, - { NPCID.PrimeSaw, 0.85 }, - { NPCID.PrimeVice, 0.85 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.Plantera, 1.15 }, - { NPCID.PlanterasTentacle, 1.15 }, - { ModContent.NPCType(), 1.15 }, - - { NPCID.HallowBoss, 0.6875 }, - - { ModContent.NPCType(), 1.2 }, - { ModContent.NPCType(), 0.8 }, - { NPCID.DetonatingBubble, 0.75 }, - - { ModContent.NPCType(), 1.1 }, - - { NPCID.Golem, 0.8 }, - { NPCID.GolemHead, 0.8 }, - { NPCID.GolemFistLeft, 0.8 }, - { NPCID.GolemFistRight, 0.8 }, - - { ModContent.NPCType(), 0.9 }, - - { NPCID.DukeFishron, 0.7 }, - { NPCID.Sharkron, 0.75 }, - { NPCID.Sharkron2, 0.75 }, - - { ModContent.NPCType(), 0.8 }, - - { NPCID.CultistDragonHead, 0.75 }, - { NPCID.CultistDragonBody1, 0.75 }, - { NPCID.CultistDragonBody2, 0.75 }, - { NPCID.CultistDragonBody3, 0.75 }, - { NPCID.CultistDragonBody4, 0.75 }, - { NPCID.CultistDragonTail, 0.75 }, - { NPCID.AncientDoom, 0.75 }, - { NPCID.AncientLight, 0.75 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.9 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.9 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.85 }, - { ModContent.NPCType(), 0.85 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - { ModContent.NPCType(), 0.8 }, - - { ModContent.NPCType(), 0.8 } - }; - - EnemyStats.ContactDamageValues = new SortedDictionary - { - { NPCID.KingSlime, new int[] { 40, 64, 80, 96, 144 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, - - { ModContent.NPCType(), new int[] { 45, 66, 88, 110, 165 } }, - { ModContent.NPCType(), new int[] { 24, 32, 40, 48, 72 } }, - { ModContent.NPCType(), new int[] { 18, 24, 30, 36, 54 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, - { ModContent.NPCType(), new int[] { 21, 28, 32, 36, 63 } }, - { ModContent.NPCType(), new int[] { 12, 16, 20, 24, 36 } }, - { ModContent.NPCType(), new int[] { 30, 44, 60, 76, 114 } }, - { ModContent.NPCType(), new int[] { 21, 28, 32, 36, 63 } }, - { ModContent.NPCType(), new int[] { 12, 16, 20, 24, 36 } }, - - { NPCID.EyeofCthulhu, new int[] { - 24, // 36 in phase 2 - 30, // 45 in phase 2 - 40, // 48 in phase 2, 56 in phase 3 - 50, // 60 in phase 2, 70 in phase 3 - 75 } }, // Vanilla: 113 in phase 2; Rev+: 90 in phase 2, 105 in phase 3 - { NPCID.ServantofCthulhu, new int[] { 18, 24, 30, 36, 54 } }, - { ModContent.NPCType(), new int[] { 20, 26, 34, 42, 63 } }, // In phase 2: 26, 34, 44, 55, 82 - - { ModContent.NPCType(), new int[] { 40, 64, 80, 96, 144 } }, - { ModContent.NPCType(), new int[] { 25, 50, 62, 74, 111 } }, - - { NPCID.EaterofWorldsHead, new int[] { 38, 55, 77, 99, 165 } }, - { NPCID.EaterofWorldsBody, new int[] { 18, 24, 32, 40, 60 } }, - { NPCID.EaterofWorldsTail, new int[] { 12, 16, 24, 32, 48 } }, - { NPCID.VileSpitEaterOfWorlds, new int[] { -1, 64, 64, 64, 96 } }, - - { NPCID.BrainofCthulhu, new int[] { 36, 54, 81, 108, 162 } }, - { NPCID.Creeper, new int[] { 24, 36, 66, 96, 144 } }, - - { ModContent.NPCType(), new int[] { 42, 63, 81, 99, 162 } }, - { ModContent.NPCType(), new int[] { 30, 50, 62, 74, 111 } }, - - { ModContent.NPCType(), new int[] { 36, 54, 63, 72, 108 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 126, 189 } }, - { ModContent.NPCType(), new int[] { 28, 48, 56, 64, 96 } }, - { ModContent.NPCType(), new int[] { 22, 36, 42, 48, 72 } }, - { ModContent.NPCType(), new int[] { 42, 70, 84, 98, 147 } }, - { ModContent.NPCType(), new int[] { 24, 42, 50, 58, 87 } }, - { ModContent.NPCType(), new int[] { 18, 28, 34, 40, 60 } }, - { ModContent.NPCType(), new int[] { 36, 60, 72, 84, 126 } }, - { ModContent.NPCType(), new int[] { 20, 36, 42, 48, 72 } }, - { ModContent.NPCType(), new int[] { 14, 20, 26, 32, 48 } }, - - { NPCID.QueenBee, new int[] { 36, 54, 81, 108, 162 } }, - { NPCID.Bee, new int[] { 20, 24, 48, 72, 108 } }, - { NPCID.BeeSmall, new int[] { 15, 18, 36, 54, 81 } }, - - { NPCID.SkeletronHead, new int[] { - 42, // 55 while spinning - 77, // 100 while spinning - 88, // 114 while spinning - 99, // 128 while spinning - 165 } }, // 215 while spinning - { NPCID.SkeletronHand, new int[] { 32, 44, 77, 110, 165 } }, - - { NPCID.Deerclops, new int[] { 20, 40, 50, 60, 90 } }, - - { ModContent.NPCType(), new int[] { 48, 80, 96, 112, 168 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 126, 189 } }, - { ModContent.NPCType(), new int[] { 48, 80, 96, 112, 168 } }, - { ModContent.NPCType(), new int[] { 60, 100, 120, 140, 210 } }, - { ModContent.NPCType(), new int[] { 54, 90, 108, 126, 189 } }, - { ModContent.NPCType(), new int[] { 36, 60, 72, 84, 126 } }, - { ModContent.NPCType(), new int[] { 24, 40, 48, 56, 84 } }, - { ModContent.NPCType(), new int[] { 42, 70, 84, 98, 147 } }, - { ModContent.NPCType(), new int[] { 30, 50, 60, 70, 105 } }, - - { NPCID.WallofFlesh, new int[] { 100, 150, 180, 210, 315 } }, - { NPCID.WallofFleshEye, new int[] { 100, 150, 180, 210, 315 } }, - { NPCID.TheHungry, new int[] { - 30, // Ranges from 30 to 75 depending on WoF life - 60, // Ranges from 60 to 150 depending on WoF life - 60, // Ranges from 60 to 150 depending on WoF life - 60, // Ranges from 60 to 150 depending on WoF life - 90 } }, // Ranges from 90 to 225 depending on WoF life - { NPCID.TheHungryII, new int[] { 30, 60, 74, 88, 132 } }, - { NPCID.LeechHead, new int[] { 26, 52, 62, 72, 108 } }, - { NPCID.LeechBody, new int[] { 22, 44, 52, 60, 90 } }, - { NPCID.LeechTail, new int[] { 18, 36, 42, 48, 72 } }, - - { NPCID.QueenSlimeBoss, new int[] { 80, 120, 150, 180, 270 } }, - { NPCID.QueenSlimeMinionBlue, new int[] { 60, 80, 100, 120, 180 } }, - { NPCID.QueenSlimeMinionPink, new int[] { 60, 80, 100, 120, 180 } }, - { NPCID.QueenSlimeMinionPurple, new int[] { 70, 100, 120, 140, 210 } }, - - { ModContent.NPCType(), new int[] { 90, 138, 161, 184, 276 } }, - { ModContent.NPCType(), new int[] { 80, 120, 138, 156, 240 } }, - - { NPCID.Spazmatism, new int[] { - 70, // 105 in phase 2 - 102, // 153 in phase 2 - 119, // 178 in phase 2 - 136, // 204 in phase 2 - 204 } }, // 306 in phase 2 - { NPCID.Retinazer, new int[] { - 55, // 83 in phase 2 - 85, // 127 in phase 2 - 102, // 153 in phase 2 - 119, // 178 in phase 2 - 153 } }, // 229 in phase 2 - { ModContent.NPCType(), new int[] { - 62, // 93 in phase 2 - 94, // 141 in phase 2 - 110, // 165 in phase 2 - 128, // 192 in phase 2 - 178 } }, // 267 in phase 2 - - { ModContent.NPCType(), new int[] { 110, 176, 187, 198, 330 } }, - { ModContent.NPCType(), new int[] { 75, 112, 136, 160, 240 } }, - { ModContent.NPCType(), new int[] { 70, 104, 112, 120, 192 } }, - { ModContent.NPCType(), new int[] { 65, 96, 104, 112, 168 } }, - - { NPCID.TheDestroyer, new int[] { 140, 280, 300, 320, 480 } }, - { NPCID.TheDestroyerBody, new int[] { 70, 102, 136, 170, 255 } }, - { NPCID.TheDestroyerTail, new int[] { 45, 68, 102, 136, 204 } }, - - { ModContent.NPCType(), new int[] { 75, 112, 136, 160, 240 } }, - - { NPCID.SkeletronPrime, new int[] { - 50, // 100 while spinning - 85, // 170 while spinning - 102, // 204 while spinning - 119, // 238 while spinning - 153 } }, // 306 while spinning - { ModContent.NPCType(), new int[] { - 50, // 100 while spinning - 85, // 170 while spinning - 102, // 204 while spinning - 119, // 238 while spinning - 153 } }, // 306 while spinning - { NPCID.PrimeVice, new int[] { 70, 102, 136, 170, 255 } }, - { NPCID.PrimeSaw, new int[] { 70, 102, 136, 170, 255 } }, - { NPCID.PrimeCannon, new int[] { 30, 51, 68, 85, 102 } }, - { NPCID.PrimeLaser, new int[] { 30, 51, 68, 85, 102 } }, - - { ModContent.NPCType(), new int[] { 95, 144, 168, 192, 288 } }, - { ModContent.NPCType(), new int[] { 80, 120, 138, 156, 240 } }, - { ModContent.NPCType(), new int[] { 85, 130, 150, 170, 255 } }, - - { NPCID.Plantera, new int[] { - 70, // 98 in phase 2 - 100, // 140 in phase 2 - 138, // 193 in phase 2 - 176, // 246 in phase 2 - 276 } }, // 386 in phase 2 - { NPCID.PlanterasTentacle, new int[] { 90, 138, 161, 184, 276 } }, - { ModContent.NPCType(), new int[] { 90, 138, 161, 184, 276 } }, - { NPCID.Spore, new int[] { 90, 140, 160, 180, 270 } }, - - { NPCID.HallowBoss, new int[] { 80, // 120 during charge - 110, // 165 during charge - 143, // 215 during charge - 176, // 264 during charge - 264 } }, // 396 during charge - - { ModContent.NPCType(), new int[] { 140, 216, 240, 264, 414 } }, - { ModContent.NPCType(), new int[] { - 75, // 113 during charge - 112, // 168 during charge - 136, // 204 during charge - 160, // 240 during charge - 240 } }, // 360 during charge - { ModContent.NPCType(), new int[] { 70, 110, 126, 142, 210 } }, - { NPCID.DetonatingBubble, new int[] { 100, 150, 180, 210, 315 } }, - { ModContent.NPCType(), new int[] { 90, 140, 160, 180, 270 } }, - - { ModContent.NPCType(), new int[] { 145, 220, 242, 264, 429 } }, - { ModContent.NPCType(), new int[] { 75, 112, 128, 144, 225 } }, - - { NPCID.Golem, new int[] { 95, 144, 176, 208, 312 } }, - { NPCID.GolemHead, new int[] { 85, 128, 144, 160, 240 } }, - { NPCID.GolemFistLeft, new int[] { 75, 112, 144, 176, 264 } }, - { NPCID.GolemFistRight, new int[] { 75, 112, 144, 176, 264 } }, - - { ModContent.NPCType(), new int[] { 120, 180, 216, 252, 378 } }, - { ModContent.NPCType(), new int[] { 120, 180, 210, 240, 360 } }, - { ModContent.NPCType(), new int[] { 130, 200, 240, 280, 420 } }, - - { NPCID.DukeFishron, new int[] { - 100, // 120 in phase 2 - 140, // 202 in phase 2, 185 in phase 3 - 168, // 242 in phase 2, 222 in phase 3 - 196, // 282 in phase 2, 259 in phase 3 - 294 } }, // 423 in phase 2, 388 in phase 3 - { NPCID.Sharkron, new int[] { 100, 150, 180, 210, 315 } }, - { NPCID.Sharkron2, new int[] { 120, 180, 210, 240, 360 } }, - - { ModContent.NPCType(), new int[] { 130, 192, 224, 256, 384 } }, - { ModContent.NPCType(), new int[] { 105, 160, 180, 200, 315 } }, - { ModContent.NPCType(), new int[] { 105, 160, 180, 200, 315 } }, - { ModContent.NPCType(), new int[] { 130, 192, 224, 256, 390 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 224, 336 } }, - - { NPCID.CultistDragonHead, new int[] { 120, 180, 210, 240, 360 } }, - { NPCID.CultistDragonBody1, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonBody2, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonBody3, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonBody4, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.CultistDragonTail, new int[] { 60, 90, 105, 120, 180 } }, - { NPCID.AncientCultistSquidhead, new int[] { 120, 180, 210, 240, 360 } }, - { NPCID.AncientLight, new int[] { 120, 180, 210, 240, 360 } }, - - { ModContent.NPCType(), new int[] { 160, 240, 268, 296, 480 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 224, 336 } }, - { ModContent.NPCType(), new int[] { 85, 128, 160, 192, 288 } }, - - { ModContent.NPCType(), new int[] { 150, 224, 256, 288, 444 } }, - { ModContent.NPCType(), new int[] { 160, 240, 264, 288, 405 } }, - { ModContent.NPCType(), new int[] { 100, 200, 220, 240, 300 } }, - { ModContent.NPCType(), new int[] { 100, 200, 220, 232, 300 } }, - - { ModContent.NPCType(), new int[] { 170, 256, 288, 320, 504 } }, - { ModContent.NPCType(), new int[] { 145, 220, 242, 264, 435 } }, - - { ModContent.NPCType(), new int[] { 240, 360, 396, 432, 720 } }, - { ModContent.NPCType(), new int[] { 175, 260, 288, 316, 525 } }, - - { ModContent.NPCType(), new int[] { 240, 360, 396, 432, 720 } }, - { ModContent.NPCType(), new int[] { 125, 192, 224, 256, 372 } }, - { ModContent.NPCType(), new int[] { 105, 160, 192, 224, 312 } }, - - { ModContent.NPCType(), new int[] { 210, 315, 351, 387, 621 } }, - { ModContent.NPCType(), new int[] { 175, 260, 288, 316, 525 } }, - { ModContent.NPCType(), new int[] { 190, 280, 300, 320, 570 } }, - - { ModContent.NPCType(), new int[] { - 160, // 192 in phase 2, 224 in phase 3 - 240, // 288 in phase 2, 336 in phase 3 - 264, // 317 in phase 2, 370 in phase 3 - 288, // 346 in phase 2, 403 in phase 3 - 480 } }, // 576 in phase 2, 672 in phase 3 - { ModContent.NPCType(), new int[] { 224, 336, 370, 403, 672 } }, - - { ModContent.NPCType(), new int[] { - 192, // 211 in phase 2, 230 in phase 3 - 288, // 317 in phase 2, 346 in phase 3 - 324, // 356 in phase 2, 389 in phase 3 - 360, // 396 in phase 2, 432 in phase 3 - 567 } }, // 624 in phase 2, 680 in phase 3 - { ModContent.NPCType(), new int[] { 192, 288, 328, 368, 576 } }, - { ModContent.NPCType(), new int[] { 192, 288, 328, 368, 576 } }, - - { ModContent.NPCType(), new int[] { 470, 700, 750, 800, 1410 } }, - { ModContent.NPCType(), new int[] { 250, 374, 425, 476, 714 } }, - { ModContent.NPCType(), new int[] { 204, 306, 340, 374, 612 } }, - { ModContent.NPCType(), new int[] { 240, 360, 396, 432, 720 } }, - { ModContent.NPCType(), new int[] { 175, 260, 290, 320, 525 } }, - { ModContent.NPCType(), new int[] { 135, 200, 230, 260, 405 } }, - - { ModContent.NPCType(), new int[] { 300, 448, 480, 512, 900 } }, - - { ModContent.NPCType(), new int[] { 340, 512, 544, 576, 1020 } }, - - { ModContent.NPCType(), new int[] { 340, 512, 544, 576, 1020 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 544, 960 } }, - - { ModContent.NPCType(), new int[] { 375, 560, 592, 624, 1116 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 544, 960 } }, - { ModContent.NPCType(), new int[] { 320, 480, 512, 544, 960 } }, - { ModContent.NPCType(), new int[] { 270, 400, 424, 448, 804 } }, - - { ModContent.NPCType(), new int[] { 535, 800, 850, 900, 1596 } } - }; - - EnemyStats.ProjectileDamageValues = new SortedDictionary, int[]> - { - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(NPCID.EyeofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 26, 44, 60, 76, 114 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.BloodShot), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 72, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 72, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 32, 48, 60, 72, 108 } }, - - { new Tuple(NPCID.EaterofWorldsHead, ProjectileID.CursedFlameHostile), new int[] { 26, 44, 60, 76, 114 } }, - { new Tuple(NPCID.EaterofWorldsHead, ModContent.ProjectileType()), new int[] { 26, 36, 44, 52, 84 } }, - - { new Tuple(NPCID.BrainofCthulhu, ProjectileID.BloodNautilusShot), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(NPCID.BrainofCthulhu, ProjectileID.BloodShot), new int[] { 26, 44, 60, 76, 114 } }, - { new Tuple(NPCID.Creeper, ProjectileID.BloodShot), new int[] { 26, 44, 60, 76, 114 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 30, 48, 60, 72, 108 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 30, 48, 60, 72, 108 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 22, 36, 44, 52, 84 } }, - - { new Tuple(NPCID.QueenBee, ProjectileID.QueenBeeStinger), new int[] { 22, 44, 64, 84, 126 } }, - { new Tuple(NPCID.QueenBee, ModContent.ProjectileType()), new int[] { 46, 72, 84, 96, 144 } }, // Beenade Bees: 122 (death mode-exclusive) - - { new Tuple(NPCID.SkeletronHead, ProjectileID.Skull), new int[] { 46, 72, 84, 96, 144 } }, - { new Tuple(NPCID.SkeletronHead, ProjectileID.Shadowflames), new int[] { 36, 72, 88, 104, 156 } }, - { new Tuple(NPCID.SkeletronHand, ProjectileID.Skull), new int[] { 36, 56, 68, 80, 120 } }, - - { new Tuple(NPCID.Deerclops, ProjectileID.DeerclopsIceSpike), new int[] { 26, 52, 76, 100, 150 } }, - { new Tuple(NPCID.Deerclops, ProjectileID.DeerclopsRangedProjectile), new int[] { 36, 72, 88, 104, 156 } }, - { new Tuple(NPCID.Deerclops, ProjectileID.InsanityShadowHostile), new int[] { 20, 40, 60, 80, 120 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 100, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 92, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 100, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 92, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 42, 68, 84, 100, 150 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 38, 60, 76, 92, 138 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 34, 52, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 36, 56, 68, 80, 120 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 24, 48, 60, 72, 108 } }, - - { new Tuple(NPCID.WallofFleshEye, ProjectileID.EyeLaser), new int[] { 36, 72, 88, 104, 156 } }, - { new Tuple(NPCID.WallofFlesh, ProjectileID.DemonSickle), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(NPCID.WallofFlesh, ProjectileID.Fireball), new int[] { 36, 72, 88, 104, 156 } }, - - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeGelAttack), new int[] { 60, 120, 136, 152, 228 } }, - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeSmash), new int[] { 80, 160, 188, 216, 324 } }, - { new Tuple(NPCID.QueenSlimeBoss, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(NPCID.QueenSlimeMinionBlue, ProjectileID.QueenSlimeMinionBlueSpike), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(NPCID.QueenSlimeMinionPink, ProjectileID.QueenSlimeMinionPinkBall), new int[] { 52, 92, 112, 132, 198 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 52, 92, 112, 132, 198 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 228 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 140, 210 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 52, 92, 112, 132, 198 } }, - - { new Tuple(NPCID.Retinazer, ProjectileID.EyeLaser), new int[] { 40, 92, 116, 140, 210 } }, - { new Tuple(NPCID.Retinazer, ProjectileID.DeathLaser), new int[] { - 50, // 38 in rapid fire - 108, // 81 in rapid fire - 132, // 99 in rapid fire - 156, // 117 in rapid fire - 234 } }, // 176 in rapid fire - { new Tuple(NPCID.Retinazer, ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 228 } }, - { new Tuple(NPCID.Spazmatism, ProjectileID.CursedFlameHostile), new int[] { 50, 100, 120, 140, 210 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 60, 120, 148, 176, 264 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - { new Tuple(NPCID.Spazmatism, ModContent.ProjectileType()), new int[] { 60, 100, 128, 156, 234 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 50, 108, 132, 156, 234 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 148, 176, 264 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 60, 100, 120, 140, 210 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 120, 136, 152, 228 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 66, 112, 128, 144, 216 } }, - - { new Tuple(NPCID.TheDestroyer, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 136, 204 } }, - { new Tuple(NPCID.TheDestroyer, ModContent.ProjectileType()), new int[] { 46, 108, 128, 148, 222 } }, - { new Tuple(NPCID.TheDestroyer, ModContent.ProjectileType()), new int[] { 48, 116, 136, 156, 234 } }, - { new Tuple(NPCID.TheDestroyerBody, ProjectileID.DeathLaser), new int[] { 44, 96, 116, 136, 204 } }, - { new Tuple(NPCID.TheDestroyerBody, ModContent.ProjectileType()), new int[] { 46, 108, 128, 148, 222 } }, - { new Tuple(NPCID.TheDestroyerBody, ModContent.ProjectileType()), new int[] { 48, 116, 136, 156, 234 } }, - { new Tuple(NPCID.Probe, ProjectileID.PinkLaser), new int[] { 50, 88, 100, 112, 168 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 200, 240, 280, 420 } }, // Split shots: 72, 120, 144, 168, 252 - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - - { new Tuple(NPCID.SkeletronPrime, ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(NPCID.SkeletronPrime, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.Skull), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 180, 200, 300 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.FrostBeam), new int[] { 50, 108, 124, 140, 210 } }, - { new Tuple(NPCID.PrimeCannon, ProjectileID.RocketSkeleton), new int[] { 60, 120, 148, 176, 264 } }, - { new Tuple(NPCID.PrimeCannon, ProjectileID.BombSkeletronPrime), new int[] { 80, 160, 0, 0, 300 } }, - { new Tuple(NPCID.PrimeLaser, ProjectileID.DeathLaser), new int[] { 50, 108, 124, 140, 210 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 70, 112, 128, 144, 216 } }, - - { new Tuple(NPCID.Plantera, ProjectileID.SeedPlantera), new int[] { 52, 96, 128, 160, 240 } }, - { new Tuple(NPCID.Plantera, ProjectileID.PoisonSeedPlantera), new int[] { 62, 116, 144, 172, 258 } }, - { new Tuple(NPCID.Plantera, ProjectileID.ThornBall), new int[] { 72, 132, 160, 188, 282 } }, - { new Tuple(NPCID.Plantera, ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(NPCID.Plantera, ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - - { new Tuple(NPCID.HallowBoss, ProjectileID.HallowBossRainbowStreak), new int[] { 100, 152, 172, 192, 300 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.FairyQueenSunDance), new int[] { 120, 180, 204, 228, 360 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.HallowBossLastingRainbow), new int[] { 100, 152, 172, 192, 300 } }, - { new Tuple(NPCID.HallowBoss, ProjectileID.FairyQueenLance), new int[] { 130, 196, 216, 236, 390 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 208, 244, 366 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 80, 140, 160, 180, 270 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 84, 148, 172, 196, 294 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 208, 244, 366 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(NPCID.Golem, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, - { new Tuple(NPCID.Golem, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, - { new Tuple(NPCID.GolemHead, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, - { new Tuple(NPCID.GolemHead, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, - { new Tuple(NPCID.GolemFistLeft, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.GolemFistRight, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.Fireball), new int[] { 60, 120, 140, 180, 270 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.EyeBeam), new int[] { 80, 140, 172, 204, 306 } }, - { new Tuple(NPCID.GolemHeadFree, ProjectileID.InfernoHostileBolt), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 372 } }, - - { new Tuple(NPCID.DukeFishron, ProjectileID.Sharknado), new int[] { 80, 100, 150, 200, 300 } }, - { new Tuple(NPCID.DukeFishron, ProjectileID.Cthulunado), new int[] { 160, 200, 232, 264, 480 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 144, 172, 200, 300 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 144, 172, 200, 300 } }, - - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossFireBall), new int[] { 88, 156, 184, 212, 318 } }, - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossIceMist), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(NPCID.CultistBoss, ProjectileID.CultistBossLightningOrb), new int[] { 120, 192, 220, 248, 372 } }, - { new Tuple(NPCID.CultistBossClone, ProjectileID.CultistBossFireBallClone), new int[] { 90, 144, 172, 200, 300 } }, - { new Tuple(NPCID.AncientDoom, ProjectileID.AncientDoomProjectile), new int[] { 88, 156, 184, 212, 318 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 90, 152, 176, 200, 300 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 180, 208, 236, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 100, 172, 192, 212, 318 } }, - - { new Tuple(NPCID.MoonLordHead, ProjectileID.PhantasmalDeathray), new int[] { 200, 300, 380, 460, 690 } }, - { new Tuple(NPCID.MoonLordHead, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 200, 300 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalEye), new int[] { 90, 120, 160, 200, 300 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalSphere), new int[] { 120, 160, 220, 280, 420 } }, - { new Tuple(NPCID.MoonLordHand, ProjectileID.PhantasmalBolt), new int[] { 90, 120, 160, 200, 300 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalBolt), new int[] { 100, 140, 180, 220, 330 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalEye), new int[] { 100, 140, 180, 220, 330 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalSphere), new int[] { 132, 176, 220, 264, 396 } }, - { new Tuple(NPCID.MoonLordFreeEye, ProjectileID.PhantasmalDeathray), new int[] { 150, 200, 260, 320, 480 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 320, 352, 384, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0, 0 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 300, 332, 364, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, // Split holy fire does: 113, 198, 216, 234, 338 - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 120, 192, 220, 248, 360 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 35, 50, 50, 0, 0 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 105, 171, 189, 207, 315 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 268, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 228, 252, 276, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 400, 440, 480, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrbArc), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.FrostWave), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 332, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrb), new int[] { 150, 264, 288, 312, 450 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 160, 276, 304, 332, 480 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 240, 264, 288, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 150, 264, 288, 312, 450 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 264, 420 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 140, 220, 244, 264, 420 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 420, 460, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 316, 348, 380, 540 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 170, 296, 324, 352, 510 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 180, 316, 348, 380, 540 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 200, 340, 376, 412, 600 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 520, 548, 576, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 220, 384, 424, 464, 660 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 592, 624, 656, 1050 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 250, 440, 464, 488, 750 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 280, 468, 484, 500, 840 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 350, 592, 624, 656, 1050 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 300, 508, 528, 548, 900 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 240, 408, 432, 456, 720 } }, - { new Tuple(ModContent.NPCType(), ModContent.ProjectileType()), new int[] { 400, 608, 640, 672, 1200 } }, - - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossIceMist), new int[] { 400, 600, 632, 664, 1200 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossLightningOrbArc), new int[] { 500, 752, 788, 824, 1500 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.AncientDoomProjectile), new int[] { 400, 600, 632, 664, 1200 } }, - { new Tuple(ModContent.NPCType(), ProjectileID.CultistBossFireBallClone), new int[] { 400, 600, 632, 664, 1200 } } - }; - } - - // Destroys the EnemyStats struct to save memory because mod assemblies will not be fully unloaded until TML 1.4. - internal static void UnloadEnemyStats() - { - EnemyStats.ExpertDamageMultiplier = null; - EnemyStats.ContactDamageValues = null; - EnemyStats.ProjectileDamageValues = null; - } - #endregion - } -} diff --git a/Dusts/WaterSplash/BasaltGullyLavaSplash.cs b/Dusts/WaterSplash/BasaltGullyLavaSplash.cs new file mode 100644 index 0000000000..aa7ec173f8 --- /dev/null +++ b/Dusts/WaterSplash/BasaltGullyLavaSplash.cs @@ -0,0 +1,178 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics.PackedVector; +using System; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Dusts.WaterSplash +{ + public class BasaltGullyLavaSplash : ModDust + { + public override void OnSpawn(Dust dust) + { + dust.velocity *= 0.1f; + dust.velocity.Y = -0.5f; + } + + public override bool Update(Dust dust) + { + if (dust.scale > 10f) + { + dust.active = false; + } + Dust.lavaBubbles++; + dust.position += dust.velocity; + if (!dust.noGravity) + { + dust.velocity.Y += 0.1f; + } + if (dust.noGravity) + { + dust.scale += 0.03f; + if (dust.scale < 1f) + { + dust.velocity.Y += 0.075f; + } + dust.velocity.X *= 1.08f; + if (dust.velocity.X > 0f) + { + dust.rotation += 0.01f; + } + else + { + dust.rotation -= 0.01f; + } + float num109 = dust.scale * 0.6f; + if (num109 > 1f) + { + num109 = 1f; + } + Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f + 1f), num109 * (2.5f / 4), num109 * (1.3f / 4), num109 * (0.1f / 4)); + } + else + { + if (!Collision.WetCollision(new Vector2(dust.position.X, dust.position.Y - 8f), 4, 4)) + { + dust.scale = 0f; + } + else + { + dust.alpha += Main.rand.Next(2); + if (dust.alpha > 255) + { + dust.scale = 0f; + } + dust.velocity.Y = -0.5f; + dust.alpha++; + dust.scale -= 0.01f; + dust.velocity.Y = -0.2f; + dust.velocity.X += (float)Main.rand.Next(-10, 10) * 0.002f; + if ((double)dust.velocity.X < -0.25) + { + dust.velocity.X = -0.25f; + } + if ((double)dust.velocity.X > 0.25) + { + dust.velocity.X = 0.25f; + } + } + float num3 = dust.scale * 0.3f + 0.4f; + if (num3 > 1f) + { + num3 = 1f; + } + Lighting.AddLight((int)(dust.position.X / 16f), (int)(dust.position.Y / 16f), num3 * (2.5f / 4), num3 * (1.3f / 4), num3 * (0.1f / 4)); + } + dust.rotation += dust.velocity.X * 0.5f; + if (dust.fadeIn > 0f && dust.fadeIn < 100f) + { + dust.scale += 0.03f; + if (dust.scale > dust.fadeIn) + { + dust.fadeIn = 0f; + } + } + dust.scale -= 0.01f; + if (dust.noGravity) + { + dust.velocity *= 0.92f; + if (dust.fadeIn == 0f) + { + dust.scale -= 0.04f; + } + } + if (dust.position.Y > Main.screenPosition.Y + (float)Main.screenHeight) + { + dust.active = false; + } + float num17 = 0.1f; + if ((double)Dust.dCount == 0.5) + { + dust.scale -= 0.001f; + } + if ((double)Dust.dCount == 0.6) + { + dust.scale -= 0.0025f; + } + if ((double)Dust.dCount == 0.7) + { + dust.scale -= 0.005f; + } + if ((double)Dust.dCount == 0.8) + { + dust.scale -= 0.01f; + } + if ((double)Dust.dCount == 0.9) + { + dust.scale -= 0.02f; + } + if ((double)Dust.dCount == 0.5) + { + num17 = 0.11f; + } + if ((double)Dust.dCount == 0.6) + { + num17 = 0.13f; + } + if ((double)Dust.dCount == 0.7) + { + num17 = 0.16f; + } + if ((double)Dust.dCount == 0.8) + { + num17 = 0.22f; + } + if ((double)Dust.dCount == 0.9) + { + num17 = 0.25f; + } + if (dust.scale < num17) + { + dust.active = false; + } + return false; + } + + public override Color? GetAlpha(Dust dust, Color lightColor) + { + float num = (float)(255 - dust.alpha) / 255f; + int num4; + int num3; + int num2; + num = (num + 3f) / 4f; + num4 = (int)((int)lightColor.R * num); + num3 = (int)((int)lightColor.G * num); + num2 = (int)((int)lightColor.B * num); + int num6 = lightColor.A - dust.alpha; + if (num6 < 0) + { + num6 = 0; + } + if (num6 > 255) + { + num6 = 255; + } + return new Color(num4, num3, num2, num6); + } + } +} diff --git a/Dusts/WaterSplash/BasaltGullyLavaSplash.png b/Dusts/WaterSplash/BasaltGullyLavaSplash.png new file mode 100644 index 0000000000..6fc3a83f98 Binary files /dev/null and b/Dusts/WaterSplash/BasaltGullyLavaSplash.png differ diff --git a/Effects/Dyes/InvisibleDyeShader.fx b/Effects/Dyes/InvisibleDyeShader.fx new file mode 100644 index 0000000000..e1b691da39 --- /dev/null +++ b/Effects/Dyes/InvisibleDyeShader.fx @@ -0,0 +1,33 @@ +sampler uImage0 : register(s0); +sampler uImage1 : register(s1); +float3 uColor; +float3 uSecondaryColor; +float uOpacity; +float uSaturation; +float uRotation; +float uTime; +float4 uSourceRect; +float2 uWorldPosition; +float uDirection; +float3 uLightSource; +float2 uImageSize0; +float2 uImageSize1; +float2 uTargetPosition; +float4 uLegacyArmorSourceRect; +float2 uLegacyArmorSheetSize; + +float4 PixelShaderFunction(float2 coords : TEXCOORD0) : COLOR0 +{ + float4 color = tex2D(uImage0, coords); + color.rgb *= 0; + color.a = 0; + return color; +} + +technique Technique1 +{ + pass DyePass + { + PixelShader = compile ps_2_0 PixelShaderFunction(); + } +} \ No newline at end of file diff --git a/Effects/Dyes/InvisibleDyeShader.xnb b/Effects/Dyes/InvisibleDyeShader.xnb new file mode 100644 index 0000000000..738b0c2935 Binary files /dev/null and b/Effects/Dyes/InvisibleDyeShader.xnb differ diff --git a/Enums/SetBonusDoubleTapOptions.cs b/Enums/SetBonusDoubleTapOptions.cs new file mode 100644 index 0000000000..f71b0e4349 --- /dev/null +++ b/Enums/SetBonusDoubleTapOptions.cs @@ -0,0 +1,14 @@ +using Terraria.ModLoader.Config; + +namespace CalamityMod.Enums +{ + public enum SetBonusDoubleTapOptions + { + [LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.On")] + On, + [LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Auto")] + Auto, + [LabelKey("$Mods.CalamityMod.Configs.CalamityClientConfig.SetBonusDoubleTap.Options.Off")] + Off + } +} diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index d3bf603ee5..339dbafa9f 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -164,7 +164,7 @@ namespace CalamityMod.Events ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), - new Boss(NPCID.EyeofCthulhu, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.ServantofCthulhu, ModContent.NPCType() }), + new Boss(NPCID.EyeofCthulhu, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.ServantofCthulhu }), new Boss(ModContent.NPCType(), TimeChangeContext.Day, type => { @@ -213,8 +213,7 @@ namespace CalamityMod.Events { NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Spazmatism); NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, NPCID.Retinazer); - NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, ModContent.NPCType()); - }, permittedNPCs: new int[] { NPCID.Retinazer, ModContent.NPCType() }), + }, permittedNPCs: new int[] { NPCID.Retinazer }), new Boss(ModContent.NPCType(), TimeChangeContext.Day, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), @@ -222,7 +221,7 @@ namespace CalamityMod.Events new Boss(ModContent.NPCType(), TimeChangeContext.Day, permittedNPCs: ModContent.NPCType()), - new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { ModContent.NPCType(), NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser, NPCID.Probe }), + new Boss(NPCID.SkeletronPrime, TimeChangeContext.Night, permittedNPCs: new int[] { NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeVice, NPCID.PrimeLaser }), new Boss(ModContent.NPCType(), TimeChangeContext.Night, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), @@ -309,7 +308,7 @@ namespace CalamityMod.Events NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, type); }, permittedNPCs: new int[] { ModContent.NPCType(), ModContent.NPCType(), ModContent.NPCType() }), - new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType() }), + new Boss(ModContent.NPCType(), permittedNPCs: new int[] { ModContent.NPCType() }), new Boss(ModContent.NPCType(), TimeChangeContext.Day, type => { diff --git a/ExtraJumps/SulphurJump.cs b/ExtraJumps/SulphurJump.cs index eef2cbb6c1..db5dd0bd9f 100644 --- a/ExtraJumps/SulphurJump.cs +++ b/ExtraJumps/SulphurJump.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Armor.Sulphurous; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Particles; using CalamityMod.Projectiles.Typeless; @@ -46,7 +47,7 @@ namespace CalamityMod.ExtraJumps if (modPlayer.sulphurBubbleCooldown <= 0) { var source = player.GetSource_Misc("0"); - int damage = (int)player.GetTotalDamage().ApplyTo(20); + int damage = (int)player.GetTotalDamage().ApplyTo(SulphurousHelmet.BubbleDamage); int bubble = Projectile.NewProjectile(source, new Vector2(player.position.X, player.position.Y + (player.gravDir == -1f ? 20 : -20)), Vector2.Zero, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 1f, 0f); if (bubble.WithinBounds(Main.maxProjectiles)) diff --git a/ExtraTextures/Bestiary/SlimeGod_Bestiary.png b/ExtraTextures/Bestiary/SlimeGod_Bestiary.png deleted file mode 100644 index dbe7056e82..0000000000 Binary files a/ExtraTextures/Bestiary/SlimeGod_Bestiary.png and /dev/null differ diff --git a/ExtraTextures/ChadPrime.png b/ExtraTextures/ChadPrime.png deleted file mode 100644 index 3bbc5902b0..0000000000 Binary files a/ExtraTextures/ChadPrime.png and /dev/null differ diff --git a/ExtraTextures/ChadPrimeHeadGlow.png b/ExtraTextures/ChadPrimeHeadGlow.png deleted file mode 100644 index e8b25ba236..0000000000 Binary files a/ExtraTextures/ChadPrimeHeadGlow.png and /dev/null differ diff --git a/ExtraTextures/ChadPrime_Head_Boss.png b/ExtraTextures/ChadPrime_Head_Boss.png deleted file mode 100644 index 313edebc2c..0000000000 Binary files a/ExtraTextures/ChadPrime_Head_Boss.png and /dev/null differ diff --git a/ExtraTextures/ExtraTextureRefs.cs b/ExtraTextures/ExtraTextureRefs.cs index bc86cb89a7..a39bd99b7c 100644 --- a/ExtraTextures/ExtraTextureRefs.cs +++ b/ExtraTextures/ExtraTextureRefs.cs @@ -19,11 +19,6 @@ namespace CalamityMod.ExtraTextures public static Asset DestroyerHeadGlowmask; public static Asset DestroyerBodyGlowmask; public static Asset DestroyerTailGlowmask; - public static Asset ProbeGlowmask; - - // Master Rev+ Skeletron Prime - public static Asset ChadPrime; - public static Asset ChadPrimeEyeGlowmask; // WoF, These are not "exactly" the ExtraTextures. But public static Asset WallOfFleshEyeGlowmask; @@ -44,16 +39,6 @@ namespace CalamityMod.ExtraTextures public static Asset CircularSmearFire2; public static Asset CircularSmearFire3; - // Boss Heads - // I know it's not exactly a Texture2D but it belongs to ExtraTextures. - public static int BossHeadIndex_ChadPrime; - - public override void Load() - { - string chadPrimeIconPath = "CalamityMod/ExtraTextures/ChadPrime_Head_Boss"; - BossHeadIndex_ChadPrime = CalamityMod.Instance.AddBossHeadTexture(chadPrimeIconPath, -1); - } - // TODO: - Every other ExtraTextures Reference could be move in here public override void OnModLoad() @@ -62,11 +47,6 @@ namespace CalamityMod.ExtraTextures DestroyerBodyGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerBodyGlow", AssetRequestMode.AsyncLoad); DestroyerTailGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/DestroyerTailGlow", AssetRequestMode.AsyncLoad); - ProbeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/ProbeGlow", AssetRequestMode.AsyncLoad); - - ChadPrime = ModContent.Request("CalamityMod/ExtraTextures/ChadPrime", AssetRequestMode.AsyncLoad); - ChadPrimeEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/ChadPrimeHeadGlow", AssetRequestMode.AsyncLoad); - WallOfFleshEyeGlowmask = ModContent.Request("CalamityMod/ExtraTextures/VanillaBossGlowmasks/WallOfFleshEyeTelegraphGlow", AssetRequestMode.AsyncLoad); WallOfFleshDemonSickleTexture = ModContent.Request("CalamityMod/Projectiles/Melee/ForbiddenOathbladeProjectile", AssetRequestMode.AsyncLoad); diff --git a/ExtraTextures/SkeletronPrime2HeadGlow.png b/ExtraTextures/SkeletronPrime2HeadGlow.png deleted file mode 100644 index 7054e2945d..0000000000 Binary files a/ExtraTextures/SkeletronPrime2HeadGlow.png and /dev/null differ diff --git a/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png b/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png deleted file mode 100644 index c0105e82e4..0000000000 Binary files a/ExtraTextures/VanillaBossGlowmasks/ProbeGlow.png and /dev/null differ diff --git a/Gores/BloodlettingServant1.png b/Gores/BloodlettingServant1.png deleted file mode 100644 index d7522171eb..0000000000 Binary files a/Gores/BloodlettingServant1.png and /dev/null differ diff --git a/Gores/BloodlettingServant2.png b/Gores/BloodlettingServant2.png deleted file mode 100644 index 391c59a4a7..0000000000 Binary files a/Gores/BloodlettingServant2.png and /dev/null differ diff --git a/Gores/BloodlettingServant3.png b/Gores/BloodlettingServant3.png deleted file mode 100644 index a4da81ae9f..0000000000 Binary files a/Gores/BloodlettingServant3.png and /dev/null differ diff --git a/Gores/BloodlettingServant4.png b/Gores/BloodlettingServant4.png deleted file mode 100644 index ddece78bac..0000000000 Binary files a/Gores/BloodlettingServant4.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png b/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png deleted file mode 100644 index 07f2e01333..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/ChadPrime1.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png b/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png deleted file mode 100644 index 303ac4ccde..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/ChadPrime2.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png deleted file mode 100644 index 860fd8b8c2..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_1.png and /dev/null differ diff --git a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png b/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png deleted file mode 100644 index 613ee6e5e1..0000000000 Binary files a/Gores/SkeletronPrimes_RevMaster/SkeletronPrime2_2.png and /dev/null differ diff --git a/Gores/WaterDroplet/BasaltGullyLavaDroplet.cs b/Gores/WaterDroplet/BasaltGullyLavaDroplet.cs new file mode 100644 index 0000000000..d11e87ee5d --- /dev/null +++ b/Gores/WaterDroplet/BasaltGullyLavaDroplet.cs @@ -0,0 +1,11 @@ +using Microsoft.Xna.Framework; + +namespace CalamityMod.Gores.WaterDroplet +{ + public class BasaltGullyLavaDroplet : LiquidDropletGore + { + public override bool lavaDroplet => true; + + public override Vector3 lavaColor => new Vector3(2.5f, 1.3f, 0.1f); + } +} diff --git a/Gores/WaterDroplet/BasaltGullyLavaDroplet.png b/Gores/WaterDroplet/BasaltGullyLavaDroplet.png new file mode 100644 index 0000000000..fa76dba55c Binary files /dev/null and b/Gores/WaterDroplet/BasaltGullyLavaDroplet.png differ diff --git a/ILEditing/BalancingILChanges.cs b/ILEditing/BalancingILChanges.cs index 5018cee4bb..f2abeedfea 100644 --- a/ILEditing/BalancingILChanges.cs +++ b/ILEditing/BalancingILChanges.cs @@ -1,6 +1,8 @@ using System; using CalamityMod.Balancing; using CalamityMod.Enums; +using CalamityMod.Projectiles.Typeless; +using Microsoft.Xna.Framework; using Mono.Cecil.Cil; using MonoMod.Cil; using Terraria; @@ -79,17 +81,6 @@ namespace CalamityMod.ILEditing } cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, 0.5f); // Decrease to 0.5f. - - // CIT 22SEP2024: Removed the edit intended to decrease Frog Leg's jump speed boost, - // as it was not doing anything due to vanilla changing how Frog Leg's jump speed boost is applied. - - // Remove the jump height addition from the Werewolf buff (Moon Charm). - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(2))) - { - LogFailure("Jump Height Boost Fixes", "Could not locate Moon Charm jump height boost value."); - return; - } - cursor.Next.Operand = 0; } private const float VanillaBaseJumpSpeed = 5.01f; @@ -115,16 +106,12 @@ namespace CalamityMod.ILEditing private static void RunSpeedAdjustments(ILContext il) { var cursor = new ILCursor(il); - float asphaltTopSpeedMultiplier = 1.75f; // +75%. Vanilla is +250% + float asphaltTopSpeedMultiplier = 2.25f; // +125%. Vanilla is +250% float asphaltSlowdown = 1f; // Vanilla is 2f. This should actually make asphalt faster. - // Dunerider Boots multiply all run stats by 1.75f in vanilla - float duneRiderBootsMultiplier = 1.25f; // Change to 1.25f - // Multiplied by 0.6 on frozen slime, for +26% acceleration // Multiplied by 0.7 on ice, for +47% acceleration float iceSkateAcceleration = 2.1f; - float iceSkateTopSpeed = 1f; // no boost at all // // ASPHALT @@ -153,22 +140,6 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldc_R4, asphaltSlowdown); } - // - // DUNERIDER BOOTS + SAND BLOCKS - // - { - // Find the multiplier for Dunerider Boots on Sand Blocks. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.75f))) - { - LogFailure("Run Speed Adjustments", "Could not locate the Dunerdier Boots multiplier."); - return; - } - - // Massively reduce the increased speed of Dunerider Boots while on Sand Blocks. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, duneRiderBootsMultiplier); - } - // // ICE SKATES + FROZEN SLIME BLOCKS // @@ -183,17 +154,6 @@ namespace CalamityMod.ILEditing // Massively reduce the acceleration bonus of Ice Skates on Frozen Slime Blocks. cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, iceSkateAcceleration); - - // Find the top speed multiplier of Ice Skates on Frozen Slime Blocks. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.25f))) - { - LogFailure("Run Speed Adjustments", "Could not locate Ice Skates + Frozen Slime Block top speed multiplier."); - return; - } - - // Make Ice Skates give no top speed boost whatsoever on Frozen Slime Blocks. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, iceSkateTopSpeed); } // @@ -210,17 +170,6 @@ namespace CalamityMod.ILEditing // Massively reduce the acceleration bonus of Ice Skates on Ice Blocks. cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, iceSkateAcceleration); - - // Find the top speed multiplier of Ice Skates on Ice Blocks. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(1.25f))) - { - LogFailure("Run Speed Adjustments", "Could not locate Ice Skates + Ice Block top speed multiplier."); - return; - } - - // Make Ice Skates give no top speed boost whatsoever on Ice Blocks. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, iceSkateTopSpeed); } } @@ -241,18 +190,7 @@ namespace CalamityMod.ILEditing } cursor.Next.Operand = BalancingConstants.SoaringInsigniaRunAccelerationMultiplier; - // Second: Magiluminescence. Find the check for whether it's equipped for run speeds. - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("hasMagiluminescence"))) - { - LogFailure("Run Acceleration Nerfs", "Could not locate the Magiluminescence bool."); - return; - } - - // - // Don't actually do anything. Magiluminescence is not intended to be nerfed by Calamity. - // - - // Third: Shadow Armor. Find the check for whether it's equipped for run speeds. + // Second: Shadow Armor. Find the check for whether it's equipped for run speeds. if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("shadowArmor"))) { LogFailure("Run Acceleration Nerfs", "Could not locate the Shadow Armor bool."); @@ -398,73 +336,15 @@ namespace CalamityMod.ILEditing orig(self, item); // Hard / Guarding / Armored / Warding give 0.25% / 0.5% / 0.75% / 1% DR if (item.prefix == PrefixID.Hard) - { - /* Prehardmode = 1 - * Hardmode = 2 - * Post-Moon Lord = 3 - * Post-DoG = 4 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; - self.endurance += 0.0025f; - } if (item.prefix == PrefixID.Guarding) - { - /* Prehardmode = 2 - * Hardmode = 3 - * Post-Moon Lord = 4 - * Post-DoG = 5 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; - self.endurance += 0.005f; - } if (item.prefix == PrefixID.Armored) - { - /* Prehardmode = 3 - * Hardmode = 4 - * Post-Moon Lord = 5 - * Post-DoG = 6 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; - self.endurance += 0.0075f; - } if (item.prefix == PrefixID.Warding) - { - /* Prehardmode = 4 - * Hardmode = 5 - * Post-Moon Lord = 6 - * Post-DoG = 7 - */ - - if (DownedBossSystem.downedDoG) - self.statDefense += 3; - else if (NPC.downedMoonlord) - self.statDefense += 2; - else if (Main.hardMode) - self.statDefense += 1; self.endurance += 0.01f; - } + // Lucky prefix increases luck if (item.prefix == PrefixID.Lucky) self.Calamity().calamityBonusLuck += 0.05f; } @@ -501,7 +381,7 @@ namespace CalamityMod.ILEditing private static void VanillaBossResistChanges(ILContext il) { // This IL edit accomplishes two things: - // 1. Reduces Expert+ Eater of Worlds' resist to explosives from 80% to 60%. + // 1. Reduces Expert+ Eater of Worlds' resist to explosives from 80% to 66%. // 2. Effectively removes Lunatic Cultist's resistance to homing projectiles. var cursor = new ILCursor(il); @@ -514,17 +394,15 @@ namespace CalamityMod.ILEditing return; } } - if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchDiv())) + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR4(5f))) { LogFailure("Reduce EoW Grenade Resist", "Could not move to the resist factor."); return; } - // Remove the division instruction, then pop the 5 off the stack to destroy it. Replace it with loading a 0.4 and then multiplying by it. - cursor.Remove(); + // Pop the 5 off the stack, and replace it with a 3. cursor.EmitPop(); - cursor.EmitLdcR4(0.4f); - cursor.EmitMul(); + cursor.EmitLdcR4(3f); // Now, move to the Cultist resist which is right below it. if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdsfld(typeof(ProjectileID.Sets), "CultistIsResistantTo"))) @@ -563,30 +441,13 @@ namespace CalamityMod.ILEditing #region UpdateBuffs Balancing Changes private static void UpdateBuffsBalancingChanges(ILContext il) { - // This IL edit accomplishes four things: - // 1. Nerf Sharpening Station's armor penetration boost from 12 to 5. - // 2. Nerf Beetle Scale Mail's set bonus Beetle Might melee speed from 10% per stack to 5%. - // 3. Nerf Nebula armor's Damage and Life Boosters (Mana Boosters are not handled in this method). - // 4. Remove the ability for Feral Bite to randomly inflict debuffs. + // This IL edit accomplishes three things: + // 1. Nerf Beetle Scale Mail's set bonus Beetle Might melee speed from 10% per stack to 5%. + // 2. Nerf Nebula armor's Damage and Life Boosters (Mana Boosters are not handled in this method). + // 3. Remove the vanilla implementation of Feral Bite inflicting random debuffs. var cursor = new ILCursor(il); - // First, find the code which applies Sharpened's armor penetration buff. - if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.Sharpened))) - { - LogFailure("Sharpening Station Nerf", "Could not locate the Sharpened buff ID."); - return; - } - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(12f))) // The amount of armor penetration to grant. - { - LogFailure("Sharpening Station Nerf", "Could not locate the amount of armor penetration granted."); - return; - } - - // Replace the value entirely. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_R4, BalancingConstants.SharpeningStationArmorPenetration); - - // Next, move to Beetle Scale Mail's melee speed boost from Beetle Might buff. + // First, move to Beetle Scale Mail's melee speed boost from Beetle Might buff. if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdcI4(BuffID.BeetleMight1))) { LogFailure("Beetle Scale Mail Nerf", "Could not locate the Beetle Might buff ID."); @@ -642,7 +503,7 @@ namespace CalamityMod.ILEditing // There are multiple branches pointing to this instruction, so it cannot be removed. Instead, swap its value directly. cursor.Next.Operand = BalancingConstants.NebulaDamagePerBooster; - // Finally, removing Feral Bite's debuffs. + // Finally, removing Feral Bite's vanilla debuff infliction. // Find the random debuff duration multiplier for the debuffs inflicted by Feral Bite. if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcR4(0.01f))) // The 0.01f random debuff duration multiplier. { @@ -651,14 +512,78 @@ namespace CalamityMod.ILEditing } // Remove and change to 0f, this makes the random debuffs from Feral Bite have 0 duration. + // Calamity reimplements a different version of this in CalamityGlobalBuff.Update cursor.Remove(); cursor.Emit(OpCodes.Ldc_R4, 0f); } #endregion - #region Vortex Booster Keeps Vortex Stealth When Dashing - private static void VortexBoosterKeepsVortexStealthWhenDashing(On_Player.orig_DashMovement orig, Player self) + #region SoC Buffs & Vortex Booster Keeping Stealth + private static void DashMovementEdits(On_Player.orig_DashMovement orig, Player self) { + //This is a modified version of Vanilla's Shield of Cthulhu dash collision checks + //This is done to be able to adjust values as needed. Here we change the iframe amount and recoil velocity + if (self.dash == 2 && self.eocDash > 0 && self.eocHit < 0) + { + Rectangle DashHitbox = new Rectangle((int)(self.position.X + self.velocity.X * 0.5 - 4.0), (int)(self.position.Y + self.velocity.Y * 0.5 - 4.0), self.width + 8, self.height + 8); + for (int i = 0; i < 200; i++) + { + NPC hitNPC = Main.npc[i]; + if (!hitNPC.active || hitNPC.dontTakeDamage || hitNPC.friendly || (hitNPC.aiStyle == 112 && !(hitNPC.ai[2] <= 1f)) || !self.CanNPCBeHitByPlayerOrPlayerProjectile(hitNPC)) + { + continue; + } + Rectangle npcHitbox = hitNPC.getRect(); + if (DashHitbox.Intersects(npcHitbox) && (hitNPC.noTileCollide || self.CanHit(hitNPC))) + { + float dmg = self.GetTotalDamage(DamageClass.Melee).ApplyTo(self.Calamity().copyrightInfringementShield ? 300f : 30f); + float kb = self.GetTotalKnockback(DamageClass.Melee).ApplyTo(self.Calamity().copyrightInfringementShield ? 12f : 9f); + bool crit = false; + if (Main.rand.Next(100) < self.GetTotalCritChance(DamageClass.Melee)) + { + crit = true; + } + int direction = self.direction; + if (self.velocity.X < 0f) + { + direction = -1; + } + if (self.velocity.X > 0f) + { + direction = 1; + } + self.eocHit = i; + if (self.whoAmI == Main.myPlayer) + { + self.ApplyDamageToNPC(hitNPC, (int)dmg, kb, direction, crit, DamageClass.Melee); + } + self.eocDash = 10; + self.dashDelay = BalancingConstants.OnShieldBonkCooldown; + self.velocity.X = -direction * 9; + self.velocity.Y = -4f; + self.GiveImmuneTimeForCollisionAttack(8); //This is normally 4 in vanilla + int heldDir = 0; + if (self.controlLeft) + heldDir--; + if (self.controlRight) + heldDir++; + int dirSum = Math.Abs(direction + heldDir); + switch (dirSum) + { + case 0: //Holding in direction of recoil + self.velocity.X *= 1.75f; + break; + case 1: //Neutral direction + self.velocity.X *= 1.5f; + break; + case 2: //Holding in direction of enemy + self.velocity.X *= 1.25f; + break; + } + } + } + } + // Allows for Vortex Booster to automatically re-engage Vortex armor's stealth after a delay when dashing bool vortexStealth = self.vortexStealthActive; orig(self); diff --git a/ILEditing/ILChangesLoading.cs b/ILEditing/ILChangesLoading.cs index e8dd980253..13cd8c2dd8 100644 --- a/ILEditing/ILChangesLoading.cs +++ b/ILEditing/ILChangesLoading.cs @@ -65,18 +65,18 @@ namespace CalamityMod.ILEditing // NPC behavior IL_Main.UpdateTime += PermitNighttimeTownNPCSpawning; On_Main.UpdateTime_SpawnTownNPCs += AlterTownNPCSpawnRate; - On_NPC.ShouldEmpressBeEnraged += AllowEmpressToEnrageInBossRush; - On_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush; + IL_NPC.DoDeathEvents += PreventVanillaBossDeathsInBossRush; IL_Player.CollectTaxes += MakeTaxCollectorUseful; // Mechanics / features - On_NPC.ApplyTileCollision += AllowTriggeredFallthrough; + On_NPC.ApplyTileCollision += AllowFusionFeederToDigThroughSand; IL_Player.ApplyEquipFunctional += ScopesRequireVisibilityToZoom; IL_Player.Hurt_PlayerDeathReason_int_int_refHurtInfo_bool_bool_int_bool_float_float_float += DodgeMechanicAdjustments; On_Player.PutHallowedArmorSetBonusOnCooldown += AddHolyProtectionCooldown; IL_Player.DashMovement += FixAllDashMechanics; - On_Player.DashMovement += VortexBoosterKeepsVortexStealthWhenDashing; + On_Player.DashMovement += DashMovementEdits; On_Player.DoCommonDashHandle += ApplyDashKeybind; + On_Player.KeyDoubleTap += DisableDoubleTapOnConfig; IL_Player.GiveImmuneTimeForCollisionAttack += MakeShieldSlamIFramesConsistent; IL_Player.Update_NPCCollision += NerfShieldOfCthulhuBonkSafety; On_WorldGen.OpenDoor += OpenDoor_LabDoorOverride; @@ -84,16 +84,11 @@ namespace CalamityMod.ILEditing On_Item.AffixName += IncorporateEnchantmentInAffix; On_Projectile.NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float += IncorporateExtraProjectileVariables; On_Player.ApplyDamageToNPC += ApplyOldFashionedDamageToMiscHits; - // TODO -- This should be unnecessary. There is now a TML hook for platform collision for ModNPCs. - On_NPC.Collision_DecideFallThroughPlatforms += EnableCalamityBossPlatformCollision; IL_Wiring.HitWireSingle += AddTwinklersToStatue; On_Player.UpdateItemDye += FindCalamityItemDyeShader; On_AWorldListItem.GetDifficulty += GetDifficultyOverride; On_Item.GetShimmered += ShimmerEffectEdits; On_Player.Teleport += TPOverride; - On_NPC.SpawnBoss += TripletsSpawnTextOverride; - On_NPC.DoDeathEvents_BeforeLoot += PreventFoveanatorDefeatMessageIfNotKilledLast; - On_NPC.DoDeathEvents_CelebrateBossDeath += TripletsDefeatTextOverride; On_TileDrawing.DrawSingleTile += GlowMaskTileRender; On_Main.DoUpdate_HandleChat += SpawnPunchCard; On_Player.PlaceThing_CannonBall += AllowCannonJellyfishUse; @@ -177,7 +172,6 @@ namespace CalamityMod.ILEditing IL_Projectile.StatusPlayer += RemoveFrozenInflictionFromDeerclopsIceSpikes; // World generation - IL_WorldGen.Pyramid += ReplacePharaohSetInPyramids; IL_WorldGen.GrowLivingTree += BlockLivingTreesNearOcean; On_WorldGen.SmashAltar += PreventSmashAltarCode; IL_WorldGen.hardUpdateWorld += AdjustChlorophyteSpawnRate; @@ -192,6 +186,7 @@ namespace CalamityMod.ILEditing // Removal of vanilla stupidity IL_Player.StatusFromNPC += RemoveExpertBrainRandomDebuffs; + IL_NPC.StrikeNPC_HitInfo_bool_bool += LetDetonatingBubblesTakeDamage; IL_Player.ItemCheck_EmitUseVisuals += MakeMagmaStoneFireGauntletDustToggleable; IL_Projectile.EmitEnchantmentVisualsAt += MakeMagmaStoneFireGauntletProjectileDustToggleable; IL_Sandstorm.HasSufficientWind += DecreaseSandstormWindSpeedRequirement; diff --git a/ILEditing/MechanicILChanges.cs b/ILEditing/MechanicILChanges.cs index ac861e5df4..faa7aa39ad 100644 --- a/ILEditing/MechanicILChanges.cs +++ b/ILEditing/MechanicILChanges.cs @@ -6,6 +6,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.CalPlayer; using CalamityMod.Cooldowns; using CalamityMod.DataStructures; +using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.FluidSimulation; using CalamityMod.Items.Accessories; @@ -79,7 +80,7 @@ namespace CalamityMod.ILEditing //private static readonly MethodInfo textureGetValueMethod = typeof(Asset).GetMethod("get_Value", BindingFlags.Public | BindingFlags.Instance); #region Punch Card Spawning Command - private static void SpawnPunchCard(Terraria.On_Main.orig_DoUpdate_HandleChat orig) + private static void SpawnPunchCard(On_Main.orig_DoUpdate_HandleChat orig) { // Any of these conditions should result in normal behaviour if (!Main.drawingPlayerChat || Main.CurrentInputTextTakerOverride != null || Main.editSign || PlayerInput.UsingGamepad) @@ -161,26 +162,7 @@ namespace CalamityMod.ILEditing // This will occur precisely when the player has no vanilla OR Calamity dash items equipped. cursor.Emit(OpCodes.Or); - // - // SHIELD OF CTHULHU - // - - // Move to Shield of Cthulhu's code by finding its function call for iframes. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCall("GiveImmuneTimeForCollisionAttack"))) - { - LogFailure("Vanilla Dash Fixes", "Could not locate function call for Shield of Cthulhu iframes."); - return; - } - - if (!cursor.TryGotoPrev(MoveType.AfterLabel, i => i.MatchLdcI4(30))) - { - LogFailure("Vanilla Dash Fixes", "Could not locate amount of frames of dash cooldown applied on impact with Shield of Cthulhu."); - return; - } - - // Remove the instruction and replace it with one which gives Calamity's (customizable) amount of dash cooldown. - cursor.Remove(); - cursor.Emit(OpCodes.Ldc_I4, BalancingConstants.OnShieldBonkCooldown); + // CIT 22JUL2025: Shield of Cthulhu bonk is reimplemented in a separate On edit; removed the change made to it via this IL edit. // // SOLAR FLARE ARMOR @@ -282,7 +264,7 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ldc_I4, 10 - BalancingConstants.ShieldOfCthulhuBonkNoCollideFrames); } - private static void ApplyDashKeybind(Terraria.On_Player.orig_DoCommonDashHandle orig, Player self, out int dir, out bool dashing, Player.DashStartAction dashStartAction) + private static void ApplyDashKeybind(On_Player.orig_DoCommonDashHandle orig, Player self, out int dir, out bool dashing, Player.DashStartAction dashStartAction) { // we feasting multiplayer bugs if (self.whoAmI != Main.myPlayer) @@ -331,46 +313,68 @@ namespace CalamityMod.ILEditing self.dashTime = 0; } } - #endregion - #region Allow Empress to Enrage in Boss Rush - private static bool AllowEmpressToEnrageInBossRush(Terraria.On_NPC.orig_ShouldEmpressBeEnraged orig) + private static void DisableDoubleTapOnConfig(On_Player.orig_KeyDoubleTap orig, Player self, int keyDir) { - if (BossRushEvent.BossRushActive) - return true; + if (self.whoAmI != Main.myPlayer) + { + orig(self, keyDir); + return; + } - return orig(); + if ((CalamityKeybinds.ArmorSetBonusHotKey.GetAssignedKeys().Count != 0 && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Auto) || CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off) + return; + + orig(self, keyDir); } #endregion #region Prevent Vanilla Bosses From Being Marked as Defeated in Boss Rush - private static void PreventVanillaBossDeathsInBossRush(On_NPC.orig_DoDeathEvents orig, NPC self, Player closestPlayer) + private static void PreventVanillaBossDeathsInBossRush(ILContext il) { - // Aside from setting the boss' downed bool, DoDeathEvents also handles the following tasks: - // Advancing Slime Rain, spawning Dungeon Spirits, advancing invasion kills, spawning Wall of Flesh's loot box, dropping boss potions and hearts, and sending the boss defeated message. - // The first three do not matter at all in Boss Rush. Wall of Flesh's loot box not spawning is also a positive, so that it doesn't clutter the Underworld. - // Dropping potions is worthless at this point, and Boss Rush is already a horribly balanced hellscape as is, so I'm not worried about hearts. - // As for the last one, well, if anyone actually notices that and cares about it, then I suppose we could make a more sophisticated IL edit. - if (BossRushEvent.BossRushActive) + // GOAL: Prevent vanilla boss defeated flags from getting set during Boss Rush. + // All of this is handled within a switch case directly in the DoDeathEvents function. + // Thus, the objective here is to add a branch past the entire switch case if it is Boss Rush. + var cursor = new ILCursor(il); + + // Move to the point right before the switch case. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("SpawnOnPlayer"))) + { + LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to before the switch case."); return; + } - orig(self, closestPlayer); + // Define a branch label, load the Boss Rush check, and create the branch if it is true. + var label = il.DefineLabel(); + cursor.Emit(OpCodes.Ldsfld, typeof(BossRushEvent).GetField("BossRushActive")); + cursor.Emit(OpCodes.Brtrue, label); + + // Move to after the switch case to place the label. + for (int i = 0; i < 2; i++) + { + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchCall("SpawnBoss"))) + { + LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to after the switch case."); + return; + } + } + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdarg0())) + { + LogFailure("Prevent Vanilla Defeated Flags in Boss Rush", "Could not move to after the switch case."); + return; + } + cursor.MarkLabel(label); } - #endregion Prevent Vanilla Bosses From Being Marked as Defeated in Boss Rush + #endregion - #region Enabling of Triggered NPC Platform Fallthrough - // Why this isn't a mechanism provided by TML itself or vanilla itself is beyond me. - private static void AllowTriggeredFallthrough(Terraria.On_NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight) + #region Enabling of Fusion Feeder Sand Digging + private static void AllowFusionFeederToDigThroughSand(On_NPC.orig_ApplyTileCollision orig, NPC self, bool fall, Vector2 cPosition, int cWidth, int cHeight) { if (self.active && self.type == ModContent.NPCType()) { self.velocity = Collision.AdvancedTileCollision(TileID.Sets.ForAdvancedCollision.ForSandshark, cPosition, self.velocity, cWidth, cHeight, fall, fall, 1); return; } - var isNpcValid = self.TryGetGlobalNPC(out CalamityGlobalNPC npc); //why the fuck this errors is anybody's guess, it absolutely shouldn't and yet it does - if (isNpcValid && self.active && npc.ShouldFallThroughPlatforms) - fall = true; - orig(self, fall, cPosition, cWidth, cHeight); } #endregion @@ -398,7 +402,7 @@ namespace CalamityMod.ILEditing cursor.Emit(OpCodes.Ret); } - private static void AlterTownNPCSpawnRate(Terraria.On_Main.orig_UpdateTime_SpawnTownNPCs orig) + private static void AlterTownNPCSpawnRate(On_Main.orig_UpdateTime_SpawnTownNPCs orig) { double oldWorldRate = Main.desiredWorldTilesUpdateRate; Main.desiredWorldTilesUpdateRate *= CalamityServerConfig.Instance.TownNPCSpawnRateMultiplier; @@ -483,7 +487,7 @@ namespace CalamityMod.ILEditing #endregion #region Custom Gate Door Logic - private static bool OpenDoor_LabDoorOverride(Terraria.On_WorldGen.orig_OpenDoor orig, int i, int j, int direction) + private static bool OpenDoor_LabDoorOverride(On_WorldGen.orig_OpenDoor orig, int i, int j, int direction) { Tile tile = Main.tile[i, j]; @@ -499,7 +503,7 @@ namespace CalamityMod.ILEditing return orig(i, j, direction); } - private static bool CloseDoor_LabDoorOverride(Terraria.On_WorldGen.orig_CloseDoor orig, int i, int j, bool forced) + private static bool CloseDoor_LabDoorOverride(On_WorldGen.orig_CloseDoor orig, int i, int j, bool forced) { Tile tile = Main.tile[i, j]; @@ -516,20 +520,8 @@ namespace CalamityMod.ILEditing } #endregion - #region Platform Collision Checks for Grounded Bosses - private static bool EnableCalamityBossPlatformCollision(Terraria.On_NPC.orig_Collision_DecideFallThroughPlatforms orig, NPC self) - { - if ((self.type == ModContent.NPCType() || self.type == ModContent.NPCType() || self.type == ModContent.NPCType() || - self.type == ModContent.NPCType() || self.type == ModContent.NPCType()) && - self.target >= 0 && Main.player[self.target].position.Y > self.position.Y + self.height) - return true; - - return orig(self); - } - #endregion - #region Incorporate Enchantments in Item Names - private static string IncorporateEnchantmentInAffix(Terraria.On_Item.orig_AffixName orig, Item self) + private static string IncorporateEnchantmentInAffix(On_Item.orig_AffixName orig, Item self) { string result = orig(self); @@ -545,7 +537,7 @@ namespace CalamityMod.ILEditing #endregion #region Apply Projectile Variables Upon Creation - private static int IncorporateExtraProjectileVariables(Terraria.On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2) + private static int IncorporateExtraProjectileVariables(On_Projectile.orig_NewProjectile_IEntitySource_float_float_float_float_int_int_float_int_float_float_float orig, IEntitySource spawnSource, float x, float y, float xSpeed, float ySpeed, int type, int damage, float knockback, int owner, float ai0, float ai1, float ai2) { // This is unfortunately not something that can be done via SetDefaults since owner is set // after that method is called. Doing it directly when the projectile is spawned appears to be the only reasonable way. @@ -613,7 +605,7 @@ namespace CalamityMod.ILEditing #endregion #region Apply Old Fashioned Damage to Miscellanous Hits - private static void ApplyOldFashionedDamageToMiscHits(Terraria.On_Player.orig_ApplyDamageToNPC orig, Player self, NPC npc, int damage, float knockback, int direction, bool crit = false, DamageClass? damageType = null, bool damageVariation = false) + private static void ApplyOldFashionedDamageToMiscHits(On_Player.orig_ApplyDamageToNPC orig, Player self, NPC npc, int damage, float knockback, int direction, bool crit = false, DamageClass? damageType = null, bool damageVariation = false) { if (self.Calamity().oldFashioned) damage = (int)(damage * OldFashioned.DamageBoostMultiplier); @@ -699,7 +691,7 @@ namespace CalamityMod.ILEditing #endregion #region Fire Cursor Effect for the Calamity Accessory - private static void UseCoolFireCursorEffect(Terraria.On_Main.orig_DrawCursor orig, Vector2 bonus, bool smart) + private static void UseCoolFireCursorEffect(On_Main.orig_DrawCursor orig, Vector2 bonus, bool smart) { Player player = Main.LocalPlayer; @@ -911,7 +903,7 @@ namespace CalamityMod.ILEditing #endregion #region General Particle Rendering - private static void DrawFusableParticles(Terraria.On_Main.orig_SortDrawCacheWorms orig, Main self) + private static void DrawFusableParticles(On_Main.orig_SortDrawCacheWorms orig, Main self) { DeathAshParticle.DrawAll(); @@ -921,7 +913,7 @@ namespace CalamityMod.ILEditing orig(self); } - private static void DrawForegroundParticles(Terraria.On_Main.orig_DrawInfernoRings orig, Main self) + private static void DrawForegroundParticles(On_Main.orig_DrawInfernoRings orig, Main self) { GeneralParticleHandler.DrawAllParticles(Main.spriteBatch); orig(self); @@ -1483,88 +1475,28 @@ namespace CalamityMod.ILEditing #endregion #region Statue Additions - /// - /// Change the following code sequence in Wiring.HitWireSingle - /// num8 = (int) Utils.SelectRandom(Main.rand, new short[2] - /// { - /// 355, - /// 358 - /// }); - /// - /// to - /// - /// var arr = new short[2] - /// { - /// 355, - /// 358 - /// }); - /// arr = arr.ToList().Add(id).ToArray(); - /// num8 = Utils.SelectRandom(Main.rand, arr); - /// - /// - /// private static void AddTwinklersToStatue(ILContext il) { - // obtain a cursor positioned before the first instruction of the method - // the cursor is used for navigating and modifying the il - var c = new ILCursor(il); + // Allow Twinklers to be spawned by the Firefly Statue. + var cursor = new ILCursor(il); - // the exact location for this hook is very complex to search for due to the hook instructions not being unique, and buried deep in control flow - // switch statements are sometimes compiled to if-else chains, and debug builds litter the code with no-ops and redundant locals - - // in general you want to search using structure and function rather than numerical constants which may change across different versions or compile settings - // using local variable indices is almost always a bad idea - - // we can search for - // switch (*) - // case 54: - // Utils.SelectRandom * - - // in general you'd want to look for a specific switch variable, or perhaps the containing switch (type) { case 105: - // but the generated IL is really variable and hard to match in this case - - // we'll just use the fact that there are no other switch statements with case 54, followed by a SelectRandom - - ILLabel[] targets = null; - while (c.TryGotoNext(i => i.MatchSwitch(out targets))) + // Move to the method which randomly selects an NPC for the Statue to spawn. This is the second call of the method in this function. + for (int i = 0; i < 2; i++) { - // some optimising compilers generate a sub so that all the switch cases start at 0 - // ldc.i4.s 51 - // sub - // switch - int offset = 0; - if (c.Prev.MatchSub() && c.Prev.Previous.MatchLdcI4(out offset)) + if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchCall(typeof(Utils), nameof(Utils.SelectRandom)))) { - ; + LogFailure("Add Twinkler to Firefly Statue", "Could not move to the SelectRandom method."); + return; } - - // get the label for case 54: if it exists - int case54Index = 54 - offset; - if (case54Index < 0 || case54Index >= targets.Length || !(targets[case54Index] is ILLabel target)) - { - continue; - } - - // move the cursor to case 54: - c.GotoLabel(target); - // there's lots of extra checks we could add here to make sure we're at the right spot, such as not encountering any branching instructions - c.GotoNext(i => i.MatchCall(typeof(Utils), nameof(Utils.SelectRandom))); - - // goto next positions us before the instruction we searched for, so we can insert our array modifying code right here - c.EmitDelegate>(arr => - { - // resize the array and add our custom firefly - Array.Resize(ref arr, arr.Length + 1); - arr[arr.Length - 1] = (short)ModContent.NPCType(); - return arr; - }); - - // hook applied successfully - return; } - // couldn't find the right place to insert - throw new Exception("Hook location not found, switch(*) { case 54: ..."); + // Emit a delegate which resizes the array and adds Twinkler to it. + cursor.EmitDelegate>(arr => + { + Array.Resize(ref arr, arr.Length + 1); + arr[arr.Length - 1] = (short)ModContent.NPCType(); + return arr; + }); } #endregion @@ -1624,7 +1556,7 @@ namespace CalamityMod.ILEditing /// /// Determines if the custom grapple movement should take place or not. Useful for hooks that only do movement tricks in some cases /// - private static void CustomGrappleMovementCheck(Terraria.On_Player.orig_GrappleMovement orig, Player self) + private static void CustomGrappleMovementCheck(On_Player.orig_GrappleMovement orig, Player self) { WulfrumPackPlayer mp = self.GetModPlayer(); @@ -1637,7 +1569,7 @@ namespace CalamityMod.ILEditing /// /// This is called right before the game decides wether or not to update the players velocity based on "real" physics (aka not tongued or hooked or with a pulley) /// - private static void CustomGrapplePreDefaultMovement(Terraria.On_Player.orig_UpdatePettingAnimal orig, Player self) + private static void CustomGrapplePreDefaultMovement(On_Player.orig_UpdatePettingAnimal orig, Player self) { orig(self); @@ -1661,7 +1593,7 @@ namespace CalamityMod.ILEditing /// Used before the player steps up a half tile. If we don't do that, players that are grappled but don't use hook movement won't be able to go over tiles. /// The hook cache is reset in PreUpdateMovement /// - private static void CustomGrapplePreStepUp(Terraria.On_Player.orig_SlopeDownMovement orig, Player self) + private static void CustomGrapplePreStepUp(On_Player.orig_SlopeDownMovement orig, Player self) { orig(self); @@ -1675,9 +1607,9 @@ namespace CalamityMod.ILEditing } /// - /// This is done to put the hook if it was cacehd during the frame instruction. + /// This is done to put the hook if it was cached during the frame instruction. /// - private static void CustomGrapplePostFrame(Terraria.On_Player.orig_PlayerFrame orig, Player self) + private static void CustomGrapplePostFrame(On_Player.orig_PlayerFrame orig, Player self) { orig(self); WulfrumPackPlayer mp = self.GetModPlayer(); @@ -1694,7 +1626,7 @@ namespace CalamityMod.ILEditing #region Find Calamity Item Dye Shader - internal static void FindCalamityItemDyeShader(Terraria.On_Player.orig_UpdateItemDye orig, Player self, bool isNotInVanitySlot, bool isSetToHidden, Item armorItem, Item dyeItem) + internal static void FindCalamityItemDyeShader(On_Player.orig_UpdateItemDye orig, Player self, bool isNotInVanitySlot, bool isSetToHidden, Item armorItem, Item dyeItem) { orig(self, isNotInVanitySlot, isSetToHidden, armorItem, dyeItem); if (armorItem.type == ModContent.ItemType()) @@ -1727,7 +1659,7 @@ namespace CalamityMod.ILEditing #endregion #region Custom world selection difficulties - internal static void GetDifficultyOverride(Terraria.GameContent.UI.Elements.On_AWorldListItem.orig_GetDifficulty orig, AWorldListItem self, out string expertText, out Color gameModeColor) + internal static void GetDifficultyOverride(On_AWorldListItem.orig_GetDifficulty orig, AWorldListItem self, out string expertText, out Color gameModeColor) { // Run the original code and pull out the original text and text color orig(self, out expertText, out gameModeColor); @@ -1762,7 +1694,7 @@ namespace CalamityMod.ILEditing #endregion #region Shimmer effect edits - public static void ShimmerEffectEdits(Terraria.On_Item.orig_GetShimmered orig, Item self) + public static void ShimmerEffectEdits(On_Item.orig_GetShimmered orig, Item self) { // Make Plagued Containment Bricks turn into Plagued Nanodroids if shimmered before defeating Golem if (self.type == ModContent.ItemType()) @@ -1805,7 +1737,7 @@ namespace CalamityMod.ILEditing #region Block Abyss from Teleportation Potions - public static void TPOverride(Terraria.On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0) + public static void TPOverride(On_Player.orig_Teleport orig, Player self, Vector2 newPos, int Style = 0, int extraInfo = 0) { // Grab the tile from where the potion wants to teleport Tile t = CalamityUtils.ParanoidTileRetrieval(newPos.ToTileCoordinates().X, newPos.ToTileCoordinates().Y); @@ -1849,67 +1781,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Revengeance Master Mode Twins Shenanigans - public static void TripletsSpawnTextOverride(Terraria.On_NPC.orig_SpawnBoss orig, int x, int y, int type, int targetPlayerIndex) - { - if (CalamityWorld.death && type == NPCID.Retinazer) - { - int retinazerIndex = NPC.NewNPC(NPC.GetBossSpawnSource(targetPlayerIndex), x, y, type, 1); - if (retinazerIndex == 200) - { - return; - } - Main.npc[retinazerIndex].target = targetPlayerIndex; - Main.npc[retinazerIndex].timeLeft *= 20; - - if (Main.dedServ && retinazerIndex < 200) - { - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, retinazerIndex); - } - - AchievementsHelper.CheckMechaMayhem(); - - CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.TripletsBossText", new Color(175, 75, 255)); - return; - } - else - { - orig(x, y, type, targetPlayerIndex); - } - } - - public static void PreventFoveanatorDefeatMessageIfNotKilledLast(On_NPC.orig_DoDeathEvents_BeforeLoot orig, NPC self, Player closestPlayer) - { - if (CalamityWorld.death && self.type == ModContent.NPCType() && (NPC.AnyNPCs(NPCID.Spazmatism) || NPC.AnyNPCs(NPCID.Retinazer))) - { - self.value = 0f; - self.boss = false; - return; - } - else - { - orig(self, closestPlayer); - } - } - - public static void TripletsDefeatTextOverride(On_NPC.orig_DoDeathEvents_CelebrateBossDeath orig, NPC self, string typeName) - { - bool correctNPCType = self.type == NPCID.Retinazer || self.type == NPCID.Spazmatism || self.type == ModContent.NPCType(); - if (CalamityWorld.death && correctNPCType) - { - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Language.GetTextValue("Announcement.HasBeenDefeated_Plural", CalamityUtils.GetTextValue("Status.Boss.TripletsDefeatName")), 175, 75, 255); - else if (Main.dedServ) - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasBeenDefeated_Plural", NetworkText.FromKey("Mods.CalamityMod.Status.Boss.TripletsDefeatName")), new Color(175, 75, 255)); - return; - } - else - { - orig(self, typeName); - } - } - #endregion - #region Optimized GlowMask Rendering on Tile private static void GlowMaskTileRender(On_TileDrawing.orig_DrawSingleTile orig, TileDrawing self, TileDrawInfo drawData, bool solidLayer, int waterStyleOverride, Vector2 screenPosition, Vector2 screenOffset, int tileX, int tileY) { @@ -1974,7 +1845,7 @@ namespace CalamityMod.ILEditing #endregion #region Allow Cannons to use jellyfish - public static void AllowCannonJellyfishUse(Terraria.On_Player.orig_PlaceThing_CannonBall orig, Player self) + public static void AllowCannonJellyfishUse(On_Player.orig_PlaceThing_CannonBall orig, Player self) { // Check if the player is holding a jelly if (self.HeldItem.type == ModContent.ItemType()) @@ -2085,7 +1956,7 @@ namespace CalamityMod.ILEditing #endregion #region Add Stohne to the Jungle - public static void AddStohne(Terraria.GameContent.Biomes.On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY) + public static void AddStohne(On_JunglePass.orig_GenerateFinishingTouches orig, JunglePass self, GenerationProgress progress, int oldX, int oldY) { int anchorX = oldX; int anchorY = oldY; @@ -2629,7 +2500,7 @@ namespace CalamityMod.ILEditing #endregion #region Make Celestial Onion give the Master Mode slot - public static bool MasterModeCelestialOnionCheck(Terraria.On_Player.orig_IsItemSlotUnlockedAndUsable orig, Player self, int slot) + public static bool MasterModeCelestialOnionCheck(On_Player.orig_IsItemSlotUnlockedAndUsable orig, Player self, int slot) { if ((slot == 9 || slot == 19) && self.Calamity().extraAccessoryML && !Main.gameMenu) { diff --git a/ILEditing/VanillaStupidityFixingILChanges.cs b/ILEditing/VanillaStupidityFixingILChanges.cs index 80c15173f8..d9298d7598 100644 --- a/ILEditing/VanillaStupidityFixingILChanges.cs +++ b/ILEditing/VanillaStupidityFixingILChanges.cs @@ -9,6 +9,7 @@ using CalamityMod.NPCs.AcidRain; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Walls; +using CalamityMod.World; using Microsoft.Xna.Framework; using Mono.Cecil.Cil; using MonoMod.Cil; @@ -17,7 +18,7 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameContent; using Terraria.GameContent.Drawing; -using Terraria.GameContent.Personalities; +using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; using Terraria.Graphics.Effects; @@ -153,7 +154,7 @@ namespace CalamityMod.ILEditing #endregion #region Prevention of Slime Rain Spawns When Near Bosses - private static void PreventBossSlimeRainSpawns(Terraria.On_NPC.orig_SlimeRainSpawns orig, int plr) + private static void PreventBossSlimeRainSpawns(On_NPC.orig_SlimeRainSpawns orig, int plr) { if (!Main.player[plr].Calamity().isNearbyBoss && CalamityServerConfig.Instance.BossZen) orig(plr); @@ -174,12 +175,47 @@ namespace CalamityMod.ILEditing } // Remove the Expert Mode check, and in its place put a check for the Zenith seed (Get fixed boi). - // Note from CIT: I originally removed these entirely; cursor.Emit(OpCodes.Pop); cursor.Emit(OpCodes.Ldsfld, typeof(Main).GetField("zenithWorld")); } #endregion + #region Disable Detonating Bubble StrikeNPC Hardcoded Override + private static void LetDetonatingBubblesTakeDamage(ILContext il) + { + // In vanilla's StrikeNPC function, Detonating Bubbles have a hardcoded type check which sets the damage of the strike to 0. + // This IL edit disables that type check in Death Mode. + var cursor = new ILCursor(il); + + // Go to the point after the check for the Detonating Bubble NPC ID. + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdcR8(0.0))) + { + LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move after the NPC type check."); + return; + } + + // Define the label. + var label = il.DefineLabel(); + + // Add a branch if it is Death Mode. + cursor.Emit(OpCodes.Ldsfld, typeof(CalamityWorld).GetField("death")); + cursor.Emit(OpCodes.Brtrue, label); + + // Move to the point after Detonating Bubble changes are implemented to place the branch label. + if (!cursor.TryGotoNext(MoveType.After, i => i.MatchStfld("dontTakeDamage"))) + { + LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move to after the Detonating Bubble logic."); + return; + } + if (!cursor.TryGotoNext(MoveType.AfterLabel, i => i.MatchLdarg0())) + { + LogFailure("Let Detonating Bubbles Take Damage in Death", "Could not move to after the Detonating Bubble logic."); + return; + } + cursor.MarkLabel(label); + } + #endregion + #region Make Meteorite Explodable private static void MakeMeteoriteExplodable(ILContext il) { @@ -271,13 +307,15 @@ namespace CalamityMod.ILEditing LogFailure("Prevent Fossil Shattering", "Could not locate the Desert Fossil Tile ID variable."); return; } + + // Remove this value and replace it with a large number that will never be a valid tile ID. cursor.Remove(); - cursor.Emit(OpCodes.Ldc_I4, TileID.PixelBox); // Change to Pixel Box because it cannot be obtained in-game without cheating. + cursor.Emit(OpCodes.Ldc_I4, 40000); } #endregion #region Remove Hellforge Pickaxe Requirement - private static int RemoveHellforgePickaxeRequirement(Terraria.On_Player.orig_GetPickaxeDamage orig, Player self, int x, int y, int pickPower, int hitBufferIndex, Tile tileTarget) + private static int RemoveHellforgePickaxeRequirement(On_Player.orig_GetPickaxeDamage orig, Player self, int x, int y, int pickPower, int hitBufferIndex, Tile tileTarget) { if (tileTarget.TileType == TileID.Hellforge) pickPower = 65; @@ -295,10 +333,6 @@ namespace CalamityMod.ILEditing } #endregion - #region Fix Chlorophyte Crystal Attacking Where it Shouldn't - // TODO -- Finish this - #endregion Fix Chlorophyte Crystal Attacking Where it Shouldn't - #region Prevent UFO Mount from Dismounting in Water private static void PreventUFODismountInWater(ILContext il) { @@ -331,7 +365,7 @@ namespace CalamityMod.ILEditing #endregion Prevent UFO Mount from Dismounting in Water #region Color Blighted Gel - private static void ColorBlightedGel(Terraria.GameContent.ItemDropRules.On_CommonCode.orig_ModifyItemDropFromNPC orig, NPC npc, int itemIndex) + private static void ColorBlightedGel(On_CommonCode.orig_ModifyItemDropFromNPC orig, NPC npc, int itemIndex) { orig(npc, itemIndex); @@ -357,7 +391,7 @@ namespace CalamityMod.ILEditing #endregion Color Blighted Gel #region Improve Angler Quest Rewards - private static void ImproveAnglerRewards(Terraria.On_Player.orig_GetAnglerReward orig, Player self, NPC angler, int questItemType) + private static void ImproveAnglerRewards(On_Player.orig_GetAnglerReward orig, Player self, NPC angler, int questItemType) { orig(self, angler, questItemType); @@ -1046,7 +1080,7 @@ namespace CalamityMod.ILEditing var cursor = new ILCursor(il); if (!cursor.TryGotoNext(MoveType.After, i => i.MatchLdfld("magmaStone"))) // Flag for if Magma Stone is equipped. Fire Gauntlet also uses this. { - LogFailure("Make Magma Stone & Fire Gauntlet Dust Toggleable", "Could not locate the magma stone variable."); + LogFailure("Make Magma Stone & Fire Gauntlet Dust Toggleable", "Could not locate the Magma Stone variable."); return; } // Load the player itself onto the stack so that it becomes an argument for the following delegate. @@ -1091,7 +1125,7 @@ namespace CalamityMod.ILEditing } // Remove the instruction and replace with 1 (true). This effectively removes the requirement for defeating Plantera. - // The only requirements for summoning Golems with Power Cells are now: 1) Golem is not alive, and 2) The world is in Hardmode. + // The only requirements for summoning Golem with Power Cells are now: 1) Golem is not alive, and 2) The world is in Hardmode. cursor.EmitPop(); cursor.Emit(OpCodes.Ldc_I4_1); } @@ -1144,7 +1178,7 @@ namespace CalamityMod.ILEditing return; } - // branch is used for exit condition. So setting ble.s opcode to nop will remove the condition + // Branch is used for exit condition. So setting ble.s opcode to nop will remove the condition cursor.Prev.OpCode = OpCodes.Nop; // After that we pop NPC.damage and 0 from stack @@ -1188,7 +1222,7 @@ namespace CalamityMod.ILEditing }*/ #endregion - #region Allow disabling gravity swap visual && allow gravity keybind + #region Allow Disabling Gravity Swap Visual and Allow Gravity Keybind private static void DelayGravity(On_Player.orig_UpdateControlHolds orig, Player Player) { var cplay = Player.Calamity(); diff --git a/ILEditing/WorldgenILChanges.cs b/ILEditing/WorldgenILChanges.cs index 419d4c19f9..002c434ca3 100644 --- a/ILEditing/WorldgenILChanges.cs +++ b/ILEditing/WorldgenILChanges.cs @@ -8,6 +8,7 @@ using MonoMod.Cil; using Terraria; using Terraria.GameContent.UI.States; using Terraria.ID; +using Terraria.IO; using Terraria.WorldBuilding; namespace CalamityMod.ILEditing @@ -33,28 +34,6 @@ namespace CalamityMod.ILEditing set; } - #region Replacement of Pharaoh Set in Pyramids - // Note: There is no need to replace the other Pharaoh piece, due to how the vanilla code works. - // The other Pharaoh vanity piece is added automatically if the mask is found in the chest. - private static void ReplacePharaohSetInPyramids(ILContext il) - { - var cursor = new ILCursor(il); - - // Find the instruction which loads in the item ID of the Pharaoh's Mask. - if (!cursor.TryGotoNext(MoveType.Before, i => i.MatchLdcI4(ItemID.PharaohsMask))) - { - LogFailure("Pharaoh Set Pyramid Replacement", "Could not locate the Pharaoh's Mask item ID."); - return; - } - - // Replace the Pharaoh's Mask with the Amber Hook. - // THIS INT CAST IS MANDATORY. DO NOT REMOVE IT. - // In TML's DLL, despite item IDs being shorts (16 bits), the hardcoded 848 here is a 32-bit integer literal. - // As such, it must be replaced with a 32-bit integer literal or the branches of the switch will misalign and the IL edit fails. - cursor.Next.Operand = (int)ItemID.AmberHook; - } - #endregion Replacement of Pharaoh Set in Pyramids - #region Fixing of Living Tree/Sulphurous Sea Interactions private static void BlockLivingTreesNearOcean(ILContext il) { @@ -66,7 +45,7 @@ namespace CalamityMod.ILEditing #endregion Fixing of Living Tree/Sulphurous Sea Interactions #region Removal of Hardmode Ore Generation from Evil Altars - private static void PreventSmashAltarCode(Terraria.On_WorldGen.orig_SmashAltar orig, int i, int j) + private static void PreventSmashAltarCode(On_WorldGen.orig_SmashAltar orig, int i, int j) { if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework) return; @@ -135,10 +114,8 @@ namespace CalamityMod.ILEditing return; } - // Pop original value off. + // Pop original value off. Push '2' to the stack. c.Emit(OpCodes.Pop); - - // Push '2' to the stack. c.Emit(OpCodes.Ldc_I4_2); // OBJECTIVE 2 @@ -181,13 +158,11 @@ namespace CalamityMod.ILEditing // Emit our new string "Mods.CalamityMod.UI.SmallWorldWarning". c.Emit(OpCodes.Ldstr, "Mods.CalamityMod.UI.SmallWorldWarning"); - - } #endregion #region Clear temporary modded tiles - private static void ClearModdedTempTiles(Terraria.IO.On_WorldFile.orig_ClearTempTiles orig) + private static void ClearModdedTempTiles(On_WorldFile.orig_ClearTempTiles orig) { orig(); diff --git a/Items/Accessories/AbyssalDivingSuit.cs b/Items/Accessories/AbyssalDivingSuit.cs index 17b15c0aba..6f2c4936cf 100644 --- a/Items/Accessories/AbyssalDivingSuit.cs +++ b/Items/Accessories/AbyssalDivingSuit.cs @@ -1,30 +1,29 @@ -using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { - public class AbyssalDivingSuit : ModItem, ILocalizedModType + public class AbyssalDivingSuit : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public static double PlatesAllDamageReduction = 0.15D; public static double PlatesHitDecay = 0.03D; - public override void Load() - { - // All code below runs only if we're not loading on a server - if (!Main.dedServ) - { - // Add equip textures - EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Head}", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Body}", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, $"{Texture}_{EquipType.Legs}", EquipType.Legs, this); - } - } + public override string AssetPath => "CalamityMod/Items/Accessories/"; + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "AbyssalDivingSuit", null), + (EquipType.Body, "AbyssalDivingSuit", null), + (EquipType.Legs, "AbyssalDivingSuit", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; + + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.NPCHit4, 10); public override void SetDefaults() { @@ -33,32 +32,9 @@ namespace CalamityMod.Items.Accessories Item.accessory = true; Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; - - if (!Main.dedServ) - { - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } } - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.abyssalDivingSuit = true; - if (hideVisual) - modPlayer.abyssalDivingSuitHide = true; - } - - public override void UpdateVanity(Player player) - { - player.Calamity().abyssalDivingSuitHide = false; - player.Calamity().abyssalDivingSuitForce = true; - } + public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().abyssalDivingSuit = true; public override void AddRecipes() { diff --git a/Items/Accessories/AquaticHeart.cs b/Items/Accessories/AquaticHeart.cs index 5c5f1de826..25c761394a 100644 --- a/Items/Accessories/AquaticHeart.cs +++ b/Items/Accessories/AquaticHeart.cs @@ -1,45 +1,30 @@ -using System; -using System.Collections.Generic; -using CalamityMod.CalPlayer; +using System.Collections.Generic; +using CalamityMod.Items.BaseItems; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { [LegacyName("SirensHeart")] - public class AquaticHeart : ModItem, ILocalizedModType + public class AquaticHeart : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public static float WaterSpeedBoost = 0.15f; public static double IceShieldAllDamageReduction = 0.2D; - public override void Load() - { - // All code below runs only if we're not loading on a server - if (!Main.dedServ) - { - // Add equip textures - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/AquaticTrans_Legs", EquipType.Legs, this); - } - } + public override string AssetPath => "CalamityMod/Items/Accessories/"; + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "AquaticTrans", null), + (EquipType.Body, "AquaticTrans", null), + (EquipType.Legs, "AquaticTrans", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; - public override void SetStaticDefaults() - { - if (!Main.dedServ) - { - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } - } + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.FemaleHit, 10); public override void SetDefaults() { @@ -50,19 +35,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.LightRed; } - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.aquaticHeart = true; - if (hideVisual) - modPlayer.aquaticHeartHide = true; - } - - public override void UpdateVanity(Player player) - { - player.Calamity().aquaticHeartHide = false; - player.Calamity().aquaticHeartForce = true; - } + public override void UpdateAccessory(Player player, bool hideVisual) => player.Calamity().aquaticHeart = true; public override void ModifyTooltips(List tooltips) { diff --git a/Items/Accessories/AsgardianAegis.cs b/Items/Accessories/AsgardianAegis.cs index 8e71f92a39..9ba8791b8d 100644 --- a/Items/Accessories/AsgardianAegis.cs +++ b/Items/Accessories/AsgardianAegis.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories Item.width = 60; Item.height = 54; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 12; + Item.defense = 6; Item.accessory = true; Item.rare = ModContent.RarityType(); } diff --git a/Items/Accessories/AsgardsValor.cs b/Items/Accessories/AsgardsValor.cs index 5478959941..3f7bff607d 100644 --- a/Items/Accessories/AsgardsValor.cs +++ b/Items/Accessories/AsgardsValor.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories Item.height = 48; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; - Item.defense = 8; // we buff Ankh Shield to 8 + Item.defense = 4; Item.accessory = true; } diff --git a/Items/Accessories/BloodstainedGlove.cs b/Items/Accessories/BloodstainedGlove.cs index 075af22adf..41d4f0b6a9 100644 --- a/Items/Accessories/BloodstainedGlove.cs +++ b/Items/Accessories/BloodstainedGlove.cs @@ -24,15 +24,5 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.bloodyGlove = true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 2). - AddIngredient(6). - AddIngredient(ItemID.Vertebrae, 2). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Accessories/BloodyWormScarf.cs b/Items/Accessories/BloodyWormScarf.cs index 8399ef805a..23c4716747 100644 --- a/Items/Accessories/BloodyWormScarf.cs +++ b/Items/Accessories/BloodyWormScarf.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 42; - Item.defense = 7; + Item.defense = 3; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; diff --git a/Items/Accessories/BloodyWormTooth.cs b/Items/Accessories/BloodyWormTooth.cs index 4c6ef7f45c..9a31aa9dad 100644 --- a/Items/Accessories/BloodyWormTooth.cs +++ b/Items/Accessories/BloodyWormTooth.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 12; Item.height = 15; - Item.defense = 7; + Item.defense = 3; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; Item.rare = ItemRarityID.Orange; Item.accessory = true; diff --git a/Items/Accessories/CorrosiveSpine.cs b/Items/Accessories/CorrosiveSpine.cs index 86c33dbb05..21b17bf5f6 100644 --- a/Items/Accessories/CorrosiveSpine.cs +++ b/Items/Accessories/CorrosiveSpine.cs @@ -16,7 +16,6 @@ namespace CalamityMod.Items.Accessories Item.height = 46; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 4; Item.accessory = true; } diff --git a/Items/Accessories/CrownJewel.cs b/Items/Accessories/CrownJewel.cs index 1c85ffd2fe..9c4b4cfca5 100644 --- a/Items/Accessories/CrownJewel.cs +++ b/Items/Accessories/CrownJewel.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 26; - Item.defense = 4; + Item.defense = 1; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; diff --git a/Items/Accessories/DarkSunRing.cs b/Items/Accessories/DarkSunRing.cs index 361bf550d6..e86eea2a52 100644 --- a/Items/Accessories/DarkSunRing.cs +++ b/Items/Accessories/DarkSunRing.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories Item.width = 42; Item.height = 60; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; - Item.defense = 10; + Item.defense = 4; Item.lifeRegen = 1; Item.accessory = true; Item.rare = ModContent.RarityType(); diff --git a/Items/Accessories/DraedonsHeart.cs b/Items/Accessories/DraedonsHeart.cs index 8825c99c92..0177e7f04c 100644 --- a/Items/Accessories/DraedonsHeart.cs +++ b/Items/Accessories/DraedonsHeart.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Accessories Item.width = 52; Item.height = 68; Item.accessory = true; - Item.defense = 48; + Item.defense = 20; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); } diff --git a/Items/Accessories/ElysianAegis.cs b/Items/Accessories/ElysianAegis.cs index 05e3ce7943..c941a263df 100644 --- a/Items/Accessories/ElysianAegis.cs +++ b/Items/Accessories/ElysianAegis.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories Item.height = 42; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; Item.rare = ModContent.RarityType(); - Item.defense = 10; + Item.defense = 5; Item.accessory = true; } diff --git a/Items/Accessories/EtherealTalisman.cs b/Items/Accessories/EtherealTalisman.cs index 5179e46fcb..0e565a1163 100644 --- a/Items/Accessories/EtherealTalisman.cs +++ b/Items/Accessories/EtherealTalisman.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Accessories player.statManaMax2 += 150; player.GetDamage() += 0.15f; - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; player.GetCritChance() += 5; } diff --git a/Items/Accessories/FilthyGlove.cs b/Items/Accessories/FilthyGlove.cs index 905d4c0ccb..35f2edb458 100644 --- a/Items/Accessories/FilthyGlove.cs +++ b/Items/Accessories/FilthyGlove.cs @@ -24,15 +24,5 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.filthyGlove = true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 2). - AddIngredient(6). - AddIngredient(ItemID.RottenChunk, 2). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Accessories/GiantShell.cs b/Items/Accessories/GiantShell.cs index 52297d4d96..fe575c6fd1 100644 --- a/Items/Accessories/GiantShell.cs +++ b/Items/Accessories/GiantShell.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 30; Item.height = 28; - Item.defense = 6; + Item.defense = 5; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; Item.accessory = true; diff --git a/Items/Accessories/GiantTortoiseShell.cs b/Items/Accessories/GiantTortoiseShell.cs index 579d15d32f..9551ffbb81 100644 --- a/Items/Accessories/GiantTortoiseShell.cs +++ b/Items/Accessories/GiantTortoiseShell.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 46; Item.height = 30; - Item.defense = 15; + Item.defense = 10; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; Item.accessory = true; diff --git a/Items/Accessories/GloveofPrecision.cs b/Items/Accessories/GloveofPrecision.cs index 9cb6f21173..81a152d40d 100644 --- a/Items/Accessories/GloveofPrecision.cs +++ b/Items/Accessories/GloveofPrecision.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Accessories CalamityPlayer modPlayer = player.Calamity(); modPlayer.gloveOfPrecision = true; player.GetDamage() += 0.10f; - player.GetCritChance() += 15; + player.GetCritChance() += 10; modPlayer.rogueVelocity += 0.15f; player.GetAttackSpeed() -= 0.15f; } diff --git a/Items/Accessories/HallowedRune.cs b/Items/Accessories/HallowedRune.cs index 360aa5df98..814c76a378 100644 --- a/Items/Accessories/HallowedRune.cs +++ b/Items/Accessories/HallowedRune.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int RegenBoost = 3; - public static int DefenseBoost = 8; + public static int DefenseBoost = 4; public static float DamageReductionBoost = 0.04f; public static float SummonDamageBoost = 0.1f; diff --git a/Items/Accessories/HoneyDew.cs b/Items/Accessories/HoneyDew.cs index 5411c27755..5d8a49719e 100644 --- a/Items/Accessories/HoneyDew.cs +++ b/Items/Accessories/HoneyDew.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 30; + player.statLifeMax2 += 10; CalamityPlayer modPlayer = player.Calamity(); modPlayer.alwaysHoneyRegen = true; modPlayer.honeyTurboRegen = true; diff --git a/Items/Accessories/InfectedJewel.cs b/Items/Accessories/InfectedJewel.cs index c5c18c08f6..7746446c7f 100644 --- a/Items/Accessories/InfectedJewel.cs +++ b/Items/Accessories/InfectedJewel.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 26; Item.height = 26; - Item.defense = 6; + Item.defense = 4; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.accessory = true; diff --git a/Items/Accessories/InkBomb.cs b/Items/Accessories/InkBomb.cs index 6ed93531bb..955e945460 100644 --- a/Items/Accessories/InkBomb.cs +++ b/Items/Accessories/InkBomb.cs @@ -21,6 +21,9 @@ namespace CalamityMod.Items.Accessories { CalamityPlayer modPlayer = player.Calamity(); modPlayer.inkBomb = true; + modPlayer.rogueStealthMax += 0.1f; + player.Calamity().stealthGenStandstill += 0.07f; + player.Calamity().stealthGenMoving += 0.07f; } } } diff --git a/Items/Accessories/LivingDew.cs b/Items/Accessories/LivingDew.cs index bc76e4a498..d384b931a1 100644 --- a/Items/Accessories/LivingDew.cs +++ b/Items/Accessories/LivingDew.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += 50; + player.statLifeMax2 += 25; // Inherits all effects of Honey Dew CalamityPlayer modPlayer = player.Calamity(); diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index ca173561dc..1be7ad87e1 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Accessories Item.rare = ItemRarityID.Blue; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.accessory = true; - Item.defense = 4; + Item.defense = 3; } public override void UpdateAccessory(Player player, bool hideVisual) diff --git a/Items/Accessories/Nanotech.cs b/Items/Accessories/Nanotech.cs index d2137c38ed..8d9774a8a0 100644 --- a/Items/Accessories/Nanotech.cs +++ b/Items/Accessories/Nanotech.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Items.Accessories { public class Nanotech : ModItem, ILocalizedModType { + //The stealth damage boost is handled in CalamityPlayer for some reason, maybe someone didn't want em to stack? public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() { diff --git a/Items/Accessories/OrnateShield.cs b/Items/Accessories/OrnateShield.cs index 2b12a2aa69..40d0834c14 100644 --- a/Items/Accessories/OrnateShield.cs +++ b/Items/Accessories/OrnateShield.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Accessories Item.height = 32; Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.defense = 4; // This has a ram dash, it should give a bit less defense due to how good it is + Item.defense = 2; // This has a ram dash, it should give a bit less defense due to how good it is Item.accessory = true; } diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index a62a6fa4f7..e1c0f21cfd 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -5,7 +5,9 @@ using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.Summon.Whips; using CalamityMod.CalPlayer; using CalamityMod.DataStructures; +using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using CalamityMod.Projectiles.Summon; @@ -23,10 +25,10 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { //Developer item, dedicatee: Mishiro Usui/Amber Sienna - public class ProfanedSoulCrystal : ModItem, ILocalizedModType, IDyeableShaderRenderer + public class ProfanedSoulCrystal : TransformationAccessory, ILocalizedModType, IDyeableShaderRenderer { public static string[] contributorNames = new[] { "IbanPlay", "Chen", "Nincity", "Amber", "Mishiro", "LordMetarex", "Memes" }; - public static int ShieldDurabilityMax = 125; + public static int ShieldDurabilityMax = 100; public new string LocalizationCategory => "Items.Accessories"; public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(5); @@ -104,7 +106,7 @@ namespace CalamityMod.Items.Accessories if (ignoreNoBuffs && (!DownedBossSystem.downedCalamitas || !DownedBossSystem.downedExoMechs || (player.maxMinions - player.slotsMinions) < maxMinionRequirement) || - player.Calamity().profanedCrystalForce || !player.HasBuff()) + player.Transformation().Type == ModContent.ItemType() || !player.HasBuff()) { return ProfanedSoulCrystalState.Vanity; //failsafe for vanity } @@ -178,28 +180,22 @@ namespace CalamityMod.Items.Accessories * Projectiles transformed are ONLY affected by alldamage and summon damage bonuses, likewise the weapon's base damage/usetime is NOT taken into account. * The on-hit effect for the whip is in globalnpc */ - public override void Load() + public override string AssetPath => "CalamityMod/Items/Accessories/"; + + public override (EquipType Type, string AssetName, string EquipName)[] EquipSlots => + [ + (EquipType.Head, "ProfanedSoulTrans", null), + (EquipType.Body, "ProfanedSoulTrans", null), + (EquipType.Legs, "ProfanedSoulTrans", null), + (EquipType.Wings, "ProfanedSoulTrans", null), + (EquipType.Head, "ProfanedSoulTransNight", "PscNightHead"), + (EquipType.Legs, "ProfanedSoulTransNight", "PscNightLegs"), + (EquipType.Wings, "ProfanedSoulTransNight", "PscNightWings"), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; + + public override void ArmorIDSets() { - if (Main.dedServ) - return; - - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHead", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransHeadNight", EquipType.Head, this, "PscNightHead"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransBody", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegs", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/ProfanedSoulTransLegsNight", EquipType.Legs, this, "PscNightLegs"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWings", EquipType.Wings, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Wings/ProfanedSoulTransWingsNight", EquipType.Wings, this, "PscNightWings"); - } - - public override void SetStaticDefaults() - { - Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); - ItemID.Sets.AnimatesAsSoul[Type] = true; - - if (Main.dedServ) - return; - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; @@ -213,6 +209,16 @@ namespace CalamityMod.Items.Accessories ArmorIDs.Legs.Sets.OverridesLegs[equipSlotNightLegs] = true; } + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (p.Calamity().pSoulShieldDurability > 0 ? ProfanedGuardianDefender.ShieldDeathSound : Providence.HurtSound, 20); + + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(8, 4)); + ItemID.Sets.AnimatesAsSoul[Type] = true; + + base.SetStaticDefaults(); + } + public override void SetDefaults() { SummonTag.TagItem = Item.type; @@ -225,10 +231,7 @@ namespace CalamityMod.Items.Accessories Item.Calamity().devItem = true; } - public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) - { - return incomingItem.type != ModContent.ItemType(); - } + public override bool CanAccessoryBeEquippedWith(Item equippedItem, Item incomingItem, Player player) => incomingItem.type != ModContent.ItemType(); public override void ModifyTooltips(List tooltips) { @@ -260,12 +263,30 @@ namespace CalamityMod.Items.Accessories } } + public override bool CustomSetEquipType(Player player, EquipType type, Mod mod, string name) + { + switch (type) + { + case EquipType.Legs: + player.legs = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightLegs", type); + return true; + case EquipType.Head: + player.head = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightHead", type); + return true; + case EquipType.Wings: + player.wings = EquipLoader.GetEquipSlot(Mod, Main.dayTime ? "ProfanedSoulCrystal" : "PscNightWings", type); + return true; + } + return false; + } + public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.pSoulArtifact = true; modPlayer.profanedCrystal = true; + if (!modPlayer.profanedCrystalPrevious && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) { modPlayer.pSoulShieldDurability = 1; @@ -275,23 +296,15 @@ namespace CalamityMod.Items.Accessories if (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs) player.Calamity().profanedSoulRelicBuff = true; - modPlayer.profanedCrystalHide = hideVisual || modPlayer.profanedCrystalAnim > 0; modPlayer.pSoulShieldVisible = !hideVisual; DetermineTransformationEligibility(player); } - public override void UpdateVanity(Player player) - { - player.Calamity().profanedCrystalHide = false; - player.Calamity().profanedCrystalForce = true; - } - internal static void DetermineTransformationEligibility(Player player) { //short circuit immediately if profanedcrystalbuffs has already been set - - if (!player.Calamity().profanedCrystalBuffs && player.Calamity().profanedCrystalAnim == -1 && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && !player.Calamity().profanedCrystalForce && player.HasBuff()) + if (!player.Calamity().profanedCrystalBuffs && player.Calamity().profanedCrystalAnim == -1 && DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs && (player.maxMinions - player.slotsMinions) >= maxMinionRequirement && player.HasBuff()) { player.Calamity().profanedCrystalBuffs = true; player.Calamity().pscState = (int)GetPscStateFor(player); //update psc state, default is 0 which is the same as the int value of vanity @@ -535,6 +548,86 @@ namespace CalamityMod.Items.Accessories return false; } + public override void TransformFrameEffects(Player player) + { + bool enrage = player.Calamity().pscState >= (int)ProfanedSoulCrystal.ProfanedSoulCrystalState.Enraged; + + if (profanedCrystalWingCounter.Value == 0) + { + int key = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(key == 3 ? 0 : key + 1, enrage ? 5 : 8); + } + + player.wingFrame = profanedCrystalWingCounter.Key; + profanedCrystalWingCounter = new KeyValuePair(profanedCrystalWingCounter.Key, profanedCrystalWingCounter.Value - 1); + player.armorEffectDrawOutlines = true; + if (player.Calamity().profanedCrystalBuffs) + { + player.armorEffectDrawShadow = true; + if (enrage) + { + player.armorEffectDrawOutlinesForbidden = true; + } + } + } + + public KeyValuePair profanedCrystalWingCounter = new KeyValuePair(1, 10); + public KeyValuePair profanedCrystalAnimCounter = new KeyValuePair(0, 10); + + private bool IsValidTransitionFrame(AnimationType currentAnim, AnimationType newAnim, int frame, int counter) //this exists so it doesn't loop through the entire walk/idle anim just to find one frame for switching. + { + bool result = newAnim != AnimationType.Jump && currentAnim != AnimationType.Jump; + if (currentAnim == AnimationType.Walk && newAnim == AnimationType.Idle) + { + result = counter <= 0 && (frame == 11 || frame == 15 || frame == 19); + } + else if (currentAnim == AnimationType.Idle && newAnim == AnimationType.Walk) + { + result = counter <= 0 && (frame == 2 || frame == 6); + } + return currentAnim != newAnim && result; //swapping to jumps should be instant, no need to check the counter here + } + + private int HandlePSCAnimationFrames(Player player, AnimationType newType) + { + int key = profanedCrystalAnimCounter.Key; //0-based indexing + int value = profanedCrystalAnimCounter.Value - 1; + AnimationType currentType = key < 8 ? AnimationType.Idle : key == 8 ? AnimationType.Jump : AnimationType.Walk; + + bool isInvalidTransFrame = !IsValidTransitionFrame(currentType, newType, key, value); //to make the transition between walk and idle frames less jarring and smoother + AnimationType type = isInvalidTransFrame ? newType : currentType; + int frameCount = type == AnimationType.Walk || (player.Calamity().profanedCrystal && player.statLife <= (int)(player.statLifeMax2 * 0.5)) ? 7 : 10; + int lowerRange = type == AnimationType.Idle ? 0 : type == AnimationType.Jump ? 8 : 9; + int upperRange = type == AnimationType.Idle ? 7 : type == AnimationType.Jump ? 8 : 22; + if (value <= 0 || !isInvalidTransFrame) + { + value = frameCount; + if (key >= lowerRange && key < upperRange) + key++; + else + key = lowerRange; + } + profanedCrystalAnimCounter = new KeyValuePair(key, value); + return profanedCrystalAnimCounter.Key; + } + + public override void TransformPostUpdate(Player player) + { + bool validEquipSlot = player.legs == EquipLoader.GetEquipSlot(Mod, "ProfanedSoulCrystal", EquipType.Legs) || + player.legs == EquipLoader.GetEquipSlot(Mod, "PscNightLegs", EquipType.Legs); + if (player.Transformation().Type == ModContent.ItemType() && validEquipSlot) + { + bool usingCarpet = player.carpetTime > 0 && player.controlJump; //doesn't make sense for carpet to use jump frame since you have solid ground + AnimationType animType = AnimationType.Walk; + if ((player.sliding || player.velocity.Y != 0 || player.mount.Active || (player.grappling[0] != -1 || !player.CheckSolidGround()) || player.GoingDownWithGrapple) && !usingCarpet) + animType = AnimationType.Jump; + else if (player.velocity.X == 0 || usingCarpet) + animType = AnimationType.Idle; + int frame = HandlePSCAnimationFrames(player, animType); + player.legFrame.Y = player.legFrame.Height * frame; + } + } + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Accessories/ProfanedSoulTransHeadNight.png b/Items/Accessories/ProfanedSoulTransNight_Head.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransHeadNight.png rename to Items/Accessories/ProfanedSoulTransNight_Head.png diff --git a/Items/Accessories/ProfanedSoulTransLegsNight.png b/Items/Accessories/ProfanedSoulTransNight_Legs.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransLegsNight.png rename to Items/Accessories/ProfanedSoulTransNight_Legs.png diff --git a/Items/Accessories/Wings/ProfanedSoulTransWingsNight.png b/Items/Accessories/ProfanedSoulTransNight_Wings.png similarity index 100% rename from Items/Accessories/Wings/ProfanedSoulTransWingsNight.png rename to Items/Accessories/ProfanedSoulTransNight_Wings.png diff --git a/Items/Accessories/ProfanedSoulTransBody.png b/Items/Accessories/ProfanedSoulTrans_Body.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransBody.png rename to Items/Accessories/ProfanedSoulTrans_Body.png diff --git a/Items/Accessories/ProfanedSoulTransHead.png b/Items/Accessories/ProfanedSoulTrans_Head.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransHead.png rename to Items/Accessories/ProfanedSoulTrans_Head.png diff --git a/Items/Accessories/ProfanedSoulTransLegs.png b/Items/Accessories/ProfanedSoulTrans_Legs.png similarity index 100% rename from Items/Accessories/ProfanedSoulTransLegs.png rename to Items/Accessories/ProfanedSoulTrans_Legs.png diff --git a/Items/Accessories/Wings/ProfanedSoulTransWings.png b/Items/Accessories/ProfanedSoulTrans_Wings.png similarity index 100% rename from Items/Accessories/Wings/ProfanedSoulTransWings.png rename to Items/Accessories/ProfanedSoulTrans_Wings.png diff --git a/Items/Accessories/Radiance.cs b/Items/Accessories/Radiance.cs index 5389af0bc6..ba2d8f31ff 100644 --- a/Items/Accessories/Radiance.cs +++ b/Items/Accessories/Radiance.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 18; Item.height = 44; - Item.defense = 8; + Item.defense = 5; Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); diff --git a/Items/Accessories/RampartofDeities.cs b/Items/Accessories/RampartofDeities.cs index 9e98211a44..091ecaaa0c 100644 --- a/Items/Accessories/RampartofDeities.cs +++ b/Items/Accessories/RampartofDeities.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories Item.width = 64; Item.height = 62; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; - Item.defense = 12; + Item.defense = 8; Item.accessory = true; Item.rare = ModContent.RarityType(); } diff --git a/Items/Accessories/Regenator.cs b/Items/Accessories/Regenerator.cs similarity index 85% rename from Items/Accessories/Regenator.cs rename to Items/Accessories/Regenerator.cs index f8bdcbf180..ea319a1373 100644 --- a/Items/Accessories/Regenator.cs +++ b/Items/Accessories/Regenerator.cs @@ -9,7 +9,8 @@ using System; namespace CalamityMod.Items.Accessories { - public class Regenator : ModItem, ILocalizedModType + [LegacyName("Regenator")] + public class Regenerator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; public override void SetDefaults() @@ -24,14 +25,14 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { CalamityPlayer modPlayer = player.Calamity(); - modPlayer.regenator = true; + modPlayer.regenerator = true; player.longInvince = true; // Gives better iframes because god help you if you end up getting hit twice } public override void ModifyTooltips(List list) { if (Main.LocalPlayer != null) - list.FindAndReplace("[DAMAGE]", (Main.LocalPlayer.Calamity().regenatorDamage).ToPercent()); + list.FindAndReplace("[DAMAGE]", (Main.LocalPlayer.Calamity().regeneratorDamage).ToPercent()); } } } diff --git a/Items/Accessories/Regenator.png b/Items/Accessories/Regenerator.png similarity index 100% rename from Items/Accessories/Regenator.png rename to Items/Accessories/Regenerator.png diff --git a/Items/Accessories/RottenDogtooth.cs b/Items/Accessories/RottenDogtooth.cs index 7dad00cdc3..d38dba206d 100644 --- a/Items/Accessories/RottenDogtooth.cs +++ b/Items/Accessories/RottenDogtooth.cs @@ -8,7 +8,6 @@ namespace CalamityMod.Items.Accessories { public new string LocalizationCategory => "Items.Accessories"; internal const int ArmorCrunchDebuffTime = 150; - internal const float StealthStrikeDamageMultiplier = 0.08f; public override void SetDefaults() { Item.width = 14; @@ -21,7 +20,6 @@ namespace CalamityMod.Items.Accessories public override void UpdateAccessory(Player player, bool hideVisual) { player.Calamity().rottenDogTooth = true; - player.Calamity().bonusStealthDamage += StealthStrikeDamageMultiplier; } } } diff --git a/Items/Accessories/RoverDrive.cs b/Items/Accessories/RoverDrive.cs index 1289b42d86..bc9c49a36c 100644 --- a/Items/Accessories/RoverDrive.cs +++ b/Items/Accessories/RoverDrive.cs @@ -27,9 +27,6 @@ namespace CalamityMod.Items.Accessories public static int ShieldDurabilityMax = 20; public static int ShieldRechargeTime = CalamityUtils.SecondsToFrames(10); - // While active, Rover Drive gives 10 defense - public static int ShieldDefenseBoost = 10; - // Interface stuff. public int OwnerPlayer { get; set; } public float RenderDepth => IDyeableShaderRenderer.RoverDriveDepth; @@ -78,9 +75,6 @@ namespace CalamityMod.Items.Accessories modPlayer.roverDrive = true; modPlayer.roverDriveShieldVisible = !hideVisual; - - if (modPlayer.RoverDriveShieldDurability > 0) - player.statDefense += ShieldDefenseBoost; } // In vanity, provides a visual shield but no actual functionality diff --git a/Items/Accessories/SandCloak.cs b/Items/Accessories/SandCloak.cs index d4188317bb..de7f1c2b4b 100644 --- a/Items/Accessories/SandCloak.cs +++ b/Items/Accessories/SandCloak.cs @@ -8,6 +8,9 @@ namespace CalamityMod.Items.Accessories public class SandCloak : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static int SandVeilDefenseBoost = 4; + public override void SetDefaults() { Item.width = 30; diff --git a/Items/Accessories/ShieldoftheHighRuler.cs b/Items/Accessories/ShieldoftheHighRuler.cs index e7e7fb50d7..1d7bc17922 100644 --- a/Items/Accessories/ShieldoftheHighRuler.cs +++ b/Items/Accessories/ShieldoftheHighRuler.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories Item.value = CalamityGlobalItem.RarityYellowBuyPrice; Item.rare = ItemRarityID.Yellow; Item.Calamity().donorItem = true; - Item.defense = 6; + Item.defense = 4; Item.accessory = true; } diff --git a/Items/Accessories/ShieldoftheOcean.cs b/Items/Accessories/ShieldoftheOcean.cs index cacb484ead..798f0c4020 100644 --- a/Items/Accessories/ShieldoftheOcean.cs +++ b/Items/Accessories/ShieldoftheOcean.cs @@ -73,8 +73,10 @@ namespace CalamityMod.Items.Accessories continue; // Inflict Riptide on empowered parries. + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds if (empowered) - npc.AddBuff(ModContent.BuffType(), 300); + npc.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); // If the NPC can be moved, violently shove them away. Make them susceptible to fall damage on empowered parries. // Otherwise, simply deal a large amount of damage to them if empowered. diff --git a/Items/Accessories/SigilofCalamitas.cs b/Items/Accessories/SigilofCalamitas.cs index eb3ff6f32b..94c5dd7487 100644 --- a/Items/Accessories/SigilofCalamitas.cs +++ b/Items/Accessories/SigilofCalamitas.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Accessories player.manaMagnet = true; player.statManaMax2 += 100; player.GetDamage() += 0.15f; - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; } public override void AddRecipes() diff --git a/Items/Accessories/SpiritGlyph.cs b/Items/Accessories/SpiritGlyph.cs index 2d1d84ad2f..4c5bd25543 100644 --- a/Items/Accessories/SpiritGlyph.cs +++ b/Items/Accessories/SpiritGlyph.cs @@ -11,8 +11,7 @@ namespace CalamityMod.Items.Accessories public new string LocalizationCategory => "Items.Accessories"; public static int RegenBoost = 2; - public static int DefenseBoost = 6; - public static float DamageReductionBoost = 0.03f; + public static int DefenseBoost = 4; public static float SummonDamageBoost = 0.1f; public override void SetDefaults() diff --git a/Items/Accessories/StatMeter.cs b/Items/Accessories/StatMeter.cs index 931dd0c47e..10edb5b418 100644 --- a/Items/Accessories/StatMeter.cs +++ b/Items/Accessories/StatMeter.cs @@ -223,7 +223,6 @@ namespace CalamityMod.Items.Accessories // Detailed Abyss stats only render if the player is in the Abyss. string stats4 = "\n" + (!modPlayer.ZoneAbyss ? this.GetLocalizedValue("AbyssStatsHidden") : this.GetLocalization("AbyssStats").Format( player.GetCurrentAbyssLightLevel(), - TwoPlaces(modPlayer.abyssBreathLossStat), TwoPlaces(modPlayer.abyssBreathLossRateStat), modPlayer.abyssLifeLostAtZeroBreathStat, modPlayer.abyssDefenseLossStat)); diff --git a/Items/Accessories/TheAbsorber.cs b/Items/Accessories/TheAbsorber.cs index 2b2e35e978..a054aba516 100644 --- a/Items/Accessories/TheAbsorber.cs +++ b/Items/Accessories/TheAbsorber.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 24; - Item.defense = 10; + Item.defense = 6; Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; Item.accessory = true; diff --git a/Items/Accessories/TheSponge.cs b/Items/Accessories/TheSponge.cs index 92895e1f74..6c1c3ee7e9 100644 --- a/Items/Accessories/TheSponge.cs +++ b/Items/Accessories/TheSponge.cs @@ -32,12 +32,11 @@ namespace CalamityMod.Items.Accessories public static readonly SoundStyle ActivationSound = new("CalamityMod/Sounds/Custom/RoverDriveActivate") { Volume = 0.85f }; public static readonly SoundStyle BreakSound = new("CalamityMod/Sounds/Custom/RoverDriveBreak") { Volume = 0.75f }; - public static int ShieldDurabilityMax = 180; + public static int ShieldDurabilityMax = 120; public static int ShieldRechargeDelay = CalamityUtils.SecondsToFrames(8); // Was 6, then was 9 public static int TotalShieldRechargeTime = CalamityUtils.SecondsToFrames(10); // Was 6 - // While active, The Sponge gives 20 defense and 10% DR - public static int ShieldActiveDefense = 20; + // While active, The Sponge gives 10% DR public static float ShieldActiveDamageReduction = 0.1f; public int OwnerPlayer { get; set; } @@ -91,10 +90,7 @@ namespace CalamityMod.Items.Accessories modPlayer.spongeShieldVisible = !hideVisual; if (modPlayer.SpongeShieldDurability > 0) - { - player.statDefense += ShieldActiveDefense; player.endurance += ShieldActiveDamageReduction; - } } // In vanity, provides a visual shield but no actual functionality diff --git a/Items/Accessories/VampiricTalisman.cs b/Items/Accessories/VampiricTalisman.cs index d5d2f6e118..eb0800a9db 100644 --- a/Items/Accessories/VampiricTalisman.cs +++ b/Items/Accessories/VampiricTalisman.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Items.Accessories { internal const int ArmorCrunchDebuffTime = 150; internal const int HeavyBleedingDebuffTime = 300; - internal const float StealthStrikeDamageMultiplier = 0.08f; public const float RaiderBonus = 15f; public bool ShowExtensionIndicator => false; @@ -36,7 +35,6 @@ namespace CalamityMod.Items.Accessories modPlayer.vampiricTalisman = true; modPlayer.raiderTalisman = true; modPlayer.rottenDogTooth = true; - player.Calamity().bonusStealthDamage += StealthStrikeDamageMultiplier; //get fixed boi funny if (Main.zenithWorld) diff --git a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs index ae04d03443..abcdf74751 100644 --- a/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs +++ b/Items/Accessories/Vanity/AbandonedWulfrumHelmet.cs @@ -1,8 +1,6 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; using Terraria; using Terraria.Audio; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -20,35 +18,19 @@ namespace CalamityMod.Items.Accessories.Vanity [LegacyName("WulfrumHeadMelee")] [LegacyName("WulfrumHood")] [LegacyName("WulfrumHeadMagic")] - public class AbandonedWulfrumHelmet : ModItem, ILocalizedModType + public class AbandonedWulfrumHelmet : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_HeadSet", EquipType.Head, name: "WulfrumOldSetHead"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/AbandonedWulfrumHelmet_Legs", EquipType.Legs, this); - } - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "AbandonedWulfrumHelmetTrans", "WulfrumOldSetHead"), + (EquipType.Body, "AbandonedWulfrumHelmet", null), + (EquipType.Legs, "AbandonedWulfrumHelmet", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; + public override bool ShouldHideAccessories => true; - public override void SetStaticDefaults() - { - - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, "WulfrumOldSetHead", EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (SoundStyle sound, int delay)? HurtSound(Player p) => (SoundID.NPCHit4, 10); public override void SetDefaults() { @@ -62,7 +44,6 @@ namespace CalamityMod.Items.Accessories.Vanity public override void UpdateVanity(Player player) { - player.GetModPlayer().transformationActive = true; player.GetModPlayer().vanityEquipped = true; } @@ -70,7 +51,6 @@ namespace CalamityMod.Items.Accessories.Vanity { if (!hideVisual) { - player.GetModPlayer().transformationActive = true; player.GetModPlayer().vanityEquipped = true; } } @@ -79,53 +59,10 @@ namespace CalamityMod.Items.Accessories.Vanity public class WulfrumTransformationPlayer : ModPlayer { public bool vanityEquipped = false; - public bool transformationActive = false; - public bool forceHelmetOn = false; public override void ResetEffects() { vanityEquipped = false; - transformationActive = false; - forceHelmetOn = false; - } - - public override void FrameEffects() - { - if (forceHelmetOn || transformationActive) - { - Player.head = EquipLoader.GetEquipSlot(Mod, "WulfrumOldSetHead", EquipType.Head); - Player.face = -1; - } - - if (transformationActive) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Body); - - Player.HideAccessories(); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (forceHelmetOn || transformationActive) - { - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "WulfrumOldSetHead", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - drawInfo.drawPlayer.face = -1; - } - - if (transformationActive) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "AbandonedWulfrumHelmet", EquipType.Body); - drawInfo.bodyGlowMask = -1; - - drawInfo.drawPlayer.HideAccessories(); - } } } } diff --git a/Items/Accessories/Vanity/AbandonedWulfrumHelmet_HeadSet.png b/Items/Accessories/Vanity/AbandonedWulfrumHelmetTrans_Head.png similarity index 100% rename from Items/Accessories/Vanity/AbandonedWulfrumHelmet_HeadSet.png rename to Items/Accessories/Vanity/AbandonedWulfrumHelmetTrans_Head.png diff --git a/Items/Accessories/Vanity/GhostBracelet.cs b/Items/Accessories/Vanity/GhostBracelet.cs index 18bb48b9c6..d1b42b67f9 100644 --- a/Items/Accessories/Vanity/GhostBracelet.cs +++ b/Items/Accessories/Vanity/GhostBracelet.cs @@ -1,38 +1,20 @@ -using Terraria; +using CalamityMod.Items.BaseItems; +using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { [LegacyName("RedBow")] - public class GhostBracelet : ModItem, ILocalizedModType + public class GhostBracelet : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Dandy_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Dandy", null), + (EquipType.Body, "Dandy", null), + (EquipType.Legs, "Dandy", null), + ]; public override void SetDefaults() { @@ -45,19 +27,6 @@ namespace CalamityMod.Items.Accessories.Vanity Item.Calamity().devItem = true; } - public override void UpdateVanity(Player player) - { - player.Calamity().ghostBracelet = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.Calamity().ghostBracelet = true; - } - } - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Accessories/Vanity/GoldenBomb.cs b/Items/Accessories/Vanity/GoldenBomb.cs index dca2e3d2a2..8bf02da708 100644 --- a/Items/Accessories/Vanity/GoldenBomb.cs +++ b/Items/Accessories/Vanity/GoldenBomb.cs @@ -1,39 +1,19 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; using Terraria; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class GoldenBomb : ModItem, ILocalizedModType + public class GoldenBomb : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mihaii_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mihaii_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mihaii_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Mihaii", null), + (EquipType.Body, "Mihaii", null), + (EquipType.Legs, "Mihaii", null), + ]; public override void SetDefaults() { @@ -45,53 +25,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.vanity = true; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class GoldenBombPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Head); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "GoldenBomb", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/HapuFruit.cs b/Items/Accessories/Vanity/HapuFruit.cs index 0461d330f8..97163ad111 100644 --- a/Items/Accessories/Vanity/HapuFruit.cs +++ b/Items/Accessories/Vanity/HapuFruit.cs @@ -1,43 +1,20 @@ -using CalamityMod.CalPlayer; -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; using Terraria; -using Terraria.Audio; -using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class HapuFruit : ModItem, ILocalizedModType + public class HapuFruit : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Legs", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Heart_Back", EquipType.Back, this); - } - } - - public override void SetStaticDefaults() - { - - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Heart", null), + (EquipType.Body, "Heart", null), + (EquipType.Legs, "Heart", null), + (EquipType.Back, "Heart", null) + ]; public override void SetDefaults() { @@ -49,56 +26,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.vanity = true; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class HapuFruitPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.back = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Back); - Player.legs = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Head); - - //Player.HideAccessories(); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.back = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Back); - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Body); - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "HapuFruit", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/LucisSight.cs b/Items/Accessories/Vanity/LucisSight.cs new file mode 100644 index 0000000000..df711e8b14 --- /dev/null +++ b/Items/Accessories/Vanity/LucisSight.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.BaseItems; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Accessories.Vanity +{ + public class LucisSight : TransformationAccessory, ILocalizedModType + { + public new string LocalizationCategory => "Items.Accessories"; + + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Face, "LucisSight", null), + ]; + + public override void SetDefaults() + { + Item.width = 28; + Item.height = 18; + Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker + Item.rare = ItemRarityID.Pink; + Item.accessory = true; + Item.vanity = true; + Item.Calamity().donorItem = true; + } + } +} diff --git a/Items/Accessories/Vanity/LucisSight.png b/Items/Accessories/Vanity/LucisSight.png new file mode 100644 index 0000000000..47aa49c9a1 Binary files /dev/null and b/Items/Accessories/Vanity/LucisSight.png differ diff --git a/Items/Accessories/Vanity/LucisSight_Face.png b/Items/Accessories/Vanity/LucisSight_Face.png new file mode 100644 index 0000000000..b56c28cf6e Binary files /dev/null and b/Items/Accessories/Vanity/LucisSight_Face.png differ diff --git a/Items/Accessories/Vanity/OracleHeadphones.cs b/Items/Accessories/Vanity/OracleHeadphones.cs index eb87fecceb..b75989ac4e 100644 --- a/Items/Accessories/Vanity/OracleHeadphones.cs +++ b/Items/Accessories/Vanity/OracleHeadphones.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -6,36 +7,16 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class OracleHeadphones : ModItem, ILocalizedModType + public class OracleHeadphones : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Legs", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Mishiro_Back", EquipType.Back, this); - } - } - - public override void SetStaticDefaults() - { - - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Mishiro", null), + (EquipType.Body, "Mishiro", null), + (EquipType.Legs, "Mishiro", null), + (EquipType.Back, "Mishiro", null) + ]; public override void SetDefaults() { @@ -47,57 +28,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.vanity = true; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class OracleHeadphonesPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.back = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Back); - Player.legs = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Head); - - //Player.HideAccessories(); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.back = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Back); - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "OracleHeadphones", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/Popo.cs b/Items/Accessories/Vanity/Popo.cs index 66fe6d0f3c..54b35ec96a 100644 --- a/Items/Accessories/Vanity/Popo.cs +++ b/Items/Accessories/Vanity/Popo.cs @@ -1,36 +1,22 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class Popo : ModItem, ILocalizedModType + public class Popo : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/PopoNoseless_Head", EquipType.Head, name: "PopoNoseless"); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Popo_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Popo", null), + (EquipType.Head, "PopoNoseless", "PopoNoseless"), + (EquipType.Body, "Popo", null), + (EquipType.Legs, "Popo", null), + (EquipType.Face, null, null), //results in setting this equip slot to -1 + ]; public override void SetDefaults() { @@ -42,20 +28,14 @@ namespace CalamityMod.Items.Accessories.Vanity Item.Calamity().devItem = true; } - public override void UpdateVanity(Player player) + public override bool CustomSetEquipType(Player player, EquipType type, Mod mod, string name) { - player.Calamity().snowmanHide = false; - player.Calamity().snowmanForce = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - CalamityPlayer modPlayer = player.Calamity(); - modPlayer.snowman = true; - if (hideVisual) + if (type == EquipType.Head) { - modPlayer.snowmanHide = true; + player.head = EquipLoader.GetEquipSlot(Mod, player.Calamity().snowmanNoseless ? "PopoNoseless" : "Popo", EquipType.Head); + return true; } + return false; } } } diff --git a/Items/Accessories/Vanity/PunchCard.cs b/Items/Accessories/Vanity/PunchCard.cs index 40ac2b7d48..23840ecacf 100644 --- a/Items/Accessories/Vanity/PunchCard.cs +++ b/Items/Accessories/Vanity/PunchCard.cs @@ -1,38 +1,20 @@ -using CalamityMod.UI; +using CalamityMod.Items.BaseItems; +using CalamityMod.UI; using Terraria; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class PunchCard : ModItem, ILocalizedModType + public class PunchCard : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shayy_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Shayy", null), + (EquipType.Body, "Shayy", null), + (EquipType.Legs, "Shayy", null), + ]; public override void SetDefaults() { @@ -53,18 +35,5 @@ namespace CalamityMod.Items.Accessories.Vanity PopupGUIManager.FlipActivityOfGUIWithType(typeof(PunchCardGUI)); return true; } - - public override void UpdateVanity(Player player) - { - player.Calamity().punchCard = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.Calamity().punchCard = true; - } - } } } diff --git a/Items/Accessories/Vanity/SharkyPlush.cs b/Items/Accessories/Vanity/SharkyPlush.cs index 521c319e7a..0edbbc3b6f 100644 --- a/Items/Accessories/Vanity/SharkyPlush.cs +++ b/Items/Accessories/Vanity/SharkyPlush.cs @@ -1,42 +1,20 @@ -using Microsoft.Xna.Framework; -using System; +using CalamityMod.Items.BaseItems; using Terraria; -using Terraria.DataStructures; -using Terraria.Graphics.Renderers; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class SharkyPlush : ModItem, ILocalizedModType + public class SharkyPlush : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shark_Head", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shark_Body", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Shark_Legs", EquipType.Legs, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Shark", null), + (EquipType.Body, "Shark", null), + (EquipType.Legs, "Shark", null), + ]; public override void SetDefaults() { @@ -48,53 +26,5 @@ namespace CalamityMod.Items.Accessories.Vanity Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.Calamity().devItem = true; } - - public override void UpdateVanity(Player player) - { - player.GetModPlayer().vanityEquipped = true; - } - - public override void UpdateAccessory(Player player, bool hideVisual) - { - if (!hideVisual) - { - player.GetModPlayer().vanityEquipped = true; - } - } - } - - public class SharkyPlushPlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Head); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "SharkyPlush", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } } } diff --git a/Items/Accessories/Vanity/Xyk_Body2.png b/Items/Accessories/Vanity/Xyk2_Body.png similarity index 100% rename from Items/Accessories/Vanity/Xyk_Body2.png rename to Items/Accessories/Vanity/Xyk2_Body.png diff --git a/Items/Accessories/Vanity/Xyk_Head2.png b/Items/Accessories/Vanity/Xyk2_Head.png similarity index 100% rename from Items/Accessories/Vanity/Xyk_Head2.png rename to Items/Accessories/Vanity/Xyk2_Head.png diff --git a/Items/Accessories/Vanity/Xyk_Legs2.png b/Items/Accessories/Vanity/Xyk2_Legs.png similarity index 100% rename from Items/Accessories/Vanity/Xyk_Legs2.png rename to Items/Accessories/Vanity/Xyk2_Legs.png diff --git a/Items/Accessories/Vanity/XyksBlessingBlue.cs b/Items/Accessories/Vanity/XyksBlessingBlue.cs index 7df7a6b928..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,57 +9,35 @@ 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() { Item.width = 36; Item.height = 34; Item.accessory = true; - Item.consumable = true; Item.vanity = true; Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.Calamity().devItem = true; } public override bool CanRightClick() => true; - - public override void ModifyItemLoot(ItemLoot itemLoot) + public override void RightClick(Player player) { - itemLoot.Add(ModContent.ItemType()); + player.PutItemInInventoryFromItemUsage(ModContent.ItemType(), 1); } public override void UpdateVanity(Player player) { - player.GetModPlayer().vanityEquipped = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.XykVisualsBlue = true; } @@ -67,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 29f2d69f89..3afa978e68 100644 --- a/Items/Accessories/Vanity/XyksBlessingOrange.cs +++ b/Items/Accessories/Vanity/XyksBlessingOrange.cs @@ -1,64 +1,42 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.BaseItems; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; -using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Items.Accessories.Vanity { - public class XyksBlessingOrange : ModItem, ILocalizedModType + public class XyksBlessingOrange : TransformationAccessory, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; - public override void Load() - { - if (!Main.dedServ) - { - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Head2", EquipType.Head, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Body2", EquipType.Body, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Accessories/Vanity/Xyk_Legs2", EquipType.Legs, this); - EquipLoader.AddEquipTexture(Mod, "CalamityMod/Projectiles/InvisibleProj", EquipType.Wings, this); - } - } - - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - - int equipSlotHead = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Head); - ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = true; - - int equipSlotBody = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Body); - ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = false; - ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; - - int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, Name, EquipType.Legs); - ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; - } + public override (EquipType, string, string)[] EquipSlots => + [ + (EquipType.Head, "Xyk2", null), + (EquipType.Body, "Xyk2", null), + (EquipType.Legs, "Xyk2", null), + (EquipType.Wings, null, null), //results in setting this equip slot to -1 + ]; public override void SetDefaults() { Item.width = 36; Item.height = 34; Item.accessory = true; - Item.consumable = true; Item.vanity = true; Item.rare = ModContent.RarityType(); Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.Calamity().devItem = true; } public override bool CanRightClick() => true; - - public override void ModifyItemLoot(ItemLoot itemLoot) + public override void RightClick(Player player) { - itemLoot.Add(ModContent.ItemType()); + player.PutItemInInventoryFromItemUsage(ModContent.ItemType(), 1); } public override void UpdateVanity(Player player) { - player.GetModPlayer().vanityEquipped = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.XykVisualsOrange = true; } @@ -67,46 +45,9 @@ namespace CalamityMod.Items.Accessories.Vanity { if (!hideVisual) { - player.GetModPlayer().vanityEquipped = true; CalamityPlayer modPlayer = player.Calamity(); modPlayer.XykVisualsOrange = true; } } } - - public class XyksBlessingOrangePlayer : ModPlayer - { - public bool vanityEquipped = false; - - public override void ResetEffects() - { - vanityEquipped = false; - } - - public override void FrameEffects() - { - if (vanityEquipped) - { - Player.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Legs); - Player.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Body); - Player.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Head); - Player.wings = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Wings); - } - } - - public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) - { - if (vanityEquipped) - { - drawInfo.drawPlayer.legs = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Legs); - drawInfo.legsGlowMask = -1; - drawInfo.legsOffset = Vector2.Zero; - drawInfo.drawPlayer.body = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Body); - drawInfo.bodyGlowMask = -1; - drawInfo.drawPlayer.head = EquipLoader.GetEquipSlot(Mod, "XyksBlessingOrange", EquipType.Head); - drawInfo.headGlowMask = -1; - drawInfo.helmetOffset = Vector2.Zero; - } - } - } } diff --git a/Items/Accessories/WarbanneroftheRighteous.cs b/Items/Accessories/WarbanneroftheRighteous.cs index cd6a16258e..04e2b9b36d 100644 --- a/Items/Accessories/WarbanneroftheRighteous.cs +++ b/Items/Accessories/WarbanneroftheRighteous.cs @@ -82,7 +82,7 @@ namespace CalamityMod.Items.Accessories float generousHitboxWidth = Math.Max(nPC.Hitbox.Width / 2f, nPC.Hitbox.Height / 2f) + 100; // Adds some room so max bonus isnt when you're ON the hitbox float intensity = Utils.Remap(Utils.Distance(player.Center, nPC.Center), MaxDistance + generousHitboxWidth, generousHitboxWidth, 1, 3, true); // We have to have this seperate from bonus, otherwise all effected enemies take damage based on the closest enemy - if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType()) && nPC.CanBeChasedBy()) + if (Utils.Distance(nPC.Center, player.Center) < MaxDistance + generousHitboxWidth && (nPC.IsAnEnemy(true, true, false) || nPC.type == ModContent.NPCType()) && !nPC.dontTakeDamage) { float minDamageMult = 0.35f; int maxTargets = 25; diff --git a/Items/Accessories/Wings/BaseWings.cs b/Items/Accessories/Wings/BaseWings.cs index 7637d61087..f7417150bb 100644 --- a/Items/Accessories/Wings/BaseWings.cs +++ b/Items/Accessories/Wings/BaseWings.cs @@ -2,7 +2,6 @@ using System.Linq; using System.Text; using CalamityMod.Balancing; -using Microsoft.Xna.Framework.Input; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -80,7 +79,7 @@ namespace CalamityMod.Items.Accessories.Wings sb.Append('\n'); sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (MaxAscentSpeed * baseJumpSpeed).ToMph())); sb.Append('\n'); - if (Main.keyState.IsKeyDown(Keys.LeftShift)) + if (Main.keyState.PressingShift()) { sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), BaseAscent.ToMphps(), (BaseAscent + BonusAscentWhileRising).ToMphps(), (RisingSpeedThreshold * baseJumpSpeed).ToMph(), diff --git a/Items/Accessories/WulfrumAcrobaticsPack.cs b/Items/Accessories/WulfrumAcrobaticsPack.cs index aab707da5b..1f6d1892c3 100644 --- a/Items/Accessories/WulfrumAcrobaticsPack.cs +++ b/Items/Accessories/WulfrumAcrobaticsPack.cs @@ -624,7 +624,7 @@ namespace CalamityMod.Items.Accessories SoundEngine.PlaySound(WulfrumAcrobaticsPack.ReleaseSound, p.Center); p.Kill(); - + Player.grapCount = 0; } } diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index 7f541ea531..2d0096cb73 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Accessories { Item.width = 20; Item.height = 22; - Item.defense = 15; // Why did this give 30 defense? This thing really needs a rework lol + Item.defense = 12; // Why did this give 30 defense? This thing really needs a rework lol Item.accessory = true; Item.value = CalamityGlobalItem.RarityVioletBuyPrice; Item.rare = ModContent.RarityType(); diff --git a/Items/Ammo/SproutingArrow.cs b/Items/Ammo/SproutingArrow.cs index d8006c98eb..5b6cf0d8c0 100644 --- a/Items/Ammo/SproutingArrow.cs +++ b/Items/Ammo/SproutingArrow.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Ammo { Item.width = 22; Item.height = 36; - Item.damage = 15; + Item.damage = 14; Item.DamageType = DamageClass.Ranged; Item.maxStack = Item.CommonMaxStack; Item.consumable = true; diff --git a/Items/Armor/Aerospec/AerospecBreastplate.cs b/Items/Armor/Aerospec/AerospecBreastplate.cs index c4601b3ca1..acd1344852 100644 --- a/Items/Armor/Aerospec/AerospecBreastplate.cs +++ b/Items/Armor/Aerospec/AerospecBreastplate.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -11,6 +12,15 @@ namespace CalamityMod.Items.Armor.Aerospec public new string LocalizationCategory => "Items.Armor.PreHardmode"; internal static string FeatherEntitySourceContext => "SetBonus_Calamity_Aerospec"; + public static float DamageBoost = 0.03f; + public static int CritBoost = 3; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); + + // Common Set Bonus + public static int SetBonusHurtDamageThreshold = 25; + public static int SetBonusFeatherDamage = 30; + public static float SetBonusFallSpeed = 15f; + public override void SetDefaults() { Item.width = 18; @@ -22,8 +32,8 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateEquip(Player player) { - player.GetDamage() += 0.03f; - player.GetCritChance() += 3; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Aerospec/AerospecHat.cs b/Items/Armor/Aerospec/AerospecHeadMagic.cs similarity index 56% rename from Items/Armor/Aerospec/AerospecHat.cs rename to Items/Armor/Aerospec/AerospecHeadMagic.cs index 5b81c6206c..3c66e85984 100644 --- a/Items/Armor/Aerospec/AerospecHat.cs +++ b/Items/Armor/Aerospec/AerospecHeadMagic.cs @@ -2,14 +2,26 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec { [AutoloadEquip(EquipType.Head)] - public class AerospecHat : ModItem, ILocalizedModType + [LegacyName("AerospecHat")] + public class AerospecHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int MaxManaBoost = 30; + public static float MagicDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, MagicDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusManaCostReduction = 0.08f; + public static float SetBonusMoveSpeedBoost = 0.05f; + public static int SetBonusMagicCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal + public override void SetDefaults() { Item.width = 18; @@ -31,19 +43,20 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusManaCostReduction.ToPercent(), SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.manaCost -= 0.08f; - player.GetCritChance() += 5; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.manaCost -= SetBonusManaCostReduction; + player.GetCritChance() += SetBonusMagicCritBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.statManaMax2 += 30; + player.GetDamage() += MagicDamageBoost; + player.statManaMax2 += MaxManaBoost; } public override void AddRecipes() diff --git a/Items/Armor/Aerospec/AerospecHat.png b/Items/Armor/Aerospec/AerospecHeadMagic.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHat.png rename to Items/Armor/Aerospec/AerospecHeadMagic.png diff --git a/Items/Armor/Aerospec/AerospecHat_Head.png b/Items/Armor/Aerospec/AerospecHeadMagic_Head.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHat_Head.png rename to Items/Armor/Aerospec/AerospecHeadMagic_Head.png diff --git a/Items/Armor/Aerospec/AerospecHelm.cs b/Items/Armor/Aerospec/AerospecHeadMelee.cs similarity index 57% rename from Items/Armor/Aerospec/AerospecHelm.cs rename to Items/Armor/Aerospec/AerospecHeadMelee.cs index 0a8e39c35d..070471a1d6 100644 --- a/Items/Armor/Aerospec/AerospecHelm.cs +++ b/Items/Armor/Aerospec/AerospecHeadMelee.cs @@ -2,14 +2,25 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec { [AutoloadEquip(EquipType.Head)] - public class AerospecHelm : ModItem, ILocalizedModType + [LegacyName("AerospecHelm")] + public class AerospecHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MeleeDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusMoveSpeedBoost = 0.05f; + public static int SetBonusMeleeCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal + public static int SetBonusAggroBoost = 300; + public override void SetDefaults() { Item.width = 18; @@ -31,19 +42,17 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.GetCritChance() += 5; - player.aggro += 300; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.GetCritChance() += SetBonusMeleeCritBoost; + player.aggro += SetBonusAggroBoost; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += MeleeDamageBoost; public override void AddRecipes() { @@ -52,7 +61,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). - SortBeforeFirstRecipesOf(ModContent.ItemType()). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHelm.png b/Items/Armor/Aerospec/AerospecHeadMelee.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHelm.png rename to Items/Armor/Aerospec/AerospecHeadMelee.png diff --git a/Items/Armor/Aerospec/AerospecHelm_Head.png b/Items/Armor/Aerospec/AerospecHeadMelee_Head.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHelm_Head.png rename to Items/Armor/Aerospec/AerospecHeadMelee_Head.png diff --git a/Items/Armor/Aerospec/AerospecHood.cs b/Items/Armor/Aerospec/AerospecHeadRanged.cs similarity index 59% rename from Items/Armor/Aerospec/AerospecHood.cs rename to Items/Armor/Aerospec/AerospecHeadRanged.cs index 6b41319026..7953422862 100644 --- a/Items/Armor/Aerospec/AerospecHood.cs +++ b/Items/Armor/Aerospec/AerospecHeadRanged.cs @@ -2,14 +2,24 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec { [AutoloadEquip(EquipType.Head)] - public class AerospecHood : ModItem, ILocalizedModType + [LegacyName("AerospecHood")] + public class AerospecHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RangedDamageBoost = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent()); + + // Set Bonus + public static float SetBonusMoveSpeedBoost = 0.05f; + public static int SetBonusRangedCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal + public override void SetDefaults() { Item.width = 18; @@ -31,18 +41,16 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.GetCritChance() += 5; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.GetCritChance() += SetBonusRangedCritBoost; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RangedDamageBoost; public override void AddRecipes() { @@ -51,7 +59,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). - SortAfterFirstRecipesOf(ModContent.ItemType()). + SortAfterFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHood.png b/Items/Armor/Aerospec/AerospecHeadRanged.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHood.png rename to Items/Armor/Aerospec/AerospecHeadRanged.png diff --git a/Items/Armor/Aerospec/AerospecHood_Head.png b/Items/Armor/Aerospec/AerospecHeadRanged_Head.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHood_Head.png rename to Items/Armor/Aerospec/AerospecHeadRanged_Head.png diff --git a/Items/Armor/Aerospec/AerospecHeadgear.cs b/Items/Armor/Aerospec/AerospecHeadRogue.cs similarity index 58% rename from Items/Armor/Aerospec/AerospecHeadgear.cs rename to Items/Armor/Aerospec/AerospecHeadRogue.cs index e4e6d096d3..5ada7136eb 100644 --- a/Items/Armor/Aerospec/AerospecHeadgear.cs +++ b/Items/Armor/Aerospec/AerospecHeadRogue.cs @@ -2,14 +2,26 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec { [AutoloadEquip(EquipType.Head)] - public class AerospecHeadgear : ModItem, ILocalizedModType + [LegacyName("AerospecHeadgear")] + public class AerospecHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.1f; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 0.8f; + public static float SetBonusMoveSpeedBoost = 0.05f; + public static int SetBonusRogueCritBoost = 5; // NOTE: Tooltip shares this number with move speed % as they're equal + public override void SetStaticDefaults() { if (!Main.dedServ) @@ -37,20 +49,21 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusMoveSpeedBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.aeroSet = true; - modPlayer.rogueStealthMax += 0.8f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; player.noFallDmg = true; - player.moveSpeed += 0.05f; - player.GetCritChance() += 5; + player.moveSpeed += SetBonusMoveSpeedBoost; + player.GetCritChance() += SetBonusRogueCritBoost; player.Calamity().wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() @@ -60,7 +73,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). - SortAfterFirstRecipesOf(ModContent.ItemType()). + SortAfterFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHeadgear.png b/Items/Armor/Aerospec/AerospecHeadRogue.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHeadgear.png rename to Items/Armor/Aerospec/AerospecHeadRogue.png diff --git a/Items/Armor/Aerospec/AerospecHeadgear_Head.png b/Items/Armor/Aerospec/AerospecHeadRogue_Head.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHeadgear_Head.png rename to Items/Armor/Aerospec/AerospecHeadRogue_Head.png diff --git a/Items/Armor/Aerospec/AerospecHelmet.cs b/Items/Armor/Aerospec/AerospecHeadSummon.cs similarity index 71% rename from Items/Armor/Aerospec/AerospecHelmet.cs rename to Items/Armor/Aerospec/AerospecHeadSummon.cs index 2ab7b3fd09..5543fb9945 100644 --- a/Items/Armor/Aerospec/AerospecHelmet.cs +++ b/Items/Armor/Aerospec/AerospecHeadSummon.cs @@ -5,14 +5,24 @@ using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Summon; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec { [AutoloadEquip(EquipType.Head)] - public class AerospecHelmet : ModItem, ILocalizedModType + [LegacyName("AerospecHelmet")] + public class AerospecHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float SummonDamageBoost = 0.1f; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.11f; public static int ValkyrieDamage = 20; public override void SetDefaults() @@ -36,7 +46,8 @@ namespace CalamityMod.Items.Armor.Aerospec public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(AerospecBreastplate.SetBonusHurtDamageThreshold); var modPlayer = player.Calamity(); modPlayer.valkyrie = true; modPlayer.aeroSet = true; @@ -57,14 +68,14 @@ namespace CalamityMod.Items.Armor.Aerospec Main.projectile[p].originalDamage = ValkyrieDamage; } } - player.GetDamage() += 0.11f; - player.maxMinions++; + player.GetDamage() += SetBonusSummonDamageBoost; + player.maxMinions += SetBonusMinionSlotBoost; } public override void UpdateEquip(Player player) { - player.moveSpeed += 0.05f; - player.GetDamage() += 0.1f; + player.moveSpeed += MoveSpeedBoost; + player.GetDamage() += SummonDamageBoost; } public override void AddRecipes() @@ -74,7 +85,7 @@ namespace CalamityMod.Items.Armor.Aerospec AddIngredient(ItemID.SunplateBlock, 3). AddIngredient(ItemID.Feather). AddTile(TileID.Anvils). - SortBeforeFirstRecipesOf(ModContent.ItemType()). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Aerospec/AerospecHelmet.png b/Items/Armor/Aerospec/AerospecHeadSummon.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHelmet.png rename to Items/Armor/Aerospec/AerospecHeadSummon.png diff --git a/Items/Armor/Aerospec/AerospecHelmet_Head.png b/Items/Armor/Aerospec/AerospecHeadSummon_Head.png similarity index 100% rename from Items/Armor/Aerospec/AerospecHelmet_Head.png rename to Items/Armor/Aerospec/AerospecHeadSummon_Head.png diff --git a/Items/Armor/Aerospec/AerospecLeggings.cs b/Items/Armor/Aerospec/AerospecLeggings.cs index e28d5c8641..f035355c2f 100644 --- a/Items/Armor/Aerospec/AerospecLeggings.cs +++ b/Items/Armor/Aerospec/AerospecLeggings.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Aerospec @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Armor.Aerospec public class AerospecLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MoveSpeedBoost = 0.12f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -18,10 +23,7 @@ namespace CalamityMod.Items.Armor.Aerospec Item.defense = 6; } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.12f; - } + public override void UpdateEquip(Player player) => player.moveSpeed += MoveSpeedBoost; public override void AddRecipes() { diff --git a/Items/Armor/Astral/AstralBreastplate.cs b/Items/Armor/Astral/AstralBreastplate.cs index 0efb6e01dc..90efeb9ebf 100644 --- a/Items/Armor/Astral/AstralBreastplate.cs +++ b/Items/Armor/Astral/AstralBreastplate.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Astral @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.Astral public class AstralBreastplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static int MaxManaBoost = 80; + public static float DamageBoost = 0.07f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, DamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -20,9 +26,8 @@ namespace CalamityMod.Items.Armor.Astral public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; - player.statManaMax2 += 80; - player.GetDamage() += 0.07f; + player.statManaMax2 += MaxManaBoost; + player.GetDamage() += DamageBoost; } public override void AddRecipes() diff --git a/Items/Armor/Astral/AstralHelm.cs b/Items/Armor/Astral/AstralHelm.cs index 35c40f89a9..0bb64452ac 100644 --- a/Items/Armor/Astral/AstralHelm.cs +++ b/Items/Armor/Astral/AstralHelm.cs @@ -2,6 +2,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Astral @@ -10,6 +11,18 @@ namespace CalamityMod.Items.Armor.Astral public class AstralHelm : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.05f; + public static int CritBoost = 10; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), CritBoost); + + // Set Bonus + public static int SetBonusMinionSlotBoost = 3; + public static float SetBonusDamageBoost = 0.1f; + public static int SetBonusCritBoost = 10; // NOTE: Tooltip shares this number with damage % as they're equal + public static int StarRainCooldown = CalamityUtils.SecondsToFrames(1); + public static int StarDamage = 120; + public override void SetDefaults() { Item.width = 18; @@ -31,20 +44,20 @@ namespace CalamityMod.Items.Armor.Astral public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusDamageBoost.ToPercent(), StarRainCooldown.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.astralStarRain = true; modPlayer.omniscience = true; - player.GetDamage() += 0.1f; - player.maxMinions += 3; - player.GetCritChance() += 10; + player.maxMinions += SetBonusMinionSlotBoost; + player.GetDamage() += SetBonusDamageBoost; + player.GetCritChance() += SetBonusCritBoost; player.Calamity().wearingRogueArmor = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; - player.GetCritChance() += 10; + player.GetDamage() += DamageBoost; + player.GetCritChance() += CritBoost; } public override void AddRecipes() diff --git a/Items/Armor/Astral/AstralLeggings.cs b/Items/Armor/Astral/AstralLeggings.cs index 3a717b7f0c..16c64551ce 100644 --- a/Items/Armor/Astral/AstralLeggings.cs +++ b/Items/Armor/Astral/AstralLeggings.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Astral @@ -9,6 +10,11 @@ namespace CalamityMod.Items.Armor.Astral public class AstralLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.Hardmode"; + + public static float DamageBoost = 0.05f; + public static float MoveSpeedBoost = 0.15f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent(), MoveSpeedBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -20,8 +26,8 @@ namespace CalamityMod.Items.Armor.Astral public override void UpdateEquip(Player player) { - player.moveSpeed += 0.15f; - player.GetDamage() += 0.05f; + player.GetDamage() += DamageBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() diff --git a/Items/Armor/Auric/AuricTeslaBodyArmor.cs b/Items/Armor/Auric/AuricTeslaBodyArmor.cs index f35231fbaf..cdc97de8ed 100644 --- a/Items/Armor/Auric/AuricTeslaBodyArmor.cs +++ b/Items/Armor/Auric/AuricTeslaBodyArmor.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Armor.Auric public override void UpdateEquip(Player player) { var modPlayer = player.Calamity(); - player.statLifeMax2 += 100; + player.statLifeMax2 += 50; player.GetDamage() += 0.08f; player.GetCritChance() += 5; } diff --git a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs b/Items/Armor/Auric/AuricTeslaHeadMagic.cs similarity index 95% rename from Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs rename to Items/Armor/Auric/AuricTeslaHeadMagic.cs index aa367ba49a..94f03805a8 100644 --- a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMagic.cs @@ -12,7 +12,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Auric { [AutoloadEquip(EquipType.Head)] - public class AuricTeslaWireHemmedVisage : ModItem, ILocalizedModType + [LegacyName("AuricTeslaWireHemmedVisage")] + public class AuricTeslaHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void SetDefaults() @@ -81,7 +82,7 @@ namespace CalamityMod.Items.Armor.Auric { var modPlayer = player.Calamity(); modPlayer.auricBoost = true; - player.manaCost *= 0.8f; + player.manaCost -= 0.2f; player.GetDamage() += 0.3f; player.GetCritChance() += 20; player.statManaMax2 += 100; @@ -95,7 +96,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). - SortBeforeFirstRecipesOf(ModContent.ItemType()). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaWireHemmedVisage.png b/Items/Armor/Auric/AuricTeslaHeadMagic.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaWireHemmedVisage.png rename to Items/Armor/Auric/AuricTeslaHeadMagic.png diff --git a/Items/Armor/Auric/AuricTeslaWireHemmedVisage_Head.png b/Items/Armor/Auric/AuricTeslaHeadMagic_Head.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaWireHemmedVisage_Head.png rename to Items/Armor/Auric/AuricTeslaHeadMagic_Head.png diff --git a/Items/Armor/Auric/AuricTeslaRoyalHelm.cs b/Items/Armor/Auric/AuricTeslaHeadMelee.cs similarity index 96% rename from Items/Armor/Auric/AuricTeslaRoyalHelm.cs rename to Items/Armor/Auric/AuricTeslaHeadMelee.cs index ce0b3e9aae..a77c7f55cf 100644 --- a/Items/Armor/Auric/AuricTeslaRoyalHelm.cs +++ b/Items/Armor/Auric/AuricTeslaHeadMelee.cs @@ -15,7 +15,8 @@ namespace CalamityMod.Items.Armor.Auric { [AutoloadEquip(EquipType.Head)] [LegacyName("AuricTeslaHelm")] - public class AuricTeslaRoyalHelm : ModItem, ILocalizedModType + [LegacyName("AuricTeslaRoyalHelm")] + public class AuricTeslaHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void SetDefaults() @@ -84,7 +85,7 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format(CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString())); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format(CalamityUtils.GetArmorSetBonusKey())); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } @@ -103,7 +104,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). - SortBeforeFirstRecipesOf(ModContent.ItemType()). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaRoyalHelm.png b/Items/Armor/Auric/AuricTeslaHeadMelee.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaRoyalHelm.png rename to Items/Armor/Auric/AuricTeslaHeadMelee.png diff --git a/Items/Armor/Auric/AuricTeslaRoyalHelm_Head.png b/Items/Armor/Auric/AuricTeslaHeadMelee_Head.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaRoyalHelm_Head.png rename to Items/Armor/Auric/AuricTeslaHeadMelee_Head.png diff --git a/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs b/Items/Armor/Auric/AuricTeslaHeadRanged.cs similarity index 94% rename from Items/Armor/Auric/AuricTeslaHoodedFacemask.cs rename to Items/Armor/Auric/AuricTeslaHeadRanged.cs index 061585b631..f143ce6580 100644 --- a/Items/Armor/Auric/AuricTeslaHoodedFacemask.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRanged.cs @@ -13,7 +13,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Auric { [AutoloadEquip(EquipType.Head)] - public class AuricTeslaHoodedFacemask : ModItem, ILocalizedModType + [LegacyName("AuricTeslaHoodedFacemask")] + public class AuricTeslaHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void SetDefaults() @@ -79,7 +80,7 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format(CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString()) : LocalizedText.Format()); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format(CalamityUtils.GetArmorSetBonusKey()) : LocalizedText.Format()); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } @@ -98,7 +99,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). - SortBeforeFirstRecipesOf(ModContent.ItemType()). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaHoodedFacemask.png b/Items/Armor/Auric/AuricTeslaHeadRanged.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaHoodedFacemask.png rename to Items/Armor/Auric/AuricTeslaHeadRanged.png diff --git a/Items/Armor/Auric/AuricTeslaHoodedFacemask_Head.png b/Items/Armor/Auric/AuricTeslaHeadRanged_Head.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaHoodedFacemask_Head.png rename to Items/Armor/Auric/AuricTeslaHeadRanged_Head.png diff --git a/Items/Armor/Auric/AuricTeslaPlumedHelm.cs b/Items/Armor/Auric/AuricTeslaHeadRogue.cs similarity index 96% rename from Items/Armor/Auric/AuricTeslaPlumedHelm.cs rename to Items/Armor/Auric/AuricTeslaHeadRogue.cs index e7bc207d37..78fe5227c7 100644 --- a/Items/Armor/Auric/AuricTeslaPlumedHelm.cs +++ b/Items/Armor/Auric/AuricTeslaHeadRogue.cs @@ -13,7 +13,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Auric { [AutoloadEquip(EquipType.Head)] - public class AuricTeslaPlumedHelm : ModItem, ILocalizedModType + [LegacyName("AuricTeslaPlumedHelm")] + public class AuricTeslaHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void SetDefaults() @@ -82,7 +83,7 @@ namespace CalamityMod.Items.Armor.Auric { Color[] armorColors = { AuricTeslaBodyArmor.tooltipTarragonColor, AuricTeslaBodyArmor.tooltipBloodflareColor, AuricTeslaBodyArmor.tooltipGodslayerColor }; var LocalizedText = CalamityUtils.GetTextFromModItem(Type, $"SetBonus{setBonusTooltipNumber}"); - line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format(CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString())); + line.Text = (setBonusTooltipNumber == 3 ? LocalizedText.Format(CalamityKeybinds.GodSlayerDashHotKey.TooltipHotkeyString(), GodslayerArmorDash.GodslayerCooldown) : setBonusTooltipNumber == 2 ? LocalizedText.Format() : LocalizedText.Format()); line.OverrideColor = armorColors[setBonusTooltipNumber - 1]; } } diff --git a/Items/Armor/Auric/AuricTeslaPlumedHelm.png b/Items/Armor/Auric/AuricTeslaHeadRogue.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaPlumedHelm.png rename to Items/Armor/Auric/AuricTeslaHeadRogue.png diff --git a/Items/Armor/Auric/AuricTeslaPlumedHelm_Head.png b/Items/Armor/Auric/AuricTeslaHeadRogue_Head.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaPlumedHelm_Head.png rename to Items/Armor/Auric/AuricTeslaHeadRogue_Head.png diff --git a/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs b/Items/Armor/Auric/AuricTeslaHeadSummon.cs similarity index 96% rename from Items/Armor/Auric/AuricTeslaSpaceHelmet.cs rename to Items/Armor/Auric/AuricTeslaHeadSummon.cs index b15fc1f6fd..44c56a3720 100644 --- a/Items/Armor/Auric/AuricTeslaSpaceHelmet.cs +++ b/Items/Armor/Auric/AuricTeslaHeadSummon.cs @@ -12,7 +12,8 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Auric { [AutoloadEquip(EquipType.Head)] - public class AuricTeslaSpaceHelmet : ModItem, ILocalizedModType + [LegacyName("AuricTeslaSpaceHelmet")] + public class AuricTeslaHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PostMoonLord"; public override void SetDefaults() @@ -95,7 +96,7 @@ namespace CalamityMod.Items.Armor.Auric AddIngredient(). AddIngredient(12). AddTile(). - SortBeforeFirstRecipesOf(ModContent.ItemType()). + SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } diff --git a/Items/Armor/Auric/AuricTeslaSpaceHelmet.png b/Items/Armor/Auric/AuricTeslaHeadSummon.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaSpaceHelmet.png rename to Items/Armor/Auric/AuricTeslaHeadSummon.png diff --git a/Items/Armor/Auric/AuricTeslaSpaceHelmet_Head.png b/Items/Armor/Auric/AuricTeslaHeadSummon_Head.png similarity index 100% rename from Items/Armor/Auric/AuricTeslaSpaceHelmet_Head.png rename to Items/Armor/Auric/AuricTeslaHeadSummon_Head.png diff --git a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs index c1fee61ca3..b9370b9752 100644 --- a/Items/Armor/Bloodflare/BloodflareBodyArmor.cs +++ b/Items/Armor/Bloodflare/BloodflareBodyArmor.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void UpdateEquip(Player player) { - player.statLifeMax2 += 40; + player.statLifeMax2 += 25; player.GetDamage() += 0.12f; player.GetCritChance() += 8; } diff --git a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs index 8a4569fc13..cff6ab1e36 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadMagic.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadMagic.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.Bloodflare public override void UpdateEquip(Player player) { - player.manaCost *= 0.83f; + player.manaCost -= 0.17f; player.GetDamage() += 0.2f; player.GetCritChance() += 10; player.statManaMax2 += 100; diff --git a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs index b8a9e4f5ef..58e7430499 100644 --- a/Items/Armor/Bloodflare/BloodflareHeadRanged.cs +++ b/Items/Armor/Bloodflare/BloodflareHeadRanged.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Armor.Bloodflare var modPlayer = player.Calamity(); modPlayer.bloodflareSet = true; modPlayer.bloodflareRanged = true; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); player.crimsonRegen = true; } diff --git a/Items/Armor/Brimflame/BrimflameRobes.cs b/Items/Armor/Brimflame/BrimflameRobes.cs index 8e2ba2b87b..47c9115271 100644 --- a/Items/Armor/Brimflame/BrimflameRobes.cs +++ b/Items/Armor/Brimflame/BrimflameRobes.cs @@ -11,7 +11,6 @@ namespace CalamityMod.Items.Armor.Brimflame public new string LocalizationCategory => "Items.Armor.Hardmode"; public override void SetStaticDefaults() { - if (Main.dedServ) return; diff --git a/Items/Armor/Brimflame/BrimflameScowl.cs b/Items/Armor/Brimflame/BrimflameScowl.cs index 24be230104..5e7bf9b284 100644 --- a/Items/Armor/Brimflame/BrimflameScowl.cs +++ b/Items/Armor/Brimflame/BrimflameScowl.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Armor.Brimflame player.GetDamage() += 0.05f; player.GetCritChance() += 5; player.statManaMax2 += 80; - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; player.buffImmune[ModContent.BuffType()] = true; player.buffImmune[BuffID.OnFire] = true; player.buffImmune[BuffID.Frostburn] = true; @@ -77,8 +77,7 @@ namespace CalamityMod.Items.Armor.Brimflame modPlayer.brimflameSet = true; player.GetDamage() += 0.15f; player.GetCritChance() += 15; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); } public override void AddRecipes() diff --git a/Items/Armor/Daedalus/DaedalusHeadMagic.cs b/Items/Armor/Daedalus/DaedalusHeadMagic.cs index 1601c041ce..9045e3c7aa 100644 --- a/Items/Armor/Daedalus/DaedalusHeadMagic.cs +++ b/Items/Armor/Daedalus/DaedalusHeadMagic.cs @@ -41,7 +41,7 @@ namespace CalamityMod.Items.Armor.Daedalus public override void UpdateEquip(Player player) { - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; player.GetDamage() += 0.13f; player.GetCritChance() += 7; player.statManaMax2 += 60; diff --git a/Items/Armor/Demonshade/DemonshadeBreastplate.cs b/Items/Armor/Demonshade/DemonshadeBreastplate.cs index dec634e4f4..4119d966ad 100644 --- a/Items/Armor/Demonshade/DemonshadeBreastplate.cs +++ b/Items/Armor/Demonshade/DemonshadeBreastplate.cs @@ -29,7 +29,7 @@ namespace CalamityMod.Items.Armor.Demonshade var modPlayer = player.Calamity(); modPlayer.shadeRegen = true; player.thorns += 100f; - player.statLifeMax2 += 200; + player.statLifeMax2 += 50; player.statManaMax2 += 200; player.GetDamage() += 0.15f; player.GetCritChance() += 15; diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index 2e854e84d2..b245974237 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -47,8 +47,7 @@ namespace CalamityMod.Items.Armor.Demonshade public override void UpdateArmorSet(Player player) { - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey, (1f + MultDamageBoost).Round(), (1D + MultDamageTakenBoost).Round()); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), (1f + MultDamageBoost).Round(), (1D + MultDamageTakenBoost).Round()); var modPlayer = player.Calamity(); modPlayer.dsSetBonus = true; modPlayer.wearingRogueArmor = true; diff --git a/Items/Armor/DesertProwler/DesertProwlerSet.cs b/Items/Armor/DesertProwler/DesertProwlerSet.cs index 7d7bcd3c06..650289817d 100644 --- a/Items/Armor/DesertProwler/DesertProwlerSet.cs +++ b/Items/Armor/DesertProwler/DesertProwlerSet.cs @@ -27,12 +27,19 @@ namespace CalamityMod.Items.Armor.DesertProwler public static readonly SoundStyle SmokeBombEndSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerSmokeBombEnd"); public static readonly SoundStyle CDResetSound = new("CalamityMod/Sounds/Custom/AbilitySounds/DesertProwlerCDReset"); - public static int FlatDamageBonus = 1; - public static int SmokeCooldown = 25 * 60; - public static int SmokeDuration = 5 * 60; - public static int LightsOutReset = (int)(1.5f * 60); + public static int RogueCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); + + // Set Bonus + public static float SetBonusRogueStealth = 0.5f; + public static float SmokeMoveSpeedMult = 1.5f; + public static float SmokeDefenseMult = 0.75f; + public static float SmokeAggroMult = 0.5f; + public static int SmokeCooldown = CalamityUtils.SecondsToFrames(25); + public static int SmokeDuration = CalamityUtils.SecondsToFrames(5); + public static int LightsOutReset = CalamityUtils.SecondsToFrames(2); public static int FreeCrit = 200; - public static int BonusDamageCap = 100; + public static int BonusDamageCap = 200; public static bool ShroudedInSmoke(Player player, out CooldownInstance cd) { @@ -41,32 +48,13 @@ namespace CalamityMod.Items.Armor.DesertProwler return (hasSmokebombCD && cd.timeLeft > SmokeCooldown); } - public override void Load() - { - Terraria.On_Player.KeyDoubleTap += ActivateSetBonus; - } - - private void ActivateSetBonus(Terraria.On_Player.orig_KeyDoubleTap orig, Player player, int keyDir) - { - if (keyDir == (Main.ReversedUpDownArmorSetBonuses ? 1 : 0) && HasArmorSet(player) && !player.mount.Active) - { - // The set bonus can only be activated if the player does not have the cooldown. - if (!player.Calamity().cooldowns.TryGetValue(SandsmokeBomb.ID, out CooldownInstance cd)) - { - player.AddCooldown(SandsmokeBomb.ID, SmokeCooldown + SmokeDuration); - } - } - - orig(player, keyDir); - } - public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 1; //6 + Item.defense = 2; // 9 } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType() && legs.type == ItemType(); @@ -78,8 +66,10 @@ namespace CalamityMod.Items.Armor.DesertProwler public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalization("SetBonus").Format(FlatDamageBonus); //More gets edited in elsewhere - player.GetDamage().Flat += FlatDamageBonus; + Color AbilityBriefColor = Color.Lerp(new Color(255, 229, 156), new Color(233, 225, 198), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), FreeCrit, BonusDamageCap, LightsOutReset.FramesToSeconds()); //More gets edited in elsewhere + player.Calamity().wearingRogueArmor = true; + player.Calamity().rogueStealthMax += SetBonusRogueStealth; DesertProwlerPlayer armorPlayer = player.GetModPlayer(); armorPlayer.desertProwlerSet = true; @@ -89,9 +79,9 @@ namespace CalamityMod.Items.Armor.DesertProwler if (cd.timeLeft == SmokeCooldown + SmokeDuration) armorPlayer.SetBonusStartEffect(); - player.moveSpeed *= 1.5f; + player.moveSpeed *= SmokeMoveSpeedMult; player.invis = true; - player.aggro = (int)(player.aggro * 0.5f); + player.aggro = (int)(player.aggro * SmokeAggroMult); player.noKnockback = true; for (int i = 0; i < 2; i++) @@ -155,37 +145,10 @@ namespace CalamityMod.Items.Armor.DesertProwler dhusvtt.fadeIn = 1f; Vector2 dustVelocity = dustDirection.RotatedBy(MathHelper.PiOver2) * 0.04f * dustDistance; dhusvtt.velocity = dustVelocity; - } } - public static void ModifySetTooltips(ModItem item, List tooltips) - { - if (HasArmorSet(Main.LocalPlayer)) - { - int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria"); - - if (setBonusIndex != -1) - { - string dir = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"); - TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem("AbilityBrief").Format(dir)); - setBonus1.OverrideColor = Color.Lerp(new Color(255, 229, 156), new Color(233, 225, 198), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); - tooltips.Insert(setBonusIndex + 1, setBonus1); - - TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", CalamityUtils.GetTextFromModItem("AbilityDescription").Format(FreeCrit, BonusDamageCap, LightsOutReset / 60f)); - setBonus2.OverrideColor = new Color(204, 181, 72); - tooltips.Insert(setBonusIndex + 2, setBonus2); - } - } - } - - public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); - - public override void UpdateEquip(Player player) - { - player.GetCritChance() += 4; - player.ammoCost80 = true; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RogueCritBoost; public override void AddRecipes() { @@ -203,6 +166,9 @@ namespace CalamityMod.Items.Armor.DesertProwler public new string LocalizationCategory => "Items.Armor.PreHardmode"; public string BulkTexture => "CalamityMod/Items/Armor/DesertProwler/DesertProwlerShirt_Bulk"; + public static float RogueDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetStaticDefaults() { if (Main.dedServ) @@ -220,15 +186,10 @@ namespace CalamityMod.Items.Armor.DesertProwler Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 3; + Item.defense = 4; } - public override void ModifyTooltips(List tooltips) => DesertProwlerHat.ModifySetTooltips(this, tooltips); - - public override void UpdateEquip(Player player) - { - player.GetCritChance() += 5; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { @@ -245,19 +206,23 @@ namespace CalamityMod.Items.Armor.DesertProwler public class DesertProwlerPants : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RogueCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 2; + Item.defense = 3; } - public override void ModifyTooltips(List tooltips) => DesertProwlerHat.ModifySetTooltips(this, tooltips); + public override void UpdateEquip(Player player) { + player.GetCritChance() += RogueCritBoost; player.buffImmune[BuffID.WindPushed] = true; - player.moveSpeed += 0.1f; } public override void AddRecipes() @@ -272,9 +237,6 @@ namespace CalamityMod.Items.Armor.DesertProwler public class DesertProwlerPlayer : ModPlayer { - public static int BastionShootDamage = 10; - public static float BastionShootSpeed = 18f; - public static int BastionShootTime = 10; internal SlotId SmokeBombSoundSlot; public bool desertProwlerSet = false; @@ -381,7 +343,7 @@ namespace CalamityMod.Items.Armor.DesertProwler { if (projectile.damage > 0 && !Main.gameMenu) { - if (projectile.owner >= 0 && DesertProwlerHat.ShroudedInSmoke(Main.player[projectile.owner], out var cd) && projectile.DamageType.CountsAsClass(DamageClass.Ranged)) + if (projectile.owner >= 0 && DesertProwlerHat.ShroudedInSmoke(Main.player[projectile.owner], out var cd) && projectile.DamageType.CountsAsClass(RogueDamageClass.Instance)) { int critPool = DesertProwlerHat.FreeCrit; diff --git a/Items/Armor/Empyrean/EmpyreanCloak.cs b/Items/Armor/Empyrean/EmpyreanCloak.cs index bf80cf38b8..d776dddcfb 100644 --- a/Items/Armor/Empyrean/EmpyreanCloak.cs +++ b/Items/Armor/Empyrean/EmpyreanCloak.cs @@ -41,7 +41,6 @@ namespace CalamityMod.Items.Armor.Empyrean public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; player.GetCritChance() += 7; player.GetDamage() += 0.07f; } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs index 33257e3b8b..d31a61768d 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBoots.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public override void UpdateEquip(Player player) { player.GetDamage() += 0.08f; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { player.moveSpeed += 0.4f; } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs index be0e044c58..16e6cb4b72 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerBreastplate.cs @@ -34,7 +34,6 @@ namespace CalamityMod.Items.Armor.FathomSwarmer public override void UpdateEquip(Player player) { player.GetDamage() += 0.1f; - player.endurance += 0.06f; player.maxMinions += 1; player.Calamity().fathomSwarmerBreastplate = true; } diff --git a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs index 5902d4e52b..8a3ae47280 100644 --- a/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs +++ b/Items/Armor/FathomSwarmer/FathomSwarmerVisage.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor.FathomSwarmer player.spikedBoots = 2; player.maxMinions += 2; player.GetDamage() += 0.1f; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (modPlayer.countsAsAnyWet) { player.GetDamage() += 0.2f; player.statDefense += 10; @@ -56,7 +56,7 @@ namespace CalamityMod.Items.Armor.FathomSwarmer player.breath = player.breathMax + 3; } modPlayer.fathomSwarmerVisage = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { Lighting.AddLight((int)player.Center.X / 16, (int)player.Center.Y / 16, 0.3f, 0.9f, 1.35f); } diff --git a/Items/Armor/Fearmonger/FearmongerGreathelm.cs b/Items/Armor/Fearmonger/FearmongerGreathelm.cs index 27838ccc22..ade4c8e7b0 100644 --- a/Items/Armor/Fearmonger/FearmongerGreathelm.cs +++ b/Items/Armor/Fearmonger/FearmongerGreathelm.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor.Fearmonger { player.statManaMax2 += 60; player.GetDamage() += 0.1f; - player.manaCost *= 0.9f; + player.manaCost -= 0.1f; } public override bool IsArmorSet(Item head, Item body, Item legs) @@ -67,7 +67,6 @@ namespace CalamityMod.Items.Armor.Fearmonger ModContent.BuffType(), BuffID.Chilled, BuffID.Frozen, - ModContent.BuffType(), }; for (var i = 0; i < immuneDebuffs.Length; ++i) player.buffImmune[immuneDebuffs[i]] = true; diff --git a/Items/Armor/ForbiddenCirclet.cs b/Items/Armor/ForbiddenCirclet.cs index f5566fca6f..17f3231598 100644 --- a/Items/Armor/ForbiddenCirclet.cs +++ b/Items/Armor/ForbiddenCirclet.cs @@ -44,8 +44,7 @@ namespace CalamityMod.Items.Armor public override void UpdateArmorSet(Player player) { int stormMana = (int)(manaCost * player.manaCost); - string hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey, stormMana); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey(), stormMana); CalamityPlayer modPlayer = player.Calamity(); modPlayer.forbiddenCirclet = true; modPlayer.rogueStealthMax += 0.4f; diff --git a/Items/Armor/GemTech/GemTechHeadgear.cs b/Items/Armor/GemTech/GemTechHeadgear.cs index eaebeaac2c..3c860e87a8 100644 --- a/Items/Armor/GemTech/GemTechHeadgear.cs +++ b/Items/Armor/GemTech/GemTechHeadgear.cs @@ -8,7 +8,6 @@ using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Microsoft.Xna.Framework.Input.Keys; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Armor.GemTech @@ -94,7 +93,7 @@ namespace CalamityMod.Items.Armor.GemTech tooltips[setBonusIndex].Text = CalamityUtils.GetTextValueFromModItem("AbilityBrief"); tooltips[setBonusIndex].OverrideColor = Color.Lerp(Color.White, Main.DiscoColor, 0.3f); - if (!Main.keyState.IsKeyDown(LeftShift)) + if (!Main.keyState.PressingShift()) { TooltipLine briefDescription = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextValueFromModItem("AbilityDescription")); briefDescription.OverrideColor = Color.Lerp(Color.White, Main.DiscoColor, 0.5f); diff --git a/Items/Armor/GodSlayer/GodSlayerChestplate.cs b/Items/Armor/GodSlayer/GodSlayerChestplate.cs index 7c21d4aa79..815eeb87e7 100644 --- a/Items/Armor/GodSlayer/GodSlayerChestplate.cs +++ b/Items/Armor/GodSlayer/GodSlayerChestplate.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Armor.GodSlayer { var modPlayer = player.Calamity(); player.thorns += 0.5f; - player.statLifeMax2 += 60; + player.statLifeMax2 += 50; player.GetDamage() += 0.11f; player.GetCritChance() += 8; } diff --git a/Items/Armor/Hydrothermic/HydrothermicArmor.cs b/Items/Armor/Hydrothermic/HydrothermicArmor.cs index b1801d6c38..c2c9737405 100644 --- a/Items/Armor/Hydrothermic/HydrothermicArmor.cs +++ b/Items/Armor/Hydrothermic/HydrothermicArmor.cs @@ -24,7 +24,6 @@ namespace CalamityMod.Items.Armor.Hydrothermic public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; player.GetDamage() += 0.08f; player.GetCritChance() += 4; } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs index 6bf014726a..de2335fbb7 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadMagic.cs @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Armor.Hydrothermic modPlayer.ataxiaBlaze = true; modPlayer.ataxiaMage = true; player.GetDamage() += 0.05f; - player.manaCost *= 0.85f; + player.manaCost -= 0.15f; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs index f67aa39d0f..ed9c3cea1c 100644 --- a/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs +++ b/Items/Armor/MarniteArchitect/MarniteArchitectSet.cs @@ -16,6 +16,7 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.GameInput; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; using static Microsoft.Xna.Framework.Input.Keys; using static Terraria.ModLoader.ModContent; @@ -32,8 +33,13 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public static readonly SoundStyle LiftGoAwaySound = new("CalamityMod/Sounds/Item/MarniteLiftUnsummon"); public static readonly SoundStyle LiftHummSound = new("CalamityMod/Sounds/Item/MarniteLiftHumm") { IsLooped = true }; + public static int TileRangeBoost = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(TileRangeBoost); + + // Set Bonus public static float LiftRaiseSpeed = 2f; public static float MaxLiftHeight = 138f; + public static float LiftHeightOffset = 22f; // Height of the lift itself minus the foot offset; 138 + 22 = 160 (10 tiles) public override void Load() { @@ -86,7 +92,8 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public override void UpdateArmorSet(Player player) { - player.setBonus = "Marnite Lift"; //Replaced below + Color AbilityBriefColor = Color.Lerp(new Color(255, 243, 161), new Color(137, 162, 255), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), (MaxLiftHeight + LiftHeightOffset).ToTiles()); player.GetModPlayer().setEquipped = true; } @@ -95,32 +102,11 @@ namespace CalamityMod.Items.Armor.MarniteArchitect //Tile range is a static variable did you know that? That's quite funny. I assume it's just because its not like other players would need to know about the players reach if (Main.myPlayer == player.whoAmI) { - Player.tileRangeX += 5; - Player.tileRangeY += 5; //Extendo grip also increases vertical tile range by one less than horizontal <-- This is silly lmao + Player.tileRangeX += TileRangeBoost; + Player.tileRangeY += TileRangeBoost; //Extendo grip also increases vertical tile range by one less than horizontal <-- This is silly lmao } } - public static void ModifySetTooltips(ModItem item, List tooltips) - { - if (HasArmorSet(Main.LocalPlayer)) - { - int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria"); - - if (setBonusIndex != -1) - { - tooltips[setBonusIndex].Text = CalamityUtils.GetTextValueFromModItem("AbilityBrief"); - tooltips[setBonusIndex].OverrideColor = Color.Lerp(new Color(255, 243, 161), new Color(137, 162, 255), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); - - TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextValueFromModItem("AbilityDescription")); - setBonus1.OverrideColor = new Color(145, 197, 239); - tooltips.Insert(setBonusIndex + 1, setBonus1); - } - - } - } - public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); - - public override void AddRecipes() { CreateRecipe(). @@ -136,6 +122,10 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public class MarniteArchitectToga : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float PlacementSpeedBoost = 0.5f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(PlacementSpeedBoost.ToPercent()); + public override void Load() { if (Main.dedServ) @@ -143,12 +133,6 @@ namespace CalamityMod.Items.Armor.MarniteArchitect EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/MarniteArchitect/MarniteArchitectToga_Legs", EquipType.Legs, this); } - public override void SetStaticDefaults() - { - if (Main.dedServ) - return; - } - public override void SetDefaults() { Item.width = 18; @@ -160,13 +144,10 @@ namespace CalamityMod.Items.Armor.MarniteArchitect public override void UpdateEquip(Player player) { - player.tileSpeed += 0.5f; - player.wallSpeed += 0.5f; + player.tileSpeed += PlacementSpeedBoost; + player.wallSpeed += PlacementSpeedBoost; } - public override void ModifyTooltips(List tooltips) => MarniteArchitectHeadgear.ModifySetTooltips(this, tooltips); - - public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs index 9f284fee8e..84b178e4d0 100644 --- a/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs +++ b/Items/Armor/OmegaBlue/OmegaBlueHelmet.cs @@ -66,8 +66,7 @@ namespace CalamityMod.Items.Armor.OmegaBlue public override void UpdateArmorSet(Player player) { - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); var mp = player.Calamity(); player.maxMinions += 2; diff --git a/Items/Armor/PlagueReaper/PlagueReaperMask.cs b/Items/Armor/PlagueReaper/PlagueReaperMask.cs index c483c15e15..ba3cdb9a84 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -37,8 +37,7 @@ namespace CalamityMod.Items.Armor.PlagueReaper public override void UpdateArmorSet(Player player) { - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); var modPlayer = player.Calamity(); modPlayer.plagueReaper = true; player.ammoCost75 = true; diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index 92ed645a33..97e4d4197b 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -29,7 +29,6 @@ namespace CalamityMod.Items.Armor.Plaguebringer public override void UpdateEquip(Player player) { player.GetDamage() += 0.15f; - player.statLifeMax2 += 20; } public override bool IsArmorSet(Item head, Item body, Item legs) diff --git a/Items/Armor/Prismatic/PrismaticHelmet.cs b/Items/Armor/Prismatic/PrismaticHelmet.cs index d21c375da9..5cb45254a2 100644 --- a/Items/Armor/Prismatic/PrismaticHelmet.cs +++ b/Items/Armor/Prismatic/PrismaticHelmet.cs @@ -38,10 +38,9 @@ namespace CalamityMod.Items.Armor.Prismatic { player.Calamity().prismaticSet = true; player.statManaMax2 += 40; - player.manaCost *= 0.85f; + player.manaCost -= 0.15f; player.manaRegenBonus += 8; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()); } public override void UpdateEquip(Player player) diff --git a/Items/Armor/Prismatic/PrismaticRegalia.cs b/Items/Armor/Prismatic/PrismaticRegalia.cs index 05f840849e..520c548143 100644 --- a/Items/Armor/Prismatic/PrismaticRegalia.cs +++ b/Items/Armor/Prismatic/PrismaticRegalia.cs @@ -37,7 +37,6 @@ namespace CalamityMod.Items.Armor.Prismatic public override void UpdateEquip(Player player) { player.Calamity().prismaticRegalia = true; - player.statLifeMax2 += 20; player.statManaMax2 += 40; player.GetDamage() += 0.12f; player.GetCritChance() += 15; diff --git a/Items/Armor/Reaver/ReaverHeadExplore.cs b/Items/Armor/Reaver/ReaverHeadExplore.cs index 116c8e422e..1e99bdc685 100644 --- a/Items/Armor/Reaver/ReaverHeadExplore.cs +++ b/Items/Armor/Reaver/ReaverHeadExplore.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.Reaver modPlayer.wearingRogueArmor = true; player.findTreasure = true; player.aggro -= 200; - if (player.IsUnderwater()) + if (player.Calamity().countsAsAnyWet) player.gills = true; if (player.whoAmI == Main.myPlayer) diff --git a/Items/Armor/Reaver/ReaverHeadTank.cs b/Items/Armor/Reaver/ReaverHeadTank.cs index 0aff26f2c8..cfed218502 100644 --- a/Items/Armor/Reaver/ReaverHeadTank.cs +++ b/Items/Armor/Reaver/ReaverHeadTank.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor.Reaver player.thorns += 0.33f; player.moveSpeed -= 0.3f; player.statDefense += 10; - player.lifeRegen += 3; + player.lifeRegen += 10; player.aggro += 600; modPlayer.reaverDefense = true; modPlayer.wearingRogueArmor = true; @@ -54,7 +54,6 @@ namespace CalamityMod.Items.Armor.Reaver { player.GetDamage() -= 0.3f; player.endurance += 0.15f; - player.Calamity().reaverRegen = true; player.statLifeMax2 += 50; } diff --git a/Items/Armor/Reaver/ReaverScaleMail.cs b/Items/Armor/Reaver/ReaverScaleMail.cs index 4b4f5a5f6d..7d1f5a9221 100644 --- a/Items/Armor/Reaver/ReaverScaleMail.cs +++ b/Items/Armor/Reaver/ReaverScaleMail.cs @@ -32,7 +32,6 @@ namespace CalamityMod.Items.Armor.Reaver public override void UpdateEquip(Player player) { - player.statLifeMax2 += 20; player.GetDamage() += 0.09f; player.GetCritChance() += 4; } diff --git a/Items/Armor/Silva/SilvaArmor.cs b/Items/Armor/Silva/SilvaArmor.cs index 28c354ad14..e3250d25d5 100644 --- a/Items/Armor/Silva/SilvaArmor.cs +++ b/Items/Armor/Silva/SilvaArmor.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Armor.Silva public override void UpdateEquip(Player player) { - player.statLifeMax2 += 80; + player.statLifeMax2 += 50; player.GetDamage() += 0.11f; player.GetCritChance() += 8; } diff --git a/Items/Armor/Silva/SilvaHeadMagic.cs b/Items/Armor/Silva/SilvaHeadMagic.cs index bd16f1c2ad..aae31f716a 100644 --- a/Items/Armor/Silva/SilvaHeadMagic.cs +++ b/Items/Armor/Silva/SilvaHeadMagic.cs @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Armor.Silva public override void UpdateEquip(Player player) { - player.manaCost *= 0.81f; + player.manaCost -= 0.19f; player.GetDamage() += 0.23f; player.GetCritChance() += 13; player.statManaMax2 += 100; diff --git a/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs b/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs index c9cc263a73..eb8c2b383c 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianChestplate.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.SnowRuffian @@ -8,6 +9,10 @@ namespace CalamityMod.Items.Armor.SnowRuffian public class SnowRuffianChestplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); + public override void Load() { if (Main.dedServ) @@ -19,7 +24,6 @@ namespace CalamityMod.Items.Armor.SnowRuffian public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -35,18 +39,16 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 4; //9 + Item.defense = 5; //12 } - public override void UpdateEquip(Player player) - { - player.GetCritChance() += 3; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { CreateRecipe(). - AddRecipeGroup("AnySnowBlock", 60). + AddIngredient(ItemID.BorealWood, 20). + AddIngredient(ItemID.Silk, 6). AddIngredient(ItemID.FlinxFur, 2). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs b/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs index 5e4137d56e..8c1bbf66ac 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianGreaves.cs @@ -1,5 +1,6 @@ using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.SnowRuffian @@ -8,24 +9,26 @@ namespace CalamityMod.Items.Armor.SnowRuffian public class SnowRuffianGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); + public override void SetDefaults() { Item.width = 18; Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 3; //9 + Item.defense = 4; //12 } - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.05f; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { CreateRecipe(). - AddRecipeGroup("AnySnowBlock", 40). + AddIngredient(ItemID.BorealWood, 15). + AddIngredient(ItemID.Silk, 5). AddIngredient(ItemID.FlinxFur). AddTile(TileID.Anvils). Register(); diff --git a/Items/Armor/SnowRuffian/SnowRuffianMask.cs b/Items/Armor/SnowRuffian/SnowRuffianMask.cs index c05014c4cb..7a54d2afea 100644 --- a/Items/Armor/SnowRuffian/SnowRuffianMask.cs +++ b/Items/Armor/SnowRuffian/SnowRuffianMask.cs @@ -1,6 +1,7 @@ using CalamityMod.CalPlayer; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.SnowRuffian @@ -9,8 +10,13 @@ namespace CalamityMod.Items.Armor.SnowRuffian public class SnowRuffianMask : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; - private bool shouldBoost = false; + public static int RangedCritBoost = 4; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedCritBoost); + + // Set Bonus + public static float GlideFallSpeedMult = 0.9f; + public static int SetBonusFrostburnDuration = CalamityUtils.SecondsToFrames(3); public override void Load() { @@ -26,70 +32,33 @@ namespace CalamityMod.Items.Armor.SnowRuffian Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; - Item.defense = 2; //9 + Item.defense = 3; // 12 } - public override bool IsArmorSet(Item head, Item body, Item legs) - { - return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); - } + public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); public override void UpdateArmorSet(Player player) { var modPlayer = player.Calamity(); modPlayer.snowRuffianSet = true; - modPlayer.rogueStealthMax += 0.5f; - player.setBonus = this.GetLocalizedValue("SetBonus"); - player.GetDamage() += 0.05f; - player.Calamity().wearingRogueArmor = true; - - if (player.controlJump) - { - player.noFallDmg = true; - player.UpdateJumpHeight(); - if (shouldBoost && !player.mount.Active) - { - player.velocity.X *= 1.1f; - shouldBoost = false; - } - - } - else if (!shouldBoost && player.velocity.Y == 0) - { - shouldBoost = true; - } + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusFrostburnDuration.FramesToSeconds()); } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.02f; - } + public override void UpdateEquip(Player player) => player.GetCritChance() += RangedCritBoost; public override void AddRecipes() { CreateRecipe(). - AddRecipeGroup("AnySnowBlock", 20). + AddIngredient(ItemID.BorealWood, 10). + AddIngredient(ItemID.Silk, 4). AddIngredient(ItemID.FlinxFur). AddTile(TileID.Anvils). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } } + public class SnowRuffianWings : EquipTexture { - public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising, ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend) - { - ascentWhenFalling = 0.5f; - ascentWhenRising = 0f; - maxCanAscendMultiplier = 0f; - maxAscentMultiplier = 0f; - constantAscend = 0f; - } - - public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration) - { - speed = 2f; - acceleration *= 1.25f; - } } } diff --git a/Items/Armor/Statigel/StatigelArmor.cs b/Items/Armor/Statigel/StatigelArmor.cs index 0ff1c28e1f..d335715a55 100644 --- a/Items/Armor/Statigel/StatigelArmor.cs +++ b/Items/Armor/Statigel/StatigelArmor.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -10,9 +11,18 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelArmor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int CritBoost = 5; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(CritBoost); + + // Common Set Bonus + public static int SetBonusHurtDamageThreshold = 100; + public static int SetBonusIFrameExtension = 30; + public static float SetBonusJumpSpeedBoost = 0.6f; + public static float SetBonusJumpHeightPercentBoost = 0.3334f; + public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -31,14 +41,14 @@ namespace CalamityMod.Items.Armor.Statigel Item.defense = 10; } - public override void UpdateEquip(Player player) => player.GetCritChance() += 5; + public override void UpdateEquip(Player player) => player.GetCritChance() += CritBoost; public override void AddRecipes() { CreateRecipe(). AddIngredient(12). AddIngredient(12). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Armor/Statigel/StatigelGreaves.cs b/Items/Armor/Statigel/StatigelGreaves.cs index ce2b1d9665..26d9f5f81b 100644 --- a/Items/Armor/Statigel/StatigelGreaves.cs +++ b/Items/Armor/Statigel/StatigelGreaves.cs @@ -2,6 +2,7 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelGreaves : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float DamageBoost = 0.05f; + public static float MoveSpeedBoost = 0.05f; // NOTE: Tooltip shares this number with damage % as they're equal + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -21,8 +27,8 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateEquip(Player player) { - player.GetDamage() += 0.05f; - player.moveSpeed += 0.05f; + player.GetDamage() += DamageBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() @@ -30,7 +36,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(7). AddIngredient(7). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Armor/Statigel/StatigelHeadMagic.cs b/Items/Armor/Statigel/StatigelHeadMagic.cs index e4c60df6fc..26acf35900 100644 --- a/Items/Armor/Statigel/StatigelHeadMagic.cs +++ b/Items/Armor/Statigel/StatigelHeadMagic.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,13 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadMagic : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int MaxManaBoost = 40; + public static float ManaCostReduction = 0.1f; + public static float MagicDamageBoost = 0.1f; + public static int MagicCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MaxManaBoost, ManaCostReduction.ToPercent(), MagicDamageBoost.ToPercent(), MagicCritBoost); + public override void SetDefaults() { Item.width = 18; @@ -28,20 +36,20 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; - player.manaCost *= 0.9f; - player.statManaMax2 += 40; + player.GetDamage() += MagicDamageBoost; + player.GetCritChance() += MagicCritBoost; + player.manaCost -= ManaCostReduction; + player.statManaMax2 += MaxManaBoost; } public override void AddRecipes() @@ -49,7 +57,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadMelee.cs b/Items/Armor/Statigel/StatigelHeadMelee.cs index 078d4805df..a6d3b93c8d 100644 --- a/Items/Armor/Statigel/StatigelHeadMelee.cs +++ b/Items/Armor/Statigel/StatigelHeadMelee.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,15 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadMelee : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float MeleeDamageBoost = 0.1f; + public static float MeleeSpeedBoost = 0.1f; // NOTE: Tooltip shares this number with damage % as they're equal + public static int MeleeCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MeleeDamageBoost.ToPercent(), MeleeCritBoost); + + // Set Bonus + public static int SetBonusAggroBoost = 400; + public override void SetDefaults() { Item.width = 18; @@ -28,20 +38,21 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalizedValue("SetBonus") + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; - player.aggro += 400; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; + player.aggro += SetBonusAggroBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; - player.GetAttackSpeed() += 0.1f; + player.GetDamage() += MeleeDamageBoost; + player.GetCritChance() += MeleeCritBoost; + player.GetAttackSpeed() += MeleeSpeedBoost; } public override void AddRecipes() @@ -49,7 +60,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadRanged.cs b/Items/Armor/Statigel/StatigelHeadRanged.cs index 25820004c8..f587500f24 100644 --- a/Items/Armor/Statigel/StatigelHeadRanged.cs +++ b/Items/Armor/Statigel/StatigelHeadRanged.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,11 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadRanged : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RangedDamageBoost = 0.1f; + public static int RangedCritBoost = 7; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RangedDamageBoost.ToPercent(), RangedCritBoost); + public override void SetDefaults() { Item.width = 18; @@ -28,18 +34,18 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; + player.GetDamage() += RangedDamageBoost; + player.GetCritChance() += RangedCritBoost; } public override void AddRecipes() @@ -47,7 +53,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadRogue.cs b/Items/Armor/Statigel/StatigelHeadRogue.cs index fab0c20533..25d42aaf34 100644 --- a/Items/Armor/Statigel/StatigelHeadRogue.cs +++ b/Items/Armor/Statigel/StatigelHeadRogue.cs @@ -3,6 +3,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Statigel @@ -12,6 +13,15 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadRogue : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.1f; + public static int RogueCritBoost = 7; + public static float MoveSpeedBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent(), RogueCritBoost, MoveSpeedBoost.ToPercent()); + + // Set Bonus + public static float SetBonusRogueStealth = 0.9f; + public override void SetDefaults() { Item.width = 18; @@ -28,21 +38,22 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; player.GetJumpState().Enable(); - modPlayer.rogueStealthMax += 0.9f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.1f; - player.GetCritChance() += 7; - player.moveSpeed += 0.05f; + player.GetDamage() += RogueDamageBoost; + player.GetCritChance() += RogueCritBoost; + player.moveSpeed += MoveSpeedBoost; } public override void AddRecipes() @@ -50,7 +61,7 @@ namespace CalamityMod.Items.Armor.Statigel CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index 44b9d4b2f4..865e54846e 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -16,6 +16,12 @@ namespace CalamityMod.Items.Armor.Statigel public class StatigelHeadSummon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float SummonKBBoost = 1.5f; + + // Set Bonus + public static int SetBonusMinionSlotBoost = 1; + public static float SetBonusSummonDamageBoost = 0.18f; public static int SlimeDamage = 18; public override void SetDefaults() @@ -34,15 +40,16 @@ namespace CalamityMod.Items.Armor.Statigel public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus") + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusMinionSlotBoost, SetBonusSummonDamageBoost.ToPercent()) + + "\n" + CalamityUtils.GetTextFromModItem("CommonSetBonus").Format(StatigelArmor.SetBonusHurtDamageThreshold, StatigelArmor.SetBonusJumpSpeedBoost.ToJumpSpeedPercent()); var modPlayer = player.Calamity(); modPlayer.statigelSet = true; modPlayer.slimeGod = true; player.GetJumpState().Enable(); - Player.jumpHeight += 5; - player.jumpSpeedBoost += 0.6f; - player.GetDamage() += 0.18f; - player.maxMinions++; + Player.jumpHeight += (int)(StatigelArmor.SetBonusJumpHeightPercentBoost * 15); + player.jumpSpeedBoost += StatigelArmor.SetBonusJumpSpeedBoost; + player.GetDamage() += SetBonusSummonDamageBoost; + player.maxMinions += SetBonusMinionSlotBoost; if (player.whoAmI == Main.myPlayer) { var source = player.GetSource_Accessory(Item); @@ -64,17 +71,14 @@ namespace CalamityMod.Items.Armor.Statigel } } - public override void UpdateEquip(Player player) - { - player.GetKnockback() += 1.5f; - } + public override void UpdateEquip(Player player) => player.GetKnockback() += SummonKBBoost; public override void AddRecipes() { CreateRecipe(). AddIngredient(5). AddIngredient(5). - AddTile(). + AddTile(TileID.Solidifier). SortBeforeFirstRecipesOf(ModContent.ItemType()). Register(); } diff --git a/Items/Armor/Sulphurous/SulphurousBreastplate.cs b/Items/Armor/Sulphurous/SulphurousBreastplate.cs index bf6118be31..e28b61c5e4 100644 --- a/Items/Armor/Sulphurous/SulphurousBreastplate.cs +++ b/Items/Armor/Sulphurous/SulphurousBreastplate.cs @@ -1,7 +1,8 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Sulphurous @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Armor.Sulphurous public class SulphurousBreastplate : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.06f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 24; @@ -20,11 +25,7 @@ namespace CalamityMod.Items.Armor.Sulphurous Item.rare = ItemRarityID.Green; } - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.06f; - player.GetCritChance() += 4; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Sulphurous/SulphurousHelmet.cs b/Items/Armor/Sulphurous/SulphurousHelmet.cs index 2f3b5b0f9f..d61781b6ea 100644 --- a/Items/Armor/Sulphurous/SulphurousHelmet.cs +++ b/Items/Armor/Sulphurous/SulphurousHelmet.cs @@ -1,9 +1,10 @@ using CalamityMod.CalPlayer; using CalamityMod.ExtraJumps; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Sulphurous @@ -13,6 +14,15 @@ namespace CalamityMod.Items.Armor.Sulphurous public class SulphurousHelmet : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int RogueCritBoost = 6; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueCritBoost); + + // Set Bonus + public static int SetBonusPoisonDuration = CalamityUtils.SecondsToFrames(1); + public static float SetBonusRogueStealth = 0.65f; + public static int BubbleDamage = 20; + public override void SetDefaults() { Item.width = 26; @@ -29,20 +39,18 @@ namespace CalamityMod.Items.Armor.Sulphurous public override void UpdateArmorSet(Player player) { - player.setBonus = this.GetLocalizedValue("SetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(SetBonusRogueStealth.ToStealth(), SetBonusPoisonDuration.FramesToSeconds()); var modPlayer = player.Calamity(); modPlayer.sulphurSet = true; player.GetJumpState().Enable(); - modPlayer.rogueStealthMax += 0.65f; + modPlayer.rogueStealthMax += SetBonusRogueStealth; modPlayer.wearingRogueArmor = true; - player.ignoreWater = true; } public override void UpdateEquip(Player player) { - player.GetDamage() += 0.04f; - player.GetCritChance() += 2; - if (player.IsUnderwater()) + player.GetCritChance() += RogueCritBoost; + if (player.Calamity().countsAsAnyWet) player.gills = true; } diff --git a/Items/Armor/Sulphurous/SulphurousLeggings.cs b/Items/Armor/Sulphurous/SulphurousLeggings.cs index ada7ef2a1b..b9ed660705 100644 --- a/Items/Armor/Sulphurous/SulphurousLeggings.cs +++ b/Items/Armor/Sulphurous/SulphurousLeggings.cs @@ -1,7 +1,8 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; +using Terraria.Localization; using Terraria.ModLoader; namespace CalamityMod.Items.Armor.Sulphurous @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Armor.Sulphurous public class SulphurousLeggings : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float RogueDamageBoost = 0.04f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(RogueDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 22; @@ -20,10 +25,7 @@ namespace CalamityMod.Items.Armor.Sulphurous Item.rare = ItemRarityID.Green; } - public override void UpdateEquip(Player player) - { - player.moveSpeed += Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 0.35f : 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += RogueDamageBoost; public override void AddRecipes() { diff --git a/Items/Armor/Tarragon/TarragonBreastplate.cs b/Items/Armor/Tarragon/TarragonBreastplate.cs index e8f74b9a7e..9c37bd9f9b 100644 --- a/Items/Armor/Tarragon/TarragonBreastplate.cs +++ b/Items/Armor/Tarragon/TarragonBreastplate.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void UpdateEquip(Player player) { - player.statLifeMax2 += 40; + player.statLifeMax2 += 25; player.GetDamage() += 0.1f; player.GetCritChance() += 5; } diff --git a/Items/Armor/Tarragon/TarragonHeadMagic.cs b/Items/Armor/Tarragon/TarragonHeadMagic.cs index 1faa537056..a9b0fac606 100644 --- a/Items/Armor/Tarragon/TarragonHeadMagic.cs +++ b/Items/Armor/Tarragon/TarragonHeadMagic.cs @@ -42,7 +42,7 @@ namespace CalamityMod.Items.Armor.Tarragon public override void UpdateEquip(Player player) { - player.manaCost *= 0.85f; + player.manaCost -= 0.15f; player.GetDamage() += 0.15f; player.GetCritChance() += 10; player.endurance += 0.1f; diff --git a/Items/Armor/Tarragon/TarragonHeadMelee.cs b/Items/Armor/Tarragon/TarragonHeadMelee.cs index c8b34346d0..3afaa9f935 100644 --- a/Items/Armor/Tarragon/TarragonHeadMelee.cs +++ b/Items/Armor/Tarragon/TarragonHeadMelee.cs @@ -39,8 +39,7 @@ namespace CalamityMod.Items.Armor.Tarragon modPlayer.tarraMelee = true; player.GetAttackSpeed() += 0.15f; player.aggro += 800; - var hotkey = CalamityKeybinds.ArmorSetBonusHotKey.TooltipHotkeyString(); - player.setBonus = this.GetLocalization("SetBonus").Format(hotkey) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); + player.setBonus = this.GetLocalization("SetBonus").Format(CalamityUtils.GetArmorSetBonusKey()) + "\n" + CalamityUtils.GetTextValueFromModItem("CommonSetBonus"); } public override void UpdateEquip(Player player) diff --git a/Items/Armor/TitanHeart/TitanHeartBoots.cs b/Items/Armor/TitanHeart/TitanHeartBoots.cs index ae7ef7e9f4..cf28c5f6e6 100644 --- a/Items/Armor/TitanHeart/TitanHeartBoots.cs +++ b/Items/Armor/TitanHeart/TitanHeartBoots.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Armor.TitanHeart Item.height = 18; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; - Item.defense = 14; + Item.defense = 10; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/TitanHeart/TitanHeartMantle.cs b/Items/Armor/TitanHeart/TitanHeartMantle.cs index fbd3c17cd5..3a8d9fb8ee 100644 --- a/Items/Armor/TitanHeart/TitanHeartMantle.cs +++ b/Items/Armor/TitanHeart/TitanHeartMantle.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -12,7 +12,6 @@ namespace CalamityMod.Items.Armor.TitanHeart public new string LocalizationCategory => "Items.Armor.Hardmode"; public override void SetStaticDefaults() { - if (Main.dedServ) return; @@ -28,7 +27,7 @@ namespace CalamityMod.Items.Armor.TitanHeart Item.height = 18; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; - Item.defense = 17; + Item.defense = 14; } public override void UpdateEquip(Player player) diff --git a/Items/Armor/TitanHeart/TitanHeartMask.cs b/Items/Armor/TitanHeart/TitanHeartMask.cs index 03b99c9fa4..b18896d408 100644 --- a/Items/Armor/TitanHeart/TitanHeartMask.cs +++ b/Items/Armor/TitanHeart/TitanHeartMask.cs @@ -1,6 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Armor.TitanHeart Item.height = 18; Item.value = CalamityGlobalItem.RarityLightRedBuyPrice; Item.rare = ItemRarityID.LightRed; - Item.defense = 12; //43 + Item.defense = 8; // 32 } public override bool IsArmorSet(Item head, Item body, Item legs) 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/LucisBoots.cs b/Items/Armor/Vanity/LucisBoots.cs new file mode 100644 index 0000000000..da9ce01a0c --- /dev/null +++ b/Items/Armor/Vanity/LucisBoots.cs @@ -0,0 +1,22 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Legs)] + public class LucisBoots : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Armor.Vanity"; + + public override void SetDefaults() + { + Item.width = 28; + Item.height = 20; + Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker + Item.rare = ItemRarityID.Pink; + Item.vanity = true; + Item.Calamity().donorItem = true; + } + } +} diff --git a/Items/Armor/Vanity/LucisBoots.png b/Items/Armor/Vanity/LucisBoots.png new file mode 100644 index 0000000000..2b91e15ca4 Binary files /dev/null and b/Items/Armor/Vanity/LucisBoots.png differ diff --git a/Items/Armor/Vanity/LucisBoots_Legs.png b/Items/Armor/Vanity/LucisBoots_Legs.png new file mode 100644 index 0000000000..cb73585b17 Binary files /dev/null and b/Items/Armor/Vanity/LucisBoots_Legs.png differ diff --git a/Items/Armor/Vanity/LucisHairstyle.cs b/Items/Armor/Vanity/LucisHairstyle.cs new file mode 100644 index 0000000000..6af1251c18 --- /dev/null +++ b/Items/Armor/Vanity/LucisHairstyle.cs @@ -0,0 +1,22 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Head)] + public class LucisHairstyle : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Armor.Vanity"; + + public override void SetDefaults() + { + Item.width = 28; + Item.height = 20; + Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker + Item.rare = ItemRarityID.Pink; + Item.vanity = true; + Item.Calamity().donorItem = true; // Donor: xAqult (Sprites made by Gote) + } + } +} diff --git a/Items/Armor/Vanity/LucisHairstyle.png b/Items/Armor/Vanity/LucisHairstyle.png new file mode 100644 index 0000000000..5808d53012 Binary files /dev/null and b/Items/Armor/Vanity/LucisHairstyle.png differ diff --git a/Items/Armor/Vanity/LucisHairstyle_Head.png b/Items/Armor/Vanity/LucisHairstyle_Head.png new file mode 100644 index 0000000000..682ad154ba Binary files /dev/null and b/Items/Armor/Vanity/LucisHairstyle_Head.png differ diff --git a/Items/Armor/Vanity/LucisMilitaryUniform.cs b/Items/Armor/Vanity/LucisMilitaryUniform.cs new file mode 100644 index 0000000000..c2fde13007 --- /dev/null +++ b/Items/Armor/Vanity/LucisMilitaryUniform.cs @@ -0,0 +1,22 @@ +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Armor.Vanity +{ + [AutoloadEquip(EquipType.Body)] + public class LucisMilitaryUniform : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Armor.Vanity"; + + public override void SetDefaults() + { + Item.width = 26; + Item.height = 20; + Item.value = Item.buyPrice(gold: 10); // Sold by Steampunker + Item.rare = ItemRarityID.Pink; + Item.vanity = true; + Item.Calamity().donorItem = true; + } + } +} diff --git a/Items/Armor/Vanity/LucisMilitaryUniform.png b/Items/Armor/Vanity/LucisMilitaryUniform.png new file mode 100644 index 0000000000..d8017d98d0 Binary files /dev/null and b/Items/Armor/Vanity/LucisMilitaryUniform.png differ diff --git a/Items/Armor/Vanity/LucisMilitaryUniform_Body.png b/Items/Armor/Vanity/LucisMilitaryUniform_Body.png new file mode 100644 index 0000000000..dcdee4ba2a Binary files /dev/null and b/Items/Armor/Vanity/LucisMilitaryUniform_Body.png differ 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/Victide/VictideBreastplate.cs b/Items/Armor/Victide/VictideBreastplate.cs index 43e1c6649b..21d2e2b914 100644 --- a/Items/Armor/Victide/VictideBreastplate.cs +++ b/Items/Armor/Victide/VictideBreastplate.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Armor.Victide { player.endurance += 0.05f; player.GetCritChance() += 5; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { player.statDefense += 5; player.endurance += 0.1f; diff --git a/Items/Armor/Victide/VictideGreaves.cs b/Items/Armor/Victide/VictideGreaves.cs index 6e96d6af32..395a2e977b 100644 --- a/Items/Armor/Victide/VictideGreaves.cs +++ b/Items/Armor/Victide/VictideGreaves.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Victide public override void UpdateEquip(Player player) { - player.moveSpeed += Collision.DrownCollision(player.position, player.width, player.height, player.gravDir) ? 0.3f : 0.08f; + player.moveSpeed += player.Calamity().countsAsAnyWet ? 0.3f : 0.08f; } public override void AddRecipes() diff --git a/Items/Armor/Victide/VictideHeadMagic.cs b/Items/Armor/Victide/VictideHeadMagic.cs index 87d322f52f..cd54798dff 100644 --- a/Items/Armor/Victide/VictideHeadMagic.cs +++ b/Items/Armor/Victide/VictideHeadMagic.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Victide var modPlayer = player.Calamity(); modPlayer.victideSet = true; player.ignoreWater = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { player.GetDamage() += 0.1f; player.lifeRegen += 3; diff --git a/Items/Armor/Victide/VictideHeadMelee.cs b/Items/Armor/Victide/VictideHeadMelee.cs index 9c97518add..2ce93d2cfe 100644 --- a/Items/Armor/Victide/VictideHeadMelee.cs +++ b/Items/Armor/Victide/VictideHeadMelee.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Victide var modPlayer = player.Calamity(); modPlayer.victideSet = true; player.ignoreWater = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { player.GetDamage() += 0.1f; player.lifeRegen += 3; diff --git a/Items/Armor/Victide/VictideHeadRanged.cs b/Items/Armor/Victide/VictideHeadRanged.cs index 068abd2914..414177b6e0 100644 --- a/Items/Armor/Victide/VictideHeadRanged.cs +++ b/Items/Armor/Victide/VictideHeadRanged.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Armor.Victide var modPlayer = player.Calamity(); modPlayer.victideSet = true; player.ignoreWater = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { player.GetDamage() += 0.1f; player.lifeRegen += 3; diff --git a/Items/Armor/Victide/VictideHeadRogue.cs b/Items/Armor/Victide/VictideHeadRogue.cs index 1ebfa59ea6..f5a404f1b8 100644 --- a/Items/Armor/Victide/VictideHeadRogue.cs +++ b/Items/Armor/Victide/VictideHeadRogue.cs @@ -33,7 +33,7 @@ namespace CalamityMod.Items.Armor.Victide modPlayer.rogueStealthMax += 0.6f; modPlayer.wearingRogueArmor = true; player.ignoreWater = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { player.GetDamage() += 0.1f; player.lifeRegen += 3; diff --git a/Items/Armor/Victide/VictideHeadSummon.cs b/Items/Armor/Victide/VictideHeadSummon.cs index 3d2d7683ce..36ed6cc02e 100644 --- a/Items/Armor/Victide/VictideHeadSummon.cs +++ b/Items/Armor/Victide/VictideHeadSummon.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Items.Armor.Victide } } player.ignoreWater = true; - if (Collision.DrownCollision(player.position, player.width, player.height, player.gravDir)) + if (player.Calamity().countsAsAnyWet) { player.GetDamage() += 0.1f; player.lifeRegen += 3; diff --git a/Items/Armor/Wulfrum/WulfrumSet.cs b/Items/Armor/Wulfrum/WulfrumSet.cs index 2b9dcc9d35..f27d55f4a1 100644 --- a/Items/Armor/Wulfrum/WulfrumSet.cs +++ b/Items/Armor/Wulfrum/WulfrumSet.cs @@ -11,7 +11,6 @@ using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -using static Microsoft.Xna.Framework.Input.Keys; using static Terraria.ModLoader.ModContent; namespace CalamityMod.Items.Armor.Wulfrum @@ -36,11 +35,16 @@ namespace CalamityMod.Items.Armor.Wulfrum public static readonly SoundStyle SetBreakSound = new("CalamityMod/Sounds/Custom/AbilitySounds/WulfrumBastionBreak"); public static readonly SoundStyle SetBreakSoundSafe = new("CalamityMod/Sounds/Custom/AbilitySounds/WulfrumBastionBreakSafely"); - public static int MinionSlotBoost = 1; - public static int BastionBuildTime = (int)(0.55f * 60); - public static int BastionTime = 30 * 60; - public static int TimeLostPerHit = 2 * 60; - public static int BastionCooldown = 20 * 60; + public static float SummonDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent()); + + // Set Bonus + public static int BastionDefenseBoost = 12; + public static float BastionDRBoost = 0.1f; + public static int BastionBuildTime = CalamityUtils.SecondsToFrames(0.55f); + public static int BastionTime = CalamityUtils.SecondsToFrames(30); + public static int TimeLostPerHit = CalamityUtils.SecondsToFrames(2); + public static int BastionCooldown = CalamityUtils.SecondsToFrames(20); internal static Item DummyCannon = new Item(); //Used for the attack swap. Basically we force the player to hold a fake item. @@ -58,8 +62,7 @@ namespace CalamityMod.Items.Armor.Wulfrum EquipLoader.AddEquipTexture(Mod, "CalamityMod/Items/Armor/Wulfrum/WulfrumHat_FemaleHead", EquipType.Head, name: "WulfrumHatFemale"); } - Terraria.On_Player.KeyDoubleTap += ActivateSetBonus; - Terraria.On_Main.DrawPendingMouseText += SpoofMouseItem; + On_Main.DrawPendingMouseText += SpoofMouseItem; } public override void Unload() @@ -68,42 +71,15 @@ namespace CalamityMod.Items.Armor.Wulfrum DummyCannon = null; } - private void ActivateSetBonus(Terraria.On_Player.orig_KeyDoubleTap orig, Player player, int keyDir) - { - if (keyDir == (Main.ReversedUpDownArmorSetBonuses ? 1 : 0) && HasArmorSet(player) && !player.mount.Active) - { - //Only activate if no cooldown & available scrap. - if (player.Calamity().cooldowns.TryGetValue(WulfrumBastion.ID, out CooldownInstance cd)) - { - if (cd.timeLeft > BastionCooldown && cd.timeLeft < BastionCooldown + BastionTime - 60 * 3) - { - cd.timeLeft = BastionCooldown + 1; - player.Calamity().SyncCooldownDictionary(false); - } - } - - else if (player.HasItem(ItemType())) - { - player.ConsumeItem(ItemType()); - //I Thiiiinnnk there's no need to add mp syncing packets since cooldowns get auto synced right. - player.AddCooldown(WulfrumBastion.ID, BastionCooldown + BastionTime); - //Though do i need to sync that or is the player inventory auto synced? - DummyCannon.SetDefaults(ItemType()); - } - } - - orig(player, keyDir); - } - //Replaces the tooltip of the armor set with the fusion cannon if the player holds shift - private void SpoofMouseItem(Terraria.On_Main.orig_DrawPendingMouseText orig) + private void SpoofMouseItem(On_Main.orig_DrawPendingMouseText orig) { var player = Main.LocalPlayer; if (DummyCannon.IsAir && !Main.gameMenu) DummyCannon.SetDefaults(ItemType()); - if (IsPartOfSet(Main.HoverItem) && HasArmorSet(player) && Main.keyState.IsKeyDown(LeftShift)) + if (IsPartOfSet(Main.HoverItem) && HasArmorSet(player) && Main.keyState.PressingShift()) { Main.HoverItem = DummyCannon.Clone(); Main.hoverItemName = DummyCannon.Name; @@ -118,6 +94,7 @@ namespace CalamityMod.Items.Armor.Wulfrum Item.height = 18; Item.value = CalamityGlobalItem.RarityBlueBuyPrice; Item.rare = ItemRarityID.Blue; + Item.defense = 1; } public override bool IsArmorSet(Item head, Item body, Item legs) => body.type == ItemType() && legs.type == ItemType(); @@ -133,8 +110,9 @@ namespace CalamityMod.Items.Armor.Wulfrum armorPlayer.wulfrumSet = true; - player.setBonus = this.GetLocalization("SetBonus").Format(MinionSlotBoost); //The cooler part of the set bonus happens in modifytooltips because i can't recolor it otherwise. Madge - player.maxMinions += MinionSlotBoost; + Color AbilityBriefColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * MathF.Sin(Main.GlobalTimeWrappedHourly * 3f)); + player.setBonus = this.GetLocalization("SetBonus").Format(AbilityBriefColor.Hex3(), CalamityUtils.GetArmorSetBonusKey(), BastionTime.FramesToSeconds(), TimeLostPerHit.FramesToSeconds()); + if (PowerModeEngaged(player, out var cd)) { if (cd.timeLeft == BastionCooldown + BastionTime) @@ -143,12 +121,13 @@ namespace CalamityMod.Items.Armor.Wulfrum } //Stats - player.statDefense += 13; - player.endurance += 0.05f; //10% Dr in total with the chestplate + player.statDefense += BastionDefenseBoost; + player.endurance += BastionDRBoost; - //Can't account for previous fullbody transformations but at this point, whatever. + //Can't account for previous fullbody transformations but at this point, whatever + bool transformed = player.Transformation().Type == ItemType(); Item headItem = player.armor[10].type != ItemID.None ? player.armor[10] : player.armor[0]; - bool hatVisible = !transformationPlayer.transformationActive && headItem.type == ItemType(); + bool hatVisible = !transformed && headItem.type == ItemType(); //Spawn the hat if (cd.timeLeft == BastionCooldown + BastionTime - (int)(BastionBuildTime * 0.9f) && hatVisible) @@ -159,11 +138,9 @@ namespace CalamityMod.Items.Armor.Wulfrum //Visuals if (cd.timeLeft < BastionCooldown + BastionTime - BastionBuildTime) - player.GetModPlayer().transformationActive = true; - else if (cd.timeLeft <= BastionCooldown + BastionTime - (int)(BastionBuildTime * 0.9f)) - player.GetModPlayer().forceHelmetOn = true; + player.Transformation().Type = ItemType(); - //Swapping the arm. + //Swapping the arm if (DummyCannon.IsAir) DummyCannon.SetDefaults(ItemType()); @@ -176,7 +153,7 @@ namespace CalamityMod.Items.Armor.Wulfrum Main.mouseItem = DummyCannon; } - //Slot 58 is the "fake" slot thats used for the item the player is holding in their mouse. + //Slot 58 is the "fake" slot thats used for the item the player is holding in their mouse player.inventory[58] = DummyCannon; player.selectedItem = 58; } @@ -188,6 +165,9 @@ namespace CalamityMod.Items.Armor.Wulfrum Main.mouseItem = new Item(); DummyCannon.TurnToAir(); + + if (player.Transformation().Type == ItemType() && player.Transformation().currentTransformation.IsForced) + player.Transformation().currentTransformation.IsForced = false; } } @@ -195,8 +175,8 @@ namespace CalamityMod.Items.Armor.Wulfrum { SoundEngine.PlaySound(SetActivationSound); - //Do'nt do the effect ifthe player is already using the wulfrum vanity lol. - bool transformedAlready = player.GetModPlayer().transformationActive; + //Don't do the effect if the player is already using the wulfrum vanity lol + bool transformedAlready = player.Transformation().Type == ItemType(); if (!transformedAlready) { @@ -221,41 +201,7 @@ namespace CalamityMod.Items.Armor.Wulfrum GeneralParticleHandler.SpawnParticle(gun); } - public static void ModifySetTooltips(ModItem item, List tooltips) - { - if (HasArmorSet(Main.LocalPlayer)) - { - int setBonusIndex = tooltips.FindIndex(x => x.Name == "SetBonus" && x.Mod == "Terraria"); - - if (setBonusIndex != -1) - { - string dir = Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"); - TooltipLine setBonus1 = new TooltipLine(item.Mod, "CalamityMod:SetBonus1", CalamityUtils.GetTextFromModItem("AbilityBrief").Format(dir)); - setBonus1.OverrideColor = Color.Lerp(new Color(194, 255, 67), new Color(112, 244, 244), 0.5f + 0.5f * (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3f)); - tooltips.Insert(setBonusIndex + 1, setBonus1); - - int AmmoItem = ItemType(); - string AmmoDisplay = $"[i:{AmmoItem}] {CalamityUtils.GetItemName(AmmoItem)}"; - TooltipLine setBonus2 = new TooltipLine(item.Mod, "CalamityMod:SetBonus2", CalamityUtils.GetTextFromModItem("AbilityDescription").Format(AmmoDisplay)); - setBonus2.OverrideColor = new Color(110, 192, 93); - tooltips.Insert(setBonusIndex + 2, setBonus2); - - if (!Main.keyState.IsKeyDown(LeftShift)) - { - TooltipLine itemDisplay = new TooltipLine(item.Mod, "CalamityMod:ArmorItemDisplay", CalamityUtils.GetTextValueFromModItem("ShiftToExpand")); - itemDisplay.OverrideColor = new Color(190, 190, 190); - tooltips.Add(itemDisplay); - } - } - - } - } - public override void ModifyTooltips(List tooltips) => ModifySetTooltips(this, tooltips); - - public override void UpdateEquip(Player player) - { - player.GetDamage() += 0.1f; - } + public override void UpdateEquip(Player player) => player.GetDamage() += SummonDamageBoost; public override void AddRecipes() { @@ -272,6 +218,10 @@ namespace CalamityMod.Items.Armor.Wulfrum public class WulfrumJacket : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static int MinionSlotBoost = 1; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(MinionSlotBoost); + public override void SetStaticDefaults() { if (!Main.dedServ) @@ -291,9 +241,7 @@ namespace CalamityMod.Items.Armor.Wulfrum Item.defense = 2; } - public override void ModifyTooltips(List tooltips) => WulfrumHat.ModifySetTooltips(this, tooltips); - - public override void UpdateEquip(Player player) => player.endurance += 0.05f; + public override void UpdateEquip(Player player) => player.maxMinions += MinionSlotBoost; public override void AddRecipes() { @@ -310,6 +258,10 @@ namespace CalamityMod.Items.Armor.Wulfrum public class WulfrumOveralls : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Armor.PreHardmode"; + + public static float SummonDamageBoost = 0.05f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(SummonDamageBoost.ToPercent()); + public override void SetDefaults() { Item.width = 18; @@ -324,11 +276,8 @@ namespace CalamityMod.Items.Armor.Wulfrum ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlot] = true; } } - public override void ModifyTooltips(List tooltips) => WulfrumHat.ModifySetTooltips(this, tooltips); - public override void UpdateEquip(Player player) - { - player.moveSpeed += 0.05f; - } + + public override void UpdateEquip(Player player) => player.GetDamage() += SummonDamageBoost; public override void AddRecipes() { @@ -343,10 +292,6 @@ namespace CalamityMod.Items.Armor.Wulfrum public class WulfrumArmorPlayer : ModPlayer { - public static int BastionShootDamage = 10; - public static float BastionShootSpeed = 18f; - public static int BastionShootTime = 10; - public bool wulfrumSet = false; public override void ResetEffects() @@ -365,7 +310,7 @@ namespace CalamityMod.Items.Armor.Wulfrum { SetBonusEndEffect(true); if (!Player.GetModPlayer().vanityEquipped) - Player.GetModPlayer().transformationActive = false; + Player.Transformation().currentTransformation = null; } } diff --git a/Items/BaseItems/TransformationAccessory.cs b/Items/BaseItems/TransformationAccessory.cs new file mode 100644 index 0000000000..f929462815 --- /dev/null +++ b/Items/BaseItems/TransformationAccessory.cs @@ -0,0 +1,289 @@ +using Terraria.DataStructures; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using System.Linq; +using System; +using Microsoft.Xna.Framework; +using Terraria.Audio; + +namespace CalamityMod.Items.BaseItems +{ + public abstract class TransformationAccessory : ModItem + { + public bool IsForced = false; + + public virtual string AssetPath => "CalamityMod/Items/Accessories/Vanity/"; + + public virtual (EquipType Type, string AssetName, string EquipName)[] EquipSlots => []; + + public virtual float Priority => 1; + + public virtual Func ShouldTransform => (player) => true; + + public virtual bool ShouldHideAccessories => false; + + public virtual (SoundStyle sound, int delay)? HurtSound(Player p) => null; + + public virtual void ModifyDrawInfo(ref PlayerDrawSet drawInfo) { } + + public virtual void ArmorIDSets() + { + if (EquipSlots.Any(s => s.Type == EquipType.Head)) + { + string name = EquipSlots.First(s => s.Type == EquipType.Head).EquipName; + int equipSlotHead = EquipLoader.GetEquipSlot(Mod, name ?? Name, EquipType.Head); + ArmorIDs.Head.Sets.DrawHead[equipSlotHead] = false; + } + + if (EquipSlots.Any(s => s.Type == EquipType.Body)) + { + string name = EquipSlots.First(s => s.Type == EquipType.Body).EquipName; + int equipSlotBody = EquipLoader.GetEquipSlot(Mod, name ?? Name, EquipType.Body); + ArmorIDs.Body.Sets.HidesTopSkin[equipSlotBody] = true; + ArmorIDs.Body.Sets.HidesArms[equipSlotBody] = true; + } + + if (EquipSlots.Any(s => s.Type == EquipType.Legs)) + { + string name = EquipSlots.First(s => s.Type == EquipType.Legs).EquipName; + int equipSlotLegs = EquipLoader.GetEquipSlot(Mod, name ?? Name, EquipType.Legs); + ArmorIDs.Legs.Sets.HidesBottomSkin[equipSlotLegs] = true; + } + } + + public virtual bool CustomSetEquipType(Player player, EquipType type, Mod mod, string name) => false; + + public virtual void TransformFrameEffects(Player player) { } + + public virtual void TransformPostUpdate(Player player) { } + + public override void Load() + { + if (Main.netMode != NetmodeID.Server) + { + foreach (var v in EquipSlots) + { + if (v.AssetName == null) + continue; + EquipLoader.AddEquipTexture(Mod, AssetPath + v.AssetName + "_" + v.Type.ToString(), v.Type, this, v.EquipName); + } + } + } + + public override void SetStaticDefaults() + { + if (Main.netMode == NetmodeID.Server) + return; + + ArmorIDSets(); + } + } + + public class TransformationPlayer : ModPlayer + { + public override void Load() + { + On_Player.ResetVisibleAccessories += ResetTransformation; + On_Player.UpdateVisibleAccessory += SetTransformationItem; + } + + internal TransformationAccessory currentTransformation = null; + int previousHighest = -1; + int currentHighest = -1; + + public int Type + { + get => currentTransformation == null ? -1 : currentTransformation.Type; + + set + { + ModItem item = ModContent.GetModItem(value); + if (item != null && item is TransformationAccessory trans) + { + currentTransformation = trans; + currentTransformation.IsForced = true; + } + else + currentTransformation = null; + } + } + + private void ResetTransformation(On_Player.orig_ResetVisibleAccessories orig, Player self) + { + orig(self); + + Reset(self); + } + + private void Reset(Player p) + { + previousHighest = currentHighest; + currentHighest = -1; + + if (p.Transformation().currentTransformation != null && !p.Transformation().currentTransformation.IsForced) + p.Transformation().currentTransformation = null; + } + + private void SetTransformationItem(On_Player.orig_UpdateVisibleAccessory orig, Player self, int itemSlot, Item item, bool modded) + { + orig(self, itemSlot, item, modded); + + if (self.Transformation().currentTransformation == null || !self.Transformation().currentTransformation.IsForced) + { + if (item.ModItem is TransformationAccessory transformation && transformation.ShouldTransform.Invoke(self) && (currentTransformation == null || transformation.Priority >= currentTransformation.Priority)) + self.Transformation().currentTransformation = transformation; + } + + if (currentHighest < itemSlot) + currentHighest = itemSlot; + + if (self.Transformation().currentTransformation != null && itemSlot == previousHighest) // last item slot, can set equip slots to our transformation if one is equipped + { + TransformationAccessory trans = self.Transformation().currentTransformation; + bool[] list = new bool[15]; + foreach (var (Type, AssetName, EquipName) in trans.EquipSlots) + { + string name = AssetName == null ? null : EquipName ?? trans.Name; + if (!trans.CustomSetEquipType(self, Type, Mod, name) && !list[(int)Type]) + { + SetEquipSlot(self, Type, Mod, name); + list[(int)Type] = true; + } + } + if (trans.ShouldHideAccessories) + self.HideAccessories(); + } + } + + public override void UpdateAutopause() + { + if (currentTransformation != null) + { + if (!currentTransformation.CustomSetEquipType(Player, EquipType.Head, Mod, currentTransformation.Name)) + { + var (Type, AssetName, EquipName) = currentTransformation.EquipSlots.First(v => v.Type == EquipType.Head); + string name = (EquipName == null && AssetName == null) ? null : EquipName ?? currentTransformation.Name; + SetEquipSlot(Player, EquipType.Head, Mod, name); + } + } + + Reset(Player); + } + + public override void ModifyDrawInfo(ref PlayerDrawSet drawInfo) + { + if (currentTransformation != null) + { + currentTransformation.ModifyDrawInfo(ref drawInfo); + + if (currentTransformation.EquipSlots.Any(s => s.Type == EquipType.Head)) + { + drawInfo.headGlowMask = -1; + drawInfo.helmetOffset = Vector2.Zero; + } + + if (currentTransformation.EquipSlots.Any(s => s.Type == EquipType.Body)) + { + drawInfo.bodyGlowMask = -1; + } + + if (currentTransformation.EquipSlots.Any(s => s.Type == EquipType.Legs)) + { + drawInfo.legsGlowMask = -1; + drawInfo.legsOffset = Vector2.Zero; + } + } + } + + public override void FrameEffects() + { + if (currentTransformation != null) + { + currentTransformation.TransformFrameEffects(Player); + + if (currentTransformation.ShouldHideAccessories) + Player.HideAccessories(); + } + } + + public override void PostUpdate() + { + currentTransformation?.TransformPostUpdate(Player); + } + + public static void SetEquipSlot(Player player, EquipType type, Mod mod, string name) + { + switch (type) + { + case EquipType.Head: + player.head = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Body: + player.body = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Legs: + player.legs = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.HandsOn: + player.handon = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.HandsOff: + player.handoff = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Back: + player.back = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Front: + player.front = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Shoes: + player.shoe = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Waist: + player.waist = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Wings: + player.wings = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Shield: + player.shield = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Neck: + player.neck = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Face: + player.face = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Balloon: + player.balloon = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + case EquipType.Beard: + player.beard = name == null ? -1 : EquipLoader.GetEquipSlot(mod, name, type); + break; + } + } + + public static int GetEquipSlot(Player player, EquipType type) => type switch + { + EquipType.Head => player.head, + EquipType.Body => player.body, + EquipType.Legs => player.legs, + EquipType.HandsOn => player.handon, + EquipType.HandsOff => player.handoff, + EquipType.Back => player.back, + EquipType.Front => player.front, + EquipType.Shoes => player.shoe, + EquipType.Waist => player.waist, + EquipType.Wings => player.wings, + EquipType.Shield => player.shield, + EquipType.Neck => player.neck, + EquipType.Face => player.face, + EquipType.Balloon => player.balloon, + EquipType.Beard => player.beard, + _ => -1, + }; + + public static EquipTexture GetEquipTexture(Player p, EquipType type) => EquipLoader.GetEquipTexture(type, GetEquipSlot(p, type)); + } +} diff --git a/Items/BrimstoneLocus.cs b/Items/BrimstoneLocus.cs index b1b7641013..5572578b6c 100644 --- a/Items/BrimstoneLocus.cs +++ b/Items/BrimstoneLocus.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items { Item.width = 20; Item.height = 20; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); Item.value = 0; } diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index f8aee874d4..38d58361c6 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -731,41 +731,6 @@ namespace CalamityMod.Items { return false; } - if (player.ActiveItem().type == ModContent.ItemType()) - { - bool hasBlades = false; - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI && p.localAI[1] == 0f) - { - hasBlades = true; - break; - } - } - if (hasBlades) - { - foreach (Projectile p in Main.ActiveProjectiles) - { - if (p.ModProjectile is IgneousBlade) - { - if (p.ModProjectile().Firing) - continue; - } - if (p.type == ModContent.ProjectileType() && p.owner == player.whoAmI && p.localAI[1] == 0f) - { - p.rotation = MathHelper.PiOver2 + MathHelper.PiOver4; - // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - p.velocity = p.SafeDirectionTo(Main.MouseWorld, Vector2.UnitY) * 22f; - p.rotation += p.velocity.ToRotation(); - p.ai[0] = 180f; - p.ModProjectile().Firing = true; - p.tileCollide = true; - p.netUpdate = true; - } - } - } - return false; - } if (player.ActiveItem().type == ModContent.ItemType() && player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) { foreach (Projectile p in Main.ActiveProjectiles) @@ -1224,6 +1189,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; @@ -1497,9 +1467,6 @@ namespace CalamityMod.Items if (item.type == ItemID.FleshKnuckles || item.type == ItemID.BerserkerGlove || item.type == ItemID.HeroShield) modPlayer.fleshKnuckles = true; - if (item.type == ItemID.WormScarf) - player.endurance -= 0.03f; - if (item.type == ItemID.RoyalGel) modPlayer.royalGel = true; diff --git a/Items/CalamityGlobalItemLoot.cs b/Items/CalamityGlobalItemLoot.cs index bdf23947ce..c9be425662 100644 --- a/Items/CalamityGlobalItemLoot.cs +++ b/Items/CalamityGlobalItemLoot.cs @@ -51,8 +51,8 @@ namespace CalamityMod.Items // We don't care. case ItemID.EaterOfWorldsBossBag: var eowRevLCR = loot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.revenge)); - eowRevLCR.Add(ItemID.DemoniteOre, 1, 90, 135); // 100% 90-135 Demonite Ore - eowRevLCR.Add(ItemID.ShadowScale, 1, 35, 55); // 100% 35-55 Shadow Scale + eowRevLCR.Add(ItemID.DemoniteOre, 1, 70, 90); // 100% 70-90 Demonite Ore + eowRevLCR.Add(ItemID.ShadowScale, 1, 20, 30); // 100% 20-30 Shadow Scale loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; @@ -62,11 +62,9 @@ namespace CalamityMod.Items // This can theoretically be exploited by killing the boss on Expert, then turning on Rev to open the bags. // We don't care. case ItemID.BrainOfCthulhuBossBag: - // BoC drops less partial loot than EoW - // However, sell price is overall higher despite the lower yield var bocRevLCR = loot.DefineConditionalDropSet(DropHelper.If(() => CalamityWorld.revenge)); - bocRevLCR.Add(ItemID.CrimtaneOre, 1, 80, 120); // 100% 80-120 Crimtane Ore - bocRevLCR.Add(ItemID.TissueSample, 1, 25, 40); // 100% 25-40 Tissue Sample + bocRevLCR.Add(ItemID.CrimtaneOre, 1, 70, 90); // 100% 70-90 Crimtane Ore + bocRevLCR.Add(ItemID.TissueSample, 1, 20, 30); // 100% 20-30 Tissue Sample loot.AddRevBagAccessories(); loot.Add(ModContent.ItemType(), ThankYouPainting.DropInt); break; diff --git a/Items/CalamityGlobalItemTooltip.cs b/Items/CalamityGlobalItemTooltip.cs index 2a35ce43b4..82fc64d935 100644 --- a/Items/CalamityGlobalItemTooltip.cs +++ b/Items/CalamityGlobalItemTooltip.cs @@ -6,6 +6,7 @@ using CalamityMod.Balancing; using CalamityMod.CustomRecipes; using CalamityMod.DataStructures; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Armor.Demonshade; using CalamityMod.Items.PermanentBoosters; using CalamityMod.Items.Tools; @@ -20,7 +21,6 @@ using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using Microsoft.Xna.Framework.Input; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -188,7 +188,7 @@ namespace CalamityMod.Items // Original code lifted from Iban's extended armor tooltips. if (item.ModItem is IHoldShiftTooltipItem holdShiftItem) { - bool holdingShift = Main.keyState.IsKeyDown(Keys.LeftShift); + bool holdingShift = Main.keyState.PressingShift(); // If holding SHIFT, actually display the extended tooltip. if (holdingShift && firstTooltipIndex != -1) @@ -289,7 +289,7 @@ namespace CalamityMod.Items #region Rarity Coloration private static void ApplyRarityColor(Item item, TooltipLine nameLine) { - if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) + if (item.type == ModContent.ItemType() || item.type == ModContent.ItemType()) nameLine.OverrideColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); // Developer items @@ -580,10 +580,6 @@ namespace CalamityMod.Items if (item.type == ItemID.ArcheryPotion) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("ArcheryPotion")); - // Buffed Ironskin Potion tooltip - if (item.type == ItemID.IronskinPotion) - EditTooltipByNum(0, (line) => line.Text = GetEditedTooltip("IronskinPotion").Format(CalamityUtils.GetScalingDefense(-1))); - // Nerfed Swiftness Potion tooltip if (item.type == ItemID.SwiftnessPotion) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); @@ -621,6 +617,10 @@ namespace CalamityMod.Items // "Buffed" Step Stool if (item.type == ItemID.PortableStool) EditTooltipByNum(0, (line) => line.Text += AddedTooltip("PortableStool")); + + // Replace the double tap line if double tap dash is overridden + if ((item.type == ItemID.EoCShield || item.type == ItemID.Tabi) && CalamityKeybinds.DashHotkey.GetAssignedKeys().Count != 0) + EditTooltipByNum(1, (line) => line.Text = CalamityUtils.GetText("Vanilla.DashKey").Format(CalamityKeybinds.DashHotkey.TooltipHotkeyString())); #endregion // For boss summon item clarity @@ -787,18 +787,11 @@ namespace CalamityMod.Items if (item.type == ItemID.HandOfCreation) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); - // Frozen Turtle Shell rebalance. - if (item.type == ItemID.FrozenTurtleShell) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("25%", "15%")); - - if (item.type == ItemID.FrozenShield) - EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("25%", "15%")); - // Ale and Sake rebalance and Alcohol Poisoning. if (item.type == ItemID.Ale || item.type == ItemID.Sake) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("AleSake")); - //Flame Waker Boots buff. + // Flame Waker Boots buff. if (item.type == ItemID.FlameWakerBoots) EditTooltipByNum(0, (line) => line.Text = EditedTooltip("FlameWakerBoots")); @@ -902,7 +895,7 @@ namespace CalamityMod.Items // Magic Power Potion nerf if (item.type == ItemID.MagicPowerPotion) - EditTooltipByNum(0, (line) => line.Text = EditedTooltip("MagicPowerPotion")); + EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("20%", "10%")); // Featherfall Potion being stupid broken with Aero Stone if (item.type == ItemID.FeatherfallPotion) @@ -935,10 +928,6 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.Text = line.Text.Replace("15%", "9%")); } - // Worm Scarf only gives 14% DR instead of 17% - if (item.type == ItemID.WormScarf) - EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("17%", "14%")); - // Feral Claws line melee speed and true melee damage changes if (item.type == ItemID.FeralClaws) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("12%", "10%")); @@ -988,63 +977,15 @@ namespace CalamityMod.Items EditTooltipByNum(1, (line) => line.Text = EditedTooltip("Gi")); #endregion - // Pre-Hardmode ore armor tooltip edits - #region Pre-Hardmode Ore Armor - // Copper - if (item.type == ItemID.CopperHelmet) - AddTooltip("CopperHelmet"); - if (item.type == ItemID.CopperChainmail) - AddTooltip("CopperChainmail"); - if (item.type == ItemID.CopperGreaves) - AddTooltip("CopperGreaves"); - - // Tin - if (item.type == ItemID.TinHelmet) - AddTooltip("TinHelmet"); - if (item.type == ItemID.TinChainmail) - AddTooltip("TinChainmail"); - if (item.type == ItemID.TinGreaves) - AddTooltip("TinGreaves"); - - // Iron - if (item.type == ItemID.IronHelmet || item.type == ItemID.AncientIronHelmet || item.type == ItemID.IronChainmail || item.type == ItemID.IronGreaves) - AddTooltip("IronPieces"); - - // Lead - if (item.type == ItemID.LeadHelmet || item.type == ItemID.LeadChainmail || item.type == ItemID.LeadGreaves) - AddTooltip("LeadPieces"); - - // Silver - if (item.type == ItemID.SilverHelmet) - AddTooltip("SilverHelmet"); - if (item.type == ItemID.SilverChainmail) - AddTooltip("SilverChainmail"); - if (item.type == ItemID.SilverGreaves) - AddTooltip("SilverGreaves"); - - // Tungsten - if (item.type == ItemID.TungstenHelmet) - AddTooltip("TungstenHelmet"); - if (item.type == ItemID.TungstenChainmail) - AddTooltip("TungstenChainmail"); - if (item.type == ItemID.TungstenGreaves) - AddTooltip("TungstenGreaves"); - - // Gold - if (item.type == ItemID.GoldHelmet || item.type == ItemID.AncientGoldHelmet) - AddTooltip("GoldHelmet"); - if (item.type == ItemID.GoldChainmail) - AddTooltip("GoldChainmail"); - if (item.type == ItemID.GoldGreaves) - AddTooltip("GoldGreaves"); - - // Platinum - if (item.type == ItemID.PlatinumHelmet) - AddTooltip("PlatinumHelmet"); - if (item.type == ItemID.PlatinumChainmail) - AddTooltip("PlatinumChainmail"); - if (item.type == ItemID.PlatinumGreaves) - AddTooltip("PlatinumGreaves"); + // Pre-Hardmode armor tooltip edits + #region Pre-Hardmode Armor + // Gladiator + if (item.type == ItemID.GladiatorHelmet) + EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent)); + if (item.type == ItemID.GladiatorBreastplate) + EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent)); + if (item.type == ItemID.GladiatorLeggings) + EditTooltipByName("Defense", (line) => line.Text += "\n" + CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent)); // Jungle if (item.type == ItemID.JungleHat || item.type == ItemID.AncientCobaltHelmet) @@ -1073,7 +1014,7 @@ namespace CalamityMod.Items #endregion // Hardmode armor tooltip edits - #region Hardmode Ore Armor + #region Hardmode Armor // Cobalt if (item.type == ItemID.CobaltHat) EditTooltipByNum(0, (line) => line.Text = line.Text.Replace("40", $"{CobaltArmorSetChange.MaxManaBoost + 40}")); @@ -1100,6 +1041,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%")); @@ -1213,18 +1158,14 @@ namespace CalamityMod.Items EditTooltipByName("SetBonus", (line) => VanillaArmorChangeManager.ApplySetBonusTooltipChanges(item, ref line.Text)); - // Gladiator - if (item.type == ItemID.GladiatorHelmet) - EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueDamage").Format(GladiatorArmorSetChange.HelmetRogueDamageBoostPercent)); - if (item.type == ItemID.GladiatorBreastplate) - EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueCrit").Format(GladiatorArmorSetChange.ChestplateRogueCritBoostPercent)); - if (item.type == ItemID.GladiatorLeggings) - EditTooltipByName("Defense", (line) => line.Text += "\n" +CalamityUtils.GetText("Common.RogueVelocity").Format(GladiatorArmorSetChange.LeggingRogueVelocityBoostPercent)); - // Forbidden (UNLESS you are wearing the Circlet, which is Summon/Rogue and does not get this line) if ((item.type == ItemID.AncientBattleArmorHat || item.type == ItemID.AncientBattleArmorShirt || item.type == ItemID.AncientBattleArmorPants) && !Main.LocalPlayer.Calamity().forbiddenCirclet) - EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Forbidden").Format(Language.GetTextValue(Main.ReversedUpDownArmorSetBonuses ? "Key.UP" : "Key.DOWN"))); + EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Forbidden").Format(CalamityUtils.GetArmorSetBonusKey())); + + // Vortex (hotkey spoof) + if (item.type == ItemID.VortexHelmet || item.type == ItemID.VortexBreastplate || item.type == ItemID.VortexLeggings) + EditTooltipByName("SetBonus", (line) => line.Text = CalamityUtils.GetText($"Vanilla.Armor.SetBonus.Vortex").Format(CalamityUtils.GetArmorSetBonusKey())); #endregion // Provide the full stats of every vanilla yoyo @@ -1297,7 +1238,7 @@ namespace CalamityMod.Items sb.Append('\n'); sb.Append(CalamityUtils.GetText($"Common.WingStats").Format(time.FramesToSeconds(), run.ToMph(), (tMax * baseJumpSpeed).ToMph())); sb.Append('\n'); - if (Main.keyState.IsKeyDown(Keys.LeftShift)) + if (Main.keyState.PressingShift()) { sb.Append(CalamityUtils.GetText($"Common.WingStatsAcceleration").Format(rAcc.ToMphps(), asc.ToMphps(), (asc + rise).ToMphps(), (rMax * baseJumpSpeed).ToMph(), (asc + fall).ToMphps())); if (hover) @@ -1556,20 +1497,16 @@ namespace CalamityMod.Items switch (item.prefix) { case PrefixID.Hard: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("1", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(0.25f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(0.25f)); return; case PrefixID.Guarding: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("2", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(0.5f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(0.5f)); return; case PrefixID.Armored: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("3", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(0.75f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(0.75f)); return; case PrefixID.Warding: - EditTooltipByName("PrefixAccDefense", - (line) => line.Text = line.Text.Replace("4", CalamityUtils.GetScalingDefense(item.prefix).ToString()) + DRString(1f)); + EditTooltipByName("PrefixAccDefense", (line) => line.Text += DRString(1f)); return; case PrefixID.Lucky: EditTooltipByName("PrefixAccCritChance", (line) => line.Text += AddedTooltip("LuckyPrefix")); @@ -1633,6 +1570,128 @@ namespace CalamityMod.Items #region Enchanted Rarity Text Drawing public override bool PreDrawTooltipLine(Item item, DrawableTooltipLine line, ref int yOffset) { + if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType()) + { + Color rarityColor = Color.White; + Vector2 basePosition = new Vector2(line.X, line.Y); + + float rate = Main.GlobalTimeWrappedHourly * 6; + List eColors = new List() + { + Color.DodgerBlue, + Color.Cyan, + Color.RoyalBlue + }; + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + + Vector2 backScale = line.BaseScale; + Color backColor = usedColor; + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); + + int draws = 20; + for (int i = 0; i < draws; i++) + { + Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (3.5f); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread); + } + Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D square = ModContent.Request("CalamityMod/Particles/BloomRing").Value; + + Vector2 drawPosition = basePosition; + Color drawColor = backColor; + Vector2 rotationPoint = texture.Size() * 0.5f; + int length = line.Text.Length; + for (int i = 0; i < 8; i++) + { + Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 23 + Vector2.UnitX * (i % 2 == 0 ? -10 * i : 10 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(0.3f - 0.02f * i, 1 + 0.35f * i) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None); + } + for (int i = 0; i < 10; i++) + { + float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (0 + i * 0.8f) / MathHelper.Pi); + float sine2 = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (5) / MathHelper.Pi); + float squareSine = (float)Math.Sin(i * 2.5f / MathHelper.Pi); + float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * (60 + i * 2)) % 120)), 5)); + Vector2 weirdPos = Vector2.UnitX * 53 * i * (Utils.GetLerpValue(20, 0, i, true)) + Vector2.UnitY * -23 * squareSine * sine2 + new Vector2(5, 10); + for (int t = 0; t < 3; t++) + Main.EntitySpriteDraw(square, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), 0, square.Size() * 0.5f, (1.2f - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None); + for (int t = 0; t < 3; t++) + Main.EntitySpriteDraw(texture, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), 0, texture.Size() * 0.5f, (0.65f - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); + + // Draw the front text as usual. + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); + + return false; + } + if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType()) + { + Color rarityColor = Color.White; + Vector2 basePosition = new Vector2(line.X, line.Y); + + float rate = Main.GlobalTimeWrappedHourly * 6; + List eColors = new List() + { + new Color(248, 117, 52), + Color.Gold, + Color.Orange + }; + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + + Vector2 backScale = line.BaseScale; + Color backColor = usedColor; + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); + + int draws = 20; + for (int i = 0; i < draws; i++) + { + Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (3.5f); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread); + } + Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D texture2 = ModContent.Request("CalamityMod/Particles/SquareRotated").Value; + Texture2D square = ModContent.Request("CalamityMod/Particles/GlowSquareParticleThick").Value; + + Vector2 drawPosition = basePosition; + Color drawColor = backColor; + Vector2 rotationPoint = texture.Size() * 0.5f; + int length = line.Text.Length; + for (int i = 0; i < 8; i++) + { + Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 23 + Vector2.UnitX * (i % 2 == 0 ? -10 * i : 10 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(0.3f - 0.02f * i, 1 + 0.35f * i) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None); + } + for (int i = 0; i < 10; i++) + { + float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * (0 + i * 0.8f) / MathHelper.Pi); + float squareSine = (float)Math.Sin(i * 2.5f / MathHelper.Pi); + float clockSine = (float)Math.Sin((float)Math.Pow(Utils.GetLerpValue(0, 110, ((int)(Main.GlobalTimeWrappedHourly * (60 + i * 2)) % 120)), 5)); + Vector2 weirdPos = Vector2.UnitX * 53 * i * (Utils.GetLerpValue(20, 0, i, true)) + Vector2.UnitY * 23 * squareSine + Vector2.UnitY * 5.5f * sine + new Vector2(5, 10); + for (int t = 0; t < 3; t++) + Main.EntitySpriteDraw(square, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), clockSine * MathHelper.PiOver2 + MathHelper.PiOver4, square.Size() * 0.5f, (1 - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None); + for (int t = 0; t < 3; t++) + Main.EntitySpriteDraw(texture2, basePosition + weirdPos, null, drawColor * (1 - 0.03f * i), clockSine * MathHelper.PiOver2, texture2.Size() * 0.5f, (0.6f - 0.07f * t) * new Vector2(1, 1) * (0.25f * ((float)Math.Pow(Utils.GetLerpValue(11, 0, i, true), 3) + 0.2f)), SpriteEffects.None); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); + + // Draw the front text as usual. + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); + + return false; + } // Special enchantment line color. if (line.Name == "ItemName" && line.Mod == "Terraria" && item.IsEnchanted()) { @@ -1659,6 +1718,64 @@ namespace CalamityMod.Items return false; } + + if (line.Name == "ItemName" && line.Mod == "Terraria" && item.type == ModContent.ItemType()) + { + Color rarityColor = Color.White; + Vector2 basePosition = new Vector2(line.X, line.Y); + + float rate = Main.GlobalTimeWrappedHourly * 29; + List eColors = new List() + { + Color.PaleVioletRed, + Color.Coral, + Color.Khaki, + Color.PaleGreen, + Color.Turquoise, + Color.Violet + }; + + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color usedColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + + + float sine = (float)Math.Sin(Main.GlobalTimeWrappedHourly * 3 / MathHelper.Pi); + sine = (float)Math.Pow(MathHelper.Lerp(sine, 0, 0.35f), 5); + Vector2 backScale = line.BaseScale; + Color backColor = usedColor; + Vector2 shake = Main.rand.NextVector2Circular(15, 15) * sine; + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, null, null, null, null, Main.UIScaleMatrix); + + int draws = 20; + for (int i = 0; i < draws; i++) + { + shake = Main.rand.NextVector2Circular(15, 15) * sine; + Vector2 backPosition = basePosition + (MathHelper.TwoPi * i / 20f).ToRotationVector2() * (5 + 0.5f * sine); + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake * 4 + backPosition, backColor, line.Rotation, line.Origin, backScale, line.MaxWidth, line.Spread); + } + Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + Vector2 drawPosition = basePosition; + Color drawColor = backColor; + Vector2 rotationPoint = texture.Size() * 0.5f; + for (int i = 0; i < 6; i++) + { + int length = line.Text.Length; + Main.EntitySpriteDraw(texture, basePosition + Vector2.UnitX * length * 4 + Vector2.UnitY * 10 + Vector2.UnitX * (i % 2 == 0 ? -7 * i : 7 * i), null, drawColor, (MathHelper.PiOver2), rotationPoint, new Vector2(1 - 0.05f * i * (1 + 0.2f * -sine), 1 + 0.75f * i * (1 + 0.2f * sine) * 1f) * 0.3f * Main.rand.NextFloat(0.9f, 1f), SpriteEffects.None); + } + + Main.spriteBatch.End(); + Main.spriteBatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Main.UIScaleMatrix); + + // Draw the front text as usual. + ChatManager.DrawColorCodedStringWithShadow(Main.spriteBatch, line.Font, line.Text, shake + basePosition, rarityColor, line.Rotation, line.Origin, line.BaseScale, line.MaxWidth, line.Spread); + + return false; + } return true; } #endregion diff --git a/Items/CalamityGlobalItemTweaks.cs b/Items/CalamityGlobalItemTweaks.cs index 6352984b55..ef2d422864 100644 --- a/Items/CalamityGlobalItemTweaks.cs +++ b/Items/CalamityGlobalItemTweaks.cs @@ -26,12 +26,14 @@ namespace CalamityMod.Items internal static void LoadTweaks() { - // Various shorthands for items which receive very simple changes, such as setting one flag. + // Various shorthands for items which receive very simple changes, or are repeated multiple times. IItemTweak[] trueMelee = Do(TrueMelee); IItemTweak[] trueMeleeNoSpeed = Do(TrueMeleeNoSpeed); IItemTweak[] pointBlank = Do(PointBlank); IItemTweak[] autoReuse = Do(AutoReuse); IItemTweak[] nonConsumableBossSummon = Do(MaxStack(1), NotConsumable, UseTimeExact(10)); + IItemTweak[] phaseblade = Do(AutoReuse, UseTurn, DamageExact(36)); + IItemTweak[] phasesaber = Do(DamageExact(132)); // SORTING NOTES: // 1. Sort tweaks by categories first, then sort by the internal name in alphabetical order. Navigate through categories and names using the search function. @@ -59,8 +61,8 @@ namespace CalamityMod.Items { ItemID.BlizzardStaff, Do(DamageExact(41), ManaExact(7)) }, { ItemID.BloodyMachete, Do(AutoReuse, DamageExact(24)) }, { ItemID.Blowgun, Do(PointBlank, DamageExact(40), ShootSpeedExact(15f)) }, - { ItemID.BluePhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.BluePhasesaber, Do(DamageExact(132)) }, + { ItemID.BluePhaseblade, phaseblade }, + { ItemID.BluePhasesaber, phasesaber }, { ItemID.BoneSword, Do(AutoReuse, UseTurn, DamageExact(25)) }, { ItemID.BookofSkulls, Do(DamageExact(27), ManaExact(13), ShootSpeedExact(5.5f)) }, { ItemID.BookStaff, Do(ManaExact(14)) }, // Tome of Infinite Wisdom @@ -81,6 +83,7 @@ namespace CalamityMod.Items { ItemID.CobaltRepeater, Do(PointBlank, UseExact(18)) }, { ItemID.CobaltSword, Do(UseTurn, DamageExact(60), UseExact(9)) }, { ItemID.Code2, Do(AutoReuse, DamageExact(43)) }, + { ItemID.CoinGun, Do(UseExact(12)) }, { ItemID.CorruptYoyo, Do(AutoReuse, DamageExact(20)) }, // Malaise { ItemID.CrimsonYoyo, Do(AutoReuse, DamageExact(20)) }, // Artery { ItemID.CrystalBullet, Do(DamageExact(6)) }, @@ -98,9 +101,10 @@ namespace CalamityMod.Items { ItemID.DD2BetsyBow, Do(DamageExact(42)) }, // Aerial Bane's ridiculous multiplier is removed, so this compensates for that { ItemID.DD2SquireBetsySword, Do(UseMeleeSpeed, DamageExact(150)) }, // Flying Dragon { ItemID.DD2SquireDemonSword, Do(DamageExact(110), UseExact(25)) }, // Brand of the Inferno - { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(82), ShootSpeedExact(15f)) }, + { ItemID.DeadlySphereStaff, Do(AutoReuse, UseExact(20), DamageExact(50)) }, + { ItemID.DeathSickle, Do(UseMeleeSpeed, DamageExact(70), ShootSpeedExact(15f)) }, { ItemID.DemonBow, Do(PointBlank, DamageExact(12), AutoReuse) }, - { ItemID.DemonScythe, Do(AutoReuse, DamageExact(33)) }, + { ItemID.DemonScythe, Do(AutoReuse, DamageExact(28)) }, { ItemID.DyeTradersScimitar, Do(AutoReuse, UseTurn, DamageExact(24)) }, // Exotic Scimitar { ItemID.ElectrosphereLauncher, Do(DamageExact(44)) }, { ItemID.ElfMelter, Do(ShootSpeedDelta(+5f)) }, @@ -109,11 +113,11 @@ namespace CalamityMod.Items { ItemID.EnchantedBoomerang, Do(DamageExact(24)) }, { ItemID.EnchantedSword, Do(UseMeleeSpeed, DamageExact(30), ShootSpeedExact(15f)) }, { ItemID.EndlessMusketPouch, Do(DamageExact(8)) }, - { ItemID.Excalibur, Do(TrueMelee, DamageExact(220), UseExact(24)) }, + { ItemID.Excalibur, Do(TrueMelee, DamageExact(205), UseExact(24)) }, { ItemID.FairyQueenMagicItem, Do(DamageExact(54)) }, // Nightglow { ItemID.FalconBlade, Do(UseTurn, UseExact(13)) }, { ItemID.FireworksLauncher, Do(DamageExact(50), UseExact(25)) }, // Celebration - { ItemID.Flamarang, Do(DamageExact(40)) }, + { ItemID.Flamarang, Do(DamageExact(37)) }, { ItemID.Flamelash, Do(DamageExact(40)) }, { ItemID.Flamethrower, Do(DamageExact(21), ShootSpeedDelta(+3f)) }, { ItemID.FlowerofFire, Do(AutoReuse, ManaExact(7), UseRatio(0.88f), DamageRatio(0.7f)) }, // Uses ratios due to remix seed @@ -122,14 +126,13 @@ namespace CalamityMod.Items { ItemID.Frostbrand, Do(UseMeleeSpeed, DamageExact(88)) }, { ItemID.FrostStaff, Do(DamageExact(160), UseExact(37), ShootSpeedExact(20f)) }, // has 1 extra update { ItemID.Gatligator, Do(PointBlank, UseExact(6)) }, - { ItemID.GoldCoin, Do(DamageExact(75)) }, // For Coin Gun { ItemID.GoldShortsword, Do(AutoReuse, TrueMelee, DamageExact(17)) }, { ItemID.GolemFist, Do(DamageExact(150)) }, { ItemID.Gradient, Do(AutoReuse, DamageExact(39)) }, - { ItemID.GreenPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.GreenPhasesaber, Do(DamageExact(132)) }, - { ItemID.GrenadeLauncher, Do(DamageExact(112)) }, - { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(7f)) }, + { ItemID.GreenPhaseblade, phaseblade }, + { ItemID.GreenPhasesaber, phasesaber }, + { ItemID.GrenadeLauncher, Do(DamageExact(105)) }, + { ItemID.Gungnir, Do(AutoReuse, TrueMelee, DamageExact(132), ShootSpeedExact(7f)) }, { ItemID.HallowedRepeater, Do(PointBlank, UseExact(12)) }, { ItemID.Handgun, Do(PointBlank, UseExact(20)) }, { ItemID.HellwingBow, Do(PointBlank, DamageExact(16)) }, @@ -143,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)) }, @@ -166,7 +169,7 @@ namespace CalamityMod.Items { ItemID.MiniNukeI, Do(DamageExact(90)) }, { ItemID.MiniNukeII, Do(DamageExact(90)) }, { ItemID.Minishark, Do(PointBlank, DamageExact(4)) }, - { ItemID.MoltenFury, Do(PointBlank, UseExact(29), AutoReuse) }, + { ItemID.MoltenFury, Do(PointBlank, UseExact(28), AutoReuse) }, { ItemID.MonkStaffT1, Do(TrueMeleeNoSpeed, DamageExact(83)) }, // Sleepy Octopod { ItemID.MonkStaffT2, Do(AutoReuse, TrueMelee, DamageExact(90)) }, // Ghastly Glaive { ItemID.MonkStaffT3, Do(DamageExact(225)) }, // Sky Dragon's Fury @@ -178,16 +181,17 @@ 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, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.OrangePhasesaber, Do(DamageExact(132)) }, + { ItemID.OrangePhaseblade, phaseblade }, + { ItemID.OrangePhasesaber, phasesaber }, { ItemID.OrichalcumHalberd, Do(AutoReuse, TrueMelee, DamageExact(128), ShootSpeedExact(6f)) }, { ItemID.OrichalcumRepeater, Do(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)) }, @@ -196,18 +200,16 @@ 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, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.PurplePhasesaber, Do(DamageExact(132)) }, - { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(70)) }, + { ItemID.PurplePhaseblade, phaseblade }, + { ItemID.PurplePhasesaber, phasesaber }, + { ItemID.PygmyStaff, Do(AutoReuse, UseExact(20), DamageExact(63)) }, { ItemID.QuadBarrelShotgun, Do(PointBlank, DamageExact(11)) }, { ItemID.RainbowGun, Do(DamageExact(60), ManaExact(40)) }, { ItemID.RainbowRod, Do(DamageExact(40), ManaExact(13), KnockbackExact(8f)) }, @@ -215,14 +217,15 @@ namespace CalamityMod.Items { ItemID.RavenStaff, Do(AutoReuse, UseExact(20), DamageExact(36)) }, { ItemID.RazorbladeTyphoon, Do(DamageExact(103)) }, { ItemID.Razorpine, Do(DamageExact(40)) }, - { ItemID.RedPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.RedPhasesaber, Do(DamageExact(132)) }, + { ItemID.RedPhaseblade, phaseblade }, + { ItemID.RedPhasesaber, phasesaber }, { ItemID.RedRyder, Do(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)) }, @@ -235,29 +238,30 @@ namespace CalamityMod.Items { ItemID.SkyFracture, Do(DamageExact(54), ShootSpeedExact(30f)) }, { ItemID.SlapHand, Do(UseTurn, DamageExact(120)) }, { ItemID.Smolstar, Do(DamageExact(9), AutoReuse, UseExact(25)) }, // Blade Staff - { ItemID.SniperRifle, Do(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(25)) }, + { ItemID.SpaceGun, Do(DamageExact(23)) }, { ItemID.Spear, Do(AutoReuse, TrueMelee, DamageExact(14)) }, - { ItemID.SpectreStaff, Do(DamageExact(78)) }, + { ItemID.SpectreStaff, Do(DamageExact(72)) }, { ItemID.SpiritFlame, Do(UseExact(20), ManaExact(11), ShootSpeedExact(2f)) }, { ItemID.StaffofEarth, Do(DamageExact(150)) }, - { ItemID.StarCannon, Do(DamageExact(25)) }, + { ItemID.StarCannon, Do(DamageExact(25), UseExact(15)) }, { ItemID.StardustDragonStaff, Do(AutoReuse, DamageExact(20), UseExact(19)) }, { ItemID.StormTigerStaff, Do(AutoReuse, DamageExact(49), UseExact(20)) }, // Desert Tiger Staff { ItemID.StylistKilLaKillScissorsIWish, Do(AutoReuse, UseTurn, DamageExact(21)) }, // Stylish Scissors { ItemID.Stynger, Do(DamageExact(75)) }, + { ItemID.SuperStarCannon, Do(DamageExact(55)) }, { ItemID.Swordfish, Do(AutoReuse, TrueMelee, DamageExact(24)) }, - { ItemID.TacticalShotgun, Do(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)) }, @@ -267,6 +271,7 @@ namespace CalamityMod.Items { ItemID.TitaniumSword, Do(UseTurn, DamageExact(192)) }, { ItemID.TitaniumTrident, Do(AutoReuse, TrueMelee, DamageExact(144), ShootSpeedExact(6.5f)) }, { ItemID.TopazStaff, Do(ManaExact(2)) }, + { ItemID.ToxicFlask, Do(DamageExact(62), UseExact(33), ManaExact(20)) }, { ItemID.Toxikarp, Do(UseExact(9)) }, { ItemID.Trident, Do(AutoReuse, TrueMelee, DamageExact(20)) }, { ItemID.Trimarang, Do(DamageExact(24)) }, @@ -280,50 +285,27 @@ 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, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.WhitePhasesaber, Do(DamageExact(132)) }, + { ItemID.WhitePhaseblade, phaseblade }, + { ItemID.WhitePhasesaber, phasesaber }, { ItemID.WoodenBoomerang, Do(DamageExact(16), Value(Item.sellPrice(copper: 20))) }, { ItemID.Yelets, Do(AutoReuse, DamageExact(53)) }, - { ItemID.YellowPhaseblade, Do(AutoReuse, UseTurn, DamageExact(48)) }, - { ItemID.YellowPhasesaber, Do(DamageExact(132)) }, + { ItemID.YellowPhaseblade, phaseblade }, + { ItemID.YellowPhasesaber, phasesaber }, { ItemID.Zenith, Do(DamageExact(210)) }, { ItemID.ZombieArm, Do(AutoReuse, UseTurn, KnockbackExact(12f)) }, #endregion #region CATEGORY 2: Defense Balancing - { ItemID.AncientHallowedGreaves, Do(DefenseDelta(+2)) }, - { ItemID.AncientHallowedPlateMail, Do(DefenseDelta(+3)) }, - { ItemID.AnkhShield, Do(DefenseDelta(+4)) }, // 8 total - { ItemID.CobaltShield, Do(DefenseDelta(+3)) }, // 4 total - { ItemID.EoCShield, Do(DefenseDelta(+1)) }, // Shield of Cthulhu - { ItemID.FrozenShield, Do(DefenseDelta(+4)) }, // 10 total (plus the Frozen Turtle Shell DR effect) - { ItemID.FrozenTurtleShell, Do(DefenseExact(6)) }, - { ItemID.HallowedGreaves, Do(DefenseDelta(+2)) }, - { ItemID.HallowedPlateMail, Do(DefenseDelta(+3)) }, - { ItemID.HeroShield, Do(DefenseDelta(+5)) }, // 15 total (plus increased max life) - { ItemID.LavaSkull, Do(DefenseExact(4)) }, // Magma Skull - { ItemID.MoltenCharm, Do(DefenseExact(4)) }, //Magma Charm - { ItemID.MoltenSkullRose, Do(DefenseExact(8)) }, - { ItemID.ObsidianShield, Do(DefenseDelta(+4)) }, // 6 total - { ItemID.ObsidianSkull, Do(DefenseDelta(+1)) }, // 2 total - { ItemID.ObsidianSkullRose, Do(DefenseExact(4)) }, - { ItemID.OrichalcumBreastplate, Do(DefenseDelta(+3)) }, - { ItemID.OrichalcumHeadgear, Do(DefenseDelta(+2)) }, - { ItemID.OrichalcumHelmet, Do(DefenseDelta(+3)) }, - { ItemID.OrichalcumLeggings, Do(DefenseDelta(+4)) }, - { ItemID.OrichalcumMask, Do(DefenseDelta(+3)) }, - { ItemID.PaladinsShield, Do(DefenseDelta(+2)) }, // 8 total - { ItemID.PalladiumBreastplate, Do(DefenseDelta(+3)) }, - { ItemID.PalladiumHeadgear, Do(DefenseDelta(+2)) }, - { ItemID.PalladiumHelmet, Do(DefenseDelta(+3)) }, - { ItemID.PalladiumMask, Do(DefenseDelta(+1)) }, - { ItemID.PalladiumLeggings, Do(DefenseDelta(+3)) }, - { ItemID.Shackle, Do(DefenseDelta(+2)) }, // 3 total - { ItemID.SquireAltHead, Do(DefenseDelta(-2)) }, + { ItemID.LavaSkull, Do(DefenseExact(3)) }, // Magma Skull + { ItemID.MoltenCharm, Do(DefenseExact(3)) }, //Magma Charm + { ItemID.MoltenSkullRose, Do(DefenseExact(4)) }, + { ItemID.ObsidianSkull, Do(DefenseExact(2)) }, + { ItemID.ObsidianSkullRose, Do(DefenseExact(3)) }, + { ItemID.Shackle, Do(DefenseExact(3)) }, + { ItemID.SquireAltHead, Do(DefenseDelta(-2)) }, // Valhalla Knight set { ItemID.SquireAltPants, Do(DefenseDelta(-3)) }, { ItemID.SquireAltShirt, Do(DefenseDelta(-3)) }, { ItemID.SquireGreatHelm, Do(DefenseDelta(-1)) }, @@ -333,106 +315,99 @@ namespace CalamityMod.Items #region CATEGORY 3: Tool Balancing { ItemID.AcornAxe, Do(AxePower(100)) }, // Axe of Regrowth - { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) }, - { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) }, - { ItemID.AdamantitePickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, + { ItemID.AdamantiteChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), TileBoostExact(+0), DamageExact(75)) }, + { ItemID.AdamantiteDrill, Do(TrueMeleeNoSpeed, TileBoostExact(+1), DamageExact(32)) }, + { ItemID.AdamantitePickaxe, Do(TileBoostExact(+1)) }, { ItemID.AdamantiteWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.BonePickaxe, Do(PickPower(55), UseTimeExact(6)) }, - { ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, AxePower(150), UseTimeExact(3), TileBoostExact(+0)) }, + { ItemID.BloodLustCluster, Do(AxePower(100), UseTimeExact(13)) }, + { ItemID.BonePickaxe, Do(UseTimeExact(6)) }, + { ItemID.BorealWoodHammer, Do(HammerPower(25), UseTimeExact(11)) }, + { ItemID.ButchersChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+0)) }, { ItemID.CactusPickaxe, Do(PickPower(34), UseTimeExact(9)) }, - { ItemID.CnadyCanePickaxe, Do(PickPower(55), UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe - { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), TileBoostExact(+0), DamageExact(112)) }, - { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, PickPower(200), UseTimeExact(4), TileBoostExact(+2), DamageExact(43)) }, - { ItemID.ChlorophyteGreataxe, Do(AxePower(165), UseTimeExact(7), TileBoostExact(+2)) }, - { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, HammerPower(90), UseTimeExact(5), TileBoostExact(+0)) }, - { ItemID.ChlorophytePickaxe, Do(PickPower(200), UseTimeExact(7), TileBoostExact(+2)) }, - { ItemID.ChlorophyteWarhammer, Do(HammerPower(90), UseTimeExact(8), TileBoostExact(+2)) }, - { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) }, + { ItemID.CnadyCanePickaxe, Do(UseTimeExact(9), TileBoostExact(+1)) }, // Candy Cane Pickaxe + { ItemID.ChlorophyteChainsaw, Do(TrueMeleeNoSpeed, AxePower(120), UseTimeExact(3), DamageExact(112)) }, + { ItemID.ChlorophyteDrill, Do(TrueMeleeNoSpeed, TileBoostExact(+2), DamageExact(43)) }, + { ItemID.ChlorophyteGreataxe, Do(AxePower(165), TileBoostExact(+2)) }, + { ItemID.ChlorophyteJackhammer, Do(TrueMeleeNoSpeed, UseTimeExact(5)) }, + { ItemID.ChlorophytePickaxe, Do(TileBoostExact(+2)) }, + { ItemID.ChlorophyteWarhammer, Do(UseTimeExact(8), TileBoostExact(+2)) }, + { ItemID.CobaltChainsaw, Do(TrueMeleeNoSpeed, UseTimeExact(4), DamageExact(51)) }, { ItemID.CobaltDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) }, { ItemID.CobaltPickaxe, Do(PickPower(130), UseTimeExact(9)) }, - { ItemID.CobaltWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) }, + { ItemID.CobaltWaraxe, Do(AxePower(125), UseTimeExact(12)) }, { ItemID.CopperAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) }, - { ItemID.CopperHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) }, - { ItemID.CopperPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.DeathbringerPickaxe, Do(PickPower(70), UseTimeExact(10)) }, - { ItemID.Drax, Do(TrueMeleeNoSpeed, PickPower(200), AxePower(110), UseTimeExact(4), TileBoostExact(+1), DamageExact(80)) }, - { ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9), TileBoostExact(+0)) }, - { ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.GoldAxe, Do(AxePower(80), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.GoldHammer, Do(HammerPower(60), UseTimeExact(9), TileBoostExact(+0)) }, - { ItemID.GoldPickaxe, Do(PickPower(55), UseTimeExact(9)) }, - { ItemID.Hammush, Do(HammerPower(85), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.IronAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) }, - { ItemID.IronHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.IronPickaxe, Do(PickPower(40), UseTimeExact(8)) }, + { ItemID.CopperHammer, Do(UseTimeExact(12), TileBoostExact(+0)) }, + { ItemID.CopperPickaxe, Do(UseTimeExact(10), TileBoostExact(+0)) }, + { ItemID.DeathbringerPickaxe, Do(UseTimeExact(10)) }, + { ItemID.Drax, Do(TrueMeleeNoSpeed, TileBoostExact(+1), DamageExact(80)) }, + { ItemID.EbonwoodHammer, Do(HammerPower(25), UseTimeExact(9)) }, + { ItemID.FleshGrinder, Do(HammerPower(70), UseTimeExact(13)) }, + { ItemID.GoldAxe, Do(AxePower(80), UseTimeExact(14)) }, + { ItemID.GoldHammer, Do(HammerPower(60), UseTimeExact(9)) }, + { ItemID.GoldPickaxe, Do(UseTimeExact(9)) }, + { ItemID.Hammush, Do(UseTimeExact(10), TileBoostExact(+1)) }, + { ItemID.IronAxe, Do(AxePower(60), UseTimeExact(15)) }, + { ItemID.IronHammer, Do(HammerPower(45), UseTimeExact(11)) }, + { ItemID.IronPickaxe, Do(UseTimeExact(8)) }, { ItemID.LaserDrill, Do(PickPower(220), AxePower(120), UseTimeExact(4), DamageExact(54)) }, - { ItemID.LeadAxe, Do(AxePower(60), UseTimeExact(15), TileBoostExact(+0)) }, - { ItemID.LeadHammer, Do(HammerPower(45), UseTimeExact(11), TileBoostExact(+0)) }, + { ItemID.LeadAxe, Do(AxePower(60), UseTimeExact(15)) }, + { ItemID.LeadHammer, Do(HammerPower(45), UseTimeExact(11)) }, { ItemID.LeadPickaxe, Do(PickPower(40), UseTimeExact(8)) }, - { ItemID.LucyTheAxe, Do(AxePower(150), UseExact(13), TileBoostExact(+1)) }, - { ItemID.LunarHamaxeNebula, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.LunarHamaxeSolar, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.LunarHamaxeStardust, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.LunarHamaxeVortex, Do(HammerPower(100), AxePower(175), UseTimeExact(5), TileBoostExact(+4)) }, - { ItemID.MeteorHamaxe, Do(HammerPower(70), AxePower(100), UseTimeExact(16), TileBoostExact(+0)) }, - { ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.MoltenPickaxe, Do(PickPower(100), UseTimeExact(10)) }, - { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) }, + { ItemID.LucyTheAxe, Do(UseExact(13), TileBoostExact(+1)) }, + { ItemID.LunarHamaxeNebula, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.LunarHamaxeSolar, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.LunarHamaxeStardust, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.LunarHamaxeVortex, Do(AxePower(175), UseTimeExact(5)) }, + { ItemID.MeteorHamaxe, Do(HammerPower(70)) }, + { ItemID.MoltenHamaxe, Do(HammerPower(75), AxePower(125)) }, + { ItemID.MoltenPickaxe, Do(UseTimeExact(10)) }, + { ItemID.MythrilChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), DamageExact(63)) }, { ItemID.MythrilDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, { ItemID.MythrilPickaxe, Do(PickPower(160), UseTimeExact(8)) }, - { ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.NebulaPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, + { ItemID.MythrilWaraxe, Do(AxePower(140), UseTimeExact(11)) }, + { ItemID.NebulaDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, { ItemID.NightmarePickaxe, Do(PickPower(66), UseTimeExact(9)) }, - { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), TileBoostExact(-1), DamageExact(63)) }, + { ItemID.OrichalcumChainsaw, Do(TrueMeleeNoSpeed, AxePower(80), UseTimeExact(4), DamageExact(63)) }, { ItemID.OrichalcumDrill, Do(TrueMeleeNoSpeed, PickPower(160), UseTimeExact(4), DamageExact(26)) }, { ItemID.OrichalcumPickaxe, Do(PickPower(160), UseTimeExact(8)) }, - { ItemID.OrichalcumWaraxe, Do(AxePower(140), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), TileBoostExact(-1), DamageExact(51)) }, - { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, PickPower(130), UseTimeExact(5), DamageExact(21)) }, - { ItemID.PalladiumPickaxe, Do(PickPower(130), UseTimeExact(9)) }, - { ItemID.PalladiumWaraxe, Do(AxePower(125), UseTimeExact(12), TileBoostExact(+0)) }, - { ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, - { ItemID.PearlwoodHammer, Do(HammerPower(25), UseTimeExact(4), UseAnimationExact(20), DamageExact(36), TileBoostExact(+0)) }, - { ItemID.PickaxeAxe, Do(PickPower(200), AxePower(110), UseTimeExact(7), TileBoostExact(+1)) }, - { ItemID.Picksaw, Do(PickPower(210), AxePower(125), UseTimeExact(6), TileBoostExact(+1)) }, - { ItemID.PlatinumAxe, Do(AxePower(80), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.PlatinumHammer, Do(HammerPower(60), UseTimeExact(9), TileBoostExact(+0)) }, + { ItemID.OrichalcumWaraxe, Do(AxePower(140), UseTimeExact(11)) }, + { ItemID.PalladiumChainsaw, Do(TrueMeleeNoSpeed, AxePower(70), UseTimeExact(4), DamageExact(51)) }, + { ItemID.PalladiumDrill, Do(TrueMeleeNoSpeed, UseTimeExact(5), DamageExact(21)) }, + { ItemID.PalladiumPickaxe, Do(UseTimeExact(9)) }, + { ItemID.PalladiumWaraxe, Do(AxePower(125)) }, + { ItemID.PalmWoodHammer, Do(HammerPower(25), UseTimeExact(11)) }, + { ItemID.PearlwoodHammer, Do(HammerPower(25), UseTimeExact(4), UseAnimationExact(20), DamageExact(36)) }, + { ItemID.PickaxeAxe, Do(TileBoostExact(+1)) }, + { ItemID.PlatinumAxe, Do(AxePower(80), UseTimeExact(14)) }, + { ItemID.PlatinumHammer, Do(HammerPower(60), UseTimeExact(9)) }, { ItemID.PlatinumPickaxe, Do(PickPower(55), UseTimeExact(9)) }, - { ItemID.Pwnhammer, Do(HammerPower(80), UseTimeExact(11), TileBoostExact(+1)) }, + { ItemID.Pwnhammer, Do(UseTimeExact(11), TileBoostExact(+1)) }, { ItemID.ReaverShark, Do(PickPower(65), UseTimeExact(16)) }, - { ItemID.RichMahoganyHammer, Do(HammerPower(25), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.Rockfish, Do(HammerPower(50), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.SawtoothShark, Do(TrueMeleeNoSpeed, AxePower(45), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.ShadewoodHammer, Do(HammerPower(25), UseTimeExact(9), TileBoostExact(+0)) }, - { ItemID.ShroomiteDiggingClaw, Do(PickPower(200), AxePower(125), UseTimeExact(4), TileBoostExact(-1)) }, - { ItemID.SilverAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.SilverHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.SilverPickaxe, Do(PickPower(50), UseTimeExact(11)) }, - { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.SolarFlarePickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, - { ItemID.SpectreHamaxe, Do(HammerPower(90), AxePower(170), TileBoostExact(+4)) }, - { ItemID.SpectrePickaxe, Do(PickPower(200), TileBoostExact(+4)) }, - { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.StardustPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, - { ItemID.TheAxe, Do(HammerPower(100), AxePower(175), UseTimeExact(7), TileBoostExact(+1)) }, - { ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.TinAxe, Do(AxePower(50), UseTimeExact(16), TileBoostExact(+0)) }, - { ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12), TileBoostExact(+0)) }, - { ItemID.TinPickaxe, Do(PickPower(35), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), UseTimeExact(4), TileBoostExact(+0), DamageExact(75)) }, - { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), UseTimeExact(4), TileBoostExact(+1), DamageExact(32)) }, + { ItemID.RichMahoganyHammer, Do(HammerPower(25), UseTimeExact(10)) }, + { ItemID.Rockfish, Do(HammerPower(50), UseTimeExact(10)) }, + { ItemID.SawtoothShark, Do(TrueMeleeNoSpeed, AxePower(45)) }, + { ItemID.ShadewoodHammer, Do(HammerPower(25), UseTimeExact(9)) }, + { ItemID.SilverAxe, Do(AxePower(70), UseTimeExact(14)) }, + { ItemID.SilverHammer, Do(HammerPower(55), UseTimeExact(10)) }, + { ItemID.SilverPickaxe, Do(PickPower(50)) }, + { ItemID.SolarFlareDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, + { ItemID.SpectreHamaxe, Do(AxePower(170), TileBoostExact(+4)) }, + { ItemID.SpectrePickaxe, Do(TileBoostExact(+4)) }, + { ItemID.StardustDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, + { ItemID.TheBreaker, Do(HammerPower(70), UseTimeExact(13)) }, + { ItemID.TinAxe, Do(AxePower(50), UseTimeExact(16)) }, + { ItemID.TinHammer, Do(HammerPower(35), UseTimeExact(12)) }, + { ItemID.TinPickaxe, Do(UseTimeExact(10)) }, + { ItemID.TitaniumChainsaw, Do(TrueMeleeNoSpeed, AxePower(90), TileBoostExact(+0), DamageExact(75)) }, + { ItemID.TitaniumDrill, Do(TrueMeleeNoSpeed, PickPower(180), TileBoostExact(+1), DamageExact(32)) }, { ItemID.TitaniumPickaxe, Do(PickPower(180), UseTimeExact(8), TileBoostExact(+1)) }, { ItemID.TitaniumWaraxe, Do(AxePower(160), UseTimeExact(10), TileBoostExact(+1)) }, - { ItemID.TungstenAxe, Do(AxePower(70), UseTimeExact(14), TileBoostExact(+0)) }, - { ItemID.TungstenHammer, Do(HammerPower(55), UseTimeExact(10), TileBoostExact(+0)) }, - { ItemID.TungstenPickaxe, Do(PickPower(50), UseTimeExact(11)) }, - { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, PickPower(225), UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, - { ItemID.VortexPickaxe, Do(PickPower(225), UseTimeExact(6), TileBoostExact(+4)) }, - { ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13), TileBoostExact(+0)) }, - { ItemID.WoodenHammer, Do(HammerPower(25), UseTimeExact(11), TileBoostExact(+0)) }, + { ItemID.TungstenAxe, Do(AxePower(70), UseTimeExact(14)) }, + { ItemID.TungstenHammer, Do(HammerPower(55), UseTimeExact(10)) }, + { ItemID.TungstenPickaxe, Do(UseTimeExact(11)) }, + { ItemID.VortexDrill, Do(TrueMeleeNoSpeed, UseTimeExact(3), TileBoostExact(+4), DamageExact(95)) }, + { ItemID.WarAxeoftheNight, Do(AxePower(100), UseTimeExact(13)) }, + { ItemID.WoodenHammer, Do(UseTimeExact(11), TileBoostExact(+0)) }, #endregion #region CATEGORY 4: True Melee support @@ -482,6 +457,7 @@ namespace CalamityMod.Items { ItemID.StakeLauncher, pointBlank }, { ItemID.TinBow, pointBlank }, { ItemID.TungstenBow, pointBlank }, + { ItemID.VenusMagnum, pointBlank }, { ItemID.VortexBeater, pointBlank }, { ItemID.WoodenBow, pointBlank }, #endregion @@ -504,7 +480,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 @@ -1384,15 +1359,14 @@ namespace CalamityMod.Items var shimmerTransmute = ItemID.Sets.ShimmerTransformToItem; // Note: Making Luminite Ore -> Astral Ore makes Deus almost completely skippable with no (recipe-related) downsides. - + // Adding Cryonic Ore to the shimmer chain has the same issue. shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = ItemID.LunarOre; shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.LunarOre]; - shimmerTransmute[ModContent.ItemType()] = ModContent.ItemType(); - shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.ChlorophyteOre]; + shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.ChlorophyteOre]; shimmerTransmute[ModContent.ItemType()] = shimmerTransmute[ItemID.CobaltOre]; //shimmerTransmute[ItemID.LunarOre] = ModContent.ItemType(); diff --git a/Items/DisgustingMeat.cs b/Items/DisgustingMeat.cs new file mode 100644 index 0000000000..9a635b1bec --- /dev/null +++ b/Items/DisgustingMeat.cs @@ -0,0 +1,95 @@ +using CalamityMod.CalPlayer; +using CalamityMod.Items.PermanentBoosters; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items +{ + public class DisgustingMeat : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Misc"; + + public override void SetDefaults() + { + Item.DefaultToFood(32, 30, 0, 0); + Item.value = 0; + Item.UseSound = SoundID.NPCDeath13; + Item.maxStack = 1; + Item.consumable = false; + } + + public override bool AltFunctionUse(Player player) => true; + public override bool? UseItem(Player player) + { + if (player.ItemTimeIsZero) + { + var calPlayer = player.Calamity(); + if (player.altFunctionUse == 2) + { + TryDropBoosterItem(player, ref calPlayer.rageBoostOne, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.rageBoostTwo, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.rageBoostThree, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.adrenalineBoostOne, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.adrenalineBoostTwo, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.adrenalineBoostThree, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.nimbleBounderBoost, ModContent.ItemType()); + } + else + { + if (calPlayer.sTangerine || calPlayer.mFruit || calPlayer.tCloudberry || calPlayer.sStrawberry) + { + TryDropBoosterItem(player, ref calPlayer.sTangerine, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.mFruit, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.tCloudberry, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.sStrawberry, ModContent.ItemType()); + } + else + { + for (int i = 0; i < player.ConsumedLifeFruit; i++) + { + int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, ItemID.LifeFruit); + Main.item[drop].noGrabDelay = 100; + } + player.ConsumedLifeFruit = 0; + for (int j = 0; j < player.ConsumedLifeCrystals; j++) + { + int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, ItemID.LifeCrystal); + Main.item[drop].noGrabDelay = 100; + } + player.ConsumedLifeCrystals = 0; + } + + if (calPlayer.cShard || calPlayer.eCore || calPlayer.pHeart) + { + TryDropBoosterItem(player, ref calPlayer.cShard, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.eCore, ModContent.ItemType()); + TryDropBoosterItem(player, ref calPlayer.pHeart, ModContent.ItemType()); + } + else + { + for (int k = 0; k < player.ConsumedManaCrystals; k++) + { + int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, ItemID.ManaCrystal); + Main.item[drop].noGrabDelay = 100; + } + player.ConsumedManaCrystals = 0; + } + } + return true; + } + + return null; + } + + private static void TryDropBoosterItem(Player player, ref bool condition, int itemType) + { + if (condition) + { + condition = false; + int drop = Item.NewItem(player.GetSource_DropAsItem(), player.Hitbox, itemType); + Main.item[drop].noGrabDelay = 100; + } + } + } +} diff --git a/Items/DisgustingMeat.png b/Items/DisgustingMeat.png new file mode 100644 index 0000000000..6d743191e2 Binary files /dev/null and b/Items/DisgustingMeat.png differ diff --git a/Items/DraedonMisc/EncryptedSchematicJungle.cs b/Items/DraedonMisc/EncryptedSchematicJungle.cs index 21ea505af7..0f3fb5688e 100644 --- a/Items/DraedonMisc/EncryptedSchematicJungle.cs +++ b/Items/DraedonMisc/EncryptedSchematicJungle.cs @@ -64,7 +64,7 @@ namespace CalamityMod.Items.DraedonMisc rangedDisplay.OverrideColor = new Color(236, 255, 31); list.Insert(insertIndex + 2, rangedDisplay); - int mageItem = ModContent.ItemType(); + int mageItem = ModContent.ItemType(); TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{mageItem}] {CalamityUtils.GetItemName(mageItem)}"); mageDisplay.OverrideColor = new Color(255, 64, 31); list.Insert(insertIndex + 3, mageDisplay); diff --git a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs index fb7e5cccf1..c5d36826ae 100644 --- a/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs +++ b/Items/DraedonMisc/EncryptedSchematicPlanetoid.cs @@ -59,12 +59,12 @@ namespace CalamityMod.Items.DraedonMisc meleeDisplay.OverrideColor = new Color(31, 242, 245); list.Insert(insertIndex + 1, meleeDisplay); - int rangedItem = ModContent.ItemType(); + int rangedItem = ModContent.ItemType(); TooltipLine rangedDisplay = new TooltipLine(this.Mod, "CalamityMod:RangedDisplay", $"[i:{rangedItem}] {CalamityUtils.GetItemName(rangedItem)}"); rangedDisplay.OverrideColor = new Color(149, 243, 43); list.Insert(insertIndex + 2, rangedDisplay); - int mageItem = ModContent.ItemType(); + int mageItem = ModContent.ItemType(); TooltipLine mageDisplay = new TooltipLine(this.Mod, "CalamityMod:MageDisplay", $"[i:{mageItem}] {CalamityUtils.GetItemName(mageItem)}"); mageDisplay.OverrideColor = new Color(236, 255, 31); list.Insert(insertIndex + 3, mageDisplay); diff --git a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs index 59ffdfced2..3af6d8f825 100644 --- a/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs +++ b/Items/DraedonMisc/EncryptedSchematicSunkenSea.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Items.DraedonMisc int insertIndex = list.FindIndex(x => x.Name == "Tooltip2" && x.Mod == "Terraria"); if (insertIndex != -1) { - int meleeItem = ModContent.ItemType(); + int meleeItem = ModContent.ItemType(); TooltipLine meleeDisplay = new TooltipLine(this.Mod, "CalamityMod:MeleeDisplay", $"[i:{meleeItem}] {CalamityUtils.GetItemName(meleeItem)}"); meleeDisplay.OverrideColor = new Color(236, 255, 31); list.Insert(insertIndex + 1, meleeDisplay); diff --git a/Items/Dyes/InvisibleDye.cs b/Items/Dyes/InvisibleDye.cs new file mode 100644 index 0000000000..af27456e67 --- /dev/null +++ b/Items/Dyes/InvisibleDye.cs @@ -0,0 +1,78 @@ +using Microsoft.Xna.Framework.Graphics; +using Mono.Cecil.Cil; +using MonoMod.Cil; +using Terraria; +using Terraria.DataStructures; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Dyes +{ + public class InvisibleDye : BaseDye + { + public override ArmorShaderData ShaderDataToBind => new ArmorShaderData(Mod.Assets.Request("Effects/Dyes/InvisibleDyeShader"), "DyePass"); + + public override void SafeSetStaticDefaults() + { + Item.ResearchUnlockCount = 3; + } + + public override void SafeSetDefaults() + { + Item.rare = ItemRarityID.Blue; + Item.value = Item.sellPrice(silver: 20); + } + + #region On Edit Hell To Actually Make Player Body Not Draw + public override void Load() + { + On_PlayerDrawLayers.DrawPlayer_21_Head += StopHeadDrawing; + On_PlayerDrawLayers.DrawPlayer_12_Skin += StopBodyAndLegDrawing; + On_PlayerDrawLayers.DrawPlayer_13_Leggings += StopLegClothesDrawing; + On_PlayerDrawLayers.DrawPlayer_17_Torso += StopBodyClothesDrawing; + On_PlayerDrawLayers.DrawPlayer_12_SkinComposite_BackArmShirt += StopCompositeArmDrawing; + On_PlayerDrawLayers.DrawPlayer_28_ArmOverItem += StopBackArmAndUndershirtDrawing; + } + + private static void StopHeadDrawing(On_PlayerDrawLayers.orig_DrawPlayer_21_Head orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cHead == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopBodyAndLegDrawing(On_PlayerDrawLayers.orig_DrawPlayer_12_Skin orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + drawInfo.hidesTopSkin = true; + if (drawInfo.drawPlayer.cLegs == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + drawInfo.hidesBottomSkin = true; + orig(ref drawInfo); + } + private static void StopLegClothesDrawing(On_PlayerDrawLayers.orig_DrawPlayer_13_Leggings orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cLegs == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopBodyClothesDrawing(On_PlayerDrawLayers.orig_DrawPlayer_17_Torso orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopCompositeArmDrawing(On_PlayerDrawLayers.orig_DrawPlayer_12_SkinComposite_BackArmShirt orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + private static void StopBackArmAndUndershirtDrawing(On_PlayerDrawLayers.orig_DrawPlayer_28_ArmOverItem orig, ref PlayerDrawSet drawInfo) + { + if (drawInfo.drawPlayer.cBody == GameShaders.Armor.GetShaderIdFromItemId(ModContent.ItemType())) + return; + orig(ref drawInfo); + } + #endregion + } +} diff --git a/Items/Dyes/InvisibleDye.png b/Items/Dyes/InvisibleDye.png new file mode 100644 index 0000000000..debd5eea5c Binary files /dev/null and b/Items/Dyes/InvisibleDye.png differ diff --git a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs index 9f73c7efe0..6b89b76f91 100644 --- a/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs +++ b/Items/Fishing/BrimstoneCragCatches/Bloodfin.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Fishing.BrimstoneCragCatches public static int RegenTimeBoost = 10; public static int DebuffedRegenBoost = 10; // Does not stack with above - public static int DebuffedRegenTimeFloor = 1800; + public static int DebuffedRegenTimeFloor = 900; public static double ExtraRegenHealthThreshold = 0.75D; public static int FramesForExtraRegen = 30; diff --git a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs index 308fe9e4d2..53b7ba2c8b 100644 --- a/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/EutrophicCrate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.SunkenSea; +using CalamityMod.Tiles.SunkenSea; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches { ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), - ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) })); itemLoot.AddBiomeCrateLootRules(false); diff --git a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs index 57b33bb787..d6cffdeb00 100644 --- a/Items/Fishing/SunkenSeaCatches/PrismCrate.cs +++ b/Items/Fishing/SunkenSeaCatches/PrismCrate.cs @@ -1,4 +1,4 @@ -using CalamityMod.Tiles.SunkenSea; +using CalamityMod.Tiles.SunkenSea; using Terraria; using Terraria.GameContent.ItemDropRules; using Terraria.ID; @@ -38,7 +38,7 @@ namespace CalamityMod.Items.Fishing.SunkenSeaCatches { ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50), - ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) + ItemDropRule.NotScalingWithLuck(ModContent.ItemType(), 1, 20, 50) })); itemLoot.AddBiomeCrateLootRules(); diff --git a/Items/IHoldShiftTooltipItem.cs b/Items/IHoldShiftTooltipItem.cs index 8ef0a22b79..28938b7a60 100644 --- a/Items/IHoldShiftTooltipItem.cs +++ b/Items/IHoldShiftTooltipItem.cs @@ -2,7 +2,7 @@ namespace CalamityMod.Items { - // This interface is used on items where you can hold Left SHIFT for an expanded tooltip. + // This interface is used on items where you can hold SHIFT for an expanded tooltip. // All actual implementation of this behavior is done in CalamityGlobalItemTooltip. public interface IHoldShiftTooltipItem { @@ -52,7 +52,7 @@ namespace CalamityMod.Items #endregion /// - /// Whether holding Left SHIFT for the tooltip extension hides the normal tooltip. Typically this is false. + /// Whether holding SHIFT for the tooltip extension hides the normal tooltip. Typically this is false. /// public virtual bool HidesNormalTooltip => false; diff --git a/Items/LoreItems/LoreCynosure.cs b/Items/LoreItems/LoreCynosure.cs index 314bb4f7ea..2e916362f6 100644 --- a/Items/LoreItems/LoreCynosure.cs +++ b/Items/LoreItems/LoreCynosure.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.LoreItems Item.width = 20; Item.height = 20; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void AddRecipes() diff --git a/Items/LoreItems/LoreDevourerofGods.cs b/Items/LoreItems/LoreDevourerofGods.cs index 04ca63eed8..360f4c90bb 100644 --- a/Items/LoreItems/LoreDevourerofGods.cs +++ b/Items/LoreItems/LoreDevourerofGods.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.LoreItems Item.width = 20; Item.height = 20; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void AddRecipes() diff --git a/Items/LoreItems/LoreYharon.cs b/Items/LoreItems/LoreYharon.cs index ee0dc0feab..25e5910e76 100644 --- a/Items/LoreItems/LoreYharon.cs +++ b/Items/LoreItems/LoreYharon.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.LoreItems Item.width = 20; Item.height = 20; Item.consumable = false; - Item.rare = ModContent.RarityType(); + Item.rare = ModContent.RarityType(); } public override void AddRecipes() diff --git a/Items/Materials/BloodSample.cs b/Items/Materials/BloodSample.cs deleted file mode 100644 index 5576926d81..0000000000 --- a/Items/Materials/BloodSample.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - public class BloodSample : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.SortingPriorityMaterials[Type] = 68; // Sturdy Fossil - ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); - } - - public override void SetDefaults() - { - Item.width = 26; - Item.height = 34; - Item.maxStack = Item.CommonMaxStack; - Item.value = Item.sellPrice(silver: 2); - Item.rare = ItemRarityID.Orange; - - Item.MakeUsableWithChlorophyteExtractinator(); - } - } -} diff --git a/Items/Materials/BloodSample.png b/Items/Materials/BloodSample.png deleted file mode 100644 index 421a652516..0000000000 Binary files a/Items/Materials/BloodSample.png and /dev/null differ diff --git a/Items/Materials/RottenMatter.cs b/Items/Materials/RottenMatter.cs deleted file mode 100644 index bd79bb3508..0000000000 --- a/Items/Materials/RottenMatter.cs +++ /dev/null @@ -1,30 +0,0 @@ -using Terraria; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Materials -{ - [LegacyName("TrueShadowScale")] - public class RottenMatter : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Materials"; - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 25; - ItemID.Sets.SortingPriorityMaterials[Type] = 65; // Crimtane Ore - ItemTrader.ChlorophyteExtractinator.AddOption_OneWay(Type, 1, ModContent.ItemType(), 1); - } - - public override void SetDefaults() - { - Item.width = 28; - Item.height = 32; - Item.maxStack = Item.CommonMaxStack; - Item.value = Item.sellPrice(silver: 2); - Item.rare = ItemRarityID.Orange; - - Item.MakeUsableWithChlorophyteExtractinator(); - } - } -} diff --git a/Items/Materials/RottenMatter.png b/Items/Materials/RottenMatter.png deleted file mode 100644 index b3b9fb798f..0000000000 Binary files a/Items/Materials/RottenMatter.png and /dev/null differ diff --git a/Items/Materials/WulfrumMetalScrap.cs b/Items/Materials/WulfrumMetalScrap.cs index 29df19b121..1f1031014f 100644 --- a/Items/Materials/WulfrumMetalScrap.cs +++ b/Items/Materials/WulfrumMetalScrap.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Items.Materials return true; else { - spriteBatch.Draw(altTexture.Value, position, null, drawColor, 0, origin, altTexture.Size() / 2, SpriteEffects.None, 0); + spriteBatch.Draw(altTexture.Value, position, null, drawColor, 0, altTexture.Size() / 2, scale, SpriteEffects.None, 0); return false; } } diff --git a/Items/Mounts/OnyxExcavator.cs b/Items/Mounts/OnyxExcavator.cs index 402c49a00d..41bb443dd8 100644 --- a/Items/Mounts/OnyxExcavator.cs +++ b/Items/Mounts/OnyxExcavator.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Items.Mounts MountData.buff = ModContent.BuffType(); // Horizontal movement - MountData.runSpeed = 5.5f; + MountData.runSpeed = 4.5f; MountData.swimSpeed = 0.5f; - MountData.acceleration = 0.2f; + MountData.acceleration = 0.1f; // Vertical movement MountData.fallDamage = 0f; diff --git a/Items/PermanentBoosters/MiracleFruit.cs b/Items/PermanentBoosters/MiracleFruit.cs index 974b0cbc05..ce2efc22de 100644 --- a/Items/PermanentBoosters/MiracleFruit.cs +++ b/Items/PermanentBoosters/MiracleFruit.cs @@ -70,7 +70,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(5). AddIngredient(12). AddTile(TileID.MythrilAnvil). diff --git a/Items/PermanentBoosters/SacredStrawberry.cs b/Items/PermanentBoosters/SacredStrawberry.cs index e22276385a..94cb0bf4ed 100644 --- a/Items/PermanentBoosters/SacredStrawberry.cs +++ b/Items/PermanentBoosters/SacredStrawberry.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(5). AddIngredient(). AddTile(). diff --git a/Items/PermanentBoosters/SanguineTangerine.cs b/Items/PermanentBoosters/SanguineTangerine.cs index 1348fda9fe..7fa60d5666 100644 --- a/Items/PermanentBoosters/SanguineTangerine.cs +++ b/Items/PermanentBoosters/SanguineTangerine.cs @@ -71,7 +71,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(10). AddIngredient(ItemID.SoulofFright, 5). AddIngredient(ItemID.SoulofMight, 5). diff --git a/Items/PermanentBoosters/TaintedCloudberry.cs b/Items/PermanentBoosters/TaintedCloudberry.cs index 56fc3b45ac..f78a25b857 100644 --- a/Items/PermanentBoosters/TaintedCloudberry.cs +++ b/Items/PermanentBoosters/TaintedCloudberry.cs @@ -72,7 +72,7 @@ namespace CalamityMod.Items.PermanentBoosters public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.LifeFruit, 5). + AddIngredient(ItemID.LifeFruit). AddIngredient(10). AddIngredient(8). AddTile(TileID.MythrilAnvil). diff --git a/Items/Placeables/Astral/CelestialRemains.cs b/Items/Placeables/Astral/CelestialRemains.cs index 5c5a398db9..1ac5969a51 100644 --- a/Items/Placeables/Astral/CelestialRemains.cs +++ b/Items/Placeables/Astral/CelestialRemains.cs @@ -108,32 +108,32 @@ namespace CalamityMod.Items.Placeables.Astral resultType = ItemID.Amber; resultStack = Main.rand.Next(1, 21); } - else if (val < 81.78f) + else if (val < 81.78f && Main.hardMode) { resultType = ItemID.PalladiumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 83.03f) + else if (val < 83.03f && Main.hardMode) { resultType = ItemID.CobaltOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 85.03f) + else if (val < 85.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre : ItemID.MythrilOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 87.03f) + else if (val < 87.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre : ItemID.OrichalcumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 88.78f) + else if (val < 88.78f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre : ItemID.AdamantiteOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 89.53f) + else if (val < 89.53f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); diff --git a/Items/Placeables/Astral/NovaeSlag.cs b/Items/Placeables/Astral/NovaeSlag.cs index b78942be81..116e17712e 100644 --- a/Items/Placeables/Astral/NovaeSlag.cs +++ b/Items/Placeables/Astral/NovaeSlag.cs @@ -97,32 +97,32 @@ namespace CalamityMod.Items.Placeables.Astral resultType = ItemID.Amber; resultStack = Main.rand.Next(1, 21); } - else if (val < 78.78f) + else if (val < 78.78f && Main.hardMode) { resultType = ItemID.PalladiumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 81.03f) + else if (val < 81.03f && Main.hardMode) { resultType = ItemID.CobaltOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 83.03f) + else if (val < 83.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : ItemID.MythrilOre : ItemID.MythrilOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 85.03f) + else if (val < 85.03f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : ItemID.OrichalcumOre : ItemID.OrichalcumOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 86.78f) + else if (val < 86.78f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.CobaltOre : !twoMechsDowned ? ItemID.MythrilOre : ItemID.AdamantiteOre : ItemID.AdamantiteOre; resultStack = Main.rand.Next(1, 17); } - else if (val < 88.53f) + else if (val < 88.53f && Main.hardMode) { resultType = CalamityServerConfig.Instance.EarlyHardmodeProgressionRework ? !NPC.downedMechBossAny ? ItemID.PalladiumOre : !twoMechsDowned ? ItemID.OrichalcumOre : ItemID.TitaniumOre : ItemID.TitaniumOre; resultStack = Main.rand.Next(1, 17); diff --git a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs index 073307f246..372f45c854 100644 --- a/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs +++ b/Items/Placeables/Furniture/DevPaintings/ThankYouPainting.cs @@ -4,7 +4,6 @@ using CalamityMod.Tiles.Furniture.DevPaintings; using Terraria; using Terraria.ID; using Terraria.ModLoader; -using static Microsoft.Xna.Framework.Input.Keys; namespace CalamityMod.Items.Placeables.Furniture.DevPaintings { @@ -24,7 +23,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings public override void ModifyTooltips(List tooltips) { - if (!Main.keyState.IsKeyDown(LeftShift)) + if (!Main.keyState.PressingShift()) return; string tooltip = ""; @@ -52,11 +51,11 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings public static IList devList = new List() { "Altix", - "Angel", "apotofkoolaid", "AquaSG", "Atalya", "Ben-TK", + "Big E", "CDMusic", "Cei", "CongratsIsTrash", @@ -65,6 +64,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "CrabBar", "Dandy", "Dia", + "Done", "dozezoze", "Eddie Spaghetti", "ENNWAY", @@ -73,7 +73,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "fryzahh", "HaguriHat", "Heart Plus Up!", - "Hugekraken", "LordMetarex", "Memes", "Mercutio 'Merkalto' Takle", @@ -90,7 +89,9 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Shayy", "Spider Prov", "StipulateVenus", + "Sunny", "Tobias", + "Tomat", "Triangle", "TYESKI (Universe)", "Uncle Danny", @@ -117,7 +118,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "DarkTiny", "Demik", "DM Dokuro", - "Done", "Doog", "drh", "dwshin", @@ -136,6 +136,7 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "Graydee", "Grox the Great", "Hectique", + "Hugekraken", "Huggles", "Ian-1KV", "IbanPlay", @@ -189,7 +190,6 @@ namespace CalamityMod.Items.Placeables.Furniture.DevPaintings "ThousandFields", "TikiWiki", "Tinymanx", - "Tomat", "Trivaxy", "Uberransy", "Vaikyia", diff --git a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs index 7029bff471..b36d59a964 100644 --- a/Items/Placeables/Furniture/Monoliths/AstralProjector.cs +++ b/Items/Placeables/Furniture/Monoliths/AstralProjector.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using CalamityMod.Tiles.Furniture.Monoliths; using Terraria; using Terraria.ID; diff --git a/Items/Placeables/Furniture/ResilientCandle.cs b/Items/Placeables/Furniture/ResilientCandle.cs index 65bc15e3db..0bb9adab8a 100644 --- a/Items/Placeables/Furniture/ResilientCandle.cs +++ b/Items/Placeables/Furniture/ResilientCandle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } diff --git a/Items/Placeables/Furniture/SpitefulCandle.cs b/Items/Placeables/Furniture/SpitefulCandle.cs index a47f64652c..1c6cf59f01 100644 --- a/Items/Placeables/Furniture/SpitefulCandle.cs +++ b/Items/Placeables/Furniture/SpitefulCandle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } diff --git a/Items/Placeables/Furniture/ThaumaticChair.cs b/Items/Placeables/Furniture/ThaumaticChair.cs index 79d46acd0a..32e3c9a452 100644 --- a/Items/Placeables/Furniture/ThaumaticChair.cs +++ b/Items/Placeables/Furniture/ThaumaticChair.cs @@ -5,7 +5,7 @@ using CalamityMod.Items.Placeables.FurnitureAncient; using CalamityMod.Items.Placeables.FurnitureAshen; using CalamityMod.Items.Placeables.FurnitureBotanic; using CalamityMod.Items.Placeables.FurnitureCosmilite; -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using CalamityMod.Items.Placeables.FurnitureExo; using CalamityMod.Items.Placeables.FurnitureMarnite; using CalamityMod.Items.Placeables.FurnitureMonolith; @@ -47,7 +47,7 @@ namespace CalamityMod.Items.Placeables.Furniture AddIngredient(). AddIngredient(). AddIngredient(). - AddIngredient(). + AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). diff --git a/Items/Placeables/Furniture/VigorousCandle.cs b/Items/Placeables/Furniture/VigorousCandle.cs index 6de8e51070..e203002839 100644 --- a/Items/Placeables/Furniture/VigorousCandle.cs +++ b/Items/Placeables/Furniture/VigorousCandle.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } diff --git a/Items/Placeables/Furniture/VoidTorch.cs b/Items/Placeables/Furniture/VoidTorch.cs index 8f1d5467ba..e759ca8304 100644 --- a/Items/Placeables/Furniture/VoidTorch.cs +++ b/Items/Placeables/Furniture/VoidTorch.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Placeables.Furniture { + [LegacyName("AbyssTorch")] public class VoidTorch : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; diff --git a/Items/Placeables/Furniture/WeightlessCandle.cs b/Items/Placeables/Furniture/WeightlessCandle.cs index b6ba17a590..834e56cb4d 100644 --- a/Items/Placeables/Furniture/WeightlessCandle.cs +++ b/Items/Placeables/Furniture/WeightlessCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.Furniture public override void SetDefaults() { Item.DefaultToPlaceableTile(ModContent.TileType()); - Item.value = Item.sellPrice(gold: 20); + Item.value = Item.buyPrice(gold: 25); // Sold by Wizard Item.rare = ItemRarityID.Pink; } } diff --git a/Items/Placeables/Abyss/Acidwood.cs b/Items/Placeables/FurnitureAcidwood/Acidwood.cs similarity index 92% rename from Items/Placeables/Abyss/Acidwood.cs rename to Items/Placeables/FurnitureAcidwood/Acidwood.cs index 629a1cdfe9..64399f45f5 100644 --- a/Items/Placeables/Abyss/Acidwood.cs +++ b/Items/Placeables/FurnitureAcidwood/Acidwood.cs @@ -3,8 +3,9 @@ using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Abyss; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Tiles.FurnitureAcidwood; -namespace CalamityMod.Items.Placeables.Abyss +namespace CalamityMod.Items.Placeables.FurnitureAcidwood { public class Acidwood : ModItem, ILocalizedModType { diff --git a/Items/Placeables/Abyss/Acidwood.png b/Items/Placeables/FurnitureAcidwood/Acidwood.png similarity index 100% rename from Items/Placeables/Abyss/Acidwood.png rename to Items/Placeables/FurnitureAcidwood/Acidwood.png diff --git a/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs b/Items/Placeables/FurnitureAncient/AncientAltar.cs similarity index 66% rename from Items/Placeables/Furniture/CraftingStations/AncientAltar.cs rename to Items/Placeables/FurnitureAncient/AncientAltar.cs index 5af066ec73..0a34f22f7e 100644 --- a/Items/Placeables/Furniture/CraftingStations/AncientAltar.cs +++ b/Items/Placeables/FurnitureAncient/AncientAltar.cs @@ -4,28 +4,23 @@ using CalamityMod.Items.Placeables.Ores; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureAncient { public class AncientAltar : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(10). AddIngredient(5). - AddTile(TileID.Anvils). + AddTile(ModContent.TileType()). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/AncientAltar.png b/Items/Placeables/FurnitureAncient/AncientAltar.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/AncientAltar.png rename to Items/Placeables/FurnitureAncient/AncientAltar.png diff --git a/Items/Placeables/FurnitureAncient/AncientBasin.cs b/Items/Placeables/FurnitureAncient/AncientBasin.cs index 13ce692fbb..ec7caa55c0 100644 --- a/Items/Placeables/FurnitureAncient/AncientBasin.cs +++ b/Items/Placeables/FurnitureAncient/AncientBasin.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(10). AddIngredient(5). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientBathtub.cs b/Items/Placeables/FurnitureAncient/AncientBathtub.cs index 6e4f0a4bf1..c95fa1da0e 100644 --- a/Items/Placeables/FurnitureAncient/AncientBathtub.cs +++ b/Items/Placeables/FurnitureAncient/AncientBathtub.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientBed.cs b/Items/Placeables/FurnitureAncient/AncientBed.cs index 09a2cc6c59..91b7f8f97f 100644 --- a/Items/Placeables/FurnitureAncient/AncientBed.cs +++ b/Items/Placeables/FurnitureAncient/AncientBed.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientBookcase.cs b/Items/Placeables/FurnitureAncient/AncientBookcase.cs index ff4c9d256c..f68aa1ae4e 100644 --- a/Items/Placeables/FurnitureAncient/AncientBookcase.cs +++ b/Items/Placeables/FurnitureAncient/AncientBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientChair.cs b/Items/Placeables/FurnitureAncient/AncientChair.cs index 2d72d10df0..69328c6969 100644 --- a/Items/Placeables/FurnitureAncient/AncientChair.cs +++ b/Items/Placeables/FurnitureAncient/AncientChair.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientChandelier.cs b/Items/Placeables/FurnitureAncient/AncientChandelier.cs index 8868fe6ff2..3c603f551d 100644 --- a/Items/Placeables/FurnitureAncient/AncientChandelier.cs +++ b/Items/Placeables/FurnitureAncient/AncientChandelier.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientDoor.cs b/Items/Placeables/FurnitureAncient/AncientDoor.cs index 6182a586f9..0ae58a1326 100644 --- a/Items/Placeables/FurnitureAncient/AncientDoor.cs +++ b/Items/Placeables/FurnitureAncient/AncientDoor.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientDresser.cs b/Items/Placeables/FurnitureAncient/AncientDresser.cs index 7724410586..62b6fc0f83 100644 --- a/Items/Placeables/FurnitureAncient/AncientDresser.cs +++ b/Items/Placeables/FurnitureAncient/AncientDresser.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientLamp.cs b/Items/Placeables/FurnitureAncient/AncientLamp.cs index ae71b05abc..9f61fda5fe 100644 --- a/Items/Placeables/FurnitureAncient/AncientLamp.cs +++ b/Items/Placeables/FurnitureAncient/AncientLamp.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientLantern.cs b/Items/Placeables/FurnitureAncient/AncientLantern.cs index 6dc360c7b1..74bcc5acfc 100644 --- a/Items/Placeables/FurnitureAncient/AncientLantern.cs +++ b/Items/Placeables/FurnitureAncient/AncientLantern.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientMonolith.cs b/Items/Placeables/FurnitureAncient/AncientMonolith.cs index afa334c193..992edc8224 100644 --- a/Items/Placeables/FurnitureAncient/AncientMonolith.cs +++ b/Items/Placeables/FurnitureAncient/AncientMonolith.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs index 8b31f31ee6..24651e8b78 100644 --- a/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs +++ b/Items/Placeables/FurnitureAncient/AncientPipeOrgan.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientSink.cs b/Items/Placeables/FurnitureAncient/AncientSink.cs index 5c80b977c8..11d515986b 100644 --- a/Items/Placeables/FurnitureAncient/AncientSink.cs +++ b/Items/Placeables/FurnitureAncient/AncientSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.LavaBucket). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientSofa.cs b/Items/Placeables/FurnitureAncient/AncientSofa.cs index 3b3465f326..2cef2b30a7 100644 --- a/Items/Placeables/FurnitureAncient/AncientSofa.cs +++ b/Items/Placeables/FurnitureAncient/AncientSofa.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientTable.cs b/Items/Placeables/FurnitureAncient/AncientTable.cs index 84a5e49443..d8ec7df3dc 100644 --- a/Items/Placeables/FurnitureAncient/AncientTable.cs +++ b/Items/Placeables/FurnitureAncient/AncientTable.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs index feec1ee3dd..88f5dab85d 100644 --- a/Items/Placeables/FurnitureAncient/AncientWorkBench.cs +++ b/Items/Placeables/FurnitureAncient/AncientWorkBench.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureAncient { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs b/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs index 60c180e58a..5af97d2f14 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBathtub.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBed.cs b/Items/Placeables/FurnitureBotanic/BotanicBed.cs index 1acb0c3b02..6ca307fc30 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBed.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBench.cs b/Items/Placeables/FurnitureBotanic/BotanicBench.cs index 466cedef84..a4624d0dd3 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBench.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBench.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs b/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs index b648886bd6..90a4f6c43c 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs b/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs index 0e6140697e..cd646f304d 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicCandle.cs b/Items/Placeables/FurnitureBotanic/BotanicCandle.cs index 00abbcf2e1..b785331349 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicCandle.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicChair.cs b/Items/Placeables/FurnitureBotanic/BotanicChair.cs index b09dc4e440..d58cad346b 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChair.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChair.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs b/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs index 136936f5d5..3fbb85558b 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicChest.cs b/Items/Placeables/FurnitureBotanic/BotanicChest.cs index ea8c94157f..316f34fcc0 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicChest.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicClock.cs b/Items/Placeables/FurnitureBotanic/BotanicClock.cs index 8687c3d0d0..b18deb8e2d 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicClock.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicDoor.cs b/Items/Placeables/FurnitureBotanic/BotanicDoor.cs index 2994122832..89e7e883c0 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicDoor.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicDoor.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicDresser.cs b/Items/Placeables/FurnitureBotanic/BotanicDresser.cs index bae1342b7f..f924debd78 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicDresser.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicDresser.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicLamp.cs b/Items/Placeables/FurnitureBotanic/BotanicLamp.cs index e1721c14f0..91a283b051 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicLamp.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicLantern.cs b/Items/Placeables/FurnitureBotanic/BotanicLantern.cs index 016f715296..81fe09456b 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicLantern.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicPiano.cs b/Items/Placeables/FurnitureBotanic/BotanicPiano.cs index bcb626d113..8f6496ee73 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicPiano.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs b/Items/Placeables/FurnitureBotanic/BotanicPlanter.cs similarity index 62% rename from Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs rename to Items/Placeables/FurnitureBotanic/BotanicPlanter.cs index bdaac5f684..c06b0e6e63 100644 --- a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicPlanter.cs @@ -1,28 +1,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureBotanic { public class BotanicPlanter : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.JungleSpores, 5). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png b/Items/Placeables/FurnitureBotanic/BotanicPlanter.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/BotanicPlanter.png rename to Items/Placeables/FurnitureBotanic/BotanicPlanter.png diff --git a/Items/Placeables/FurnitureBotanic/BotanicSink.cs b/Items/Placeables/FurnitureBotanic/BotanicSink.cs index 7b2d93382e..f7780421f6 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicSink.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.HoneyBucket). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicTable.cs b/Items/Placeables/FurnitureBotanic/BotanicTable.cs index 72801307f6..a407f157fc 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicTable.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicTable.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs b/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs index 677b7876fc..6992bc754a 100644 --- a/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs +++ b/Items/Placeables/FurnitureBotanic/BotanicWorkBench.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureBotanic { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.LivingLoom). Register(); } } diff --git a/Items/Placeables/SunkenSea/Driftwood.cs b/Items/Placeables/FurnitureDriftwood/Driftwood.cs similarity index 87% rename from Items/Placeables/SunkenSea/Driftwood.cs rename to Items/Placeables/FurnitureDriftwood/Driftwood.cs index d870b66fb5..0c707086a7 100644 --- a/Items/Placeables/SunkenSea/Driftwood.cs +++ b/Items/Placeables/FurnitureDriftwood/Driftwood.cs @@ -1,7 +1,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.SunkenSea +namespace CalamityMod.Items.Placeables.FurnitureDriftwood { public class Driftwood : ModItem, ILocalizedModType { @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.Wood; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) { diff --git a/Items/Placeables/SunkenSea/Driftwood.png b/Items/Placeables/FurnitureDriftwood/Driftwood.png similarity index 100% rename from Items/Placeables/SunkenSea/Driftwood.png rename to Items/Placeables/FurnitureDriftwood/Driftwood.png diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.cs new file mode 100644 index 0000000000..2db737545a --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.FurnitureDriftwood; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBaroqueCello : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 4). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.png new file mode 100644 index 0000000000..d212716b57 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBaroqueCello.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.cs new file mode 100644 index 0000000000..42217ec36b --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBathtub : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(14). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.png new file mode 100644 index 0000000000..73c7b19ed4 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBathtub.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBed.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.cs new file mode 100644 index 0000000000..7f41e9909e --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBed : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 4); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 5). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBed.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.png new file mode 100644 index 0000000000..39ef943058 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBed.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.cs new file mode 100644 index 0000000000..0ceb8e9e25 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodBookcase : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(20). + AddIngredient(ItemID.Book, 10). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.png b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.png new file mode 100644 index 0000000000..8014290409 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodBookcase.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.cs new file mode 100644 index 0000000000..c979a742d2 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodCandelabra : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 3); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Torch, 3). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.png b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.png new file mode 100644 index 0000000000..cf0798c369 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodCandelabra.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.cs new file mode 100644 index 0000000000..5d64ff15af --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodCandle : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.png b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.png new file mode 100644 index 0000000000..4bb35c5f2a Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodCandle.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChair.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.cs new file mode 100644 index 0000000000..324b392b8d --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodChair : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChair.png b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.png new file mode 100644 index 0000000000..ec6e9bd9ee Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodChair.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.cs new file mode 100644 index 0000000000..67264739f7 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodChandelier : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch, 4). + AddIngredient(ItemID.Chain). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.png b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.png new file mode 100644 index 0000000000..59ca9bc75a Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodChandelier.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChest.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.cs new file mode 100644 index 0000000000..09371eb58f --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodChest : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddRecipeGroup("IronBar", 2). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodChest.png b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.png new file mode 100644 index 0000000000..1d0b01e9f3 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodChest.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.cs new file mode 100644 index 0000000000..24a13ffa5d --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.FurnitureDriftwood; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodDoor : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 40); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.png b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.png new file mode 100644 index 0000000000..ed03fbc288 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodDoor.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.cs new file mode 100644 index 0000000000..c0e4945091 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodDresser : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(16). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.png b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.png new file mode 100644 index 0000000000..0e10813c48 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodDresser.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.cs new file mode 100644 index 0000000000..eb7ef97722 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodLamp : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Torch). + AddIngredient(3). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.png b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.png new file mode 100644 index 0000000000..fdcf21b3c4 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodLamp.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.cs new file mode 100644 index 0000000000..bc42935b65 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodLantern : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.png b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.png new file mode 100644 index 0000000000..952adc2cf2 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodLantern.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.cs new file mode 100644 index 0000000000..bebc858e99 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodPlatform : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 200; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + public override void AddRecipes() + { + CreateRecipe(2). + AddIngredient(). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.png b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.png new file mode 100644 index 0000000000..1bd785cc73 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodPlatform.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSink.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.cs new file mode 100644 index 0000000000..4dd848f719 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodSink : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.WaterBucket). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSink.png b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.png new file mode 100644 index 0000000000..2ff5b161f6 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodSink.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.cs new file mode 100644 index 0000000000..f15523527f --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodSofa : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Silk, 2). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.png b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.png new file mode 100644 index 0000000000..77730724c1 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodSofa.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.cs new file mode 100644 index 0000000000..5de21becdc --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodSundial : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddRecipeGroup("IronBar", 3). + AddIngredient(ItemID.Glass, 6). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.png b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.png new file mode 100644 index 0000000000..959cb779c9 Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodSundial.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodTable.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.cs new file mode 100644 index 0000000000..49890c4505 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodTable : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodTable.png b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.png new file mode 100644 index 0000000000..a6db8a185b Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodTable.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.cs new file mode 100644 index 0000000000..5b5863386e --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodToilet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.png b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.png new file mode 100644 index 0000000000..65321ca8fb Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodToilet.png differ diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.cs b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.cs new file mode 100644 index 0000000000..d93e4a0817 --- /dev/null +++ b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.cs @@ -0,0 +1,24 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureDriftwood +{ + public class DriftwoodWorkBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.png b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.png new file mode 100644 index 0000000000..e8125c908e Binary files /dev/null and b/Items/Placeables/FurnitureDriftwood/DriftwoodWorkBench.png differ diff --git a/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs b/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs index c74ae9cd78..ca19d16f17 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteBathtub.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteBed.cs b/Items/Placeables/FurnitureMarnite/MarniteBed.cs index 75e39a9129..76bb5b7a42 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteBed.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Silk, 5). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs b/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs index d86b858582..3ba23a6beb 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Book, 10). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs b/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs index a7d2ebea32..2597db9c86 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch, 4). - AddTile(TileID.WorkBenches). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteClock.cs b/Items/Placeables/FurnitureMarnite/MarniteClock.cs index 2a65849521..d2e93221e6 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteClock.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteClock.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite AddIngredient(4). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteDresser.cs b/Items/Placeables/FurnitureMarnite/MarniteDresser.cs index 7eee4ef299..eab9197ea6 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteDresser.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteDresser.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs b/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs index d4e8f381f4..ad53340e47 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteOrgan.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite AddIngredient(1). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteSofa.cs b/Items/Placeables/FurnitureMarnite/MarniteSofa.cs index f754aaf8a8..999add1972 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteSofa.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteSofa.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Silk, 2). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteToilet.cs b/Items/Placeables/FurnitureMarnite/MarniteToilet.cs index 9d91fac578..02d6a94e66 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteToilet.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteToilet.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(6). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs b/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs index 631e7ede23..fbe3a96370 100644 --- a/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs +++ b/Items/Placeables/FurnitureMarnite/MarniteWorkBench.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs b/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs index 156984f82d..385e5b8f69 100644 --- a/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs +++ b/Items/Placeables/FurnitureMarnite/PolishedMarniteBlock.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMarnite public override void AddRecipes() { - CreateRecipe(). + CreateRecipe(4). AddIngredient(ItemID.Marble, 2). AddIngredient(ItemID.Granite, 2). AddRecipeGroup(RecipeSystem.AnyGoldOre, 1). diff --git a/Items/Placeables/Astral/AstralMonolith.cs b/Items/Placeables/FurnitureMonolith/AstralMonolith.cs similarity index 86% rename from Items/Placeables/Astral/AstralMonolith.cs rename to Items/Placeables/FurnitureMonolith/AstralMonolith.cs index df2a693ba4..58f088114a 100644 --- a/Items/Placeables/Astral/AstralMonolith.cs +++ b/Items/Placeables/FurnitureMonolith/AstralMonolith.cs @@ -1,9 +1,9 @@ -using CalamityMod.Items.Placeables.FurnitureMonolith; +using CalamityMod.Items.Placeables.Astral; using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Astral +namespace CalamityMod.Items.Placeables.FurnitureMonolith { public class AstralMonolith : ModItem, ILocalizedModType { @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Placeables.Astral ItemID.Sets.ShimmerTransformToItem[Type] = ItemID.Wood; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) { diff --git a/Items/Placeables/Astral/AstralMonolith.png b/Items/Placeables/FurnitureMonolith/AstralMonolith.png similarity index 100% rename from Items/Placeables/Astral/AstralMonolith.png rename to Items/Placeables/FurnitureMonolith/AstralMonolith.png diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs b/Items/Placeables/FurnitureMonolith/MonolithAmalgam.cs similarity index 63% rename from Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs rename to Items/Placeables/FurnitureMonolith/MonolithAmalgam.cs index 1f3116f9b6..daa3809586 100644 --- a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithAmalgam.cs @@ -2,7 +2,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureMonolith { [LegacyName("MonolithCrafting")] public class MonolithAmalgam : ModItem, ILocalizedModType @@ -10,20 +10,15 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(20). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.png b/Items/Placeables/FurnitureMonolith/MonolithAmalgam.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/MonolithAmalgam.png rename to Items/Placeables/FurnitureMonolith/MonolithAmalgam.png diff --git a/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs b/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs index 180e480867..4b8b1ddb7a 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBathtub.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithBed.cs b/Items/Placeables/FurnitureMonolith/MonolithBed.cs index 1d333de777..11a5b1b15a 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBed.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBed.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithBench.cs b/Items/Placeables/FurnitureMonolith/MonolithBench.cs index 8498b4de74..a0c78194b3 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBench.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBench.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs b/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs index c2c7c915d8..3f1c9b7a85 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs b/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs index 70090c243b..873725f333 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithCandelabra.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithCandle.cs b/Items/Placeables/FurnitureMonolith/MonolithCandle.cs index f76318e634..3f829512f1 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithCandle.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithCandle.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithChair.cs b/Items/Placeables/FurnitureMonolith/MonolithChair.cs index 25bd448184..d786a4ab6f 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChair.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChair.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs b/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs index e3a72a15c7..71dbcc7ccf 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChandelier.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithChest.cs b/Items/Placeables/FurnitureMonolith/MonolithChest.cs index 6192e86422..6b44623b5b 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithChest.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithChest.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithClock.cs b/Items/Placeables/FurnitureMonolith/MonolithClock.cs index 8878384da9..a45174c2c7 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithClock.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithClock.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithDoor.cs b/Items/Placeables/FurnitureMonolith/MonolithDoor.cs index 0f01131333..08cdd65ea1 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithDoor.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithDoor.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithDresser.cs b/Items/Placeables/FurnitureMonolith/MonolithDresser.cs index 1c1d788560..f77e09789d 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithDresser.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithDresser.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithLamp.cs b/Items/Placeables/FurnitureMonolith/MonolithLamp.cs index 2b9635cdad..d315b40511 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithLamp.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithLamp.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithLantern.cs b/Items/Placeables/FurnitureMonolith/MonolithLantern.cs index 63692653c1..5c0685f57f 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithLantern.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithLantern.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithPiano.cs b/Items/Placeables/FurnitureMonolith/MonolithPiano.cs index 2c6238a177..91af9b49fe 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithPiano.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithPiano.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithSink.cs b/Items/Placeables/FurnitureMonolith/MonolithSink.cs index 65f6164663..a6f2f4b910 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithSink.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithSink.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithTable.cs b/Items/Placeables/FurnitureMonolith/MonolithTable.cs index af80d2f04d..8aa8eab032 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithTable.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithTable.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs b/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs index 7aab4573e8..a63ece403f 100644 --- a/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs +++ b/Items/Placeables/FurnitureMonolith/MonolithWorkBench.cs @@ -18,7 +18,6 @@ namespace CalamityMod.Items.Placeables.FurnitureMonolith { CreateRecipe(). AddIngredient(10). - AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs new file mode 100644 index 0000000000..f513a1a114 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBathtub")] + public class AncientNavystoneBathtub : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(14). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBathtub.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs new file mode 100644 index 0000000000..066f41bce1 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBed")] + public class AncientNavystoneBed : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 4); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 5). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBed.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBed.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs new file mode 100644 index 0000000000..1070db8bd9 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBench")] + public class AncientNavystoneBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBench.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBench.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs new file mode 100644 index 0000000000..6433472084 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBookcase")] + public class AncientNavystoneBookcase : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(20). + AddIngredient(ItemID.Book, 10). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicBookcase.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs new file mode 100644 index 0000000000..186efab3fc --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandelabra")] + public class AncientNavystoneCandelabra : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 3); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Torch, 3). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs new file mode 100644 index 0000000000..a403118f45 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandle")] + public class AncientNavystoneCandle : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandle.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs new file mode 100644 index 0000000000..d560526fbf --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChair")] + public class AncientNavystoneChair : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChair.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicChair.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs new file mode 100644 index 0000000000..c68d8a9923 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs @@ -0,0 +1,29 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChandelier")] + public class AncientNavystoneChandelier : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch, 4). + AddIngredient(ItemID.Chain). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicChandelier.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs new file mode 100644 index 0000000000..b2dd187125 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChest")] + public class AncientNavystoneChest : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddRecipeGroup("IronBar", 2). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChest.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicChest.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs new file mode 100644 index 0000000000..a3877aca24 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs @@ -0,0 +1,29 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicClock")] + public class AncientNavystoneClock : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddRecipeGroup("IronBar", 3). + AddIngredient(ItemID.Glass, 6). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicClock.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicClock.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.cs new file mode 100644 index 0000000000..ed3d9c9052 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.cs @@ -0,0 +1,29 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using CalamityMod.Tiles.FurnitureNavystone; +using CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDoor")] + public class AncientNavystoneDoor : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 40); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicDoor.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoor.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs new file mode 100644 index 0000000000..d24b1ec83c --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDresser")] + public class AncientNavystoneDresser : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(16). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicDresser.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs new file mode 100644 index 0000000000..32ffdfabe8 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLamp")] + public class AncientNavystoneLamp : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(3). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicLamp.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs new file mode 100644 index 0000000000..4a5de1d91b --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLantern")] + public class AncientNavystoneLantern : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.Torch). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicLantern.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs new file mode 100644 index 0000000000..baf2ee4181 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs @@ -0,0 +1,28 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPiano")] + public class AncientNavystonePiano : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Bone, 4). + AddIngredient(ItemID.Book). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicPiano.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs new file mode 100644 index 0000000000..5508dbcad0 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPlatform")] + public class AncientNavystonePlatform : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 200; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + public override void AddRecipes() + { + CreateRecipe(2). + AddIngredient(). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicPlatform.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs new file mode 100644 index 0000000000..142c3deb30 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicSink")] + public class AncientNavystoneSink : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.WaterBucket). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicSink.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicSink.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs new file mode 100644 index 0000000000..0ec2790536 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicTable")] + public class AncientNavystoneTable : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicTable.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicTable.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png diff --git a/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs new file mode 100644 index 0000000000..622b46f7c0 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicWorkBench")] + public class AncientNavystoneWorkBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png diff --git a/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs similarity index 78% rename from Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs index 5fe203a28e..ef6ec61025 100644 --- a/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.cs +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs @@ -2,7 +2,7 @@ using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone { public class AncientSmoothNavystone : ModItem, ILocalizedModType { @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic Item.ResearchUnlockCount = 100; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); /*public override void AddRecipes() { diff --git a/Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/AncientSmoothNavystone.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png diff --git a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs similarity index 66% rename from Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs index b403fe488c..bb40af0be1 100644 --- a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.cs +++ b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone { [LegacyName("EutrophicCrafting")] public class EutrophicShelf : ModItem, ILocalizedModType @@ -12,23 +12,18 @@ namespace CalamityMod.Items.Placeables.Furniture.CraftingStations public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 50); // This is too easy to craft to sell for 2 gold } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(10). AddIngredient(5). AddIngredient(5). AddIngredient(3). - AddTile(TileID.WorkBenches). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/EutrophicShelf.png b/Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/EutrophicShelf.png rename to Items/Placeables/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicBench.cs rename to Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs index 20f4da4428..3bea3df35d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBench.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBench : ModItem, ILocalizedModType + public class NavystoneBathtub : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). - AddTile(). + AddIngredient(14). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneBathtub.png b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.png new file mode 100644 index 0000000000..d096c1edb4 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneBathtub.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs b/Items/Placeables/FurnitureNavystone/NavystoneBed.cs similarity index 70% rename from Items/Placeables/FurnitureEutrophic/EutrophicBed.cs rename to Items/Placeables/FurnitureNavystone/NavystoneBed.cs index dd9074f28f..0331f11379 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBed.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneBed.cs @@ -3,23 +3,23 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBed : ModItem, ILocalizedModType + public class NavystoneBed : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 4); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneBed.png b/Items/Placeables/FurnitureNavystone/NavystoneBed.png new file mode 100644 index 0000000000..6336a84e7d Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneBed.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs rename to Items/Placeables/FurnitureNavystone/NavystoneBookcase.cs index 6ad2fb84a5..c15d2e9602 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.cs @@ -3,23 +3,23 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBookcase : ModItem, ILocalizedModType + public class NavystoneBookcase : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(20). + AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneBookcase.png b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.png new file mode 100644 index 0000000000..29cde351e8 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneBookcase.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs rename to Items/Placeables/FurnitureNavystone/NavystoneCandelabra.cs index 8351687fae..0d7400ce54 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicCandelabra : ModItem, ILocalizedModType + public class NavystoneCandelabra : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 3); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(5). + AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.png b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.png new file mode 100644 index 0000000000..f238bbc491 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneCandelabra.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs b/Items/Placeables/FurnitureNavystone/NavystoneCandle.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs rename to Items/Placeables/FurnitureNavystone/NavystoneCandle.cs index e159fc7cfc..7dfdee5c2b 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicCandle.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneCandle.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicCandle : ModItem, ILocalizedModType + public class NavystoneCandle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneCandle.png b/Items/Placeables/FurnitureNavystone/NavystoneCandle.png new file mode 100644 index 0000000000..3bbac4d65c Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneCandle.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs b/Items/Placeables/FurnitureNavystone/NavystoneChair.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs rename to Items/Placeables/FurnitureNavystone/NavystoneChair.cs index 74c10dc6db..6ed1c890cb 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneChair.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicWorkBench : ModItem, ILocalizedModType + public class NavystoneChair : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 30); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). - AddTile(). + AddIngredient(4). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneChair.png b/Items/Placeables/FurnitureNavystone/NavystoneChair.png new file mode 100644 index 0000000000..bfb86147f9 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneChair.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.cs similarity index 71% rename from Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs rename to Items/Placeables/FurnitureNavystone/NavystoneChandelier.cs index ab029ab282..4c3527eea0 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.cs @@ -4,24 +4,24 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicChandelier : ModItem, ILocalizedModType + public class NavystoneChandelier : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). + AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.Anvils). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneChandelier.png b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.png new file mode 100644 index 0000000000..e62c1e7c0e Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneChandelier.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs b/Items/Placeables/FurnitureNavystone/NavystoneChest.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicChest.cs rename to Items/Placeables/FurnitureNavystone/NavystoneChest.cs index eb9f034571..5473c4adfd 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChest.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneChest.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicChest : ModItem, ILocalizedModType + public class NavystoneChest : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). + AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneChest.png b/Items/Placeables/FurnitureNavystone/NavystoneChest.png new file mode 100644 index 0000000000..3628fc230d Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneChest.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs b/Items/Placeables/FurnitureNavystone/NavystoneClock.cs similarity index 71% rename from Items/Placeables/FurnitureEutrophic/EutrophicClock.cs rename to Items/Placeables/FurnitureNavystone/NavystoneClock.cs index 30bc7622c0..b2e6d917db 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicClock.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneClock.cs @@ -4,24 +4,24 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicClock : ModItem, ILocalizedModType + public class NavystoneClock : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(10). + AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneClock.png b/Items/Placeables/FurnitureNavystone/NavystoneClock.png new file mode 100644 index 0000000000..ccd6909fe6 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneClock.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs b/Items/Placeables/FurnitureNavystone/NavystoneDoor.cs similarity index 58% rename from Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs rename to Items/Placeables/FurnitureNavystone/NavystoneDoor.cs index 12b9a49e24..33bd862c0a 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDoor.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneDoor.cs @@ -1,26 +1,26 @@ using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Tiles.Furniture.CraftingStations; -using CalamityMod.Tiles.FurnitureEutrophic; +using CalamityMod.Tiles.FurnitureNavystone; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicDoor : ModItem, ILocalizedModType + public class NavystoneDoor : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 40); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). - AddTile(). + AddIngredient(6). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneDoor.png b/Items/Placeables/FurnitureNavystone/NavystoneDoor.png new file mode 100644 index 0000000000..3aeeedfb40 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneDoor.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs b/Items/Placeables/FurnitureNavystone/NavystoneDresser.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs rename to Items/Placeables/FurnitureNavystone/NavystoneDresser.cs index cc508f17c8..da81b3c8ef 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicDresser.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneDresser.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicDresser : ModItem, ILocalizedModType + public class NavystoneDresser : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(16). - AddTile(). + AddIngredient(16). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneDresser.png b/Items/Placeables/FurnitureNavystone/NavystoneDresser.png new file mode 100644 index 0000000000..24ed7def97 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneDresser.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs b/Items/Placeables/FurnitureNavystone/NavystoneLamp.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs rename to Items/Placeables/FurnitureNavystone/NavystoneLamp.cs index 7b366fb21a..0377f93cc4 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLamp.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneLamp.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicLamp : ModItem, ILocalizedModType + public class NavystoneLamp : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(3). + AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneLamp.png b/Items/Placeables/FurnitureNavystone/NavystoneLamp.png new file mode 100644 index 0000000000..a058c3e769 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneLamp.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs b/Items/Placeables/FurnitureNavystone/NavystoneLantern.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs rename to Items/Placeables/FurnitureNavystone/NavystoneLantern.cs index 04a0ff5d2c..f7db6dde5d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicLantern.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneLantern.cs @@ -4,23 +4,23 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicLantern : ModItem, ILocalizedModType + public class NavystoneLantern : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 30); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneLantern.png b/Items/Placeables/FurnitureNavystone/NavystoneLantern.png new file mode 100644 index 0000000000..a88ffc2099 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneLantern.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs b/Items/Placeables/FurnitureNavystone/NavystoneLyre.cs similarity index 71% rename from Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs rename to Items/Placeables/FurnitureNavystone/NavystoneLyre.cs index 40ef588135..fcc0a58f28 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPiano.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneLyre.cs @@ -3,24 +3,24 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicPiano : ModItem, ILocalizedModType + public class NavystoneLyre : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(15). + AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneLyre.png b/Items/Placeables/FurnitureNavystone/NavystoneLyre.png new file mode 100644 index 0000000000..1dc721d732 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneLyre.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs b/Items/Placeables/FurnitureNavystone/NavystonePlatform.cs similarity index 69% rename from Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs rename to Items/Placeables/FurnitureNavystone/NavystonePlatform.cs index f1ccad62a8..c603d7bbd0 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Items/Placeables/FurnitureNavystone/NavystonePlatform.cs @@ -3,9 +3,9 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicPlatform : ModItem, ILocalizedModType + public class NavystonePlatform : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetStaticDefaults() @@ -13,12 +13,12 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic Item.ResearchUnlockCount = 200; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { CreateRecipe(2). - AddIngredient(). + AddIngredient(). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystonePlatform.png b/Items/Placeables/FurnitureNavystone/NavystonePlatform.png new file mode 100644 index 0000000000..926737cb55 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystonePlatform.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs b/Items/Placeables/FurnitureNavystone/NavystoneSink.cs similarity index 70% rename from Items/Placeables/FurnitureEutrophic/EutrophicSink.cs rename to Items/Placeables/FurnitureNavystone/NavystoneSink.cs index 9eab014730..eea8e0073d 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicSink.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneSink.cs @@ -3,23 +3,23 @@ using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicSink : ModItem, ILocalizedModType + public class NavystoneSink : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(6). + AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneSink.png b/Items/Placeables/FurnitureNavystone/NavystoneSink.png new file mode 100644 index 0000000000..dc2dbdd522 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneSink.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs b/Items/Placeables/FurnitureNavystone/NavystoneTable.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicTable.cs rename to Items/Placeables/FurnitureNavystone/NavystoneTable.cs index e615b230a4..009034c1dd 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicTable.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneTable.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicTable : ModItem, ILocalizedModType + public class NavystoneTable : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(8). - AddTile(). + AddIngredient(8). + AddTile(TileID.WorkBenches). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneTable.png b/Items/Placeables/FurnitureNavystone/NavystoneTable.png new file mode 100644 index 0000000000..4dd36e89c9 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneTable.png differ diff --git a/Items/Placeables/FurnitureNavystone/NavystoneToilet.cs b/Items/Placeables/FurnitureNavystone/NavystoneToilet.cs new file mode 100644 index 0000000000..2a06c94973 --- /dev/null +++ b/Items/Placeables/FurnitureNavystone/NavystoneToilet.cs @@ -0,0 +1,26 @@ +using CalamityMod.Tiles.FurnitureNavystone; +using CalamityMod.Tiles.SunkenSea; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureNavystone +{ + public class NavystoneToilet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.Sawmill). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureNavystone/NavystoneToilet.png b/Items/Placeables/FurnitureNavystone/NavystoneToilet.png new file mode 100644 index 0000000000..1ab7abf58e Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneToilet.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.cs similarity index 67% rename from Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs rename to Items/Placeables/FurnitureNavystone/NavystoneTriclinium.cs index 657e022d09..ce3b0b199f 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.cs @@ -4,22 +4,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicBathtub : ModItem, ILocalizedModType + public class NavystoneTriclinium : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 60); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(14). - AddTile(). + AddIngredient(8). + AddTile(TileID.Sawmill). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.png b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.png new file mode 100644 index 0000000000..b760662708 Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneTriclinium.png differ diff --git a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.cs similarity index 68% rename from Items/Placeables/FurnitureEutrophic/EutrophicChair.cs rename to Items/Placeables/FurnitureNavystone/NavystoneWorkBench.cs index 6d0b102069..4979e521b3 100644 --- a/Items/Placeables/FurnitureEutrophic/EutrophicChair.cs +++ b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.cs @@ -4,22 +4,21 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { - public class EutrophicChair : ModItem, ILocalizedModType + public class NavystoneWorkBench : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(copper: 30); } public override void AddRecipes() { CreateRecipe(). - AddIngredient(4). - AddTile(). + AddIngredient(10). Register(); } } diff --git a/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.png b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.png new file mode 100644 index 0000000000..6e12e7b36a Binary files /dev/null and b/Items/Placeables/FurnitureNavystone/NavystoneWorkBench.png differ diff --git a/Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs b/Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.cs similarity index 75% rename from Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs rename to Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.cs index e0aa52e928..e78073a46b 100644 --- a/Items/Placeables/SunkenSea/PolishedNavystoneBrick.cs +++ b/Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.cs @@ -1,7 +1,8 @@ using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Placeables.SunkenSea; -namespace CalamityMod.Items.Placeables.SunkenSea +namespace CalamityMod.Items.Placeables.FurnitureNavystone { public class PolishedNavystoneBrick : ModItem, ILocalizedModType { @@ -11,7 +12,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea Item.ResearchUnlockCount = 100; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/SunkenSea/PolishedNavystoneBrick.png b/Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.png similarity index 100% rename from Items/Placeables/SunkenSea/PolishedNavystoneBrick.png rename to Items/Placeables/FurnitureNavystone/PolishedNavystoneBrick.png diff --git a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs b/Items/Placeables/FurnitureNavystone/SmoothNavystone.cs similarity index 82% rename from Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs rename to Items/Placeables/FurnitureNavystone/SmoothNavystone.cs index 19a4f66101..737345d1a8 100644 --- a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.cs +++ b/Items/Placeables/FurnitureNavystone/SmoothNavystone.cs @@ -1,9 +1,10 @@ using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Placeables.Walls; +using CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.FurnitureEutrophic +namespace CalamityMod.Items.Placeables.FurnitureNavystone { public class SmoothNavystone : ModItem, ILocalizedModType { @@ -14,7 +15,7 @@ namespace CalamityMod.Items.Placeables.FurnitureEutrophic ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/FurnitureEutrophic/SmoothNavystone.png b/Items/Placeables/FurnitureNavystone/SmoothNavystone.png similarity index 100% rename from Items/Placeables/FurnitureEutrophic/SmoothNavystone.png rename to Items/Placeables/FurnitureNavystone/SmoothNavystone.png diff --git a/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.cs b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.cs new file mode 100644 index 0000000000..31ae7192a0 --- /dev/null +++ b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.cs @@ -0,0 +1,30 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Walls; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureRunestone +{ + public class RunestoneTerracotta : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 200; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + //public override void AddRecipes() + //{ + // CreateRecipe(). + // AddIngredient(4). + // AddTile(TileID.WorkBenches). + // DisableDecraft(). + // Register(); + //} + + } +} diff --git a/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.png b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.png new file mode 100644 index 0000000000..32329b4f68 Binary files /dev/null and b/Items/Placeables/FurnitureRunestone/RunestoneTerracotta.png differ diff --git a/Items/Placeables/FurnitureShellstone/ShellTrimBrick.cs b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.cs new file mode 100644 index 0000000000..b891c8dce0 --- /dev/null +++ b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.cs @@ -0,0 +1,30 @@ +using CalamityMod.Items.Placeables.Walls; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Items.Placeables.SunkenSea; +namespace CalamityMod.Items.Placeables.FurnitureShellstone +{ + public class ShellTrimBrick : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + + //public override void AddRecipes() + //{ + // CreateRecipe(). + // AddIngredient(). + // AddTile(TileID.HeavyWorkBench). + // Register(); + // CreateRecipe(). + // AddIngredient(4). + // AddTile(TileID.WorkBenches). + // DisableDecraft(). + // Register(); + //} + } +} diff --git a/Items/Placeables/FurnitureShellstone/ShellTrimBrick.png b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.png new file mode 100644 index 0000000000..532dc11562 Binary files /dev/null and b/Items/Placeables/FurnitureShellstone/ShellTrimBrick.png differ diff --git a/Items/Placeables/SunkenSea/ShellstoneSlab.cs b/Items/Placeables/FurnitureShellstone/ShellstoneSlab.cs similarity index 81% rename from Items/Placeables/SunkenSea/ShellstoneSlab.cs rename to Items/Placeables/FurnitureShellstone/ShellstoneSlab.cs index 2e3be721f4..294482fc1d 100644 --- a/Items/Placeables/SunkenSea/ShellstoneSlab.cs +++ b/Items/Placeables/FurnitureShellstone/ShellstoneSlab.cs @@ -1,8 +1,8 @@ using CalamityMod.Items.Placeables.Walls; using Terraria.ID; using Terraria.ModLoader; - -namespace CalamityMod.Items.Placeables.SunkenSea +using CalamityMod.Items.Placeables.SunkenSea; +namespace CalamityMod.Items.Placeables.FurnitureShellstone { public class ShellstoneSlab : ModItem, ILocalizedModType { @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea Item.ResearchUnlockCount = 100; } - public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); public override void AddRecipes() { diff --git a/Items/Placeables/SunkenSea/ShellstoneSlab.png b/Items/Placeables/FurnitureShellstone/ShellstoneSlab.png similarity index 100% rename from Items/Placeables/SunkenSea/ShellstoneSlab.png rename to Items/Placeables/FurnitureShellstone/ShellstoneSlab.png diff --git a/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs b/Items/Placeables/FurnitureSilva/SilvaBasin.cs similarity index 56% rename from Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs rename to Items/Placeables/FurnitureSilva/SilvaBasin.cs index 38cd253bdc..73033cc0da 100644 --- a/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBasin.cs @@ -3,29 +3,24 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureSilva { - [LegacyName("SilvaBasin")] - public class EffulgentManipulator : ModItem, ILocalizedModType + [LegacyName("EffulgentManipulator")] + public class SilvaBasin : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(10). AddRecipeGroup("AnyGoldBar", 5). - AddTile(TileID.MythrilAnvil). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.png b/Items/Placeables/FurnitureSilva/SilvaBasin.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/EffulgentManipulator.png rename to Items/Placeables/FurnitureSilva/SilvaBasin.png diff --git a/Items/Placeables/FurnitureSilva/SilvaBathtub.cs b/Items/Placeables/FurnitureSilva/SilvaBathtub.cs index 1334cde423..6491d8e879 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBathtub.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBathtub.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaBed.cs b/Items/Placeables/FurnitureSilva/SilvaBed.cs index 3d0c73f109..00230ac8b1 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBed.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaBench.cs b/Items/Placeables/FurnitureSilva/SilvaBench.cs index 333fed0272..afff559458 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBench.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBench.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaBookcase.cs b/Items/Placeables/FurnitureSilva/SilvaBookcase.cs index f036b18c6e..c240d76956 100644 --- a/Items/Placeables/FurnitureSilva/SilvaBookcase.cs +++ b/Items/Placeables/FurnitureSilva/SilvaBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs b/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs index 92ae20f92e..9305522a77 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaCandle.cs b/Items/Placeables/FurnitureSilva/SilvaCandle.cs index b5bedb72c0..ea0f420147 100644 --- a/Items/Placeables/FurnitureSilva/SilvaCandle.cs +++ b/Items/Placeables/FurnitureSilva/SilvaCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaChair.cs b/Items/Placeables/FurnitureSilva/SilvaChair.cs index 276ece5d5b..0199580bd9 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChair.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChair.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs index a10990fdd0..68578c6cd4 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChandelier.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChandelier.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaChest.cs b/Items/Placeables/FurnitureSilva/SilvaChest.cs index dc123f5db8..ad89ca7ca9 100644 --- a/Items/Placeables/FurnitureSilva/SilvaChest.cs +++ b/Items/Placeables/FurnitureSilva/SilvaChest.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaClock.cs b/Items/Placeables/FurnitureSilva/SilvaClock.cs index f4afb5cf0e..009882961a 100644 --- a/Items/Placeables/FurnitureSilva/SilvaClock.cs +++ b/Items/Placeables/FurnitureSilva/SilvaClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaDoor.cs b/Items/Placeables/FurnitureSilva/SilvaDoor.cs index 703348131f..7239023ff4 100644 --- a/Items/Placeables/FurnitureSilva/SilvaDoor.cs +++ b/Items/Placeables/FurnitureSilva/SilvaDoor.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaDresser.cs b/Items/Placeables/FurnitureSilva/SilvaDresser.cs index 7f149b01f1..e23238bb9e 100644 --- a/Items/Placeables/FurnitureSilva/SilvaDresser.cs +++ b/Items/Placeables/FurnitureSilva/SilvaDresser.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaLamp.cs b/Items/Placeables/FurnitureSilva/SilvaLamp.cs index 336d5e4d8e..1c344ab103 100644 --- a/Items/Placeables/FurnitureSilva/SilvaLamp.cs +++ b/Items/Placeables/FurnitureSilva/SilvaLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaLantern.cs b/Items/Placeables/FurnitureSilva/SilvaLantern.cs index bcd188b58c..a2f716f2e9 100644 --- a/Items/Placeables/FurnitureSilva/SilvaLantern.cs +++ b/Items/Placeables/FurnitureSilva/SilvaLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaPiano.cs b/Items/Placeables/FurnitureSilva/SilvaPiano.cs index 619ac5cdc8..19c0df3650 100644 --- a/Items/Placeables/FurnitureSilva/SilvaPiano.cs +++ b/Items/Placeables/FurnitureSilva/SilvaPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaSink.cs b/Items/Placeables/FurnitureSilva/SilvaSink.cs index 56e6f60507..dd76733ba0 100644 --- a/Items/Placeables/FurnitureSilva/SilvaSink.cs +++ b/Items/Placeables/FurnitureSilva/SilvaSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaTable.cs b/Items/Placeables/FurnitureSilva/SilvaTable.cs index 8b0175b74c..16cdb6305c 100644 --- a/Items/Placeables/FurnitureSilva/SilvaTable.cs +++ b/Items/Placeables/FurnitureSilva/SilvaTable.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs b/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs index 4311048e5d..c9494cc42b 100644 --- a/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs +++ b/Items/Placeables/FurnitureSilva/SilvaWorkBench.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureSilva { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.GlassKiln). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs b/Items/Placeables/FurnitureStatigel/StaticRefiner.cs similarity index 54% rename from Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs rename to Items/Placeables/FurnitureStatigel/StaticRefiner.cs index 105adef50b..cd4fdb2820 100644 --- a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.cs +++ b/Items/Placeables/FurnitureStatigel/StaticRefiner.cs @@ -2,28 +2,22 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureStatigel { public class StaticRefiner : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(gold: 2); } - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). - AddIngredient(ItemID.Solidifier). - AddIngredient(5). - AddTile(TileID.Anvils). + AddIngredient(10). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/StaticRefiner.png b/Items/Placeables/FurnitureStatigel/StaticRefiner.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/StaticRefiner.png rename to Items/Placeables/FurnitureStatigel/StaticRefiner.png diff --git a/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs b/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs index 3f7fc58b21..dd9ee9988c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBathtub.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBed.cs b/Items/Placeables/FurnitureStatigel/StatigelBed.cs index cafa39bbcf..694148e826 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBed.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelBlock.cs b/Items/Placeables/FurnitureStatigel/StatigelBlock.cs index d28fcccc64..db4e3aa915 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBlock.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBlock.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(25). AddIngredient(). - AddTile(). + AddTile(TileID.Solidifier). Register(); CreateRecipe(). AddIngredient(2). diff --git a/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs b/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs index 148c98fbc4..35aaf72798 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelBookcase.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs b/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs index 4cab592c8a..69323827ba 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelCandle.cs b/Items/Placeables/FurnitureStatigel/StatigelCandle.cs index 2b615e086a..01c803ce2b 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelCandle.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChair.cs b/Items/Placeables/FurnitureStatigel/StatigelChair.cs index 5a67a9131a..5ac443729f 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChair.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChair.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs b/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs index 08014dcb98..65bebcb6af 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelChest.cs b/Items/Placeables/FurnitureStatigel/StatigelChest.cs index 751521bc2a..14f8706915 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelChest.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelChest.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelClock.cs b/Items/Placeables/FurnitureStatigel/StatigelClock.cs index a3ad4e7f12..ae974e9446 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelClock.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelDoor.cs b/Items/Placeables/FurnitureStatigel/StatigelDoor.cs index 583efa5451..6de286fc7d 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelDoor.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelDoor.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelDresser.cs b/Items/Placeables/FurnitureStatigel/StatigelDresser.cs index 59b759b84c..0084913f3c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelDresser.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelDresser.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelLamp.cs b/Items/Placeables/FurnitureStatigel/StatigelLamp.cs index 01f6b7453c..ac7a37385d 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelLamp.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelLantern.cs b/Items/Placeables/FurnitureStatigel/StatigelLantern.cs index 8eea59ba86..572a4959fb 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelLantern.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelPiano.cs b/Items/Placeables/FurnitureStatigel/StatigelPiano.cs index 05b1cd26fd..3d3eee379c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelPiano.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelSink.cs b/Items/Placeables/FurnitureStatigel/StatigelSink.cs index 4f62ce1aca..bdb43753e5 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelSink.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelSofa.cs b/Items/Placeables/FurnitureStatigel/StatigelSofa.cs index 15e53c4ebc..3ba339302c 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelSofa.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelTable.cs b/Items/Placeables/FurnitureStatigel/StatigelTable.cs index db940dd1d7..2f7980c52d 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelTable.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelTable.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs b/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs index e284ee43ed..0f45927793 100644 --- a/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs +++ b/Items/Placeables/FurnitureStatigel/StatigelWorkBench.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStatigel { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBathtub.cs b/Items/Placeables/FurnitureStratus/StratusBathtub.cs index ff810e5010..db3b5797b5 100644 --- a/Items/Placeables/FurnitureStratus/StratusBathtub.cs +++ b/Items/Placeables/FurnitureStratus/StratusBathtub.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(14). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBed.cs b/Items/Placeables/FurnitureStratus/StratusBed.cs index 65c93798ec..3a23cd3b1e 100644 --- a/Items/Placeables/FurnitureStratus/StratusBed.cs +++ b/Items/Placeables/FurnitureStratus/StratusBed.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBookcase.cs b/Items/Placeables/FurnitureStratus/StratusBookcase.cs index ac1226a1f8..63064b76b9 100644 --- a/Items/Placeables/FurnitureStratus/StratusBookcase.cs +++ b/Items/Placeables/FurnitureStratus/StratusBookcase.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusBricks.cs b/Items/Placeables/FurnitureStratus/StratusBricks.cs index 36f87a04c9..64080d7e9c 100644 --- a/Items/Placeables/FurnitureStratus/StratusBricks.cs +++ b/Items/Placeables/FurnitureStratus/StratusBricks.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(3). AddIngredient(). AddIngredient(). - AddTile(TileID.AdamantiteForge). + AddTile(). Register(); CreateRecipe(). AddIngredient(4). diff --git a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs index 63228f55f2..29b342236a 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandelabra.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandelabra.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusCandle.cs b/Items/Placeables/FurnitureStratus/StratusCandle.cs index f8dd4f71ea..6a60ac11de 100644 --- a/Items/Placeables/FurnitureStratus/StratusCandle.cs +++ b/Items/Placeables/FurnitureStratus/StratusCandle.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChair.cs b/Items/Placeables/FurnitureStratus/StratusChair.cs index 8a6ff76d53..bc41ac8a37 100644 --- a/Items/Placeables/FurnitureStratus/StratusChair.cs +++ b/Items/Placeables/FurnitureStratus/StratusChair.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(4). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChandelier.cs b/Items/Placeables/FurnitureStratus/StratusChandelier.cs index 5f21142e57..bd8fb08464 100644 --- a/Items/Placeables/FurnitureStratus/StratusChandelier.cs +++ b/Items/Placeables/FurnitureStratus/StratusChandelier.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(TileID.Anvils). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusChest.cs b/Items/Placeables/FurnitureStratus/StratusChest.cs index 753df53dec..aa4f89e08c 100644 --- a/Items/Placeables/FurnitureStratus/StratusChest.cs +++ b/Items/Placeables/FurnitureStratus/StratusChest.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(8). AddRecipeGroup("IronBar", 2). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusClock.cs b/Items/Placeables/FurnitureStratus/StratusClock.cs index 01b94235d7..c36dd0c39c 100644 --- a/Items/Placeables/FurnitureStratus/StratusClock.cs +++ b/Items/Placeables/FurnitureStratus/StratusClock.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDoor.cs b/Items/Placeables/FurnitureStratus/StratusDoor.cs index 9182e72e40..c7b39082f0 100644 --- a/Items/Placeables/FurnitureStratus/StratusDoor.cs +++ b/Items/Placeables/FurnitureStratus/StratusDoor.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(6). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusDresser.cs b/Items/Placeables/FurnitureStratus/StratusDresser.cs index 12e18ed01a..a05a61a315 100644 --- a/Items/Placeables/FurnitureStratus/StratusDresser.cs +++ b/Items/Placeables/FurnitureStratus/StratusDresser.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(16). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLamp.cs b/Items/Placeables/FurnitureStratus/StratusLamp.cs index 3d1e1f2488..2b778c19b0 100644 --- a/Items/Placeables/FurnitureStratus/StratusLamp.cs +++ b/Items/Placeables/FurnitureStratus/StratusLamp.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusLantern.cs b/Items/Placeables/FurnitureStratus/StratusLantern.cs index 050ea27365..0943f5f6ee 100644 --- a/Items/Placeables/FurnitureStratus/StratusLantern.cs +++ b/Items/Placeables/FurnitureStratus/StratusLantern.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusPiano.cs b/Items/Placeables/FurnitureStratus/StratusPiano.cs index 8d305c2cc2..2985284bac 100644 --- a/Items/Placeables/FurnitureStratus/StratusPiano.cs +++ b/Items/Placeables/FurnitureStratus/StratusPiano.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSink.cs b/Items/Placeables/FurnitureStratus/StratusSink.cs index 82c625509b..b1f842dd38 100644 --- a/Items/Placeables/FurnitureStratus/StratusSink.cs +++ b/Items/Placeables/FurnitureStratus/StratusSink.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusSofa.cs b/Items/Placeables/FurnitureStratus/StratusSofa.cs index 705a35948b..703293629e 100644 --- a/Items/Placeables/FurnitureStratus/StratusSofa.cs +++ b/Items/Placeables/FurnitureStratus/StratusSofa.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(TileID.Sawmill). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusTable.cs b/Items/Placeables/FurnitureStratus/StratusTable.cs index 3e21e4e5b8..de3a38bc05 100644 --- a/Items/Placeables/FurnitureStratus/StratusTable.cs +++ b/Items/Placeables/FurnitureStratus/StratusTable.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(8). - AddTile(TileID.WorkBenches). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureStratus/StratusWorkBench.cs b/Items/Placeables/FurnitureStratus/StratusWorkBench.cs index 69f1b33b25..9d2cc08edc 100644 --- a/Items/Placeables/FurnitureStratus/StratusWorkBench.cs +++ b/Items/Placeables/FurnitureStratus/StratusWorkBench.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureStratus { CreateRecipe(). AddIngredient(10). + AddTile(). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs b/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs index cfa4f34b81..3a7b5af97b 100644 --- a/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs +++ b/Items/Placeables/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(). AddIngredient(). AddIngredient(). - AddTile(TileID.Anvils). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs new file mode 100644 index 0000000000..0dbb5c4e03 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBathtub : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(14). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png new file mode 100644 index 0000000000..c8ab44889a Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs new file mode 100644 index 0000000000..024e48867a --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBookcase : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(20). + AddIngredient(ItemID.Book, 10). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png new file mode 100644 index 0000000000..57cf58bd96 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs new file mode 100644 index 0000000000..f2c71f63e8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChair : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png new file mode 100644 index 0000000000..649e6f9e82 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs new file mode 100644 index 0000000000..394de25e31 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs @@ -0,0 +1,27 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChandelier : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch, 4). + AddIngredient(ItemID.Chain). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png new file mode 100644 index 0000000000..94b71006d0 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs new file mode 100644 index 0000000000..1372897fd8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChest : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddRecipeGroup("IronBar", 2). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png new file mode 100644 index 0000000000..44df951fe5 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png new file mode 100644 index 0000000000..7cb80254aa Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs new file mode 100644 index 0000000000..a0558ff07b --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDeskLight : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddIngredient(ItemID.Torch). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png new file mode 100644 index 0000000000..fad6a339c0 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.cs new file mode 100644 index 0000000000..1c491693b5 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDoor : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 40); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.png new file mode 100644 index 0000000000..dd4f7de09c Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoor.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs new file mode 100644 index 0000000000..ae67c2dac8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDresser : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(16). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png new file mode 100644 index 0000000000..b0f8cc58c4 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs new file mode 100644 index 0000000000..b27d2c8cbb --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumJukebox : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png new file mode 100644 index 0000000000..672db05d5a Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs new file mode 100644 index 0000000000..64738b8544 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLamp : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 1); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(ItemID.Torch). + AddIngredient(3). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png new file mode 100644 index 0000000000..a19882f1b3 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs new file mode 100644 index 0000000000..46fbde76df --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLantern : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.Torch). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png new file mode 100644 index 0000000000..8e530f9b95 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs new file mode 100644 index 0000000000..128827dbab --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSink : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(6). + AddIngredient(ItemID.WaterBucket). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png new file mode 100644 index 0000000000..c96f440a2b Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs new file mode 100644 index 0000000000..66403bdb55 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSleepingPod : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(silver: 4); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(ItemID.Silk, 5). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png new file mode 100644 index 0000000000..b438294241 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs new file mode 100644 index 0000000000..79eb99b99c --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSofa : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(ItemID.Silk, 2). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png new file mode 100644 index 0000000000..c848b79b7c Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs new file mode 100644 index 0000000000..c00b901567 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs @@ -0,0 +1,25 @@ + +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumTable : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 60); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(8). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png new file mode 100644 index 0000000000..b24d120326 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs new file mode 100644 index 0000000000..9ced6a0dd8 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs @@ -0,0 +1,26 @@ + +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumToilet : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(4). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png new file mode 100644 index 0000000000..5483bcf85a Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png differ diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs new file mode 100644 index 0000000000..c4ba7c3a04 --- /dev/null +++ b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs @@ -0,0 +1,26 @@ +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Tiles.Furniture.CraftingStations; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumWorkBench : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetDefaults() + { + Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.value = Item.sellPrice(copper: 30); + } + + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(10). + AddTile(TileID.HeavyWorkBench). + Register(); + } + } +} diff --git a/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png new file mode 100644 index 0000000000..b066974f66 Binary files /dev/null and b/Items/Placeables/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png differ diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs b/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs index 45519cd146..009f33382c 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumBathtub.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(14). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs b/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs index dba6f46033..44f940e7b5 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumBed.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(15). AddIngredient(ItemID.Silk, 5). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs b/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs index 183ac5df10..a0c1dd023f 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumBookcase.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(20). AddIngredient(ItemID.Book, 10). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs b/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs index 6f0a7e44f5..ab250a0424 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumCandelabra.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Torch, 3). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs b/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs index be884f8399..dd749adeb3 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumCandle.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(4). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs b/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs index 87ee331186..5a39d707eb 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumChair.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(4). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs b/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs index d023bcca90..7c8a34cdd1 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumChandelier.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(4). AddIngredient(ItemID.Torch, 4). AddIngredient(ItemID.Chain). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs b/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs index 16228bfe97..7bbd7662a1 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumChest.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(10). AddRecipeGroup("IronBar", 2). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs b/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs index fd29ef50dc..d5c9fcfce0 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumClock.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(10). AddRecipeGroup("IronBar", 3). AddIngredient(ItemID.Glass, 6). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs b/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs index e18969357f..cb2d32e226 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumDresser.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(16). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.cs b/Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.cs similarity index 64% rename from Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.cs rename to Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.cs index 5f1ebc1011..8a3fc90abe 100644 --- a/Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.cs @@ -2,27 +2,21 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Items.Placeables.Furniture.CraftingStations +namespace CalamityMod.Items.Placeables.FurnitureWulfrum { public class WulfrumLabstationItem : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Placeables"; public override void SetDefaults() { - Item.DefaultToPlaceableTile(ModContent.TileType()); + Item.DefaultToPlaceableTile(ModContent.TileType()); Item.value = Item.sellPrice(silver: 1); // This is REALLY too easy to craft to sell for 2 gold } - - public override void ModifyResearchSorting(ref ContentSamples.CreativeHelper.ItemGroup itemGroup) - { - itemGroup = ContentSamples.CreativeHelper.ItemGroup.CraftingObjects; - } - public override void AddRecipes() { CreateRecipe(). AddIngredient(20). - AddTile(TileID.Anvils). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.png b/Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.png similarity index 100% rename from Items/Placeables/Furniture/CraftingStations/WulfrumLabstationItem.png rename to Items/Placeables/FurnitureWulfrum/WulfrumLabstationItem.png diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs b/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs index b271efdb91..2a4d4f41ad 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumLamp.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(3). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs b/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs index 72ebb8ebc3..ee4af86b88 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumLantern.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.Torch). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs b/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs index 1000898784..4130a6902f 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumPiano.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(15). AddIngredient(ItemID.Bone, 4). AddIngredient(ItemID.Book). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs b/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs index 5cff22aca0..8209196161 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumSink.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(6). AddIngredient(ItemID.WaterBucket). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs b/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs index bc87369619..bf4c0e14fe 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumSofa.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum CreateRecipe(). AddIngredient(5). AddIngredient(ItemID.Silk, 2). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs b/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs index 9f4ca75337..125629aa6b 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumTable.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(8). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs b/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs index bb8189d1d8..9aa0a43fec 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumToilet.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(6). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs b/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs index 50db216abe..1148e3da9e 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumWallMountedBulb.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum AddIngredient(). AddIngredient(). AddIngredient(). - AddTile(TileID.Anvils). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs b/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs index a4b4e96e4a..4a914037c9 100644 --- a/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs +++ b/Items/Placeables/FurnitureWulfrum/WulfrumWorkBench.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Placeables.FurnitureWulfrum { CreateRecipe(). AddIngredient(10). - AddTile(). + AddTile(TileID.HeavyWorkBench). Register(); } } diff --git a/Items/Placeables/SunkenSea/AridSoil.cs b/Items/Placeables/SunkenSea/AridSoil.cs new file mode 100644 index 0000000000..7979aeda66 --- /dev/null +++ b/Items/Placeables/SunkenSea/AridSoil.cs @@ -0,0 +1,18 @@ +using CalamityMod.Tiles.SunkenSea; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Placeables.SunkenSea +{ + public class AridSoil : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 100; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } + + public override void SetDefaults() => Item.DefaultToPlaceableTile(ModContent.TileType()); + } +} diff --git a/Items/Placeables/SunkenSea/AridSoil.png b/Items/Placeables/SunkenSea/AridSoil.png new file mode 100644 index 0000000000..040ca55e28 Binary files /dev/null and b/Items/Placeables/SunkenSea/AridSoil.png differ diff --git a/Items/Placeables/SunkenSea/Navystone.cs b/Items/Placeables/SunkenSea/Navystone.cs index 247e14cc42..c38fb7d2e3 100644 --- a/Items/Placeables/SunkenSea/Navystone.cs +++ b/Items/Placeables/SunkenSea/Navystone.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using CalamityMod.Items.Placeables.Walls; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria.ID; @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Placeables.SunkenSea Register(); CreateRecipe(). - AddIngredient(2). + AddIngredient(2). DisableDecraft(). Register(); } diff --git a/Items/Placeables/Walls/AcidwoodWallItem.cs b/Items/Placeables/Walls/AcidwoodWallItem.cs index 51968f9e81..4d6d6f3b77 100644 --- a/Items/Placeables/Walls/AcidwoodWallItem.cs +++ b/Items/Placeables/Walls/AcidwoodWallItem.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/AncientSmoothNavystoneWall .cs b/Items/Placeables/Walls/AncientSmoothNavystoneWall .cs new file mode 100644 index 0000000000..1e314cc02e --- /dev/null +++ b/Items/Placeables/Walls/AncientSmoothNavystoneWall .cs @@ -0,0 +1,25 @@ +using CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone; +using Terraria.ID; +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; +namespace CalamityMod.Items.Placeables.Walls +{ + public class AncientSmoothNavystoneWall : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 400; + } + + public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType()); + + public override void AddRecipes() + { + CreateRecipe(4). + AddIngredient(). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/Walls/AncientSmoothNavystoneWall.png b/Items/Placeables/Walls/AncientSmoothNavystoneWall.png new file mode 100644 index 0000000000..d867a30eb6 Binary files /dev/null and b/Items/Placeables/Walls/AncientSmoothNavystoneWall.png differ diff --git a/Items/Placeables/Walls/AstralMonolithWall.cs b/Items/Placeables/Walls/AstralMonolithWall.cs index 0066082c69..a82474c496 100644 --- a/Items/Placeables/Walls/AstralMonolithWall.cs +++ b/Items/Placeables/Walls/AstralMonolithWall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/DriftwoodWall.cs b/Items/Placeables/Walls/DriftwoodWall.cs index 6f4217b604..dad7d4bf22 100644 --- a/Items/Placeables/Walls/DriftwoodWall.cs +++ b/Items/Placeables/Walls/DriftwoodWall.cs @@ -1,7 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; using Terraria.ID; -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; namespace CalamityMod.Items.Placeables.Walls { diff --git a/Items/Placeables/Walls/ShellTrimBrickWall.cs b/Items/Placeables/Walls/ShellTrimBrickWall.cs new file mode 100644 index 0000000000..d319d780ea --- /dev/null +++ b/Items/Placeables/Walls/ShellTrimBrickWall.cs @@ -0,0 +1,26 @@ +using Terraria.ModLoader; +using WallTiles = CalamityMod.Walls; +using Terraria.ID; +using CalamityMod.Items.Placeables.FurnitureShellstone; + +namespace CalamityMod.Items.Placeables.Walls +{ + public class ShellTrimBrickWall : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Placeables"; + public override void SetStaticDefaults() + { + Item.ResearchUnlockCount = 400; + } + + public override void SetDefaults() => Item.DefaultToPlaceableWall(ModContent.WallType()); + + public override void AddRecipes() + { + CreateRecipe(4). + AddIngredient(). + AddTile(TileID.WorkBenches). + Register(); + } + } +} diff --git a/Items/Placeables/Walls/ShellTrimBrickWall.png b/Items/Placeables/Walls/ShellTrimBrickWall.png new file mode 100644 index 0000000000..6659b189f6 Binary files /dev/null and b/Items/Placeables/Walls/ShellTrimBrickWall.png differ diff --git a/Items/Placeables/Walls/ShellstoneSlabWall.cs b/Items/Placeables/Walls/ShellstoneSlabWall.cs index 71a1f34779..556af95bbd 100644 --- a/Items/Placeables/Walls/ShellstoneSlabWall.cs +++ b/Items/Placeables/Walls/ShellstoneSlabWall.cs @@ -1,7 +1,7 @@ using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; using Terraria.ID; -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureShellstone; namespace CalamityMod.Items.Placeables.Walls { diff --git a/Items/Placeables/Walls/SmoothNavystoneWall.cs b/Items/Placeables/Walls/SmoothNavystoneWall.cs index a2104c8b5c..11667b7dc1 100644 --- a/Items/Placeables/Walls/SmoothNavystoneWall.cs +++ b/Items/Placeables/Walls/SmoothNavystoneWall.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using Terraria.ID; using Terraria.ModLoader; using WallTiles = CalamityMod.Walls; diff --git a/Items/Placeables/Walls/SmoothNavystoneWall.png b/Items/Placeables/Walls/SmoothNavystoneWall.png index d867a30eb6..d58aa5330c 100644 Binary files a/Items/Placeables/Walls/SmoothNavystoneWall.png and b/Items/Placeables/Walls/SmoothNavystoneWall.png differ diff --git a/Items/Potions/Alcohol/OddMushroom.cs b/Items/Potions/Alcohol/OddMushroom.cs index 494d19a656..0c8166cea2 100644 --- a/Items/Potions/Alcohol/OddMushroom.cs +++ b/Items/Potions/Alcohol/OddMushroom.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Potions.Alcohol { Item.DefaultToFood(38, 50, ModContent.BuffType(), CalamityUtils.MinutesToFrames(60)); - Item.value = Item.sellPrice(gold: 10); + Item.value = Item.buyPrice(gold: 5); // Sold by Truffle Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/SoaringPotion.cs b/Items/Potions/SoaringPotion.cs index 91606786c4..0404bafdb8 100644 --- a/Items/Potions/SoaringPotion.cs +++ b/Items/Potions/SoaringPotion.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Potions public override void SetDefaults() { - Item.DefaultToFood(30, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(6), true); + Item.DefaultToFood(30, 30, ModContent.BuffType(), CalamityUtils.MinutesToFrames(8), true); Item.value = Item.sellPrice(silver: 2); Item.rare = ItemRarityID.LightRed; } diff --git a/Items/Potions/SupremeHealingPotion.cs b/Items/Potions/SupremeHealingPotion.cs index 8d2d5d7d74..a6be404eb4 100644 --- a/Items/Potions/SupremeHealingPotion.cs +++ b/Items/Potions/SupremeHealingPotion.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -23,7 +24,7 @@ namespace CalamityMod.Items.Potions { Item.DefaultToHealingPotion(26, 38, 250); Item.value = Item.sellPrice(silver: 60); - Item.rare = ItemRarityID.Purple; + Item.rare = ModContent.RarityType(); } public override void AddRecipes() diff --git a/Items/SummonItems/BloodyWormFood.cs b/Items/SummonItems/BloodyWormFood.cs index 590d5c5b4b..b5dd639393 100644 --- a/Items/SummonItems/BloodyWormFood.cs +++ b/Items/SummonItems/BloodyWormFood.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.SummonItems { CreateRecipe() .AddIngredient(ItemID.CrimtaneBar, 3) - .AddIngredient(7) + .AddIngredient(7) .AddIngredient(ItemID.Vertebrae, 13) .AddTile(TileID.DemonAltar) .AddDecraftCondition(CalamityConditions.DownedPerforator) diff --git a/Items/SummonItems/ExoticPheromones.cs b/Items/SummonItems/ExoticPheromones.cs index 995118804c..6c6504bc90 100644 --- a/Items/SummonItems/ExoticPheromones.cs +++ b/Items/SummonItems/ExoticPheromones.cs @@ -34,12 +34,12 @@ namespace CalamityMod.Items.SummonItems public override bool CanUseItem(Player player) { - return player.ZoneJungle && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; + return player.ZoneJungle && !NPC.AnyNPCs(ModContent.NPCType()) && !BossRushEvent.BossRushActive; } public override bool? UseItem(Player player) { - CalamityUtils.SpawnBossUsingItem(player, SoundID.Roar); + CalamityUtils.SpawnBossUsingItem(player, SoundID.Roar); return true; } diff --git a/Items/SummonItems/NaiadsWarhorn.cs b/Items/SummonItems/NaiadsWarhorn.cs index ff3e494d4f..cfc28464db 100644 --- a/Items/SummonItems/NaiadsWarhorn.cs +++ b/Items/SummonItems/NaiadsWarhorn.cs @@ -1,7 +1,7 @@ using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Abyss; -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using CalamityMod.NPCs.Leviathan; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; diff --git a/Items/SummonItems/Teratoma.cs b/Items/SummonItems/Teratoma.cs index fabb86b0a4..9e09b791ae 100644 --- a/Items/SummonItems/Teratoma.cs +++ b/Items/SummonItems/Teratoma.cs @@ -46,7 +46,7 @@ namespace CalamityMod.Items.SummonItems { CreateRecipe(). AddIngredient(ItemID.DemoniteBar, 3). - AddIngredient(7). + AddIngredient(7). AddIngredient(ItemID.RottenChunk, 13). AddTile(TileID.DemonAltar). AddDecraftCondition(CalamityConditions.DownedHiveMind). diff --git a/Items/SuperDummy.cs b/Items/SuperDummy.cs index c6055399d2..47958aa978 100644 --- a/Items/SuperDummy.cs +++ b/Items/SuperDummy.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Items } } } - else if (player.whoAmI == Main.myPlayer) + else if (player.whoAmI == Main.myPlayer && NPC.CountNPCS(ModContent.NPCType()) < 50) { int x = (int)Main.MouseWorld.X - 9; int y = (int)Main.MouseWorld.Y - 20; diff --git a/Items/Tools/AcidwoodHammer.cs b/Items/Tools/AcidwoodHammer.cs index 78f5eeb610..31653ac752 100644 --- a/Items/Tools/AcidwoodHammer.cs +++ b/Items/Tools/AcidwoodHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Tools/DriftwoodHammer.cs b/Items/Tools/DriftwoodHammer.cs index 2a1917c2e2..caf2f47cb7 100644 --- a/Items/Tools/DriftwoodHammer.cs +++ b/Items/Tools/DriftwoodHammer.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Tools/Gelpick.cs b/Items/Tools/Gelpick.cs index 6b7fe5b12e..4146b16c6d 100644 --- a/Items/Tools/Gelpick.cs +++ b/Items/Tools/Gelpick.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Tools CreateRecipe(). AddIngredient(12). AddIngredient(12). - AddTile(). + AddTile(TileID.Solidifier). Register(); } diff --git a/Items/Tools/MonolithHammer.cs b/Items/Tools/MonolithHammer.cs index 4c30aa8ccb..0280dc5695 100644 --- a/Items/Tools/MonolithHammer.cs +++ b/Items/Tools/MonolithHammer.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/TreasureBags/CalamitasCloneBag.cs b/Items/TreasureBags/CalamitasCloneBag.cs index 08b9c7558d..29a16a9229 100644 --- a/Items/TreasureBags/CalamitasCloneBag.cs +++ b/Items/TreasureBags/CalamitasCloneBag.cs @@ -73,7 +73,7 @@ namespace CalamityMod.Items.TreasureBags // Equipment itemLoot.Add(ModContent.ItemType(), DropHelper.BagWeaponDropRateFraction); itemLoot.Add(ModContent.ItemType()); - itemLoot.Add(ModContent.ItemType(), 10); + itemLoot.Add(ModContent.ItemType(), 10); itemLoot.AddRevBagAccessories(); // Vanity diff --git a/Items/TreasureBags/DragonfollyBag.cs b/Items/TreasureBags/DragonfollyBag.cs index bdbc785757..ac6f05ebad 100644 --- a/Items/TreasureBags/DragonfollyBag.cs +++ b/Items/TreasureBags/DragonfollyBag.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Items.TreasureBags public override void ModifyItemLoot(ItemLoot itemLoot) { // Money - itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); + itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); // Materials itemLoot.Add(ModContent.ItemType(), 1, 30, 35); diff --git a/Items/TreasureBags/HiveMindBag.cs b/Items/TreasureBags/HiveMindBag.cs index 22c3df8060..bff6d42bfc 100644 --- a/Items/TreasureBags/HiveMindBag.cs +++ b/Items/TreasureBags/HiveMindBag.cs @@ -60,7 +60,6 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); // Materials - itemLoot.Add(ModContent.ItemType(), 1, 30, 40); itemLoot.Add(ItemID.DemoniteBar, 1, 15, 20); itemLoot.Add(ItemID.RottenChunk, 1, 15, 20); itemLoot.AddIf(() => Main.hardMode, ItemID.CursedFlame, 1, 25, 30); diff --git a/Items/TreasureBags/PerforatorBag.cs b/Items/TreasureBags/PerforatorBag.cs index cec78d95d9..d1a2b58520 100644 --- a/Items/TreasureBags/PerforatorBag.cs +++ b/Items/TreasureBags/PerforatorBag.cs @@ -60,7 +60,6 @@ namespace CalamityMod.Items.TreasureBags itemLoot.Add(ItemDropRule.CoinsBasedOnNPCValue(ModContent.NPCType())); // Materials - itemLoot.Add(ModContent.ItemType(), 1, 30, 40); itemLoot.Add(ItemID.CrimtaneBar, 1, 15, 20); itemLoot.Add(ItemID.Vertebrae, 1, 15, 20); itemLoot.AddIf(() => Main.hardMode, ItemID.Ichor, 1, 25, 30); diff --git a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs index 97b89059ef..43c6867f92 100644 --- a/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/AdamantiteArmorSetChange.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Adamantite"; public const int MaxManaBoost = 20; - public const int DefenseBoostMax = 15; + public const int DefenseBoostMax = 10; public const int TimeUntilDecayBeginsAfterAttacking = 60; public const int TimeUntilBoostCompletelyDecays = 210; diff --git a/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs b/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs index 478e6ceca6..f284793d44 100644 --- a/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs +++ b/Items/VanillaArmorChanges/ChlorophyteArmorSetChange.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.VanillaArmorChanges public const int DelayBetweenHeals = 270; - public const int BaseDamageToEnemies = 250; + public const int BaseDamageToEnemies = 220; public override void UpdateSetBonusText(ref string setBonusText) { diff --git a/Items/VanillaArmorChanges/CopperArmorSetChange.cs b/Items/VanillaArmorChanges/CopperArmorSetChange.cs index fbf35b1549..6f4d3ea46a 100644 --- a/Items/VanillaArmorChanges/CopperArmorSetChange.cs +++ b/Items/VanillaArmorChanges/CopperArmorSetChange.cs @@ -1,5 +1,4 @@ -using System.Text; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,20 +14,11 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Copper"; - public const float HeadDamage = 0.05f; - public const float ChestCrit = 3f; - public const float LegsMoveSpeed = 0.05f; public const float SetBonusFlatDamage = 2.0f; - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.GetCritChance() += ChestCrit; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; - public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusFlatDamage.ToString("N0"))}"; } public override void ApplyArmorSetBonus(Player player) diff --git a/Items/VanillaArmorChanges/EskimoArmorSetChange.cs b/Items/VanillaArmorChanges/EskimoArmorSetChange.cs index f3a4cf6f2d..2226f8afe5 100644 --- a/Items/VanillaArmorChanges/EskimoArmorSetChange.cs +++ b/Items/VanillaArmorChanges/EskimoArmorSetChange.cs @@ -33,7 +33,6 @@ namespace CalamityMod.Items.VanillaArmorChanges player.Calamity().ColdDebuffMultiplier += 0.25f; player.buffImmune[BuffID.Frostburn] = true; - player.buffImmune[ModContent.BuffType()] = true; } } } diff --git a/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs b/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs index d1ebc8a41b..93c2886fbf 100644 --- a/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs +++ b/Items/VanillaArmorChanges/GladiatorArmorSetChange.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Items.VanillaArmorChanges player.Calamity().wearingRogueArmor = true; player.GetDamage() += 0.05f; player.Calamity().rogueVelocity += 0.1f; - player.statDefense += 3; } } } diff --git a/Items/VanillaArmorChanges/GoldArmorSetChange.cs b/Items/VanillaArmorChanges/GoldArmorSetChange.cs index fbb7771b69..9b34eb9fc9 100644 --- a/Items/VanillaArmorChanges/GoldArmorSetChange.cs +++ b/Items/VanillaArmorChanges/GoldArmorSetChange.cs @@ -17,23 +17,14 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Gold"; - public const float HeadDamage = 0.05f; - public const float ChestDR = 0.05f; - public const float LegsMoveSpeed = 0.1f; public const float GoldDropChanceFromEnemies = 0.02f; public const int GoldFromBosses = 3; - public const float SetBonusCritPerGoldCoin = 0.1f; // 10 gold coins = +1% crit chance - public const float MaximumCritBonus = 7f; - - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.endurance += ChestDR; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float SetBonusCritPerGoldCoin = 0.2f; // 5 gold coins = +1% crit chance + public const float MaximumCritBonus = 5f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(GoldDropChanceFromEnemies.ToPercent(), GoldFromBosses, SetBonusCritPerGoldCoin, MaximumCritBonus)}"; } public override void ApplyArmorSetBonus(Player player) diff --git a/Items/VanillaArmorChanges/IronArmorSetChange.cs b/Items/VanillaArmorChanges/IronArmorSetChange.cs index ea739abcf5..3906498ffb 100644 --- a/Items/VanillaArmorChanges/IronArmorSetChange.cs +++ b/Items/VanillaArmorChanges/IronArmorSetChange.cs @@ -1,6 +1,6 @@ -using System.Text; -using Terraria; +using Terraria; using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { @@ -16,25 +16,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Iron"; - public const float ArmorPieceDR = 0.03f; - public const float SetBonusDR = 0.06f; - public const int SetBonusLifeRegen = 2; - - public override void ApplyHeadPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyBodyPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyLegPieceEffect(Player player) => player.endurance += ArmorPieceDR; + public const float KnockbackMultiplier = 1.5f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(KnockbackMultiplier)}"; } public override void ApplyArmorSetBonus(Player player) { - player.endurance += SetBonusDR; - player.lifeRegen += SetBonusLifeRegen; + player.GetKnockback() *= KnockbackMultiplier; } } } diff --git a/Items/VanillaArmorChanges/LeadArmorSetChange.cs b/Items/VanillaArmorChanges/LeadArmorSetChange.cs index 4fc7541f41..07dfe7c7e6 100644 --- a/Items/VanillaArmorChanges/LeadArmorSetChange.cs +++ b/Items/VanillaArmorChanges/LeadArmorSetChange.cs @@ -13,16 +13,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Lead"; - public const float ArmorPieceDR = 0.02f; - public const float SetBonusDR = 0.04f; - public const int SetBonusLifeRegen = 1; - - public override void ApplyHeadPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyBodyPieceEffect(Player player) => player.endurance += ArmorPieceDR; - - public override void ApplyLegPieceEffect(Player player) => player.endurance += ArmorPieceDR; - public override void UpdateSetBonusText(ref string setBonusText) { setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; @@ -30,8 +20,6 @@ namespace CalamityMod.Items.VanillaArmorChanges public override void ApplyArmorSetBonus(Player player) { - player.endurance += SetBonusDR; - player.lifeRegen += SetBonusLifeRegen; player.noKnockback = true; } } diff --git a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs index 18fee450a0..ace816e610 100644 --- a/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs +++ b/Items/VanillaArmorChanges/PlatinumArmorSetChange.cs @@ -1,7 +1,5 @@ -using System; -using Terraria; +using Terraria; using Terraria.ID; -using Terraria.ModLoader; namespace CalamityMod.Items.VanillaArmorChanges { @@ -15,34 +13,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Platinum"; - public const float HeadDamage = 0.06f; - public const float ChestCrit = 3f; - public const float LegsMoveSpeed = 0.1f; - public const float SetBonusDamagePerDefense = 0.1f; // 10 defense = +1% damage, this gets divided by 100 - public const int SetBonusDefenseCap = 50; - - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.GetCritChance() += ChestCrit; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float SetBonusDR = 0.1f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusDR.ToPercent())}"; } public override void ApplyArmorSetBonus(Player player) { - // 07MAY2024: Ozzatron: Platinum armor doesn't count its own defense for its set bonus - // CIT 1MAR2025: Platinum armor should not count its set bonus defense here, because it hasn't been applied yet - int defenseBesidesThisArmor = player.statDefense - (5 + 6 + 5); - if (defenseBesidesThisArmor <= 0) - return; - - if (defenseBesidesThisArmor > SetBonusDefenseCap) - defenseBesidesThisArmor = SetBonusDefenseCap; - player.GetDamage() += (float)Math.Floor(defenseBesidesThisArmor * SetBonusDamagePerDefense) * 0.01f; + player.endurance += SetBonusDR; } } } diff --git a/Items/VanillaArmorChanges/SilverArmorSetChange.cs b/Items/VanillaArmorChanges/SilverArmorSetChange.cs index 9c9bc580e9..05372ca492 100644 --- a/Items/VanillaArmorChanges/SilverArmorSetChange.cs +++ b/Items/VanillaArmorChanges/SilverArmorSetChange.cs @@ -16,29 +16,17 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Silver"; - public const float HeadCrit = 5f; - public const int ChestLifeRegen = 2; - public const float LegsMoveSpeed = 0.08f; - public const int SetBonusLifeRegen = 1; - public const double SetBonusMinimumDamageToHeal = 20.0; public const int SetBonusHealTime = 120; public const int SetBonusHealAmount = 10; - public override void ApplyHeadPieceEffect(Player player) => player.GetCritChance() += HeadCrit; - - public override void ApplyBodyPieceEffect(Player player) => player.lifeRegen += ChestLifeRegen; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; - public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusHealTime.FramesToSeconds(), SetBonusMinimumDamageToHeal.ToString("N0"), SetBonusHealAmount)}"; } public override void ApplyArmorSetBonus(Player player) { - player.lifeRegen += SetBonusLifeRegen; player.Calamity().silverMedkit = true; } diff --git a/Items/VanillaArmorChanges/TinArmorSetChange.cs b/Items/VanillaArmorChanges/TinArmorSetChange.cs index 12a2c7f88e..a46b8b9f21 100644 --- a/Items/VanillaArmorChanges/TinArmorSetChange.cs +++ b/Items/VanillaArmorChanges/TinArmorSetChange.cs @@ -1,5 +1,4 @@ -using System.Text; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -15,25 +14,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Tin"; - public const float HeadCrit = 4f; - public const int ChestLifeRegen = 1; - public const float LegsMoveSpeed = 0.05f; - public const float SetBonusArmorPen = 5.0f; - - public override void ApplyHeadPieceEffect(Player player) => player.GetCritChance() += HeadCrit; - - public override void ApplyBodyPieceEffect(Player player) => player.lifeRegen += ChestLifeRegen; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float SetBonusCrit = 10f; public override void UpdateSetBonusText(ref string setBonusText) { - setBonusText += $"\n{CalamityUtils.GetTextValue($"Vanilla.Armor.SetBonus.{ArmorSetName}")}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(SetBonusCrit)}"; } public override void ApplyArmorSetBonus(Player player) { - player.GetArmorPenetration() += SetBonusArmorPen; + player.GetCritChance() += SetBonusCrit; } } } diff --git a/Items/VanillaArmorChanges/TungstenArmorSetChange.cs b/Items/VanillaArmorChanges/TungstenArmorSetChange.cs index 50c4be4121..fc4a333b7e 100644 --- a/Items/VanillaArmorChanges/TungstenArmorSetChange.cs +++ b/Items/VanillaArmorChanges/TungstenArmorSetChange.cs @@ -1,6 +1,4 @@ -using System.Text; -using Microsoft.Xna.Framework; -using Terraria; +using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -16,37 +14,16 @@ namespace CalamityMod.Items.VanillaArmorChanges public override string ArmorSetName => "Tungsten"; - public const float HeadDamage = 0.07f; - public const int ChestLifeRegen = 1; - public const float LegsMoveSpeed = 0.08f; - public const float KnockbackMultiplier = 1.33f; - public const float MaxKnockbackCritConversion = 10f; - - public override void ApplyHeadPieceEffect(Player player) => player.GetDamage() += HeadDamage; - - public override void ApplyBodyPieceEffect(Player player) => player.lifeRegen += ChestLifeRegen; - - public override void ApplyLegPieceEffect(Player player) => player.moveSpeed += LegsMoveSpeed; + public const float HookBoost = 0.5f; public override void UpdateSetBonusText(ref string setBonusText) { - Player player = Main.LocalPlayer; - float kb = player.GetWeaponKnockback(player.ActiveItem()); - float bonus = MathHelper.Clamp(kb, 0f, MaxKnockbackCritConversion); - - string bonusText = bonus.ToString("n2"); - string kbText = kb.ToString("n2"); - setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(bonusText, kbText)}"; + setBonusText += $"\n{CalamityUtils.GetText($"Vanilla.Armor.SetBonus.{ArmorSetName}").Format(HookBoost.ToPercent())}"; } public override void ApplyArmorSetBonus(Player player) { - // Apply the 33% knockback boost first, so it applies to the following crit boost - player.GetKnockback() *= KnockbackMultiplier; - - // Give the player crit chance equal to the (now boosted) knockback of their held weapon. - float kbToUse = player.GetWeaponKnockback(player.ActiveItem()); - player.GetCritChance() += MathHelper.Clamp(kbToUse, 0f, MaxKnockbackCritConversion); + player.Calamity().tungstenArmorHookBoost = true; } } } diff --git a/Items/Weapons/DraedonsArsenal/Auger.cs b/Items/Weapons/DraedonsArsenal/Auger.cs new file mode 100644 index 0000000000..cac2c11b2f --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/Auger.cs @@ -0,0 +1,71 @@ +using System.Collections.Generic; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Projectiles.DraedonsArsenal; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + public class Auger : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public override void SetDefaults() + { + Item.width = 26; + Item.height = 26; + Item.damage = 68; + Item.DamageType = TrueMeleeDamageClass.Instance; + Item.useTime = Item.useAnimation = 12; + Item.knockBack = 12f; + Item.autoReuse = true; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.shoot = ModContent.ProjectileType(); + Item.noMelee = true; + Item.channel = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; + Item.rare = ItemRarityID.Orange; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/AugerGlow").Value); + } + public override bool MeleePrefix() => true; + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool AltFunctionUse(Player player) => true; + public override void HoldItem(Player player) + { + if (Main.myPlayer == player.whoAmI) + player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + float swordType = 0; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && player.Calamity().arsenalCooldown <= 0) + swordType = 5; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, swordType); + + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(5). + AddIngredient(7). + AddIngredient(4). + AddIngredient(7). + AddTile(TileID.Anvils). + Register(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/Auger.png b/Items/Weapons/DraedonsArsenal/Auger.png new file mode 100644 index 0000000000..deb4092662 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/Auger.png differ diff --git a/Items/Weapons/DraedonsArsenal/AugerGlow.png b/Items/Weapons/DraedonsArsenal/AugerGlow.png new file mode 100644 index 0000000000..5c8a5771a1 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/AugerGlow.png differ diff --git a/Items/Weapons/DraedonsArsenal/CountermeasureMitt.cs b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.cs new file mode 100644 index 0000000000..f364289272 --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.cs @@ -0,0 +1,79 @@ +using System; +using System.Collections.Generic; +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.DraedonsArsenal; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + [LegacyName("GatlingLaser")] + public class CountermeasureMitt : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public override void SetDefaults() + { + CalamityGlobalItem modItem = Item.Calamity(); + + Item.width = 54; + Item.height = 56; + Item.DamageType = DamageClass.Magic; + Item.mana = 3; + Item.damage = 45; + Item.knockBack = 4f; + Item.useAnimation = Item.useTime = 11; + Item.autoReuse = true; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.channel = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityYellowBuyPrice; + Item.rare = ItemRarityID.Yellow; + + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 24f; + } + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool AltFunctionUse(Player player) => true; + public override void HoldItem(Player player) + { + if (Main.myPlayer == player.whoAmI) + player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow").Value); + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + float gunType = 0; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && player.Calamity().arsenalCooldown <= 0) + gunType = 5; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, gunType); + + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(15). + AddIngredient(15). + AddIngredient(5). + AddIngredient(10). + AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Func condition), condition). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/CountermeasureMitt.png b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.png new file mode 100644 index 0000000000..ea23481c15 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/CountermeasureMitt.png differ diff --git a/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow.png b/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow.png new file mode 100644 index 0000000000..3c119c3088 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/CountermeasureMittGlow.png differ diff --git a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs b/Items/Weapons/DraedonsArsenal/GatlingLaser.cs deleted file mode 100644 index 17fb58acf7..0000000000 --- a/Items/Weapons/DraedonsArsenal/GatlingLaser.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using CalamityMod.CustomRecipes; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.DraedonsArsenal; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.DraedonsArsenal -{ - public class GatlingLaser : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/GatlingLaserFireStart"); - public static readonly SoundStyle FireLoopSound = new("CalamityMod/Sounds/Item/GatlingLaserFireLoop"); - public static readonly SoundStyle FireEndSound = new("CalamityMod/Sounds/Item/GatlingLaserFireEnd"); - - - // This is the amount of charge consumed every time the holdout projectile fires a laser. - public const float HoldoutChargeUse = 0.0075f; - - public override void SetDefaults() - { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.width = 43; - Item.height = 24; - Item.DamageType = DamageClass.Magic; - Item.damage = 43; - Item.knockBack = 1f; - Item.useTime = 2; - Item.useAnimation = 2; - Item.noUseGraphic = true; - Item.autoReuse = false; - Item.channel = true; - Item.mana = 4; - - Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = FireSound; - Item.noMelee = true; - - Item.value = CalamityGlobalItem.RarityYellowBuyPrice; - Item.rare = ItemRarityID.Yellow; - - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 24f; - - modItem.UsesCharge = true; - modItem.MaxCharge = 135f; - modItem.ChargePerUse = 0f; // This weapon is a holdout. Charge is consumed by the holdout projectile. - } - - public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - - public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 3); - - public override Vector2? HoldoutOffset() => new Vector2(-20, 0); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(15). - AddIngredient(15). - AddIngredient(5). - AddIngredient(10). - AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(3, out Func condition), condition). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.cs b/Items/Weapons/DraedonsArsenal/GaussDagger.cs deleted file mode 100644 index e8e51a0954..0000000000 --- a/Items/Weapons/DraedonsArsenal/GaussDagger.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.SunkenSea; -using CalamityMod.Projectiles.DraedonsArsenal; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.DraedonsArsenal -{ - public class GaussDagger : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - public override void SetDefaults() - { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.width = 26; - Item.height = 26; - Item.damage = 25; - Item.DamageType = DamageClass.Melee; - Item.useTime = 24; - Item.useAnimation = 24; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.knockBack = 7f; - - Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; - Item.rare = ItemRarityID.Orange; - - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - - modItem.UsesCharge = true; - modItem.MaxCharge = 50f; - modItem.ChargePerUse = 0.05f; - } - - public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 1); - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - if (target.Calamity().GaussFluxTimer == 0) - { - target.Calamity().GaussFluxTimer = 50; - if (player.whoAmI == Main.myPlayer) - { - Projectile.NewProjectile(player.GetSource_ItemUse(Item), target.Center, Vector2.Zero, ModContent.ProjectileType(), Item.damage, 0f, player.whoAmI, 0f, target.whoAmI); - } - } - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(5). - AddIngredient(7). - AddIngredient(4). - AddIngredient(7). - AddTile(TileID.Anvils). - Register(); - } - } -} diff --git a/Items/Weapons/DraedonsArsenal/GaussDagger.png b/Items/Weapons/DraedonsArsenal/GaussDagger.png deleted file mode 100644 index 77ac1dfc11..0000000000 Binary files a/Items/Weapons/DraedonsArsenal/GaussDagger.png and /dev/null differ diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.cs b/Items/Weapons/DraedonsArsenal/GaussPistol.cs deleted file mode 100644 index 445df79e74..0000000000 --- a/Items/Weapons/DraedonsArsenal/GaussPistol.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System; -using System.Collections.Generic; -using CalamityMod.CustomRecipes; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.DraedonsArsenal; -using CalamityMod.Sounds; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.DraedonsArsenal -{ - public class GaussPistol : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; - public override void SetDefaults() - { - CalamityGlobalItem modItem = Item.Calamity(); - - Item.width = 40; - Item.height = 22; - Item.DamageType = DamageClass.Magic; - Item.mana = 6; - Item.damage = 150; - Item.knockBack = 11f; - Item.useAnimation = Item.useTime = 20; - Item.autoReuse = true; - - Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = CommonCalamitySounds.GaussWeaponFire; - Item.noMelee = true; - - Item.value = CalamityGlobalItem.RarityPinkBuyPrice; - Item.rare = ItemRarityID.Pink; - - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 14f; - - modItem.MaxCharge = 85f; - modItem.UsesCharge = true; - modItem.ChargePerUse = 0.05f; - } - - public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(12). - AddIngredient(8). - AddRecipeGroup("AnyMythrilBar", 10). - AddIngredient(ItemID.SoulofMight, 20). - AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Func condition), condition). - AddTile(TileID.MythrilAnvil). - Register(); - } - } -} diff --git a/Items/Weapons/DraedonsArsenal/GaussPistol.png b/Items/Weapons/DraedonsArsenal/GaussPistol.png deleted file mode 100644 index d68e739419..0000000000 Binary files a/Items/Weapons/DraedonsArsenal/GaussPistol.png and /dev/null differ diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs b/Items/Weapons/DraedonsArsenal/HolofibreImmolator.cs similarity index 92% rename from Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs rename to Items/Weapons/DraedonsArsenal/HolofibreImmolator.cs index a260077562..50f7d1ee74 100644 --- a/Items/Weapons/DraedonsArsenal/HolofiberImmolator.cs +++ b/Items/Weapons/DraedonsArsenal/HolofibreImmolator.cs @@ -14,7 +14,7 @@ using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.DraedonsArsenal { [LegacyName("MatterModulator")] - public class HolofiberImmolator : ModItem, ILocalizedModType + public class HolofibreImmolator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; public static readonly SoundStyle PlasmaSound = new("CalamityMod/Sounds/Item/PlasmaSmall"); @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.value = CalamityGlobalItem.RarityPinkBuyPrice; Item.rare = ItemRarityID.Pink; - Item.shoot = ModContent.ProjectileType(); + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 12f; } @@ -48,11 +48,11 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow").Value); + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow").Value); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0, 1); holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); return false; } diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolator.png b/Items/Weapons/DraedonsArsenal/HolofibreImmolator.png similarity index 100% rename from Items/Weapons/DraedonsArsenal/HolofiberImmolator.png rename to Items/Weapons/DraedonsArsenal/HolofibreImmolator.png diff --git a/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow.png b/Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow.png similarity index 100% rename from Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow.png rename to Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow.png diff --git a/Items/Weapons/DraedonsArsenal/PulsePistol.cs b/Items/Weapons/DraedonsArsenal/PulsePistol.cs index afd9ba1dd8..955d04c411 100644 --- a/Items/Weapons/DraedonsArsenal/PulsePistol.cs +++ b/Items/Weapons/DraedonsArsenal/PulsePistol.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Items.Weapons.DraedonsArsenal Item.rare = ItemRarityID.Orange; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 8.2f; + Item.shootSpeed = 8f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/DraedonsArsenal/Vulcan.cs b/Items/Weapons/DraedonsArsenal/Vulcan.cs new file mode 100644 index 0000000000..5c7a7f9f4f --- /dev/null +++ b/Items/Weapons/DraedonsArsenal/Vulcan.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using CalamityMod.CustomRecipes; +using CalamityMod.Items.Materials; +using CalamityMod.Projectiles.DraedonsArsenal; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Items.Weapons.DraedonsArsenal +{ + [LegacyName("GaussPistol")] + public class Vulcan : ModItem, ILocalizedModType + { + public new string LocalizationCategory => "Items.Weapons.DraedonsArsenal"; + public override void SetDefaults() + { + Item.width = 28; + Item.height = 34; + Item.DamageType = DamageClass.Magic; + Item.mana = 11; + Item.damage = 40; + Item.knockBack = 11f; + Item.useAnimation = Item.useTime = 11; + Item.autoReuse = true; + + Item.useStyle = ItemUseStyleID.Shoot; + Item.noMelee = true; + Item.channel = true; + Item.noUseGraphic = true; + + Item.value = CalamityGlobalItem.RarityPinkBuyPrice; + Item.rare = ItemRarityID.Pink; + + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 14f; + } + + public override void ModifyTooltips(List tooltips) => CalamityGlobalItem.InsertKnowledgeTooltip(tooltips, 2); + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; + public override bool AltFunctionUse(Player player) => true; + public override void HoldItem(Player player) + { + if (Main.myPlayer == player.whoAmI) + player.Calamity().rightClickListener = true; + player.Calamity().mouseWorldListener = true; + } + public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) + { + Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/VulcanGlow").Value); + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + float gunType = 0; + if (player.Calamity().mouseRight && player.whoAmI == Main.myPlayer && !Main.mapFullscreen && !Main.blockMouse && player.Calamity().arsenalCooldown <= 0) + gunType = 5; + Projectile holdout = Projectile.NewProjectileDirect(source, player.MountedCenter, Vector2.Zero, type, damage, knockback, player.whoAmI, 0, 0, gunType); + + holdout.velocity = (player.Calamity().mouseWorld - player.MountedCenter).SafeNormalize(Vector2.Zero); + return false; + } + public override void AddRecipes() + { + CreateRecipe(). + AddIngredient(12). + AddIngredient(8). + AddRecipeGroup("AnyMythrilBar", 10). + AddIngredient(ItemID.SoulofMight, 20). + AddCondition(ArsenalTierGatedRecipe.ConstructRecipeCondition(2, out Func condition), condition). + AddTile(TileID.MythrilAnvil). + Register(); + } + } +} diff --git a/Items/Weapons/DraedonsArsenal/Vulcan.png b/Items/Weapons/DraedonsArsenal/Vulcan.png new file mode 100644 index 0000000000..975227e30f Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/Vulcan.png differ diff --git a/Items/Weapons/DraedonsArsenal/VulcanGlow.png b/Items/Weapons/DraedonsArsenal/VulcanGlow.png new file mode 100644 index 0000000000..8a4e160b58 Binary files /dev/null and b/Items/Weapons/DraedonsArsenal/VulcanGlow.png differ diff --git a/Items/Weapons/Magic/AbyssalTome.cs b/Items/Weapons/Magic/AbyssalTome.cs index 12edcf818c..005898e5f7 100644 --- a/Items/Weapons/Magic/AbyssalTome.cs +++ b/Items/Weapons/Magic/AbyssalTome.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.SlimeGod; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs.SlimeGod; using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Magic public class AbyssalTome : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; diff --git a/Items/Weapons/Magic/AcidGun.cs b/Items/Weapons/Magic/AcidGun.cs index fea1b480a5..002238f231 100644 --- a/Items/Weapons/Magic/AcidGun.cs +++ b/Items/Weapons/Magic/AcidGun.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Magic/AlulaAustralis.cs b/Items/Weapons/Magic/AlulaAustralis.cs index 7211108bdf..a4f9a3b733 100644 --- a/Items/Weapons/Magic/AlulaAustralis.cs +++ b/Items/Weapons/Magic/AlulaAustralis.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -12,6 +14,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/AnahitasArpeggio.cs b/Items/Weapons/Magic/AnahitasArpeggio.cs index 154e914af3..12687cad69 100644 --- a/Items/Weapons/Magic/AnahitasArpeggio.cs +++ b/Items/Weapons/Magic/AnahitasArpeggio.cs @@ -1,5 +1,7 @@ using System.Collections.Generic; using System.Linq; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -19,12 +21,15 @@ namespace CalamityMod.Items.Weapons.Magic public static readonly SoundStyle CapSound = new("CalamityMod/Sounds/Item/HarpLV6"); public static readonly SoundStyle EndSound = new("CalamityMod/Sounds/Item/HarpEnd"); public static readonly SoundStyle HitSound = new("CalamityMod/Sounds/Item/HarpNoteHit"); - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 56; Item.height = 50; - Item.damage = 127; + Item.damage = 65; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useTime = 22; @@ -58,8 +63,8 @@ namespace CalamityMod.Items.Weapons.Magic if (nonReleasedMusicNotes >= musicNoteCap) { - Main.musicPitch = -0.5f; - SoundEngine.PlaySound(CapSound with { Volume = 0.8f }, player.Center); + if (!Main.zenithWorld) + SoundEngine.PlaySound(CapSound with { Volume = 0.8f }, player.Center); return false; } else diff --git a/Items/Weapons/Magic/ArcticBearPaw.cs b/Items/Weapons/Magic/ArcticBearPaw.cs index 467f1d0c4b..66ea5e090c 100644 --- a/Items/Weapons/Magic/ArcticBearPaw.cs +++ b/Items/Weapons/Magic/ArcticBearPaw.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 28; Item.height = 24; - Item.damage = 90; + Item.damage = 80; Item.DamageType = DamageClass.Magic; Item.mana = 18; Item.useTime = 28; diff --git a/Items/Weapons/Magic/AstralachneaStaff.cs b/Items/Weapons/Magic/AstralachneaStaff.cs index 8ffa9448aa..27113d25e3 100644 --- a/Items/Weapons/Magic/AstralachneaStaff.cs +++ b/Items/Weapons/Magic/AstralachneaStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 52; Item.height = 52; - Item.damage = 50; + Item.damage = 55; Item.DamageType = DamageClass.Magic; Item.mana = 19; Item.useTime = 21; @@ -39,38 +39,18 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - int i = Main.myPlayer; - float fangSpeed = Item.shootSpeed; float mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - int spikeAmount = 4; - if (Main.rand.NextBool(3)) - { - spikeAmount++; - } - if (Main.rand.NextBool(4)) - { - spikeAmount++; - } - if (Main.rand.NextBool(5)) - { - spikeAmount += 2; - } + + int spikeAmount = Main.rand.Next(3, 4+1); for (int j = 0; j < spikeAmount; j++) { - float fangSpawnX = mouseXDist; - float fangSpawnY = mouseYDist; - float offsetDampener = 0.05f * (float)j; - fangSpawnX += (float)Main.rand.Next(-400, 400) * offsetDampener; - fangSpawnY += (float)Main.rand.Next(-400, 400) * offsetDampener; - float fangDistance = (float)Math.Sqrt((double)(fangSpawnX * fangSpawnX + fangSpawnY * fangSpawnY)); - fangDistance = fangSpeed / fangDistance; - fangSpawnX *= fangDistance; - fangSpawnY *= fangDistance; - float x2 = realPlayerPos.X; - float y2 = realPlayerPos.Y; - Projectile.NewProjectile(source, x2, y2, fangSpawnX, fangSpawnY, ModContent.ProjectileType(), damage, knockback, i, 0f, 0f); + Vector2 fangSpawn = new Vector2(mouseXDist, mouseYDist); + fangSpawn.X += Main.rand.NextFloat(-20f, 20f) * j; + fangSpawn.Y += Main.rand.NextFloat(-20f, 20f) * j; + fangSpawn = fangSpawn.SafeNormalize(Vector2.UnitX) * Item.shootSpeed; + + Projectile.NewProjectile(source, realPlayerPos, fangSpawn, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 0f); } return false; } diff --git a/Items/Weapons/Magic/Atlantis.cs b/Items/Weapons/Magic/Atlantis.cs index ffa9afe85a..9a3d1edf4d 100644 --- a/Items/Weapons/Magic/Atlantis.cs +++ b/Items/Weapons/Magic/Atlantis.cs @@ -7,6 +7,7 @@ using CalamityMod.Particles; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Items.Weapons.Summon; namespace CalamityMod.Items.Weapons.Magic { @@ -16,13 +17,14 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { Item.width = 28; Item.height = 30; - Item.damage = 88; + Item.damage = 81; Item.DamageType = DamageClass.Magic; Item.mana = 12; Item.useTime = 25; diff --git a/Items/Weapons/Magic/BloodBath.cs b/Items/Weapons/Magic/BloodBath.cs index 5bdcb4e06f..b5e7b46e52 100644 --- a/Items/Weapons/Magic/BloodBath.cs +++ b/Items/Weapons/Magic/BloodBath.cs @@ -1,5 +1,7 @@ using System; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -15,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -90,15 +93,5 @@ namespace CalamityMod.Items.Weapons.Magic } return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 3). - AddIngredient(9). - AddIngredient(ItemID.Vertebrae, 3). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Magic/DeathValleyDuster.cs b/Items/Weapons/Magic/DeathValleyDuster.cs index 1067e27f81..78a54eeab3 100644 --- a/Items/Weapons/Magic/DeathValleyDuster.cs +++ b/Items/Weapons/Magic/DeathValleyDuster.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 36; Item.height = 40; - Item.damage = 159; + Item.damage = 130; Item.DamageType = DamageClass.Magic; Item.mana = 38; Item.useTime = 50; @@ -33,6 +33,8 @@ namespace CalamityMod.Items.Weapons.Magic } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + if (player.velocity.Length() <= 12) + player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 5f; bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness); Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 0f, MaxMana ? 1f : 0f); diff --git a/Items/Weapons/Magic/DeathhailStaff.cs b/Items/Weapons/Magic/DeathhailStaff.cs index c06f2343cd..d63e6f57c0 100644 --- a/Items/Weapons/Magic/DeathhailStaff.cs +++ b/Items/Weapons/Magic/DeathhailStaff.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,8 +18,8 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() { Item.width = 80; diff --git a/Items/Weapons/Magic/Downpour.cs b/Items/Weapons/Magic/Downpour.cs index 0bede5d021..65e5e80756 100644 --- a/Items/Weapons/Magic/Downpour.cs +++ b/Items/Weapons/Magic/Downpour.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/EldritchTome.cs b/Items/Weapons/Magic/EldritchTome.cs index 3021f53ee0..993e63b377 100644 --- a/Items/Weapons/Magic/EldritchTome.cs +++ b/Items/Weapons/Magic/EldritchTome.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic public class EldritchTome : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; diff --git a/Items/Weapons/Magic/EvergladeSpray.cs b/Items/Weapons/Magic/EvergladeSpray.cs index d073842bf8..4f43c5ad4f 100644 --- a/Items/Weapons/Magic/EvergladeSpray.cs +++ b/Items/Weapons/Magic/EvergladeSpray.cs @@ -13,14 +13,14 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 34; Item.height = 30; - Item.damage = 28; + Item.damage = 65; Item.DamageType = DamageClass.Magic; - Item.mana = 8; + Item.mana = 7; Item.useTime = 6; Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 4.5f; + Item.knockBack = 2f; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.UseSound = SoundID.Item13; diff --git a/Items/Weapons/Magic/FatesReveal.cs b/Items/Weapons/Magic/FatesReveal.cs index 26f28c4056..7a692a38c4 100644 --- a/Items/Weapons/Magic/FatesReveal.cs +++ b/Items/Weapons/Magic/FatesReveal.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/GhastlyVisage.cs b/Items/Weapons/Magic/GhastlyVisage.cs index 086b54ccde..05bf23161e 100644 --- a/Items/Weapons/Magic/GhastlyVisage.cs +++ b/Items/Weapons/Magic/GhastlyVisage.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Magic public class GhastlyVisage : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; diff --git a/Items/Weapons/Magic/HadalUrn.cs b/Items/Weapons/Magic/HadalUrn.cs index 1a30b38322..22c98c5b65 100644 --- a/Items/Weapons/Magic/HadalUrn.cs +++ b/Items/Weapons/Magic/HadalUrn.cs @@ -21,8 +21,7 @@ namespace CalamityMod.Items.Weapons.Magic Item.damage = 37; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.useTime = 16; - Item.useAnimation = 16; + Item.useTime = Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2.75f; diff --git a/Items/Weapons/Magic/HellwingStaff.cs b/Items/Weapons/Magic/HellwingStaff.cs index 11717fe7c5..964464d8d0 100644 --- a/Items/Weapons/Magic/HellwingStaff.cs +++ b/Items/Weapons/Magic/HellwingStaff.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 70; Item.height = 60; - Item.damage = 22; + Item.damage = 21; Item.DamageType = DamageClass.Magic; Item.mana = 18; Item.useTime = 30; @@ -39,48 +39,18 @@ namespace CalamityMod.Items.Weapons.Magic public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float projSpeed = velocity.Length(); - Vector2 realPlayerPos = player.RotatedRelativePoint(player.MountedCenter, true); - float mouseXDist = (float)Main.mouseX + Main.screenPosition.X + realPlayerPos.X; - float mouseYDist = (float)Main.mouseY + Main.screenPosition.Y + realPlayerPos.Y; - if (player.gravDir == -1f) - { - mouseYDist = Main.screenPosition.Y + (float)Main.screenHeight + (float)Main.mouseY + realPlayerPos.Y; - } - float mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - if ((float.IsNaN(mouseXDist) && float.IsNaN(mouseYDist)) || (mouseXDist == 0f && mouseYDist == 0f)) - { - mouseXDist = (float)player.direction; - mouseYDist = 0f; - mouseDistance = projSpeed; - } - else - { - mouseDistance = projSpeed / mouseDistance; - } - for (int i = 0; i < 4; i++) { - realPlayerPos = new Vector2(player.position.X + (float)player.width * 0.5f + (float)(Main.rand.Next(201) * -(float)player.direction) + ((float)Main.mouseX + Main.screenPosition.X - player.position.X), player.MountedCenter.Y); - realPlayerPos.X = (realPlayerPos.X + player.Center.X) / 2f + (float)Main.rand.Next(-200, 201); - realPlayerPos.Y -= (float)(100 * i); - mouseXDist = (float)Main.mouseX + Main.screenPosition.X - realPlayerPos.X; - mouseYDist = (float)Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y; - if (mouseYDist < 0f) - { - mouseYDist *= -1f; - } - if (mouseYDist < 20f) - { - mouseYDist = 20f; - } - mouseDistance = (float)Math.Sqrt((double)(mouseXDist * mouseXDist + mouseYDist * mouseYDist)); - mouseDistance = projSpeed / mouseDistance; - mouseXDist *= mouseDistance; - mouseYDist *= mouseDistance; - float speedX4 = mouseXDist + (float)Main.rand.Next(-40, 41) * 0.02f; - float speedY5 = mouseYDist + (float)Main.rand.Next(-40, 41) * 0.02f; - Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, damage, knockback, player.whoAmI); + Vector2 realPlayerPos = new Vector2((player.MountedCenter.X + Main.mouseX + Main.screenPosition.X - player.position.X + player.Center.X) / 2f, player.MountedCenter.Y - (100f * i)); + + Vector2 mouseDist = new Vector2(Main.mouseX + Main.screenPosition.X - realPlayerPos.X, Math.Abs(Main.mouseY + Main.screenPosition.Y - realPlayerPos.Y)); + if (mouseDist.Y < 20f) + mouseDist.Y = 20f; + mouseDist = mouseDist.SafeNormalize(Vector2.UnitX) * velocity.Length(); + mouseDist.X += Main.rand.NextFloat(-0.4f, 0.4f); + mouseDist.Y += Main.rand.NextFloat(-0.4f, 0.4f); + + Projectile.NewProjectile(source, realPlayerPos, mouseDist, type, damage, knockback, player.whoAmI); } return false; } diff --git a/Items/Weapons/Magic/Hematemesis.cs b/Items/Weapons/Magic/Hematemesis.cs index 5ccbd20082..8071e3633f 100644 --- a/Items/Weapons/Magic/Hematemesis.cs +++ b/Items/Weapons/Magic/Hematemesis.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -13,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Heresy.cs b/Items/Weapons/Magic/Heresy.cs index 5b215872ec..55230bb5f9 100644 --- a/Items/Weapons/Magic/Heresy.cs +++ b/Items/Weapons/Magic/Heresy.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Terraria; using Terraria.DataStructures; @@ -14,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic { Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 6)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/HyphaeRod.cs b/Items/Weapons/Magic/HyphaeRod.cs index dc7b12a637..e0052dbee8 100644 --- a/Items/Weapons/Magic/HyphaeRod.cs +++ b/Items/Weapons/Magic/HyphaeRod.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Keelhaul.cs b/Items/Weapons/Magic/Keelhaul.cs index 5929c99224..770e8029e4 100644 --- a/Items/Weapons/Magic/Keelhaul.cs +++ b/Items/Weapons/Magic/Keelhaul.cs @@ -12,11 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic Item.width = 42; Item.height = 42; Item.damage = 55; - Item.mana = 50; + Item.mana = 40; Item.DamageType = DamageClass.Magic; Item.noMelee = true; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = Item.useAnimation = 30; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 2f; diff --git a/Items/Weapons/Magic/LashesofChaos.cs b/Items/Weapons/Magic/LashesofChaos.cs index e993083d8c..e3e1f630a4 100644 --- a/Items/Weapons/Magic/LashesofChaos.cs +++ b/Items/Weapons/Magic/LashesofChaos.cs @@ -1,4 +1,6 @@ using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Particles; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; @@ -16,7 +18,10 @@ namespace CalamityMod.Items.Weapons.Magic public int FiringMode = 0; // 0 = hellfireballs, 1 = hellblasts public int ProjectilesFired = 0; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; diff --git a/Items/Weapons/Magic/ParasiticSceptor.cs b/Items/Weapons/Magic/ParasiticSceptor.cs index 52190729cf..ecae376a81 100644 --- a/Items/Weapons/Magic/ParasiticSceptor.cs +++ b/Items/Weapons/Magic/ParasiticSceptor.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Magic/PhoenixFlameBarrage.cs b/Items/Weapons/Magic/PhoenixFlameBarrage.cs index 9e50922cde..118911fbaf 100644 --- a/Items/Weapons/Magic/PhoenixFlameBarrage.cs +++ b/Items/Weapons/Magic/PhoenixFlameBarrage.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -15,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/Photosynthesis.cs b/Items/Weapons/Magic/Photosynthesis.cs index dc4e32d222..47d1882e66 100644 --- a/Items/Weapons/Magic/Photosynthesis.cs +++ b/Items/Weapons/Magic/Photosynthesis.cs @@ -22,11 +22,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 78; Item.height = 78; - Item.damage = 60; + Item.damage = 74; Item.DamageType = DamageClass.Magic; Item.mana = 10; - Item.useTime = 24; - Item.useAnimation = 24; + Item.useTime = Item.useAnimation = 21; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 4f; diff --git a/Items/Weapons/Magic/PlagueStaff.cs b/Items/Weapons/Magic/PlagueStaff.cs index c9cd97def5..eacb05e87f 100644 --- a/Items/Weapons/Magic/PlagueStaff.cs +++ b/Items/Weapons/Magic/PlagueStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -13,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/PrimordialAncient.cs b/Items/Weapons/Magic/PrimordialAncient.cs index 8da0f86ef4..ba48da9d4b 100644 --- a/Items/Weapons/Magic/PrimordialAncient.cs +++ b/Items/Weapons/Magic/PrimordialAncient.cs @@ -24,9 +24,9 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 40; Item.height = 56; - Item.damage = 3900; + Item.damage = 4500; Item.DamageType = DamageClass.Magic; - Item.mana = 85; + Item.mana = 95; Item.useTime = 78; Item.useAnimation = 78; Item.useStyle = ItemUseStyleID.Shoot; @@ -41,6 +41,9 @@ namespace CalamityMod.Items.Weapons.Magic } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + if (player.velocity.Length() <= 16) + player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 7.5f; + bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness); for (int i = -2; i <= 2; i++) { diff --git a/Items/Weapons/Magic/PrimordialEarth.cs b/Items/Weapons/Magic/PrimordialEarth.cs index bfe7b3b5d2..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; @@ -38,10 +37,14 @@ namespace CalamityMod.Items.Weapons.Magic } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + if (player.velocity.Length() <= 14) + player.velocity += -velocity.SafeNormalize(Vector2.UnitX) * 6f; + + Vector2 staticSpeed = Utils.DirectionTo(player.Center, player.Calamity().mouseWorld) * Utils.Distance(player.Center, player.ClampedMouseWorld()) * 0.008f; bool MaxMana = player.statMana >= (player.statManaMax2 - ((int)(Item.mana * player.manaCost))) && !player.HasBuff(BuffID.ManaSickness); float rotation = 0.4f; - Projectile.NewProjectile(source, position, velocity.RotatedBy(-rotation), type, damage / 2, knockback, player.whoAmI, 0f, 1f, MaxMana ? 1f : 0f); - Projectile.NewProjectile(source, position, velocity.RotatedBy(rotation), type, damage / 2, knockback, player.whoAmI, 0f, 0f, MaxMana ? 1f : 0f); + Projectile.NewProjectile(source, position, staticSpeed.RotatedBy(-rotation), type, damage / 2, knockback, player.whoAmI, 0f, 1f, MaxMana ? 1f : 0f); + Projectile.NewProjectile(source, position, staticSpeed.RotatedBy(rotation), type, damage / 2, knockback, player.whoAmI, 0f, 0f, MaxMana ? 1f : 0f); return false; } diff --git a/Items/Weapons/Magic/PurgeGuzzler.cs b/Items/Weapons/Magic/PurgeGuzzler.cs index b39487c4e9..9675c27234 100644 --- a/Items/Weapons/Magic/PurgeGuzzler.cs +++ b/Items/Weapons/Magic/PurgeGuzzler.cs @@ -1,4 +1,7 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -13,7 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic { public new string LocalizationCategory => "Items.Weapons.Magic"; private const float Spread = 0.025f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 64; diff --git a/Items/Weapons/Magic/RougeSlash.cs b/Items/Weapons/Magic/RougeSlash.cs index e9975d1d74..06930e2bf0 100644 --- a/Items/Weapons/Magic/RougeSlash.cs +++ b/Items/Weapons/Magic/RougeSlash.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic public class RougeSlash : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.mana = 30; diff --git a/Items/Weapons/Magic/SHPC.cs b/Items/Weapons/Magic/SHPC.cs index a4eff61271..563b1c809a 100644 --- a/Items/Weapons/Magic/SHPC.cs +++ b/Items/Weapons/Magic/SHPC.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 124; Item.height = 52; - Item.damage = 110; + Item.damage = 97; Item.DamageType = DamageClass.Magic; Item.mana = 15; Item.useAnimation = Item.useTime = 60; diff --git a/Items/Weapons/Magic/SandstreamScepter.cs b/Items/Weapons/Magic/SandstreamScepter.cs index 2478aed15c..d80b24a5a6 100644 --- a/Items/Weapons/Magic/SandstreamScepter.cs +++ b/Items/Weapons/Magic/SandstreamScepter.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -14,6 +15,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/SeethingDischarge.cs b/Items/Weapons/Magic/SeethingDischarge.cs index 63aeac78ab..2d8ec34175 100644 --- a/Items/Weapons/Magic/SeethingDischarge.cs +++ b/Items/Weapons/Magic/SeethingDischarge.cs @@ -1,4 +1,6 @@ -using CalamityMod.NPCs.BrimstoneElemental; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.NPCs.BrimstoneElemental; using CalamityMod.Projectiles.Magic; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -14,6 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; public int DartTimer = 0; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; diff --git a/Items/Weapons/Magic/ShaderainStaff.cs b/Items/Weapons/Magic/ShaderainStaff.cs index cb4d8ccff9..fe4378f2ec 100644 --- a/Items/Weapons/Magic/ShaderainStaff.cs +++ b/Items/Weapons/Magic/ShaderainStaff.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Summon; using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public class ShaderainStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + #region Other stats // Stats for the shaderain. @@ -26,10 +28,10 @@ namespace CalamityMod.Items.Weapons.Magic public const float DeaccelerationStrenght = 0.95f; // A number lower than 1, non-including 1, changing it very slightly will have drastic results. #endregion - public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -77,15 +79,5 @@ namespace CalamityMod.Items.Weapons.Magic return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 3). - AddIngredient(9). - AddIngredient(ItemID.RottenChunk, 3). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Magic/ShadowboltStaff.cs b/Items/Weapons/Magic/ShadowboltStaff.cs index c3c932f9a3..7ba0f2ac67 100644 --- a/Items/Weapons/Magic/ShadowboltStaff.cs +++ b/Items/Weapons/Magic/ShadowboltStaff.cs @@ -20,16 +20,17 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 58; Item.height = 56; - Item.damage = 205; + Item.damage = 285; Item.DamageType = DamageClass.Magic; - Item.mana = 10; - Item.useTime = 12; - Item.useAnimation = 12; + Item.mana = 15; + Item.useTime = 8; + Item.useAnimation = 24; + Item.reuseDelay = 30; + Item.useLimitPerAnimation = 3; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; Item.value = CalamityGlobalItem.RarityPureGreenBuyPrice; - Item.UseSound = SoundID.Item72; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5f; diff --git a/Items/Weapons/Magic/ShiftingSands.cs b/Items/Weapons/Magic/ShiftingSands.cs index 6c97761796..d0fa9deba3 100644 --- a/Items/Weapons/Magic/ShiftingSands.cs +++ b/Items/Weapons/Magic/ShiftingSands.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetDefaults() { Item.width = Item.height = 58; - Item.damage = 76; + Item.damage = 81; Item.knockBack = 5f; Item.useAnimation = Item.useTime = 30; Item.mana = 20; diff --git a/Items/Weapons/Magic/SnowstormStaff.cs b/Items/Weapons/Magic/SnowstormStaff.cs index 4d4c8e00f5..39c0f133b2 100644 --- a/Items/Weapons/Magic/SnowstormStaff.cs +++ b/Items/Weapons/Magic/SnowstormStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +9,10 @@ namespace CalamityMod.Items.Weapons.Magic public class SnowstormStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; diff --git a/Items/Weapons/Magic/StarShower.cs b/Items/Weapons/Magic/StarShower.cs index f699464be8..349ac20155 100644 --- a/Items/Weapons/Magic/StarShower.cs +++ b/Items/Weapons/Magic/StarShower.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using Microsoft.Xna.Framework; using System; using Terraria; @@ -14,7 +16,10 @@ namespace CalamityMod.Items.Weapons.Magic public new string LocalizationCategory => "Items.Weapons.Magic"; internal const float ShootSpeed = 28f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 38; diff --git a/Items/Weapons/Magic/TearsofHeaven.cs b/Items/Weapons/Magic/TearsofHeaven.cs index 6e31eef359..babeb02a00 100644 --- a/Items/Weapons/Magic/TearsofHeaven.cs +++ b/Items/Weapons/Magic/TearsofHeaven.cs @@ -18,11 +18,10 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 38; Item.height = 48; - Item.damage = 45; + Item.damage = 43; Item.DamageType = DamageClass.Magic; - Item.mana = 18; - Item.useTime = 20; - Item.useAnimation = 20; + Item.mana = 15; + Item.useTime = Item.useAnimation = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5.5f; @@ -38,9 +37,9 @@ namespace CalamityMod.Items.Weapons.Magic { for (int index = 0; index < 2; ++index) { - float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; - Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); + float SpeedX = velocity.X + Main.rand.NextFloat(-2f, 2f); + float SpeedY = velocity.Y + Main.rand.NextFloat(-2f, 2f); + Projectile.NewProjectile(source, position, new Vector2(SpeedX, SpeedY), type, damage, knockback, player.whoAmI); } return false; } diff --git a/Items/Weapons/Magic/TheCauldron.cs b/Items/Weapons/Magic/TheCauldron.cs index d3b57adcb1..065b00b449 100644 --- a/Items/Weapons/Magic/TheCauldron.cs +++ b/Items/Weapons/Magic/TheCauldron.cs @@ -25,12 +25,11 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 46; Item.height = 46; - Item.damage = 59; + Item.damage = 56; Item.noMelee = true; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; - Item.useAnimation = 60; - Item.useTime = 60; + Item.useTime = Item.useAnimation = 60; Item.knockBack = 8f; Item.mana = 18; Item.UseSound = SoundID.DD2_MonkStaffSwing; diff --git a/Items/Weapons/Magic/UndinesRetribution.cs b/Items/Weapons/Magic/UndinesRetribution.cs index 1ffeebf364..3b0c0a2a62 100644 --- a/Items/Weapons/Magic/UndinesRetribution.cs +++ b/Items/Weapons/Magic/UndinesRetribution.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 64; Item.height = 64; - Item.damage = 46; + Item.damage = 44; Item.DamageType = DamageClass.Magic; Item.mana = 15; Item.useTime = 18; diff --git a/Items/Weapons/Magic/ValkyrieRay.cs b/Items/Weapons/Magic/ValkyrieRay.cs index 9c8c4765fe..5174f80dbc 100644 --- a/Items/Weapons/Magic/ValkyrieRay.cs +++ b/Items/Weapons/Magic/ValkyrieRay.cs @@ -10,11 +10,11 @@ namespace CalamityMod.Items.Weapons.Magic public class ValkyrieRay : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - // The base use time of the weapon is 47: 28 charge frames + 19 cooldown frames. + // The base use time of the weapon is 28: 18 charge frames + 10 cooldown frames. // The rate at which it progresses through its charge and discharge cycle is dynamically sped up by reforges. // This math is handled in its holdout projectile, ValkyrieRayStaff. - public const int ChargeFrames = 28; - public const int CooldownFrames = 19; + public const int ChargeFrames = 18; + public const int CooldownFrames = 10; public const float GemDistance = 18f; public static readonly Color LightColor = new Color(235, 40, 121); @@ -27,14 +27,14 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 54; Item.height = 52; - Item.damage = 53; + Item.damage = 115; Item.knockBack = 8.5f; Item.DamageType = DamageClass.Magic; - Item.mana = 26; + Item.mana = 17; Item.useTime = ChargeFrames + CooldownFrames; Item.useAnimation = ChargeFrames + CooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; - Item.UseSound = SoundID.NPCDeath7; + Item.UseSound = SoundID.NPCDeath7 with { Volume = 0.7f }; Item.useTurn = false; Item.noMelee = true; Item.noUseGraphic = true; @@ -45,6 +45,8 @@ namespace CalamityMod.Items.Weapons.Magic Item.autoReuse = true; } + public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 11; + public override void AddRecipes() { CreateRecipe(). diff --git a/Items/Weapons/Magic/Vehemence.cs b/Items/Weapons/Magic/Vehemence.cs index 25da1eb71e..a33d1a3aca 100644 --- a/Items/Weapons/Magic/Vehemence.cs +++ b/Items/Weapons/Magic/Vehemence.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -17,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Magic public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Magic/VitriolicViper.cs b/Items/Weapons/Magic/VitriolicViper.cs index 681c2e9007..a931b51f65 100644 --- a/Items/Weapons/Magic/VitriolicViper.cs +++ b/Items/Weapons/Magic/VitriolicViper.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,7 +12,10 @@ namespace CalamityMod.Items.Weapons.Magic public class VitriolicViper : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 60; diff --git a/Items/Weapons/Magic/Volterion.cs b/Items/Weapons/Magic/Volterion.cs index 5579403159..10636642ae 100644 --- a/Items/Weapons/Magic/Volterion.cs +++ b/Items/Weapons/Magic/Volterion.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Magic; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -12,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Magic public class Volterion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Magic"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 220; diff --git a/Items/Weapons/Magic/WintersFury.cs b/Items/Weapons/Magic/WintersFury.cs index 73d7bf6a5e..6e35c1d79c 100644 --- a/Items/Weapons/Magic/WintersFury.cs +++ b/Items/Weapons/Magic/WintersFury.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Magic { Item.width = 36; Item.height = 40; - Item.damage = 70; + Item.damage = 65; Item.DamageType = DamageClass.Magic; Item.mana = 7; Item.useTime = 12; @@ -32,16 +32,14 @@ namespace CalamityMod.Items.Weapons.Magic Item.UseSound = SoundID.Item9; Item.autoReuse = true; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 15f; + Item.shootSpeed = 16f; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (!Main.rand.NextBool(4)) { - Vector2 speed = velocity.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-15, 16))); - speed.Normalize(); - speed *= 15f; + Vector2 speed = velocity.RotatedByRandom(MathHelper.Pi / 12f); speed.Y -= Math.Abs(speed.X) * 0.2f; int p = Projectile.NewProjectile(source, position, speed, ModContent.ProjectileType(), damage, knockback, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) @@ -52,8 +50,8 @@ namespace CalamityMod.Items.Weapons.Magic SoundEngine.PlaySound(SoundID.Item1, position); Projectile.NewProjectile(source, position.X, position.Y, velocity.X * 1.2f, velocity.Y * 1.2f, ModContent.ProjectileType(), damage, knockback * 2f, player.whoAmI); } - velocity.X += Main.rand.Next(-40, 41) * 0.05f; - velocity.Y += Main.rand.Next(-40, 41) * 0.05f; + velocity.X += Main.rand.NextFloat(-2f, 2f); + velocity.Y += Main.rand.NextFloat(-2f, 2f); return true; } } diff --git a/Items/Weapons/Melee/AbsoluteZero.cs b/Items/Weapons/Melee/AbsoluteZero.cs index de9f7969e6..1b9615ad9c 100644 --- a/Items/Weapons/Melee/AbsoluteZero.cs +++ b/Items/Weapons/Melee/AbsoluteZero.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { target.AddBuff(BuffID.Frostburn2, 300); - target.AddBuff(ModContent.BuffType(), 60); var source = player.GetSource_ItemUse(Item); int p = Projectile.NewProjectile(source, target.Center, Vector2.Zero, ModContent.ProjectileType(), Item.damage, 12f, player.whoAmI); Main.projectile[p].Kill(); diff --git a/Items/Weapons/Melee/AbyssBlade.cs b/Items/Weapons/Melee/AbyssBlade.cs index 71525139dd..83ea8d665e 100644 --- a/Items/Weapons/Melee/AbyssBlade.cs +++ b/Items/Weapons/Melee/AbyssBlade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 74; Item.height = 74; - Item.damage = 140; + Item.damage = 123; Item.knockBack = 7.5f; Item.useTime = 65; Item.useAnimation = 65; diff --git a/Items/Weapons/Melee/AcidwoodSword.cs b/Items/Weapons/Melee/AcidwoodSword.cs index e66fd94976..518cd066c9 100644 --- a/Items/Weapons/Melee/AcidwoodSword.cs +++ b/Items/Weapons/Melee/AcidwoodSword.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Melee/AnarchyBlade.cs b/Items/Weapons/Melee/AnarchyBlade.cs index deda0bf7d1..93f04e9e1d 100644 --- a/Items/Weapons/Melee/AnarchyBlade.cs +++ b/Items/Weapons/Melee/AnarchyBlade.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 114; Item.height = 122; - Item.damage = 150; + Item.damage = 120; Item.DamageType = DamageClass.Melee; Item.useAnimation = 19; Item.useTime = 19; diff --git a/Items/Weapons/Melee/Aorta.cs b/Items/Weapons/Melee/Aorta.cs index 6552a7ee34..b6092caa54 100644 --- a/Items/Weapons/Melee/Aorta.cs +++ b/Items/Weapons/Melee/Aorta.cs @@ -1,4 +1,6 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.ID; @@ -21,6 +23,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -46,15 +49,5 @@ namespace CalamityMod.Items.Weapons.Melee Item.rare = ItemRarityID.Orange; Item.value = CalamityGlobalItem.RarityOrangeBuyPrice; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 3). - AddIngredient(9). - AddIngredient(ItemID.Vertebrae, 3). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Melee/ArkoftheCosmos.cs b/Items/Weapons/Melee/ArkoftheCosmos.cs index 127c76be64..695c21e84c 100644 --- a/Items/Weapons/Melee/ArkoftheCosmos.cs +++ b/Items/Weapons/Melee/ArkoftheCosmos.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee public static float MaxThrowReach = 760; public static float SnapDamageMultiplier = 1.2f; //Extra damage from making the scissors snap - public static float MaxCharge = 15f; // Maximum charge value AKA how much charge you get from a parry + public static float MaxCharge = 16f; // Maximum charge value AKA how much charge you get from a parry public static float chargeDamageMultiplier = 1.35f; //Extra damage from charge public static float chainDamageMultiplier = 0.1f; public static float SnapBoltsDamageMultiplier = 0.1f; @@ -235,7 +235,7 @@ namespace CalamityMod.Items.Weapons.Melee var barBG = Request("CalamityMod/UI/MiscTextures/GenericBarBack").Value; var barFG = Request("CalamityMod/UI/MiscTextures/GenericBarFront").Value; - float barScale = 3f; + float barScale = 4f; Vector2 barOrigin = barBG.Size() * 0.5f; float yOffset = 50f; Vector2 drawPos = position + Vector2.UnitY * scale * (frame.Height - yOffset); diff --git a/Items/Weapons/Melee/Avalanche.cs b/Items/Weapons/Melee/Avalanche.cs index af32ff182b..745a1360a0 100644 --- a/Items/Weapons/Melee/Avalanche.cs +++ b/Items/Weapons/Melee/Avalanche.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Avalanche : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 64; diff --git a/Items/Weapons/Melee/BansheeHook.cs b/Items/Weapons/Melee/BansheeHook.cs index 0c788bd3ff..311a9d72ff 100644 --- a/Items/Weapons/Melee/BansheeHook.cs +++ b/Items/Weapons/Melee/BansheeHook.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -16,6 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.Spears[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/Basher.cs b/Items/Weapons/Melee/Basher.cs index a880589f9f..1a7398acf0 100644 --- a/Items/Weapons/Melee/Basher.cs +++ b/Items/Weapons/Melee/Basher.cs @@ -2,7 +2,7 @@ using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/BladecrestOathsword.cs b/Items/Weapons/Melee/BladecrestOathsword.cs index e88d676e19..ab15acffd1 100644 --- a/Items/Weapons/Melee/BladecrestOathsword.cs +++ b/Items/Weapons/Melee/BladecrestOathsword.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 56; Item.height = 56; - Item.damage = 50; + Item.damage = 42; Item.knockBack = 3f; Item.useTime = 53; Item.useAnimation = 53; diff --git a/Items/Weapons/Melee/BlightedCleaver.cs b/Items/Weapons/Melee/BlightedCleaver.cs index cf51e42102..5b1abeecab 100644 --- a/Items/Weapons/Melee/BlightedCleaver.cs +++ b/Items/Weapons/Melee/BlightedCleaver.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 88; Item.height = 88; - Item.damage = 92; + Item.damage = 90; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 28; Item.useStyle = ItemUseStyleID.Swing; @@ -74,14 +74,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - player.AddBuff(ModContent.BuffType(), 180); target.AddBuff(BuffID.Venom, 240); target.AddBuff(BuffID.OnFire3, 240); } public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { - player.AddBuff(ModContent.BuffType(), 180); target.AddBuff(BuffID.Venom, 240); target.AddBuff(BuffID.OnFire3, 240); } diff --git a/Items/Weapons/Melee/BotanicPiercer.cs b/Items/Weapons/Melee/BotanicPiercer.cs index 25f5f5eb42..1d67b9f7ff 100644 --- a/Items/Weapons/Melee/BotanicPiercer.cs +++ b/Items/Weapons/Melee/BotanicPiercer.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 112; Item.height = 112; - Item.damage = 88; + Item.damage = 110; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; diff --git a/Items/Weapons/Melee/Brimlance.cs b/Items/Weapons/Melee/Brimlance.cs index 891c17c57e..46913bec43 100644 --- a/Items/Weapons/Melee/Brimlance.cs +++ b/Items/Weapons/Melee/Brimlance.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee.Spears; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.Melee.Spears; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,8 +12,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.Spears[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } - public override void SetDefaults() { Item.width = 56; diff --git a/Items/Weapons/Melee/Brimlash.cs b/Items/Weapons/Melee/Brimlash.cs index 2107039480..39a841fea3 100644 --- a/Items/Weapons/Melee/Brimlash.cs +++ b/Items/Weapons/Melee/Brimlash.cs @@ -15,10 +15,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 72; - Item.damage = 70; + Item.damage = 60; Item.DamageType = DamageClass.Melee; - Item.useAnimation = 30; - Item.useTime = 30; + Item.useTime = Item.useAnimation = 30; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; diff --git a/Items/Weapons/Melee/BurningRevelation.cs b/Items/Weapons/Melee/BurningRevelation.cs index c0bdd8753b..8d4f9d133a 100644 --- a/Items/Weapons/Melee/BurningRevelation.cs +++ b/Items/Weapons/Melee/BurningRevelation.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -24,6 +26,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/DefiledGreatsword.cs b/Items/Weapons/Melee/DefiledGreatsword.cs index b5f9b9150a..306271d675 100644 --- a/Items/Weapons/Melee/DefiledGreatsword.cs +++ b/Items/Weapons/Melee/DefiledGreatsword.cs @@ -119,14 +119,12 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - player.AddBuff(ModContent.BuffType(), 300); target.AddBuff(BuffID.Venom, 360); target.AddBuff(BuffID.OnFire3, 360); } public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) { - player.AddBuff(ModContent.BuffType(), 300); target.AddBuff(BuffID.Venom, 360); target.AddBuff(BuffID.OnFire3, 360); } diff --git a/Items/Weapons/Melee/DragonRage.cs b/Items/Weapons/Melee/DragonRage.cs index 3b7300228c..8358f4fdaf 100644 --- a/Items/Weapons/Melee/DragonRage.cs +++ b/Items/Weapons/Melee/DragonRage.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +9,10 @@ namespace CalamityMod.Items.Weapons.Melee public class DragonRage : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 128; diff --git a/Items/Weapons/Melee/DriftwoodSword.cs b/Items/Weapons/Melee/DriftwoodSword.cs index 92ea5b1ac9..dfa2d06a56 100644 --- a/Items/Weapons/Melee/DriftwoodSword.cs +++ b/Items/Weapons/Melee/DriftwoodSword.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Melee/Excelsus.cs b/Items/Weapons/Melee/Excelsus.cs index ad3d886059..33959b6463 100644 --- a/Items/Weapons/Melee/Excelsus.cs +++ b/Items/Weapons/Melee/Excelsus.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Excelsus : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 78; diff --git a/Items/Weapons/Melee/Floodtide.cs b/Items/Weapons/Melee/Floodtide.cs index 67930b7773..515e863bfd 100644 --- a/Items/Weapons/Melee/Floodtide.cs +++ b/Items/Weapons/Melee/Floodtide.cs @@ -16,10 +16,9 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 80; Item.height = 92; - Item.damage = 91; + Item.damage = 85; Item.DamageType = DamageClass.Melee; - Item.useTime = 21; - Item.useAnimation = 21; + Item.useTime = Item.useAnimation = 24; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; diff --git a/Items/Weapons/Melee/GalactusBlade.cs b/Items/Weapons/Melee/GalactusBlade.cs index 93ba5d4a87..1e376464e4 100644 --- a/Items/Weapons/Melee/GalactusBlade.cs +++ b/Items/Weapons/Melee/GalactusBlade.cs @@ -30,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 144; Item.height = 146; - Item.damage = 828; + Item.damage = 185; Item.DamageType = DamageClass.Melee; Item.useAnimation = 27; Item.useStyle = ItemUseStyleID.Swing; @@ -40,8 +40,8 @@ namespace CalamityMod.Items.Weapons.Melee Item.UseSound = SoundID.Item105; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityTurquoiseBuyPrice; - Item.rare = ModContent.RarityType(); - Item.shoot = ModContent.ProjectileType(); + Item.rare = RarityType(); + Item.shoot = ProjectileType(); Item.shootSpeed = 13f; Item.scale = 0.75f; } @@ -99,7 +99,7 @@ namespace CalamityMod.Items.Weapons.Melee { Vector2 clampedMouse = player.ClampedMouseWorld(); Vector2 spawnSpot = new Vector2(clampedMouse.X, player.Center.Y) + new Vector2(Main.rand.NextFloat(-850, 850), Main.rand.NextFloat(-750, -1250)); - Projectile comet = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), spawnSpot, Utils.DirectionTo(spawnSpot, player.Calamity().mouseWorld + Main.rand.NextVector2Circular(50, 50)) * Item.shootSpeed, Item.shoot, Item.damage / 3, Item.knockBack, player.whoAmI); + Projectile comet = Projectile.NewProjectileDirect(player.GetSource_ItemUse(Item), spawnSpot, Utils.DirectionTo(spawnSpot, player.Calamity().mouseWorld + Main.rand.NextVector2Circular(50, 50)) * Item.shootSpeed, Item.shoot, Item.damage, Item.knockBack, player.whoAmI); comet.extraUpdates = Main.rand.Next(2, 3 + 1); } spawnProj = false; diff --git a/Items/Weapons/Melee/GeliticBlade.cs b/Items/Weapons/Melee/GeliticBlade.cs index 7fd0f6babb..6c6c677157 100644 --- a/Items/Weapons/Melee/GeliticBlade.cs +++ b/Items/Weapons/Melee/GeliticBlade.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Melee/GildedProboscis.cs b/Items/Weapons/Melee/GildedProboscis.cs index e278081d7e..88189f95cd 100644 --- a/Items/Weapons/Melee/GildedProboscis.cs +++ b/Items/Weapons/Melee/GildedProboscis.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Spears; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Spears; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.Spears[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/GreatswordofJudgement.cs b/Items/Weapons/Melee/GreatswordofJudgement.cs index 19486833cb..5b0b5fb1a8 100644 --- a/Items/Weapons/Melee/GreatswordofJudgement.cs +++ b/Items/Weapons/Melee/GreatswordofJudgement.cs @@ -1,85 +1,144 @@ -using CalamityMod.Dusts; +using System; +using CalamityMod.Items.Materials; using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using Terraria; using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { public class GreatswordofJudgement : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - private float swingRoatation = 0; - private int time = 0; - private Color mainColor; - private int swordDirection; - private int useTime = 20; - private int opacityAdjust = 0; - private float smearOpacity = 0; + public int time = 0; + public Vector2 bladeHitboxPos; + public float bladeRotation = 0; + public int bladeDirection = 0; + public float completion = 0; + public bool canHit => (completion >= 0.35f && completion <= 0.8f); + public int swingCount = 0; + public bool spawnProj = true; + public bool playSound = true; + + public Color clr = Color.MediumOrchid; + public override void SetDefaults() { Item.width = 78; Item.height = 78; - Item.damage = 155; + Item.damage = 240; Item.DamageType = DamageClass.Melee; Item.useStyle = ItemUseStyleID.Swing; - Item.useAnimation = Item.useTime = useTime; + Item.useAnimation = Item.useTime = 20; Item.useTurn = true; Item.knockBack = 7f; - Item.UseSound = SoundID.Item60; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityPurpleBuyPrice; Item.rare = ItemRarityID.Purple; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 5f; + Item.shootSpeed = 5.5f; + } + public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) + { + return false; } public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) { - float scale = 1.1f; + // Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC + float scale = 8f; Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale; - hitbox = new Rectangle(hitbox.X - (int)((newSize.X - hitbox.Width) / 2f), hitbox.Y - (int)((newSize.Y - hitbox.Height) / 2f), (int)newSize.X, (int)newSize.Y); + hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y); + } + public override bool? CanHitNPC(Player player, NPC target) + { + Vector2 mPos = player.Calamity().mouseWorld; + Vector2 shootDir = player.Center.DirectionTo(mPos); + float _ = float.NaN; + bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 145, Item.width * 3f, ref _); + return ((canHit && hitCheck) ? null : false); } public override void UseAnimation(Player player) { - swordDirection = player.direction; + swingCount++; time = 0; - swingRoatation = 0; - mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; - opacityAdjust = 0; - smearOpacity = 0; + bladeDirection = player.direction; + bladeHitboxPos = player.Center; + bladeRotation = 0; + spawnProj = true; + playSound = true; + int dir = -Math.Sign(player.Center.X - player.Calamity().mouseWorld.X); + float startRot = MathHelper.ToRadians(-90) * dir * (swingCount % 2 == 0 ? 1 : -1); + + clr = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; } public override void MeleeEffects(Player player, Rectangle hitbox) { - opacityAdjust++; - if (opacityAdjust >= 5 && opacityAdjust <= 15 && smearOpacity < 0.9f) - smearOpacity += 0.1f; - else if (smearOpacity > 0) - smearOpacity -= 0.2f; + Vector2 mPos = player.Calamity().mouseWorld; + completion = (float)((float)time / ((float)(Item.useAnimation / player.GetAttackSpeed(DamageClass.Melee)))); + int dir = -Math.Sign(player.Center.X - mPos.X); + + float startRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? 1 : -1); + float endRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? -1 : 1); + float minRot = MathHelper.ToRadians(-150) * dir * (swingCount % 2 == 0 ? 1 : -1); + float cutoff = 0.2f; + float cutoff2 = 0.95f; + + Vector2 shootDir = player.Center.DirectionTo(mPos) * Item.shootSpeed; + + if (completion <= cutoff) + { + float lerp = Utils.GetLerpValue(0, cutoff, completion, true); + player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(startRot, minRot, CalamityUtils.EaseInOutExp(lerp, 4f, 4f)); + player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir; + } + else + { + if (playSound) + { + SoundStyle swing = new("CalamityMod/Sounds/Item/SwooshMid"); + SoundEngine.PlaySound(swing with { Pitch = Main.rand.NextFloat(0.1f, 0.3f), Volume = 1f }, player.Center); + playSound = false; + } + if (completion >= 0.65f && spawnProj) + { + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f); + + Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.6f, clr, new Vector2(1f, 1f), true, false, 0, false, false); + GeneralParticleHandler.SpawnParticle(swipe); + + SoundEngine.PlaySound(SoundID.Item60, player.Center); + spawnProj = false; + } + float lerp = Utils.GetLerpValue(cutoff, cutoff2, completion, true); + player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(minRot, endRot, CalamityUtils.EaseInOutExp(lerp, 6f, 2f)); + player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir; + } + + float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225)); + bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180; + + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir); + player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir); + + player.itemLocation = player.Center; + player.direction = dir; time++; - swingRoatation += swordDirection == 1 ? 0.13f : -0.13f; - - float Rot = (swordDirection == -1 ? 1.8f : -1.8f) + swingRoatation; - if (swordDirection != player.direction) + } + public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) + { + int beamDamage = player.CalcIntDamage(Item.damage * 0.4f); + Vector2 mouseClamped = player.ClampedMouseWorld(); + SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f) }, player.Center); + for (int i = 0; i < 2; i++) { - swingRoatation *= -1; - swordDirection = player.direction; - } - Particle Smear = new SemiCircularSmearFade(player.Center, Vector2.Zero, mainColor * smearOpacity, Rot, Main.rand.NextFloat(1.95f, 2.2f), new Vector2(1, 1), 2, true, false, true, player.direction); - GeneralParticleHandler.SpawnParticle(Smear); - - if (Main.rand.NextBool(3)) - { - Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f); - Dust dust = Dust.NewDustPerfect(player.Center + dustVel * 9, 278); - dust.scale = Main.rand.NextFloat(0.4f, 0.55f); - dust.velocity = dustVel * 0.55f; - dust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; - dust.noGravity = true; + Vector2 vel = player.Center.DirectionFrom(target.Center).RotatedByRandom(0.7f) * Main.rand.NextFloat(18, 20); + Projectile.NewProjectile(player.GetSource_ItemUse(Item), player.Center, vel, ModContent.ProjectileType(), beamDamage, 0, player.whoAmI, 0, (i == 0 ? -1 : 1), 1); } } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) @@ -90,6 +149,8 @@ namespace CalamityMod.Items.Weapons.Melee { CreateRecipe(). AddIngredient(ItemID.LunarBar, 7). + AddIngredient(). + AddIngredient(5). AddTile(TileID.LunarCraftingStation). Register(); } diff --git a/Items/Weapons/Melee/Greentide.cs b/Items/Weapons/Melee/Greentide.cs index ce68ea8fc9..877ec86454 100644 --- a/Items/Weapons/Melee/Greentide.cs +++ b/Items/Weapons/Melee/Greentide.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -20,16 +22,19 @@ namespace CalamityMod.Items.Weapons.Melee internal const int TotalRows = 2; - internal const int TotalTeeth = 4; + internal const int TotalTeeth = 3; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 62; Item.height = 62; - Item.damage = 97; + Item.damage = 81; Item.DamageType = DamageClass.Melee; - Item.useTime = 27; - Item.useAnimation = 27; + Item.useTime = Item.useAnimation = 30; Item.useTurn = true; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 7f; @@ -46,17 +51,19 @@ namespace CalamityMod.Items.Weapons.Melee } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - for (int i = 0; i < 2; ++i) + for (int i = -2; i <= 2; i++) { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.RotatedBy(-0.1f * (i + 1)).RotatedByRandom(0.06f) * (1 - i * 0.3f), type, (int)(damage * 0.5f), knockback / 3, player.whoAmI, 1f, 0f); + if (i == 0) + { + Projectile strongTooth = Projectile.NewProjectileDirect(source, position, velocity * 1.2f, type, damage, knockback, player.whoAmI, 2f, 0f); + strongTooth.penetrate = -1; + strongTooth.timeLeft = 150; + } + else + { + Projectile.NewProjectile(source, position, velocity.RotatedBy(0.1f * i).RotatedByRandom(0.06f) * (1 - (Math.Abs(i) - 1) * 0.3f), type, (int)(damage * 0.5f), knockback / 3, player.whoAmI, 1f, 0f); + } } - for (int i = 0; i < 2; ++i) - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.RotatedBy(0.1f * (i + 1)).RotatedByRandom(0.06f) * (1 - i * 0.3f), type, (int)(damage * 0.5f), knockback / 3, player.whoAmI, 1f, 0f); - } - Projectile strongTooth = Projectile.NewProjectileDirect(source, position, velocity * 1.2f, type, (int)(damage), knockback, player.whoAmI, 2f, 0f); - strongTooth.penetrate = -1; - strongTooth.timeLeft = 150; return false; } @@ -81,20 +88,16 @@ namespace CalamityMod.Items.Weapons.Melee int teethDamage = player.CalcIntDamage((int)(Item.damage * 0.1f)); float teethKnockback = Item.knockBack * 0.2f; - bool evenNumberOfProjectiles = TotalTeeth % 2 == 0; - float amountToAdd = evenNumberOfProjectiles ? 0.5f : 0f; int centralProjectile = TotalTeeth / 2; - int otherCentralProjectile = centralProjectile - 1; float teethXVelocityReduction = 0.9f; float minVelocityAdjustment = 0.8f; float maxVelocityAdjustment = 1f; - float velocityAdjustment = minVelocityAdjustment; for (int i = 0; i < TotalRows; i++) { bool topTeeth = i == 0; for (int j = 0; j < TotalTeeth; j++) { - velocityAdjustment = ((j == centralProjectile || j == otherCentralProjectile) && evenNumberOfProjectiles) ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs((j + amountToAdd) - centralProjectile) / (float)centralProjectile); + float velocityAdjustment = j == centralProjectile ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs(j + 0.5f - centralProjectile) / (float)centralProjectile); if (topTeeth) { position.X += MathHelper.Lerp(-HalvedTeethSpread * 0.3f, HalvedTeethSpread * 0.3f, j / (float)(TotalTeeth - 1)); @@ -131,22 +134,18 @@ namespace CalamityMod.Items.Weapons.Melee Vector2 secondVelocity = (destination - secondPosition).SafeNormalize(Vector2.UnitY) * ShootSpeed; Vector2 secondCachedVelocity = secondVelocity; - int teethDamage = player.CalcIntDamage((int)(Item.damage * 0.5)); + int teethDamage = player.CalcIntDamage((int)(Item.damage * 0.1f)); float teethKnockback = Item.knockBack * 0.2f; - bool evenNumberOfProjectiles = TotalTeeth % 2 == 0; - float amountToAdd = evenNumberOfProjectiles ? 0.5f : 0f; int centralProjectile = TotalTeeth / 2; - int otherCentralProjectile = centralProjectile - 1; float teethXVelocityReduction = 0.9f; float minVelocityAdjustment = 0.8f; float maxVelocityAdjustment = 1f; - float velocityAdjustment = minVelocityAdjustment; for (int i = 0; i < TotalRows; i++) { bool topTeeth = i == 0; for (int j = 0; j < TotalTeeth; j++) { - velocityAdjustment = ((j == centralProjectile || j == otherCentralProjectile) && evenNumberOfProjectiles) ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs((j + amountToAdd) - centralProjectile) / (float)centralProjectile); + float velocityAdjustment = j == centralProjectile ? minVelocityAdjustment : MathHelper.Lerp(minVelocityAdjustment, maxVelocityAdjustment, Math.Abs(j + 0.5f - centralProjectile) / (float)centralProjectile); if (topTeeth) { position.X += MathHelper.Lerp(-HalvedTeethSpread, HalvedTeethSpread, j / (float)(TotalTeeth - 1)); @@ -173,7 +172,7 @@ namespace CalamityMod.Items.Weapons.Melee { Vector2 dustVel = Vector2.One.RotatedByRandom(100) * Main.rand.NextFloat(0.9f, 1.5f); if (Main.rand.NextBool(3)) - Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, 102, dustVel.X, dustVel.Y); + Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.Water_Desert, dustVel.X, dustVel.Y); } } } diff --git a/Items/Weapons/Melee/HellionFlowerSpear.cs b/Items/Weapons/Melee/HellionFlowerSpear.cs index d89110439a..94a013896c 100644 --- a/Items/Weapons/Melee/HellionFlowerSpear.cs +++ b/Items/Weapons/Melee/HellionFlowerSpear.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 64; Item.height = 64; - Item.damage = 135; + Item.damage = 85; Item.DamageType = DamageClass.Melee; Item.noMelee = true; Item.useTurn = true; diff --git a/Items/Weapons/Melee/Hellkite.cs b/Items/Weapons/Melee/Hellkite.cs index e3954b3dff..5cb216baa4 100644 --- a/Items/Weapons/Melee/Hellkite.cs +++ b/Items/Weapons/Melee/Hellkite.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 124; Item.height = 124; - Item.damage = 795; + Item.damage = 760; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 71; Item.useTurn = true; diff --git a/Items/Weapons/Melee/HolyCollider.cs b/Items/Weapons/Melee/HolyCollider.cs index 8829a63b1c..88240d2b8e 100644 --- a/Items/Weapons/Melee/HolyCollider.cs +++ b/Items/Weapons/Melee/HolyCollider.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.BaseItems; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Melee public class HolyCollider : CustomUseProjItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 114; diff --git a/Items/Weapons/Melee/InsidiousImpaler.cs b/Items/Weapons/Melee/InsidiousImpaler.cs index 61e02ad1f3..e481325e65 100644 --- a/Items/Weapons/Melee/InsidiousImpaler.cs +++ b/Items/Weapons/Melee/InsidiousImpaler.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Spears; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,7 +14,10 @@ namespace CalamityMod.Items.Weapons.Melee public class InsidiousImpaler : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; diff --git a/Items/Weapons/Melee/IridescentExcalibur.cs b/Items/Weapons/Melee/IridescentExcalibur.cs deleted file mode 100644 index 76c749add9..0000000000 --- a/Items/Weapons/Melee/IridescentExcalibur.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Items.Materials; -using CalamityMod.Projectiles.Melee; -using CalamityMod.Rarities; -using CalamityMod.Tiles.Furniture.CraftingStations; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.DataStructures; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Items.Weapons.Melee -{ - [LegacyName("ElementalExcalibur")] - public class IridescentExcalibur : ModItem, ILocalizedModType - { - public new string LocalizationCategory => "Items.Weapons.Melee"; - - private int MaxBeamTypes = 12; - - private int BeamType = 0; - - private const int Alpha = 100; - - private const float ShootSpeed = 16f; - - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } - - public override void SetDefaults() - { - Item.width = 112; - Item.height = 112; - Item.damage = 3000; - Item.useAnimation = Item.useTime = 15; - Item.useStyle = ItemUseStyleID.Swing; - Item.useTurn = true; - Item.DamageType = DamageClass.Melee; - Item.knockBack = 8f; - Item.UseSound = SoundID.Item1; - Item.autoReuse = true; - Item.value = CalamityGlobalItem.RarityHotPinkBuyPrice; - Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = ShootSpeed; - Item.rare = ModContent.RarityType(); - Item.shootsEveryUse = true; - } - - public override void UseStyle(Player player, Rectangle heldItemFrame) - { - player.itemLocation += new Vector2(-12f * player.direction, 2f * player.gravDir).RotatedBy(player.itemRotation); - } - - public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) - { - Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/IridescentExcaliburGlow").Value); - } - - // Terraria seems to really dislike high crit values in SetDefaults - public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 10; - - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) - { - if (player.altFunctionUse == 2) - { - float adjustedItemScale = player.GetAdjustedItemScale(Item); - Projectile.NewProjectile(source, player.MountedCenter, new Vector2(player.direction, 0f), ModContent.ProjectileType(), damage, knockback, player.whoAmI, (float)player.direction * player.gravDir, player.itemAnimationMax, adjustedItemScale); - Projectile.NewProjectile(source, player.MountedCenter, new Vector2(player.direction, 0f), ModContent.ProjectileType(), 0, knockback, player.whoAmI, (float)player.direction * player.gravDir, player.itemAnimationMax, adjustedItemScale); - Projectile.NewProjectile(source, player.MountedCenter, new Vector2(player.direction, 0f), ModContent.ProjectileType(), 0, knockback, player.whoAmI, (float)player.direction * player.gravDir, player.itemAnimationMax, adjustedItemScale); - NetMessage.SendData(MessageID.PlayerControls, -1, -1, null, player.whoAmI); - } - else - { - int proj = Projectile.NewProjectile(source, position, velocity, type, (int)Math.Round(damage * 0.5), knockback * 0.5f, player.whoAmI, (float)BeamType); - if (BeamType == 7) - Main.projectile[proj].penetrate = 3; - - BeamType++; - if (BeamType >= MaxBeamTypes) - BeamType = 0; - } - - return false; - } - - public override bool AltFunctionUse(Player player) => true; - - public override bool? UseItem(Player player) - { - Item.noMelee = player.altFunctionUse == 2; - return base.UseItem(player); - } - - public override void ModifyHitNPC(Player player, NPC target, ref NPC.HitModifiers modifiers) - { - if (player.altFunctionUse == 2) - modifiers.SourceDamage *= 2; - } - - public override void ModifyHitPvp(Player player, Player target, ref Player.HurtModifiers modifiers) - { - if (player.altFunctionUse == 2) - modifiers.SourceDamage *= 2; - } - - public override void MeleeEffects(Player player, Rectangle hitbox) - { - if (Main.rand.NextBool()) - { - Color rainbowColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Alpha); - Color color = Color.White; - int dustChoice = player.altFunctionUse == 2 ? Main.rand.Next(12) : BeamType; - switch (dustChoice) - { - case 0: // Red - color = new Color(255, 0, 0, Alpha); - break; - case 1: // Orange - color = new Color(255, 128, 0, Alpha); - break; - case 2: // Yellow - color = new Color(255, 255, 0, Alpha); - break; - case 3: // Lime - color = new Color(128, 255, 0, Alpha); - break; - case 4: // Green - color = new Color(0, 255, 0, Alpha); - break; - case 5: // Turquoise - color = new Color(0, 255, 128, Alpha); - break; - case 6: // Cyan - color = new Color(0, 255, 255, Alpha); - break; - case 7: // Light Blue - color = new Color(0, 128, 255, Alpha); - break; - case 8: // Blue - color = new Color(0, 0, 255, Alpha); - break; - case 9: // Purple - color = new Color(128, 0, 255, Alpha); - break; - case 10: // Fuschia - color = new Color(255, 0, 255, Alpha); - break; - case 11: // Hot Pink - color = new Color(255, 0, 128, Alpha); - break; - default: - break; - } - - Dust rainbow = Main.dust[Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.RainbowMk2)]; - rainbow.velocity *= 0f; - rainbow.color = Color.Lerp(rainbowColor, color, (float)Math.Sqrt((MathF.Cos(Main.GlobalTimeWrappedHourly / 60f) + 1f) * 0.5f)); - rainbow.color.A = 100; - rainbow.scale = Main.rand.NextFloat(1.2f, 1.6f); - rainbow.fadeIn = Main.rand.NextFloat(0.4f, 1f); - rainbow.noGravity = true; - } - } - - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 60); - } - - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 60); - } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.TrueExcalibur). - AddIngredient(). - AddIngredient(3). - AddIngredient(15). - AddTile(). - Register(); - } - } -} diff --git a/Items/Weapons/Melee/IridescentExcalibur.png b/Items/Weapons/Melee/IridescentExcalibur.png deleted file mode 100644 index 5ff82d5ac7..0000000000 Binary files a/Items/Weapons/Melee/IridescentExcalibur.png and /dev/null differ diff --git a/Items/Weapons/Melee/IridescentExcaliburGlow.png b/Items/Weapons/Melee/IridescentExcaliburGlow.png deleted file mode 100644 index e122aef76b..0000000000 Binary files a/Items/Weapons/Melee/IridescentExcaliburGlow.png and /dev/null differ diff --git a/Items/Weapons/Melee/Lacerator.cs b/Items/Weapons/Melee/Lacerator.cs index a23c35ba04..187f17e51e 100644 --- a/Items/Weapons/Melee/Lacerator.cs +++ b/Items/Weapons/Melee/Lacerator.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 30; Item.height = 26; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 152; + Item.damage = 115; Item.knockBack = 7f; Item.useTime = 20; Item.useAnimation = 20; diff --git a/Items/Weapons/Melee/LifehuntScythe.cs b/Items/Weapons/Melee/LifehuntScythe.cs index 488dc49969..eea043bf64 100644 --- a/Items/Weapons/Melee/LifehuntScythe.cs +++ b/Items/Weapons/Melee/LifehuntScythe.cs @@ -38,25 +38,7 @@ namespace CalamityMod.Items.Weapons.Melee Dust.NewDust(new Vector2(hitbox.X, hitbox.Y), hitbox.Width, hitbox.Height, DustID.CursedTorch); } - public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) - { - if (player.moonLeech || player.lifeSteal <= 0f || target.lifeMax <= 5) - return; - - int heal = 5; - player.lifeSteal -= heal; - player.HealPlayer(heal); - } - - public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo) - { - if (player.moonLeech || player.lifeSteal <= 0f) - return; - - int heal = 5; - player.lifeSteal -= heal; - player.HealPlayer(heal); - } + public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) => player.DoLifestealDirect(target, 5, 0.5f); public override void AddRecipes() { diff --git a/Items/Weapons/Melee/MantisClaws.cs b/Items/Weapons/Melee/MantisClaws.cs index e088461822..828860755b 100644 --- a/Items/Weapons/Melee/MantisClaws.cs +++ b/Items/Weapons/Melee/MantisClaws.cs @@ -1,17 +1,8 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; +using CalamityMod.Items.BaseItems; +using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; -using CalamityMod.Items.BaseItems; using Terraria.ModLoader; -using CalamityMod.Projectiles.BaseProjectiles; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using CalamityMod.Balancing; -using Terraria.Audio; -using CalamityMod.Projectiles.Melee; -using System; -using CalamityMod.Particles; namespace CalamityMod.Items.Weapons.Melee { @@ -20,10 +11,9 @@ namespace CalamityMod.Items.Weapons.Melee public new string LocalizationCategory => "Items.Weapons.Melee"; public override void SetDefaults() { - base.SetDefaults(); Item.width = 26; Item.height = 20; - Item.damage = 111; + Item.damage = 75; Item.DamageType = DamageClass.Melee; Item.useAnimation = Item.useTime = 25; Item.knockBack = 0.25f; diff --git a/Items/Weapons/Melee/MirrorBlade.cs b/Items/Weapons/Melee/MirrorBlade.cs index 08ad1543fe..684601d2fa 100644 --- a/Items/Weapons/Melee/MirrorBlade.cs +++ b/Items/Weapons/Melee/MirrorBlade.cs @@ -10,6 +10,8 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.Localization; +using Terraria.Audio; +using CalamityMod.Items.Weapons.Summon; using Terraria.ModLoader; using static System.Net.Mime.MediaTypeNames; @@ -33,6 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.AnimatesAsSoul[Type] = true; ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; base.SetStaticDefaults(); + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Melee/MonolithSword.cs b/Items/Weapons/Melee/MonolithSword.cs index 79100057a1..911473b62a 100644 --- a/Items/Weapons/Melee/MonolithSword.cs +++ b/Items/Weapons/Melee/MonolithSword.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Melee/MycelialClaws.cs b/Items/Weapons/Melee/MycelialClaws.cs index d8ed6d9a09..b8da26e630 100644 --- a/Items/Weapons/Melee/MycelialClaws.cs +++ b/Items/Weapons/Melee/MycelialClaws.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -9,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Melee public class MycelialClaws : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 22; diff --git a/Items/Weapons/Melee/Nebulash.cs b/Items/Weapons/Melee/Nebulash.cs index b6c96a6a50..4858d975ea 100644 --- a/Items/Weapons/Melee/Nebulash.cs +++ b/Items/Weapons/Melee/Nebulash.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,11 +12,15 @@ namespace CalamityMod.Items.Weapons.Melee public class Nebulash : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 16; Item.height = 16; - Item.damage = 60; + Item.damage = 85; Item.rare = ItemRarityID.Lime; Item.noMelee = true; Item.noUseGraphic = true; diff --git a/Items/Weapons/Melee/Oblivion.cs b/Items/Weapons/Melee/Oblivion.cs index 33ee8074d6..f836bb4d0b 100644 --- a/Items/Weapons/Melee/Oblivion.cs +++ b/Items/Weapons/Melee/Oblivion.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.ID; using Terraria.Localization; @@ -20,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -27,7 +30,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 28; Item.height = 38; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 55; + Item.damage = 50; Item.knockBack = 4f; Item.useTime = 22; Item.useAnimation = 22; diff --git a/Items/Weapons/Melee/OldLordClaymore.cs b/Items/Weapons/Melee/OldLordClaymore.cs index 58a906a399..82d8b08a91 100644 --- a/Items/Weapons/Melee/OldLordClaymore.cs +++ b/Items/Weapons/Melee/OldLordClaymore.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 76; Item.height = 76; - Item.damage = 195; + Item.damage = 144; Item.DamageType = TrueMeleeDamageClass.Instance; Item.useAnimation = Item.useTime = 90; // Yes it's actually supposed to be this slow diff --git a/Items/Weapons/Melee/Orderbringer.cs b/Items/Weapons/Melee/Orderbringer.cs index 4bcfb4b25b..2a05c47c20 100644 --- a/Items/Weapons/Melee/Orderbringer.cs +++ b/Items/Weapons/Melee/Orderbringer.cs @@ -1,42 +1,44 @@ -using CalamityMod.Items.Materials; +using System; +using System.Collections.Generic; +using System.Linq; +using CalamityMod.Items.Materials; +using CalamityMod.Particles; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using CalamityMod.Tiles.Furniture.CraftingStations; -using Terraria.Audio; -using Terraria.ID; using Microsoft.Xna.Framework; -using Terraria.ModLoader; -using CalamityMod.Particles; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.DataStructures; -using Basic.Reference.Assemblies; -using System; -using Mono.Cecil; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Items.Weapons.Melee { [LegacyName("GreatswordofBlah")] + [LegacyName("IridescentExcalibur")] public class Orderbringer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - private float swingRoatation = 0; - private int time = 0; - private Color mainColor; - private int swordDirection; - private int useTime = 18; - private int opacityAdjust = 0; - private float smearOpacity = 0; + public int time = 0; + public Vector2 bladeHitboxPos; + public float bladeRotation = 0; + public int bladeDirection = 0; + public float completion = 0; + public bool canHit => (completion >= 0.35f && completion <= 0.8f); + public int swingCount = 0; + public bool spawnProj = true; + public bool playSound = true; public override void SetDefaults() { - Item.width = Item.height = 108; - Item.damage = 445; + Item.width = Item.height = 112; + Item.damage = 840; Item.DamageType = DamageClass.Melee; - Item.useAnimation = Item.useTime = useTime; + Item.useAnimation = Item.useTime = 16; Item.useStyle = ItemUseStyleID.Swing; Item.useTurn = true; Item.knockBack = 8f; - Item.UseSound = SoundID.Item60; Item.autoReuse = true; Item.value = CalamityGlobalItem.RarityDarkBlueBuyPrice; Item.rare = ModContent.RarityType(); @@ -45,87 +47,149 @@ 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) { - Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f); - - for (int i = 0; i < 4; i++) - { - Vector2 vel = (velocity * 2.5f).RotatedByRandom(0.6f); - Projectile.NewProjectile(source, player.ClampedMouseWorld() - (velocity * 40) + Main.rand.NextVector2Circular(130, 130), vel * Main.rand.NextFloat(0.8f, 1.2f), ModContent.ProjectileType(), (int)(damage * 0.1f), knockback * 0.2f, player.whoAmI, 0, 0, 1); - } return false; } public override void UseItemHitbox(Player player, ref Rectangle hitbox, ref bool noHitbox) { - float scale = 1.2f; + // Basically just insures the enemy is always able to be hit if they're in range, the actual collision check is done in CanHitNPC + float scale = 8f; Vector2 newSize = new Point(hitbox.Width, hitbox.Height).ToVector2() * scale; - hitbox = new Rectangle(hitbox.X - (int)((newSize.X - hitbox.Width) / 2f), hitbox.Y - (int)((newSize.Y - hitbox.Height) / 2f), (int)newSize.X, (int)newSize.Y); + hitbox = new Rectangle((int)(bladeHitboxPos.X - newSize.X / 2f), (int)(bladeHitboxPos.Y - newSize.Y / 2f), (int)newSize.X, (int)newSize.Y); + } + public override bool? CanHitNPC(Player player, NPC target) + { + Vector2 mPos = player.Calamity().mouseWorld; + Vector2 shootDir = player.Center.DirectionTo(mPos); + float _ = float.NaN; + bool hitCheck = Collision.CheckAABBvLineCollision(target.Hitbox.TopLeft(), target.Hitbox.Size(), player.Center - shootDir * 30, player.Center + shootDir * 245, Item.width * 3f, ref _); + return ((canHit && hitCheck) ? null : false); } public override void UseAnimation(Player player) { - swordDirection = player.direction; + swingCount++; time = 0; - swingRoatation = 0; - mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; - opacityAdjust = 0; - smearOpacity = 0; + bladeDirection = player.direction; + bladeHitboxPos = player.Center; + bladeRotation = 0; + spawnProj = true; + playSound = true; + int dir = -Math.Sign(player.Center.X - player.Calamity().mouseWorld.X); + float startRot = MathHelper.ToRadians(-90) * dir * (swingCount % 2 == 0 ? 1 : -1); } public override void MeleeEffects(Player player, Rectangle hitbox) { - opacityAdjust++; - if (opacityAdjust >= 5 && opacityAdjust <= 15 && smearOpacity < 0.9f) - smearOpacity += 0.1f; - else if (smearOpacity > 0) - smearOpacity -= 0.2f; + Vector2 mPos = player.Calamity().mouseWorld; + completion = (float)((float)time / ((float)(Item.useAnimation / player.GetAttackSpeed(DamageClass.Melee)))); + int dir = -Math.Sign(player.Center.X - mPos.X); + + float startRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? 1 : -1); + float endRot = MathHelper.ToRadians(-110) * dir * (swingCount % 2 == 0 ? -1 : 1); + float minRot = MathHelper.ToRadians(-150) * dir * (swingCount % 2 == 0 ? 1 : -1); + float cutoff = 0.2f; + float cutoff2 = 0.95f; + + Vector2 shootDir = player.Center.DirectionTo(mPos) * Item.shootSpeed; + + if (completion <= cutoff) + { + float lerp = Utils.GetLerpValue(0, cutoff, completion, true); + player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(startRot, minRot, CalamityUtils.EaseInOutExp(lerp, 4f, 4f)); + player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir; + } + else + { + if (playSound) + { + SoundStyle swing = new("CalamityMod/Sounds/Item/SwooshMid"); + SoundEngine.PlaySound(swing with { Pitch = Main.rand.NextFloat(0.1f, 0.3f), Volume = 1f }, player.Center); + playSound = false; + } + if (completion >= 0.65f && spawnProj) + { + Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, shootDir, Item.shoot, Item.damage, Item.knockBack, player.whoAmI, 0f); + + for (int i = 0; i < 4; i++) + { + float rot = Main.rand.NextFloat(0.5f, 0.65f) * (Main.rand.NextBool() ? 1 : -1); + Vector2 vel = (shootDir * 2.5f).RotatedByRandom(0.6f); + Projectile.NewProjectile(player.GetSource_FromThis(), player.ClampedMouseWorld() - (shootDir * 40) + Main.rand.NextVector2Circular(130, 130), vel.RotatedBy(rot) * Main.rand.NextFloat(0.9f, 1.2f), ModContent.ProjectileType(), (int)(Item.damage * 0.12f), (int)(Item.knockBack * 0.2f), player.whoAmI, 0, rot, 1); + } + + Particle swipe = new CustomSpark(player.Center - shootDir * 5, shootDir.RotatedBy(0.4f * (dir * (swingCount % 2 == 0 ? 1 : -1))) * 2.5f, "CalamityMod/Particles/VerticalSmearLarge", false, (int)(14 / player.GetAttackSpeed(DamageClass.Melee)), 0.8f, player.Calamity().lightRGB, new Vector2(1f, 1f), true, false, 0, false, false); + GeneralParticleHandler.SpawnParticle(swipe); + + SoundEngine.PlaySound(SoundID.Item60, player.Center); + spawnProj = false; + } + float lerp = Utils.GetLerpValue(cutoff, cutoff2, completion, true); + player.itemRotation = player.Center.DirectionTo(mPos).ToRotation() + MathHelper.Lerp(minRot, endRot, CalamityUtils.EaseInOutExp(lerp, 6f, 2f)); + player.itemRotation += (MathHelper.Pi) * (dir == 1 ? 0 : 1) + MathHelper.PiOver4 * dir; + } + + float extraRot = (dir == 1 ? -MathHelper.PiOver4 : MathHelper.ToRadians(225)); + bladeHitboxPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 240; + Vector2 tipPos = player.Center + (player.itemRotation + extraRot).ToRotationVector2() * 180; + + player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir); + player.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, player.itemRotation + MathHelper.ToRadians(-130) * dir); + + player.itemLocation = player.Center; + player.direction = dir; time++; - swingRoatation += swordDirection == 1 ? 0.17f : -0.17f; - - float Rot = (swordDirection == -1 ? 1.8f : -1.8f) + swingRoatation; - if (swordDirection != player.direction) - { - swingRoatation *= -1; - swordDirection = player.direction; - } - Particle Smear = new SemiCircularSmearFade(player.Center, Vector2.Zero, mainColor * smearOpacity, Rot, Main.rand.NextFloat(2.8f, 3.2f), new Vector2(1, 1), 2, true, false, true, player.direction); - GeneralParticleHandler.SpawnParticle(Smear); - - if (Main.rand.NextBool()) - { - Vector2 dustVel = new Vector2(5 * swordDirection, -5).RotatedByRandom(1.55f) * Main.rand.NextFloat(0.7f, 1.3f) * 2; - Dust dust = Dust.NewDustPerfect(player.Center + dustVel * 9, 278); - dust.scale = Main.rand.NextFloat(0.5f, 0.75f); - dust.velocity = dustVel * 0.55f; - dust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; - dust.noGravity = true; - } } public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - int beamDamage = player.CalcIntDamage(Item.damage * 0.5f); + int beamDamage = player.CalcIntDamage(Item.damage * 0.4f); Vector2 mouseClamped = player.ClampedMouseWorld(); + SoundEngine.PlaySound(SoundID.Item84 with { Volume = 1f, Pitch = Main.rand.NextFloat(0.5f, 0.7f)}, player.Center); for (int i = 0; i < 2; i++) { Vector2 targetPos = Main.MouseWorld; NPC target2 = Main.MouseWorld.ClosestNPCAt(650); if (target2 != null) - targetPos = target2.Center + target2.velocity * 14; + targetPos = target2.Center; Vector2 spawnPos = mouseClamped + new Vector2(Main.rand.NextFloat(-300, 300), -900); Vector2 vel = (targetPos - spawnPos).SafeNormalize(Vector2.UnitY) * 10; Projectile.NewProjectile(player.GetSource_ItemUse(Item), spawnPos, vel, ModContent.ProjectileType(), beamDamage, 0, player.whoAmI); } } + public override void ModifyTooltips(List list) + { + Player Owner = Main.LocalPlayer; + if (Owner is null) + return; + + float rate = Main.GlobalTimeWrappedHourly * 7; + List eColors = new List() + { + Color.PaleVioletRed, + Color.Coral, + Color.Khaki, + Color.PaleGreen, + Color.Turquoise, + Color.Violet + }; + + int colorIndex = (int)(rate / 2 % eColors.Count); + Color currentColor = eColors[colorIndex]; + Color nextColor = eColors[(colorIndex + 1) % eColors.Count]; + Color finalColor = Color.Lerp(currentColor, nextColor, rate % 2f > 1f ? 1f : rate % 1f); + TooltipLine line = list.FirstOrDefault(x => x.Mod == "Terraria" && x.Name == "Tooltip2"); + if (line != null) + line.OverrideColor = Color.Lerp(finalColor, Color.White, 0.3f); + } public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI) { Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request("CalamityMod/Items/Weapons/Melee/OrderbringerGlow").Value); } - public override void AddRecipes() { CreateRecipe(). AddIngredient(). - AddIngredient(8). - AddIngredient(20). + AddIngredient(5). + AddIngredient(5). AddTile(). Register(); } diff --git a/Items/Weapons/Melee/Orderbringer.png b/Items/Weapons/Melee/Orderbringer.png index ade13f44bf..5ff82d5ac7 100644 Binary files a/Items/Weapons/Melee/Orderbringer.png and b/Items/Weapons/Melee/Orderbringer.png differ diff --git a/Items/Weapons/Melee/OrderbringerGlow.png b/Items/Weapons/Melee/OrderbringerGlow.png index 8c6448103a..e122aef76b 100644 Binary files a/Items/Weapons/Melee/OrderbringerGlow.png and b/Items/Weapons/Melee/OrderbringerGlow.png differ diff --git a/Items/Weapons/Melee/PerfectDark.cs b/Items/Weapons/Melee/PerfectDark.cs index 666b744d04..73949cbb30 100644 --- a/Items/Weapons/Melee/PerfectDark.cs +++ b/Items/Weapons/Melee/PerfectDark.cs @@ -1,5 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Melee public class PerfectDark : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 50; @@ -37,14 +43,5 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(ModContent.BuffType(), 300); } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 5). - AddIngredient(15). - AddIngredient(ItemID.RottenChunk, 5). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Melee/Pwnagehammer.cs b/Items/Weapons/Melee/Pwnagehammer.cs index 4c0510417d..0b0e47fa19 100644 --- a/Items/Weapons/Melee/Pwnagehammer.cs +++ b/Items/Weapons/Melee/Pwnagehammer.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 66; Item.height = 66; - Item.damage = 210; + Item.damage = 150; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; diff --git a/Items/Weapons/Melee/Quagmire.cs b/Items/Weapons/Melee/Quagmire.cs index 93827b8f25..0d405a1c87 100644 --- a/Items/Weapons/Melee/Quagmire.cs +++ b/Items/Weapons/Melee/Quagmire.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 30; Item.height = 36; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 52; + Item.damage = 54; Item.knockBack = 3.5f; Item.useTime = 22; Item.useAnimation = 22; diff --git a/Items/Weapons/Melee/SaharaSlicers.cs b/Items/Weapons/Melee/SaharaSlicers.cs index 40549fec04..4a6023a941 100644 --- a/Items/Weapons/Melee/SaharaSlicers.cs +++ b/Items/Weapons/Melee/SaharaSlicers.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Melee.Shortswords; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; @@ -18,6 +19,8 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Melee/SausageMaker.cs b/Items/Weapons/Melee/SausageMaker.cs index d43d86bd7f..6fbf590a5c 100644 --- a/Items/Weapons/Melee/SausageMaker.cs +++ b/Items/Weapons/Melee/SausageMaker.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee.Spears; using Terraria; using Terraria.ID; @@ -12,6 +13,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { ItemID.Sets.Spears[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() @@ -36,15 +38,5 @@ namespace CalamityMod.Items.Weapons.Melee } public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0; - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Melee/SkytideDragoon.cs b/Items/Weapons/Melee/SkytideDragoon.cs index eb4c791c2c..a406565bb4 100644 --- a/Items/Weapons/Melee/SkytideDragoon.cs +++ b/Items/Weapons/Melee/SkytideDragoon.cs @@ -1,5 +1,7 @@ using CalamityMod.Items.BaseItems; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,7 +15,10 @@ namespace CalamityMod.Items.Weapons.Melee public class SkytideDragoon : CustomUseProjItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 86; diff --git a/Items/Weapons/Melee/SmokingComet.cs b/Items/Weapons/Melee/SmokingComet.cs index 8fe6c66857..2373e4d3c0 100644 --- a/Items/Weapons/Melee/SmokingComet.cs +++ b/Items/Weapons/Melee/SmokingComet.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Melee Item.width = 36; Item.height = 40; Item.DamageType = DamageClass.MeleeNoSpeed; - Item.damage = 21; + Item.damage = 17; Item.knockBack = 1.5f; Item.useTime = 25; Item.useAnimation = 25; diff --git a/Items/Weapons/Melee/StellarStriker.cs b/Items/Weapons/Melee/StellarStriker.cs index 8efaa7e44f..56fad47d94 100644 --- a/Items/Weapons/Melee/StellarStriker.cs +++ b/Items/Weapons/Melee/StellarStriker.cs @@ -17,9 +17,8 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 100; Item.height = 118; - Item.damage = 110; + Item.damage = 143; Item.DamageType = TrueMeleeDamageClass.Instance; - Item.useAnimation = Item.useTime = 33; Item.useTurn = true; diff --git a/Items/Weapons/Melee/SubmarineShocker.cs b/Items/Weapons/Melee/SubmarineShocker.cs index 3ec096138d..757cb2ce38 100644 --- a/Items/Weapons/Melee/SubmarineShocker.cs +++ b/Items/Weapons/Melee/SubmarineShocker.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Shortswords; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Shortswords; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Melee public class SubmarineShocker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; diff --git a/Items/Weapons/Melee/TaintedBlade.cs b/Items/Weapons/Melee/TaintedBlade.cs index 82b65ddff0..99777f59cd 100644 --- a/Items/Weapons/Melee/TaintedBlade.cs +++ b/Items/Weapons/Melee/TaintedBlade.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 46; Item.height = 46; - Item.damage = 60; + Item.damage = 48; Item.DamageType = DamageClass.Melee; Item.useTurn = true; Item.useAnimation = 27; diff --git a/Items/Weapons/Melee/TerrorBlade.cs b/Items/Weapons/Melee/TerrorBlade.cs index 4d786f1baf..3f04aeed65 100644 --- a/Items/Weapons/Melee/TerrorBlade.cs +++ b/Items/Weapons/Melee/TerrorBlade.cs @@ -1,4 +1,6 @@ using System.Collections.Generic; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,7 +15,10 @@ namespace CalamityMod.Items.Weapons.Melee { public new string LocalizationCategory => "Items.Weapons.Melee"; internal const float TerrorBlastMultiplier = 0.3f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 88; diff --git a/Items/Weapons/Melee/TheBurningSky.cs b/Items/Weapons/Melee/TheBurningSky.cs index 88597dead0..743506420f 100644 --- a/Items/Weapons/Melee/TheBurningSky.cs +++ b/Items/Weapons/Melee/TheBurningSky.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -17,9 +19,9 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetStaticDefaults() { - // Visually a sword, but with no true melee capability. The Burning Sky is held out like a staff. Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheGodsGambit.cs b/Items/Weapons/Melee/TheGodsGambit.cs index d17e980aa4..7b188bfdf3 100644 --- a/Items/Weapons/Melee/TheGodsGambit.cs +++ b/Items/Weapons/Melee/TheGodsGambit.cs @@ -52,7 +52,7 @@ namespace CalamityMod.Items.Weapons.Melee CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Melee/TheMicrowave.cs b/Items/Weapons/Melee/TheMicrowave.cs index 21be661ebd..d89a786352 100644 --- a/Items/Weapons/Melee/TheMicrowave.cs +++ b/Items/Weapons/Melee/TheMicrowave.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee.Yoyos; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee.Yoyos; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -22,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TheObliterator.cs b/Items/Weapons/Melee/TheObliterator.cs index 07c02ed83e..ab59e6f12f 100644 --- a/Items/Weapons/Melee/TheObliterator.cs +++ b/Items/Weapons/Melee/TheObliterator.cs @@ -1,4 +1,7 @@ using System.Collections.Generic; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee.Yoyos; using CalamityMod.Rarities; using Terraria; @@ -21,6 +24,7 @@ namespace CalamityMod.Items.Weapons.Melee ItemID.Sets.Yoyo[Type] = true; ItemID.Sets.GamepadExtraRange[Type] = 15; ItemID.Sets.GamepadSmartQuickReach[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs index c24a749c40..4ca93ea57a 100644 --- a/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs +++ b/Items/Weapons/Melee/TriactisTruePaladinianMageHammerofMight.cs @@ -17,11 +17,11 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 168; Item.height = 168; - Item.damage = 5000; + Item.damage = 2000; Item.noMelee = true; Item.noUseGraphic = true; Item.autoReuse = true; - Item.useAnimation = Item.useTime = 36; + Item.useAnimation = Item.useTime = 40; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 14f; Item.UseSound = SoundID.Item1; diff --git a/Items/Weapons/Melee/TrueArkoftheAncients.cs b/Items/Weapons/Melee/TrueArkoftheAncients.cs index bce0c1ee8b..965503a687 100644 --- a/Items/Weapons/Melee/TrueArkoftheAncients.cs +++ b/Items/Weapons/Melee/TrueArkoftheAncients.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Items.Weapons.Melee public float Charge = 0f; public static float chargeDamageMultiplier = 1.25f; //Extra damage from charge public static float beamDamageMultiplier = 1f; //Damage multiplier for the charged shots (remember it applies ontop of the charge damage multiplied - public static float glassStarDamageMultiplier = 0.6f; //Damage multiplier for the glass stars it shoots (Shoots 3x glass stars when not charged, shoots 2x glass stars + one beam when charged) + public static float glassStarDamageMultiplier = 1f; //Damage multiplier for the glass stars it shoots (Shoots 3x glass stars when not charged, shoots 2x glass stars + one beam when charged) public override void ModifyTooltips(List tooltips) { @@ -43,7 +43,7 @@ namespace CalamityMod.Items.Weapons.Melee public override void SetDefaults() { Item.width = Item.height = 72; - Item.damage = 194; + Item.damage = 130; Item.DamageType = DamageClass.MeleeNoSpeed; Item.noUseGraphic = true; Item.noMelee = true; @@ -103,7 +103,6 @@ namespace CalamityMod.Items.Weapons.Melee Projectile.NewProjectile(source, player.Center - Shift, velocity.RotatedBy(-MathHelper.PiOver4 * 0.3f), ProjectileType(), (int)(damage * glassStarDamageMultiplier), knockback, player.whoAmI, Charge > 0 ? 1 : 0); } - Charge--; if (Charge < 0) Charge = 0; diff --git a/Items/Weapons/Melee/TrueBiomeBlade.cs b/Items/Weapons/Melee/TrueBiomeBlade.cs index 2dbd3efbd9..36b0850ef5 100644 --- a/Items/Weapons/Melee/TrueBiomeBlade.cs +++ b/Items/Weapons/Melee/TrueBiomeBlade.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Melee #region stats public static int BaseDamage = 115; - public static int DefaultAttunement_BaseDamage = 100; + public static int DefaultAttunement_BaseDamage = 90; public static int DefaultAttunement_SigilTime = 900; public static int DefaultAttunement_BeamTime = 90; public static float DefaultAttunement_LungeDamageMult = 2f; @@ -48,27 +48,27 @@ namespace CalamityMod.Items.Weapons.Melee public static float EvilAttunement_SlashDamageBoost = 3f; public static int EvilAttunement_SlashIFrames = 60; - public static int ColdAttunement_BaseDamage = 150; + public static int ColdAttunement_BaseDamage = 140; public static float ColdAttunement_ThirdSwingBoost = 1.25f; public static float ColdAttunement_MistDamageReduction = 0.11f; - public static int HotAttunement_BaseDamage = 135; + public static int HotAttunement_BaseDamage = 126; public static int HotAttunement_PlayerShredIFrames = 8; public static float HotAttunement_ShotDamageBoost = 4.5f; public static int HotAttunement_LocalIFrames = 24; //Be warned its got one extra update so all the iframes should be divided in 2 public static float HotAttunement_ShredDecayRate = 0.65f; //How much charge is lost per frame. - public static int TropicalAttunement_BaseDamage = 150; + public static int TropicalAttunement_BaseDamage = 132; public static float TropicalAttunement_ChainDamageReduction = 0.6f; public static float TropicalAttunement_VineDamageReduction = 0.3f; public static float TropicalAttunement_SweetSpotDamageMultiplier = 1.5f; //It also crits, so be mindful of that public static int TropicalAttunement_LocalIFrames = 60; //Be warned its got 2 extra updates so all the iframes should be divided in 3 - public static int HolyAttunement_BaseDamage = 66; - public static float HolyAttunement_BaseSwingDamageMult = 0.75f; - public static float HolyAttunement_FullSwingDamageMult = 1.5f; - public static float HolyAttunement_ThrowDamageBoost = 3.8f; - public static int HolyAttunement_LocalIFrames = 16; //Be warned its got 1 extra update yadda yadda + public static int HolyAttunement_BaseDamage = 84; + public static float HolyAttunement_BaseSwingDamageMult = 0.5f; + public static float HolyAttunement_FullSwingDamageMult = 1f; + public static float HolyAttunement_ThrowDamageBoost = 3f; + public static int HolyAttunement_LocalIFrames = 20; //Be warned its got 1 extra update yadda yadda public static float HolyAttunement_MonolithDamage = 0.5f; #endregion diff --git a/Items/Weapons/Melee/TyphonsGreed.cs b/Items/Weapons/Melee/TyphonsGreed.cs index e2d8e61327..40517717a8 100644 --- a/Items/Weapons/Melee/TyphonsGreed.cs +++ b/Items/Weapons/Melee/TyphonsGreed.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Melee { Item.width = 16; Item.height = 16; - Item.damage = 62; + Item.damage = 60; Item.DamageType = DamageClass.Melee; Item.useTime = 30; Item.useAnimation = 30; diff --git a/Items/Weapons/Melee/UltimusCleaver.cs b/Items/Weapons/Melee/UltimusCleaver.cs index f9128f195b..a4e97d574d 100644 --- a/Items/Weapons/Melee/UltimusCleaver.cs +++ b/Items/Weapons/Melee/UltimusCleaver.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; @@ -12,7 +14,10 @@ namespace CalamityMod.Items.Weapons.Melee public class UltimusCleaver : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 72; @@ -36,51 +41,34 @@ namespace CalamityMod.Items.Weapons.Melee public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.OnFire3, 360); + SoundEngine.PlaySound(SoundID.Item14, target.Center); int onHitDamage = player.CalcIntDamage(Item.damage); Projectile blast = Projectile.NewProjectileDirect(Item.GetSource_FromThis(), target.Center, Vector2.Zero, ModContent.ProjectileType(), onHitDamage, 0f, player.whoAmI, target.whoAmI); blast.DamageType = Item.DamageType; - float firstDustScale = 1.7f; - float secondDustScale = 0.8f; - float thirdDustScale = 2f; - Vector2 dustRotation = (target.rotation - 1.57079637f).ToRotationVector2(); + + Vector2 dustRotation = (target.rotation - MathHelper.PiOver2).ToRotationVector2(); Vector2 dustVelocity = dustRotation * target.velocity.Length(); - SoundEngine.PlaySound(SoundID.Item14, target.Center); - int increment; - for (int i = 0; i < 40; i = increment + 1) + for (int i = 0; i < 40; i++) { - int swingDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 200, default, firstDustScale); - Dust dust = Main.dust[swingDust]; - dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; - dust.noGravity = true; - dust.velocity.Y -= 6f; - dust.velocity *= 3f; - dust.velocity += dustVelocity * Main.rand.NextFloat(); - swingDust = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 100, default, secondDustScale); - dust.position = target.Center + Vector2.UnitY.RotatedByRandom(3.1415927410125732) * (float)Main.rand.NextDouble() * (float)target.width / 2f; - dust.velocity.Y -= 6f; - dust.velocity *= 2f; - dust.noGravity = true; - dust.fadeIn = 1f; - dust.color = Color.Crimson * 0.5f; - dust.velocity += dustVelocity * Main.rand.NextFloat(); - increment = i; + Vector2 mainDustPos = target.Center + Main.rand.NextVector2Circular(target.width / 2, target.width / 2); + Dust swingDust = Dust.NewDustPerfect(mainDustPos, DustID.InfernoFork, dustVelocity * Main.rand.NextFloat() - Vector2.UnitY * 18f, 200, Scale: 1.7f); + swingDust.noGravity = true; + + Dust swingDust2 = Dust.NewDustPerfect(mainDustPos, DustID.InfernoFork, dustVelocity * Main.rand.NextFloat() - Vector2.UnitY * 12f, 100, Color.Crimson * 0.5f, 0.8f); + swingDust2.noGravity = true; + swingDust2.fadeIn = 1f; } - for (int j = 0; j < 20; j = increment + 1) + for (int j = 0; j < 20; j++) { - int swingDust2 = Dust.NewDust(new Vector2(target.position.X, target.position.Y), target.width, target.height, DustID.InfernoFork, 0f, 0f, 0, default, thirdDustScale); - Dust dust = Main.dust[swingDust2]; - dust.position = target.Center + Vector2.UnitX.RotatedByRandom(3.1415927410125732).RotatedBy((double)target.velocity.ToRotation(), default) * (float)target.width / 3f; - dust.noGravity = true; - dust.velocity.Y -= 6f; - dust.velocity *= 0.5f; - dust.velocity += dustVelocity * (0.6f + 0.6f * Main.rand.NextFloat()); - increment = j; + Vector2 dustPos = target.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(target.velocity.ToRotation()) * (target.width / 3f); + Dust moreDust = Dust.NewDustPerfect(dustPos, DustID.InfernoFork, dustVelocity * (0.6f + 0.6f * Main.rand.NextFloat()) - Vector2.UnitY * 3f, Scale: 2f); + moreDust.noGravity = true; } } public override void MeleeEffects(Player player, Rectangle hitbox) { - if (player.whoAmI == Main.myPlayer) + if (player.whoAmI == Main.myPlayer && !player.Calamity().bladeArmEnchant) { if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1) || player.itemAnimation == (int)(player.itemAnimationMax * 0.3) || @@ -88,65 +76,48 @@ namespace CalamityMod.Items.Weapons.Melee player.itemAnimation == (int)(player.itemAnimationMax * 0.7) || player.itemAnimation == (int)(player.itemAnimationMax * 0.9)) { - float sparkYVel = 0f; float sparkXVel = 0f; - float sparkYSpawn = 0f; + float sparkYVel = 0f; float sparkXSpawn = 0f; + float sparkYSpawn = 0f; + if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9)) { - sparkYVel = -7f; + sparkYVel = -10.5f; + if (player.direction == -1) + sparkXSpawn = -8f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7)) { - sparkYVel = -6f; - sparkXVel = 2f; + sparkYVel = -9f; + sparkXVel = 3f; + sparkXSpawn = player.direction == -1 ? 20f : 26f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.5)) { - sparkYVel = -4f; - sparkXVel = 4f; - } - if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3)) - { - sparkYVel = -2f; + sparkYVel = -6f; sparkXVel = 6f; } - if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1)) - { - sparkXVel = 7f; - } - if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7)) - { - sparkXSpawn = 26f; - } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.3)) { - sparkXSpawn -= 4f; - sparkYSpawn -= 20f; + sparkXVel = 9f; + sparkYVel = -3f; + sparkXSpawn = -4f; + sparkYSpawn = -20f; } if (player.itemAnimation == (int)(player.itemAnimationMax * 0.1)) { - sparkYSpawn += 6f; + sparkXVel = 10.5f; + sparkYSpawn = 6f; } - if (player.direction == -1) - { - if (player.itemAnimation == (int)(player.itemAnimationMax * 0.9)) - { - sparkXSpawn -= 8f; - } - if (player.itemAnimation == (int)(player.itemAnimationMax * 0.7)) - { - sparkXSpawn -= 6f; - } - } - sparkYVel *= 1.5f; - sparkXVel *= 1.5f; - sparkXSpawn *= (float)player.direction; + + sparkXVel *= player.direction; + sparkYVel *= player.gravDir; + sparkXSpawn *= player.direction; sparkYSpawn *= player.gravDir; var source = player.GetSource_ItemUse(Item); int damage = (int)player.GetTotalDamage().ApplyTo(Item.damage * 0.1f); - Projectile.NewProjectile(source, (float)(hitbox.X + hitbox.Width / 2) + sparkXSpawn, (float)(hitbox.Y + hitbox.Height / 2) + sparkYSpawn, - (float)player.direction * sparkXVel, sparkYVel * player.gravDir, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, hitbox.X + hitbox.Width / 2 + sparkXSpawn, hitbox.Y + hitbox.Height / 2 + sparkYSpawn, sparkXVel, sparkYVel, ModContent.ProjectileType(), damage, 0f, player.whoAmI); } } } diff --git a/Items/Weapons/Melee/VeinBurster.cs b/Items/Weapons/Melee/VeinBurster.cs index c8d2f1f9d7..e23cc6bb6b 100644 --- a/Items/Weapons/Melee/VeinBurster.cs +++ b/Items/Weapons/Melee/VeinBurster.cs @@ -1,5 +1,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using Terraria; using Terraria.ID; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Melee public class VeinBurster : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 52; @@ -37,14 +43,5 @@ namespace CalamityMod.Items.Weapons.Melee { target.AddBuff(ModContent.BuffType(), 300); } - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 5). - AddIngredient(15). - AddIngredient(ItemID.Vertebrae, 5). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Melee/Violence.cs b/Items/Weapons/Melee/Violence.cs index a5c14dd92e..70362f76b4 100644 --- a/Items/Weapons/Melee/Violence.cs +++ b/Items/Weapons/Melee/Violence.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Melee; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Violence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 142; diff --git a/Items/Weapons/Melee/Virulence.cs b/Items/Weapons/Melee/Virulence.cs index 97f4b5a5ac..df28227dba 100644 --- a/Items/Weapons/Melee/Virulence.cs +++ b/Items/Weapons/Melee/Virulence.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Melee; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Melee public class Virulence : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Melee"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 74; diff --git a/Items/Weapons/Ranged/AcidwoodBow.cs b/Items/Weapons/Ranged/AcidwoodBow.cs index 37af5aa1ea..2f0ddc6042 100644 --- a/Items/Weapons/Ranged/AcidwoodBow.cs +++ b/Items/Weapons/Ranged/AcidwoodBow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using Terraria; using Terraria.ID; using Terraria.ModLoader; diff --git a/Items/Weapons/Ranged/Animosity.cs b/Items/Weapons/Ranged/Animosity.cs index 3ca149441e..f04613eac6 100644 --- a/Items/Weapons/Ranged/Animosity.cs +++ b/Items/Weapons/Ranged/Animosity.cs @@ -1,5 +1,7 @@ using System; using System.Collections.Generic; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles; using CalamityMod.Projectiles.Magic; using CalamityMod.Projectiles.Ranged; @@ -23,20 +25,20 @@ namespace CalamityMod.Items.Weapons.Ranged public float SniperVelocityMult = 2f; public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() => ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - + public override void SetStaticDefaults() + { + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 70; Item.height = 18; - Item.damage = 46; + Item.damage = 39; Item.DamageType = DamageClass.Ranged; - Item.width = 70; - Item.height = 18; Item.scale = 0.85f; - Item.useTime = 30; + Item.useTime = Item.useAnimation = 33; Item.reuseDelay = 10; - Item.useAnimation = 30; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 2f; @@ -53,7 +55,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 +67,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) { @@ -180,7 +175,7 @@ namespace CalamityMod.Items.Weapons.Ranged if (!Main.dedServ) { string goreType = Main.rand.NextBool() ? "EmptyAnimosityShell" : "EmptyAnimosityShell2"; - Gore.NewGore(source, position, velocity.RotatedBy(2f * -player.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type); + Gore.NewGore(source, position, velocity.RotatedBy(2f * -player.direction) * Main.rand.NextFloat(0.6f, 0.7f), Mod.Find(goreType).Type, 0.75f); } return false; } diff --git a/Items/Weapons/Ranged/Arietes41.cs b/Items/Weapons/Ranged/Arietes41.cs index 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..168753fe67 100644 --- a/Items/Weapons/Ranged/AuroraBlazer.cs +++ b/Items/Weapons/Ranged/AuroraBlazer.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,11 +13,15 @@ namespace CalamityMod.Items.Weapons.Ranged public class AuroraBlazer : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 68; Item.height = 36; - Item.damage = 80; + Item.damage = 69; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 30; diff --git a/Items/Weapons/Ranged/Barinade.cs b/Items/Weapons/Ranged/Barinade.cs index aae8b9e920..ed8ba5560f 100644 --- a/Items/Weapons/Ranged/Barinade.cs +++ b/Items/Weapons/Ranged/Barinade.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,11 @@ namespace CalamityMod.Items.Weapons.Ranged public class Barinade : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 52; diff --git a/Items/Weapons/Ranged/Barinautical.cs b/Items/Weapons/Ranged/Barinautical.cs index 12d468c942..f3b401d895 100644 --- a/Items/Weapons/Ranged/Barinautical.cs +++ b/Items/Weapons/Ranged/Barinautical.cs @@ -1,4 +1,7 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Barinautical : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 30; diff --git a/Items/Weapons/Ranged/BladedgeRailbow.cs b/Items/Weapons/Ranged/BladedgeRailbow.cs index 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/BlightSpewer.cs b/Items/Weapons/Ranged/BlightSpewer.cs index 50e3df7a73..0fa6b0f31b 100644 --- a/Items/Weapons/Ranged/BlightSpewer.cs +++ b/Items/Weapons/Ranged/BlightSpewer.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -13,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Ranged public new string LocalizationCategory => "Items.Weapons.Ranged"; public static readonly SoundStyle Nanomachines = new("CalamityMod/Sounds/Item/NanoSwarm") { PitchVariance = 0.45f, Volume = 0.4f }; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 76; diff --git a/Items/Weapons/Ranged/BlissfulBombardier.cs b/Items/Weapons/Ranged/BlissfulBombardier.cs index 4f76ab7311..b429d4cd86 100644 --- a/Items/Weapons/Ranged/BlissfulBombardier.cs +++ b/Items/Weapons/Ranged/BlissfulBombardier.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class BlissfulBombardier : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 88; diff --git a/Items/Weapons/Ranged/BloodBoiler.cs b/Items/Weapons/Ranged/BloodBoiler.cs index 3067ec1c17..35eabb4e58 100644 --- a/Items/Weapons/Ranged/BloodBoiler.cs +++ b/Items/Weapons/Ranged/BloodBoiler.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 60; Item.height = 30; - Item.damage = 135; + Item.damage = 120; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 25; diff --git a/Items/Weapons/Ranged/BlossomFlux.cs b/Items/Weapons/Ranged/BlossomFlux.cs index 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/ChickenCannon.cs b/Items/Weapons/Ranged/ChickenCannon.cs index 2300098a78..1832cea17c 100644 --- a/Items/Weapons/Ranged/ChickenCannon.cs +++ b/Items/Weapons/Ranged/ChickenCannon.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -12,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class ChickenCannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 126; diff --git a/Items/Weapons/Ranged/Condemnation.cs b/Items/Weapons/Ranged/Condemnation.cs index 8132546927..c80a369ecc 100644 --- a/Items/Weapons/Ranged/Condemnation.cs +++ b/Items/Weapons/Ranged/Condemnation.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -16,6 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() diff --git a/Items/Weapons/Ranged/ConferenceCall.cs b/Items/Weapons/Ranged/ConferenceCall.cs index a673f01eb8..550f6e4e1c 100644 --- a/Items/Weapons/Ranged/ConferenceCall.cs +++ b/Items/Weapons/Ranged/ConferenceCall.cs @@ -44,7 +44,6 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - int bulletAmt = 4; for (int index = 0; index < bulletAmt; ++index) { @@ -87,10 +86,12 @@ namespace CalamityMod.Items.Weapons.Ranged targetPosition.X = (targetPosition.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); targetPosition.Y -= 100 * j; - Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[j]].Center - targetPosition) * Item.shootSpeed; + // Create a dummy projectile to grab the number of max updates the bullet has for predictive aim use + Projectile dummy = new Projectile(); + dummy.SetDefaults(type); + Vector2 extraBulletVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(targetPosition, Main.npc[targets[j]], Item.shootSpeed, dummy.MaxUpdates); int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } @@ -107,10 +108,12 @@ namespace CalamityMod.Items.Weapons.Ranged targetPosition.X = (targetPosition.X + player.Center.X) / 2f + Main.rand.Next(-200, 201); targetPosition.Y -= 100 * randomTarget; - Vector2 extraBulletVel = Vector2.Normalize(Main.npc[targets[randomTarget]].Center - targetPosition) * Item.shootSpeed; + // Create a dummy projectile to grab the number of max updates the bullet has for predictive aim use + Projectile dummy = new Projectile(); + dummy.SetDefaults(type); + Vector2 extraBulletVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(targetPosition, Main.npc[targets[randomTarget]], Item.shootSpeed, dummy.MaxUpdates); int proj = Projectile.NewProjectile(source, targetPosition, extraBulletVel, type, extraBulletDamage, knockback, player.whoAmI); - Main.projectile[proj].extraUpdates += 14; Main.projectile[proj].tileCollide = false; Main.projectile[proj].timeLeft /= 2; } diff --git a/Items/Weapons/Ranged/DaemonsFlame.cs b/Items/Weapons/Ranged/DaemonsFlame.cs index 6a3667da12..f42eb94dd5 100644 --- a/Items/Weapons/Ranged/DaemonsFlame.cs +++ b/Items/Weapons/Ranged/DaemonsFlame.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class DaemonsFlame : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 62; diff --git a/Items/Weapons/Ranged/Deathwind.cs b/Items/Weapons/Ranged/Deathwind.cs index 9632dcfee7..73fc040b5b 100644 --- a/Items/Weapons/Ranged/Deathwind.cs +++ b/Items/Weapons/Ranged/Deathwind.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Deathwind : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 40; diff --git a/Items/Weapons/Ranged/DragonsBreath.cs b/Items/Weapons/Ranged/DragonsBreath.cs index f313c05955..34eab37a86 100644 --- a/Items/Weapons/Ranged/DragonsBreath.cs +++ b/Items/Weapons/Ranged/DragonsBreath.cs @@ -1,4 +1,6 @@ using System; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -21,7 +23,10 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle WeldingShoot = new("CalamityMod/Sounds/Item/WeldingShoot") { Volume = 0.45f }; public int Counter = 0; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 124; diff --git a/Items/Weapons/Ranged/DriftwoodBow.cs b/Items/Weapons/Ranged/DriftwoodBow.cs index 66322c7e39..2ed7345aee 100644 --- a/Items/Weapons/Ranged/DriftwoodBow.cs +++ b/Items/Weapons/Ranged/DriftwoodBow.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; diff --git a/Items/Weapons/Ranged/Eviscerator.cs b/Items/Weapons/Ranged/Eviscerator.cs index 6a6d5e6b82..ecbb2126b4 100644 --- a/Items/Weapons/Ranged/Eviscerator.cs +++ b/Items/Weapons/Ranged/Eviscerator.cs @@ -1,4 +1,6 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Eviscerator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 58; @@ -46,15 +52,5 @@ namespace CalamityMod.Items.Weapons.Ranged return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Ranged/FetidEmesis.cs b/Items/Weapons/Ranged/FetidEmesis.cs index 6027e5535d..12c1023bb0 100644 --- a/Items/Weapons/Ranged/FetidEmesis.cs +++ b/Items/Weapons/Ranged/FetidEmesis.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class FetidEmesis : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 76; diff --git a/Items/Weapons/Ranged/FirestormCannon.cs b/Items/Weapons/Ranged/FirestormCannon.cs index 766db7e7b6..5dd7c75d29 100644 --- a/Items/Weapons/Ranged/FirestormCannon.cs +++ b/Items/Weapons/Ranged/FirestormCannon.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Projectiles.Ranged; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -9,10 +10,13 @@ namespace CalamityMod.Items.Weapons.Ranged public class FirestormCannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; - public override void SetStaticDefaults() - { - ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; - } + + // This is intentionally stored on the item instead of the holdout to prevent swapping items to instantly reset the heat + // This could be theoretically exploited using multiple items, but the heat dissipates fast enough that I can't really care + public int BuiltUpHeat = 0; + public const int OverheatLevel = 480; + public const int OverheatCooldown = 180; + public const int OverheatDamage = 20; public override void SetDefaults() { @@ -20,71 +24,41 @@ namespace CalamityMod.Items.Weapons.Ranged Item.height = 28; Item.damage = 14; Item.DamageType = DamageClass.Ranged; - Item.useTime = 12; - Item.useAnimation = 12; + Item.useTime = Item.useAnimation = 11; + Item.knockBack = 1.5f; + Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 1.5f; + Item.channel = true; + Item.noUseGraphic = true; + Item.autoReuse = true; + Item.value = CalamityGlobalItem.RarityGreenBuyPrice; Item.rare = ItemRarityID.Green; - Item.UseSound = SoundID.Item11; - Item.autoReuse = true; - Item.shoot = ProjectileID.Flare; + Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 5.5f; Item.useAmmo = AmmoID.Flare; - Item.Calamity().canFirePointBlankShots = true; } - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - - public override bool CanConsumeAmmo(Item ammo, Player player) => Main.rand.Next(100) >= 70; - - public override bool AltFunctionUse(Player player) => true; - - public override float UseSpeedMultiplier(Player player) + public override void HoldItem(Player player) { - if (player.altFunctionUse == 2) - return 1 / 3f; - return 1f; + player.Calamity().rightClickListener = true; + // Heat decrements if: + // The holdout exists, the player is not firing, the player is not in overheat, and there is heat in the weapon + if (player.ownedProjectileCounts[Item.shoot] > 0 && !Main.mouseLeft && player.Calamity().flareGunOverheat == 0 && BuiltUpHeat > 0) + { + BuiltUpHeat -= player.miscCounter % 2 == 0 ? 3 : 2; + if (BuiltUpHeat < 0) + BuiltUpHeat = 0; + } } + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && !player.Calamity().mouseRight; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; // Spawning the holdout cannot consume ammo public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.altFunctionUse == 2) - { - velocity *= 2f; - int flareAmt = Main.rand.Next(4, 6); - for (int index = 0; index < flareAmt; ++index) - { - float SpeedX = velocity.X + (float)Main.rand.Next(-50, 51) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-50, 51) * 0.05f; - int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - if (flare.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flare].penetrate = 1; - Main.projectile[flare].timeLeft = 600; - Main.projectile[flare].DamageType = DamageClass.Ranged; - } - } - return false; - } - else - { - int flareAmt = Main.rand.Next(1, 3); - for (int index = 0; index < flareAmt; ++index) - { - float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; - int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - if (flare.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flare].DamageType = DamageClass.Ranged; - Main.projectile[flare].timeLeft = 200; - Main.projectile[flare].penetrate = 3; - } - } - return false; - } + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); + return false; } public override void AddRecipes() diff --git a/Items/Weapons/Ranged/FlakKraken.cs b/Items/Weapons/Ranged/FlakKraken.cs index 868f04b376..76ccecc30f 100644 --- a/Items/Weapons/Ranged/FlakKraken.cs +++ b/Items/Weapons/Ranged/FlakKraken.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 152; Item.height = 58; - Item.damage = 124; + Item.damage = 78; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = OriginalUseTime; Item.knockBack = 0.25f; diff --git a/Items/Weapons/Ranged/Fungicide.cs b/Items/Weapons/Ranged/Fungicide.cs index 830466446c..656cdd1b20 100644 --- a/Items/Weapons/Ranged/Fungicide.cs +++ b/Items/Weapons/Ranged/Fungicide.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,11 +11,15 @@ namespace CalamityMod.Items.Weapons.Ranged public class Fungicide : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 40; Item.height = 26; - Item.damage = 20; + Item.damage = 19; Item.DamageType = DamageClass.Ranged; Item.useTime = 22; Item.useAnimation = 22; diff --git a/Items/Weapons/Ranged/GoldenEagle.cs b/Items/Weapons/Ranged/GoldenEagle.cs index 87e94b5a7c..0188b657ce 100644 --- a/Items/Weapons/Ranged/GoldenEagle.cs +++ b/Items/Weapons/Ranged/GoldenEagle.cs @@ -1,4 +1,6 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -10,7 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; private const float Spread = 0.0425f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 46; diff --git a/Items/Weapons/Ranged/Goobow.cs b/Items/Weapons/Ranged/Goobow.cs index 6b51c5ba4b..b2d20525cf 100644 --- a/Items/Weapons/Ranged/Goobow.cs +++ b/Items/Weapons/Ranged/Goobow.cs @@ -62,7 +62,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Ranged/GunkShot.cs b/Items/Weapons/Ranged/GunkShot.cs index 175b7691be..9f68640f98 100644 --- a/Items/Weapons/Ranged/GunkShot.cs +++ b/Items/Weapons/Ranged/GunkShot.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Ranged CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Ranged/HavocsBreath.cs b/Items/Weapons/Ranged/HavocsBreath.cs index fa23d2cd9b..9ca4a9a5a4 100644 --- a/Items/Weapons/Ranged/HavocsBreath.cs +++ b/Items/Weapons/Ranged/HavocsBreath.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 68; Item.height = 26; - Item.damage = 74; + Item.damage = 62; Item.DamageType = DamageClass.Ranged; Item.useTime = 5; Item.useAnimation = 35; diff --git a/Items/Weapons/Ranged/Hellborn.cs b/Items/Weapons/Ranged/Hellborn.cs index c259c226ab..1d82cba55f 100644 --- a/Items/Weapons/Ranged/Hellborn.cs +++ b/Items/Weapons/Ranged/Hellborn.cs @@ -1,6 +1,7 @@ using System.Linq; using CalamityMod.Cooldowns; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -18,6 +19,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/HoarfrostBow.cs b/Items/Weapons/Ranged/HoarfrostBow.cs index 6dcc2a5750..8bad1545c0 100644 --- a/Items/Weapons/Ranged/HoarfrostBow.cs +++ b/Items/Weapons/Ranged/HoarfrostBow.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class HoarfrostBow : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 26; diff --git a/Items/Weapons/Ranged/Hydra.cs b/Items/Weapons/Ranged/Hydra.cs index 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/Infinity.cs b/Items/Weapons/Ranged/Infinity.cs index 8a164a88ae..f2f5ffe8ec 100644 --- a/Items/Weapons/Ranged/Infinity.cs +++ b/Items/Weapons/Ranged/Infinity.cs @@ -64,8 +64,8 @@ namespace CalamityMod.Items.Weapons.Ranged { Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); - int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 1f); - int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 1f); + int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 1 : 0); + int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 1 : 0); } else if (player.altFunctionUse != 2) { diff --git a/Items/Weapons/Ranged/Leviatitan.cs b/Items/Weapons/Ranged/Leviatitan.cs index 61010b9c37..90464eefc7 100644 --- a/Items/Weapons/Ranged/Leviatitan.cs +++ b/Items/Weapons/Ranged/Leviatitan.cs @@ -1,5 +1,7 @@ using System; using System.Diagnostics.Metrics; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Particles; using CalamityMod.Projectiles.Ranged; using Microsoft.Build.Tasks; @@ -21,13 +23,14 @@ namespace CalamityMod.Items.Weapons.Ranged public override void SetStaticDefaults() { ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { Item.width = 82; Item.height = 28; - Item.damage = 121; + Item.damage = 89; Item.DamageType = DamageClass.Ranged; Item.useTime = Item.useAnimation = 18; //Try not to change this if you can help it. Item.noMelee = true; @@ -58,7 +61,7 @@ namespace CalamityMod.Items.Weapons.Ranged public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - // Reposition to the gun's tip. Calculated seperately due to the two different shot styles. + // Reposition to the gun's tip. Calculated separately due to the two different shot styles. Vector2 boulderPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -2f : -8f)).RotatedBy(velocity.ToRotation()); Vector2 shotPos = position + new Vector2(74f, player.direction * (Math.Abs(velocity.SafeNormalize(Vector2.Zero).X) < 0.02f ? -6f : 3f)).RotatedBy(velocity.ToRotation()); diff --git a/Items/Weapons/Ranged/MagnaCannon.cs b/Items/Weapons/Ranged/MagnaCannon.cs index d31343d31b..891cb67dd6 100644 --- a/Items/Weapons/Ranged/MagnaCannon.cs +++ b/Items/Weapons/Ranged/MagnaCannon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged public static readonly SoundStyle Fire = new("CalamityMod/Sounds/Item/MagnaCannonShot") { PitchVariance = 0.3f, Volume = 0.4f }; public static int AftershotCooldownFrames = 30; - public static int FullChargeFrames = 138; //126 frames is durration of charge sound + public static int FullChargeFrames = 138; //126 frames is duration of charge sound public new string LocalizationCategory => "Items.Weapons.Ranged"; @@ -28,7 +28,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 56; Item.height = 34; - Item.damage = 30; + Item.damage = 25; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Ranged/Malevolence.cs b/Items/Weapons/Ranged/Malevolence.cs index 0645679232..c02c95234f 100644 --- a/Items/Weapons/Ranged/Malevolence.cs +++ b/Items/Weapons/Ranged/Malevolence.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; 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/MonolithBow.cs b/Items/Weapons/Ranged/MonolithBow.cs index fa8b2ea872..5d35184a01 100644 --- a/Items/Weapons/Ranged/MonolithBow.cs +++ b/Items/Weapons/Ranged/MonolithBow.cs @@ -1,5 +1,5 @@ using CalamityMod.Dusts; -using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureMonolith; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; diff --git a/Items/Weapons/Ranged/NitroExpressRifle.cs b/Items/Weapons/Ranged/NitroExpressRifle.cs index 021467e500..6985f2b139 100644 --- a/Items/Weapons/Ranged/NitroExpressRifle.cs +++ b/Items/Weapons/Ranged/NitroExpressRifle.cs @@ -80,30 +80,6 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 itemSize = new Vector2(Item.width, Item.height); Vector2 itemOrigin = new Vector2(-5, 6); - - //Sniper's horizontal recoil; can be a bit subtle but it is noticeable - if (player.altFunctionUse == 2) - { - //Recoil: - int anim = 0; - for (int r = 0; r < Item.useAnimation; ++r) - { - if (anim == 10 && r < Item.useAnimation / 2) //animates every 10 frames so that the player notices a recoil because this happens way too fast - { - itemPosition.X -= player.direction * 0.025f; - itemPosition.Y -= player.direction * 0.025f; - anim = 0; - } - else if (anim == 10 && r > Item.useAnimation / 2) - { - itemPosition.X += player.direction * 0.025f; - itemPosition.Y += player.direction * 0.025f; - anim = 0; - } - ++anim; - } - } - CalamityUtils.CleanHoldStyle(player, itemRotation, itemPosition, itemSize, itemOrigin); base.UseStyle(player, heldItemFrame); } @@ -116,7 +92,7 @@ namespace CalamityMod.Items.Weapons.Ranged float animProgress = 1 - player.itemTime / (float)player.itemTimeMax; float rotation = (player.Center - player.Calamity().mouseWorld).ToRotation() * player.gravDir + MathHelper.PiOver2; if (animProgress < 0.5) - rotation += (player.altFunctionUse == 2 ? -1f : -0.45f) * (float)Math.Pow((0.5f - animProgress) / 0.5f, 2) * player.direction; + rotation += -0.45f * (float)Math.Pow((0.5f - animProgress) / 0.5f, 2) * player.direction; player.SetCompositeArmFront(true, Player.CompositeArmStretchAmount.Full, rotation); //must be here otherwise it will vibrate diff --git a/Items/Weapons/Ranged/OpalStriker.cs b/Items/Weapons/Ranged/OpalStriker.cs index e2abf396ac..e923ec174b 100644 --- a/Items/Weapons/Ranged/OpalStriker.cs +++ b/Items/Weapons/Ranged/OpalStriker.cs @@ -27,7 +27,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 48; Item.height = 24; - Item.damage = 33; + Item.damage = 30; Item.DamageType = DamageClass.Ranged; Item.useAnimation = Item.useTime = AftershotCooldownFrames; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Ranged/OverloadedBlaster.cs b/Items/Weapons/Ranged/OverloadedBlaster.cs index 509277d994..94f3c69f60 100644 --- a/Items/Weapons/Ranged/OverloadedBlaster.cs +++ b/Items/Weapons/Ranged/OverloadedBlaster.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class OverloadedBlaster : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 42; diff --git a/Items/Weapons/Ranged/PestilentDefiler.cs b/Items/Weapons/Ranged/PestilentDefiler.cs index f8eebf70e4..395795456d 100644 --- a/Items/Weapons/Ranged/PestilentDefiler.cs +++ b/Items/Weapons/Ranged/PestilentDefiler.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Ranged/RealmRavager.cs b/Items/Weapons/Ranged/RealmRavager.cs index baaed6a188..16b499d389 100644 --- a/Items/Weapons/Ranged/RealmRavager.cs +++ b/Items/Weapons/Ranged/RealmRavager.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class RealmRavager : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 76; diff --git a/Items/Weapons/Ranged/Sandblaster.cs b/Items/Weapons/Ranged/Sandblaster.cs index 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/SepticSkewer.cs b/Items/Weapons/Ranged/SepticSkewer.cs index ab572d256f..4227b9cd41 100644 --- a/Items/Weapons/Ranged/SepticSkewer.cs +++ b/Items/Weapons/Ranged/SepticSkewer.cs @@ -9,6 +9,8 @@ using System; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Boss; using Terraria.Audio; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Items.Weapons.Magic; namespace CalamityMod.Items.Weapons.Ranged { @@ -20,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ItemID.Sets.IsRangedSpecialistWeapon[Type] = true; ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/Shadethrower.cs b/Items/Weapons/Ranged/Shadethrower.cs index 24ffb6e7cb..7abe62d724 100644 --- a/Items/Weapons/Ranged/Shadethrower.cs +++ b/Items/Weapons/Ranged/Shadethrower.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Ranged public class Shadethrower : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 76; @@ -32,15 +37,5 @@ namespace CalamityMod.Items.Weapons.Ranged } public override Vector2? HoldoutOffset() => new Vector2(-5, 0); - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 4). - AddIngredient(12). - AddIngredient(ItemID.RottenChunk, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Ranged/SpectralstormCannon.cs b/Items/Weapons/Ranged/SpectralstormCannon.cs index fc161fa028..b52a0d3939 100644 --- a/Items/Weapons/Ranged/SpectralstormCannon.cs +++ b/Items/Weapons/Ranged/SpectralstormCannon.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Projectiles.Ranged; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,56 +11,53 @@ namespace CalamityMod.Items.Weapons.Ranged public class SpectralstormCannon : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Ranged"; + + // This is intentionally stored on the item instead of the holdout to prevent swapping items to instantly reset the heat + // This could be theoretically exploited using multiple items, but the heat dissipates fast enough that I can't really care + public int BuiltUpHeat = 0; + public const int OverheatLevel = 540; + public const int OverheatCooldown = 160; + public const int OverheatDamage = 50; + public override void SetDefaults() { Item.width = 66; Item.height = 26; - Item.damage = 48; + Item.damage = 82; Item.DamageType = DamageClass.Ranged; - Item.useTime = 4; - Item.useAnimation = 12; + Item.useTime = Item.useAnimation = 11; + Item.knockBack = 1.5f; + Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; - Item.knockBack = 1.5f; + Item.channel = true; + Item.noUseGraphic = true; + Item.autoReuse = true; + Item.value = CalamityGlobalItem.RarityRedBuyPrice; Item.rare = ItemRarityID.Red; - Item.UseSound = SoundID.Item11; - Item.autoReuse = true; - Item.shoot = ProjectileID.Flare; - Item.shootSpeed = 9.5f; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 10f; Item.useAmmo = AmmoID.Flare; - Item.Calamity().canFirePointBlankShots = true; } - public override Vector2? HoldoutOffset() => new Vector2(-10, 0); - - public override bool CanConsumeAmmo(Item ammo, Player player) + public override void HoldItem(Player player) { - if (Main.rand.Next(0, 100) < 70) - return false; - return true; + player.Calamity().rightClickListener = true; + // Heat decrements if: + // The holdout exists, the player is not firing, the player is not in overheat, and there is heat in the weapon + if (player.ownedProjectileCounts[Item.shoot] > 0 && !Main.mouseLeft && player.Calamity().flareGunOverheat == 0 && BuiltUpHeat > 0) + { + BuiltUpHeat -= 3; + if (BuiltUpHeat < 0) + BuiltUpHeat = 0; + } } - + public override bool CanUseItem(Player player) => player.ownedProjectileCounts[Item.shoot] <= 0 && !player.Calamity().mouseRight; + public override bool CanConsumeAmmo(Item ammo, Player player) => player.ownedProjectileCounts[Item.shoot] > 0; // Spawning the holdout cannot consume ammo public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float SpeedX = velocity.X + (float)Main.rand.Next(-40, 41) * 0.05f; - float SpeedY = velocity.Y + (float)Main.rand.Next(-40, 41) * 0.05f; - int flare = Projectile.NewProjectile(source, position.X, position.Y, SpeedX, SpeedY, type, damage, knockback, player.whoAmI); - if (flare.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[flare].timeLeft = 200; - Main.projectile[flare].DamageType = DamageClass.Ranged; - } - - float SpeedX2 = velocity.X + (float)Main.rand.Next(-20, 21) * 0.05f; - float SpeedY2 = velocity.Y + (float)Main.rand.Next(-20, 21) * 0.05f; - int soul = Projectile.NewProjectile(source, position.X, position.Y, SpeedX2, SpeedY2, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 2f, 0f); - if (soul.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[soul].timeLeft = 600; - Main.projectile[soul].DamageType = DamageClass.Ranged; - Main.projectile[soul].frame = Main.rand.Next(4); - } + Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI); return false; } diff --git a/Items/Weapons/Ranged/StarSputter.cs b/Items/Weapons/Ranged/StarSputter.cs index f8c21806ff..6bd01f58d0 100644 --- a/Items/Weapons/Ranged/StarSputter.cs +++ b/Items/Weapons/Ranged/StarSputter.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,7 +13,10 @@ namespace CalamityMod.Items.Weapons.Ranged { public new string LocalizationCategory => "Items.Weapons.Ranged"; private int counter = 0; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 80; diff --git a/Items/Weapons/Ranged/StellarCannon.cs b/Items/Weapons/Ranged/StellarCannon.cs index 376629dbca..7445e3628f 100644 --- a/Items/Weapons/Ranged/StellarCannon.cs +++ b/Items/Weapons/Ranged/StellarCannon.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Item.width = 50; Item.height = 30; - Item.damage = 182; + Item.damage = 180; Item.DamageType = DamageClass.Ranged; Item.useTime = 40; Item.useAnimation = 40; diff --git a/Items/Weapons/Ranged/Svantechnical.cs b/Items/Weapons/Ranged/Svantechnical.cs index 2261b93f72..d8f1d3de75 100644 --- a/Items/Weapons/Ranged/Svantechnical.cs +++ b/Items/Weapons/Ranged/Svantechnical.cs @@ -65,9 +65,9 @@ namespace CalamityMod.Items.Weapons.Ranged Vector2 helixVel1 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine)); Vector2 helixVel2 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(-sine)); Vector2 helixVel3 = (velocity * Main.rand.NextFloat(0.9f, 1.1f)).RotatedBy(MathHelper.ToRadians(sine2)); - int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 2f); - int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 4f); - int shot3 = Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, 3f); + int shot1 = Projectile.NewProjectile(source, position.X, position.Y, helixVel1.X, helixVel1.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 2f : 0); + int shot2 = Projectile.NewProjectile(source, position.X, position.Y, helixVel2.X, helixVel2.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 4f : 0); + int shot3 = Projectile.NewProjectile(source, position.X, position.Y, helixVel3.X, helixVel3.Y, shotType, damage, knockback, player.whoAmI, 0f, 0, player.altFunctionUse != 2 ? 3f : 0); } else if (player.altFunctionUse != 2) { diff --git a/Items/Weapons/Ranged/TelluricGlare.cs b/Items/Weapons/Ranged/TelluricGlare.cs index 08adaa405d..bdf5de94a8 100644 --- a/Items/Weapons/Ranged/TelluricGlare.cs +++ b/Items/Weapons/Ranged/TelluricGlare.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -20,6 +22,7 @@ namespace CalamityMod.Items.Weapons.Ranged { Main.RegisterItemAnimation(Type, new DrawAnimationVertical(3, 5)); ItemID.Sets.AnimatesAsSoul[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/TheBallista.cs b/Items/Weapons/Ranged/TheBallista.cs index 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/TheHive.cs b/Items/Weapons/Ranged/TheHive.cs index a5365bc034..cdf9b6d41d 100644 --- a/Items/Weapons/Ranged/TheHive.cs +++ b/Items/Weapons/Ranged/TheHive.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -16,7 +18,10 @@ namespace CalamityMod.Items.Weapons.Ranged public static float MaxCharge = 90f; public static int OriginalUseTime = 34; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.damage = 92; diff --git a/Items/Weapons/Ranged/TheStorm.cs b/Items/Weapons/Ranged/TheStorm.cs index 62013d29ee..531499c4e2 100644 --- a/Items/Weapons/Ranged/TheStorm.cs +++ b/Items/Weapons/Ranged/TheStorm.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Ranged; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -18,6 +20,7 @@ namespace CalamityMod.Items.Weapons.Ranged { ItemID.Sets.AnimatesAsSoul[Type] = true; Main.RegisterItemAnimation(Type, new DrawAnimationVertical(5, 9)); + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { diff --git a/Items/Weapons/Ranged/TitaniumRailgun.cs b/Items/Weapons/Ranged/TitaniumRailgun.cs index 34ad55a974..ce97852a7d 100644 --- a/Items/Weapons/Ranged/TitaniumRailgun.cs +++ b/Items/Weapons/Ranged/TitaniumRailgun.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Ranged Item.shootSpeed = 16f; } - public override Vector2? HoldoutOffset() => new Vector2(-5, 4); + public override Vector2? HoldoutOffset() => new Vector2(-5, 0); public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Ranged/TitaniumRailgun.png b/Items/Weapons/Ranged/TitaniumRailgun.png index 869227b094..1122b96be4 100644 Binary files a/Items/Weapons/Ranged/TitaniumRailgun.png and b/Items/Weapons/Ranged/TitaniumRailgun.png differ diff --git a/Items/Weapons/Ranged/Toxibow.cs b/Items/Weapons/Ranged/Toxibow.cs index 87580560b6..c35b54cd02 100644 --- a/Items/Weapons/Ranged/Toxibow.cs +++ b/Items/Weapons/Ranged/Toxibow.cs @@ -1,6 +1,6 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Projectiles.Ranged; using Microsoft.Xna.Framework; using Terraria; diff --git a/Items/Weapons/Ranged/VernalBolter.cs b/Items/Weapons/Ranged/VernalBolter.cs index 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/AuroradicalThrow.cs b/Items/Weapons/Rogue/AuroradicalThrow.cs index 04409f3752..95aae5cd59 100644 --- a/Items/Weapons/Rogue/AuroradicalThrow.cs +++ b/Items/Weapons/Rogue/AuroradicalThrow.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class AuroradicalThrow : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 34; diff --git a/Items/Weapons/Rogue/BallisticPoisonBomb.cs b/Items/Weapons/Rogue/BallisticPoisonBomb.cs index a5adb023be..f35c9df13b 100644 --- a/Items/Weapons/Rogue/BallisticPoisonBomb.cs +++ b/Items/Weapons/Rogue/BallisticPoisonBomb.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 30; Item.height = 38; - Item.damage = 72; + Item.damage = 57; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 26; diff --git a/Items/Weapons/Rogue/CosmicKunai.cs b/Items/Weapons/Rogue/CosmicKunai.cs index 39a5b4a75d..378cee23de 100644 --- a/Items/Weapons/Rogue/CosmicKunai.cs +++ b/Items/Weapons/Rogue/CosmicKunai.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class CosmicKunai : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 26; diff --git a/Items/Weapons/Rogue/CraniumSmasher.cs b/Items/Weapons/Rogue/CraniumSmasher.cs index 5ef882b4c0..7c33cb6419 100644 --- a/Items/Weapons/Rogue/CraniumSmasher.cs +++ b/Items/Weapons/Rogue/CraniumSmasher.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class CraniumSmasher : RogueWeapon { private bool throwExplosive = false; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 50; diff --git a/Items/Weapons/Rogue/CrushsawCrasher.cs b/Items/Weapons/Rogue/CrushsawCrasher.cs index 611d050155..a82b2e5f37 100644 --- a/Items/Weapons/Rogue/CrushsawCrasher.cs +++ b/Items/Weapons/Rogue/CrushsawCrasher.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 38; Item.height = 22; - Item.damage = 81; + Item.damage = 57; Item.useAnimation = 18; Item.useStyle = ItemUseStyleID.Swing; Item.useTime = 18; @@ -31,20 +31,19 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.7f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike { int spread = 3; - for (int i = 0; i < 5; i++) + for (int i = 0; i < 6; i++) { Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-3, 4), velocity.Y + Main.rand.Next(-3, 4)).RotatedBy(MathHelper.ToRadians(spread)); int proj = Projectile.NewProjectile(source, position, perturbedspeed, type, damage, knockback, player.whoAmI); if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].Calamity().stealthStrike = true; + Main.projectile[proj].penetrate = 1; } spread -= Main.rand.Next(1, 4); } diff --git a/Items/Weapons/Rogue/Crystalline.cs b/Items/Weapons/Rogue/Crystalline.cs index 74260456a7..83add7844f 100644 --- a/Items/Weapons/Rogue/Crystalline.cs +++ b/Items/Weapons/Rogue/Crystalline.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 4; - public override float StealthDamageMultiplier => 3f; + public override float StealthDamageMultiplier => 1.7f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/DeepWounder.cs b/Items/Weapons/Rogue/DeepWounder.cs index 4bb20aae43..7cbfc94525 100644 --- a/Items/Weapons/Rogue/DeepWounder.cs +++ b/Items/Weapons/Rogue/DeepWounder.cs @@ -13,12 +13,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 58; Item.height = 52; - Item.damage = 136; + Item.damage = 132; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 23; + Item.useTime = Item.useAnimation = 25; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 23; Item.knockBack = 3f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; @@ -36,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue { if (player.Calamity().StealthStrikeAvailable()) { - int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); + int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); if (p.WithinBounds(Main.maxProjectiles)) Main.projectile[p].Calamity().stealthStrike = true; return false; diff --git a/Items/Weapons/Rogue/DefectiveSphere.cs b/Items/Weapons/Rogue/DefectiveSphere.cs index d9a4719ab1..2fc9f55986 100644 --- a/Items/Weapons/Rogue/DefectiveSphere.cs +++ b/Items/Weapons/Rogue/DefectiveSphere.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 42; Item.height = 44; - Item.damage = 116; + Item.damage = 85; Item.knockBack = 5f; Item.useAnimation = 13; Item.useTime = 13; @@ -37,22 +37,9 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool CanUseItem(Player player) { - if (player.Calamity().StealthStrikeAvailable()) - { - return true; - } - else if ((player.ownedProjectileCounts[Item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()]) >= 5) - { - return false; - } - else - { - return true; - } + return player.Calamity().StealthStrikeAvailable() || (player.ownedProjectileCounts[Item.shoot] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()] + player.ownedProjectileCounts[ProjectileType()]) <= 4; } - public override float StealthDamageMultiplier => 0.9f; - public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) { type = Utils.SelectRandom(Main.rand, new int[] @@ -72,13 +59,13 @@ namespace CalamityMod.Items.Weapons.Rogue { // This is done to allow looping when creating projectiles, instead of having to create many projectile/velocity variables all at once, // which this shoot code used to do. - int[] projectilesToShoot = new int[] - { + int[] projectilesToShoot = + [ ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType() - }; + ]; foreach (int projectileType in projectilesToShoot) { diff --git a/Items/Weapons/Rogue/DuststormInABottle.cs b/Items/Weapons/Rogue/DuststormInABottle.cs index cb31651c19..c2fcaf1af4 100644 --- a/Items/Weapons/Rogue/DuststormInABottle.cs +++ b/Items/Weapons/Rogue/DuststormInABottle.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 20; Item.height = 24; - Item.damage = 74; + Item.damage = 65; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 28; @@ -30,18 +30,16 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public static float StealthDmgMult = 0.6f; //So I can edit it directly via DragonLens instead of having to do math with CalTestHelpers - public override float StealthDamageMultiplier => StealthDmgMult; + public override float StealthDamageMultiplier => 0.6f; public static int CloudLifetime = 200; public static float DustRadius = 11f; - public static int StealthIframes = 9; //Cloud hitbox size manipulation public static float MaxSize = 3.2f; public static float MaxSizeStealth = 3.6f; public static float GrowthRate = 0.025f; - public static float StealthGrowhRate = 0.035f; + public static float StealthGrowthRate = 0.035f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/Eradicator.cs b/Items/Weapons/Rogue/Eradicator.cs index e9d74d021e..ef9768f94a 100644 --- a/Items/Weapons/Rogue/Eradicator.cs +++ b/Items/Weapons/Rogue/Eradicator.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,7 +13,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class Eradicator : RogueWeapon { public static float Speed = 10.5f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 62; diff --git a/Items/Weapons/Rogue/Exorcism.cs b/Items/Weapons/Rogue/Exorcism.cs index 4742e420dc..115a31a492 100644 --- a/Items/Weapons/Rogue/Exorcism.cs +++ b/Items/Weapons/Rogue/Exorcism.cs @@ -13,12 +13,12 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 109; Item.height = 128; - Item.damage = 285; + Item.damage = 192; Item.noMelee = true; Item.noUseGraphic = true; - // Due to the amazing sound engine, having more than one of these on screen will cause audio bugs! - // Therefore this thing has to be absurdly slow (Not that I've ever complained about that before) - Item.useAnimation = Item.useTime = 115; + // Due to the amazing sound engine, having multiple crosses embedded in enemies cuts off the sound + // Therefore this thing has to be very slow (Not that I've ever complained about that before) + Item.useAnimation = Item.useTime = 96; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 12f; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/FantasyTalisman.cs b/Items/Weapons/Rogue/FantasyTalisman.cs index aad9aeb1d9..8b7f5a9494 100644 --- a/Items/Weapons/Rogue/FantasyTalisman.cs +++ b/Items/Weapons/Rogue/FantasyTalisman.cs @@ -14,11 +14,10 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 30; Item.height = 30; - Item.damage = 52; + Item.damage = 45; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 25; - Item.useTime = 25; + Item.useTime = Item.useAnimation = 25; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6f; Item.UseSound = SoundID.Item1; @@ -29,28 +28,18 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shootSpeed = 18f; Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.7f; + public override float StealthDamageMultiplier => 0.75f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (!player.Calamity().StealthStrikeAvailable()) + for (int i = -1; i <= 1; i++) { - for (int i = -1; i <= 1; i++) - { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * 6f)); - Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI); - } + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * (player.Calamity().StealthStrikeAvailable() ? 5f : 6f))); + int shootCard = player.Calamity().StealthStrikeAvailable() ? ModContent.ProjectileType() : type; + int card = Projectile.NewProjectile(source, position, perturbedSpeed, shootCard, damage, knockback, player.whoAmI); + if (card.WithinBounds(Main.maxProjectiles) && player.Calamity().StealthStrikeAvailable()) + Main.projectile[card].Calamity().stealthStrike = true; } - else if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - for (int i = -1; i <= 1; i++) - { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i * 5f)); - int stealth = Projectile.NewProjectile(source, position, perturbedSpeed, ModContent.ProjectileType(), damage, knockback, player.whoAmI); - if (stealth.WithinBounds(Main.maxProjectiles)) - Main.projectile[stealth].Calamity().stealthStrike = true; - } - } - return true; + return false; } public override void AddRecipes() diff --git a/Items/Weapons/Rogue/FrostcrushValari.cs b/Items/Weapons/Rogue/FrostcrushValari.cs index 43953e042c..b8342c3b62 100644 --- a/Items/Weapons/Rogue/FrostcrushValari.cs +++ b/Items/Weapons/Rogue/FrostcrushValari.cs @@ -18,9 +18,9 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 46; - Item.damage = 89; + Item.damage = 81; Item.DamageType = RogueDamageClass.Instance; - Item.useTime = Item.useAnimation = 17; + Item.useTime = Item.useAnimation = 19; Item.knockBack = 12; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; @@ -37,9 +37,6 @@ namespace CalamityMod.Items.Weapons.Rogue // Terraria seems to really dislike high crit values in SetDefaults public override void ModifyWeaponCrit(Player player, ref float crit) => crit += 16; - public override float StealthDamageMultiplier => 0.9f; - public override float StealthKnockbackMultiplier => 0.3333f; - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable()) @@ -48,7 +45,7 @@ namespace CalamityMod.Items.Weapons.Rogue if (proj.WithinBounds(Main.maxProjectiles)) { Main.projectile[proj].Calamity().stealthStrike = true; - Main.projectile[proj].penetrate = 5; + Main.projectile[proj].penetrate = 4; } return false; } diff --git a/Items/Weapons/Rogue/FrostyFlare.cs b/Items/Weapons/Rogue/FrostyFlare.cs index 1226639a46..acf40a72cb 100644 --- a/Items/Weapons/Rogue/FrostyFlare.cs +++ b/Items/Weapons/Rogue/FrostyFlare.cs @@ -9,16 +9,11 @@ namespace CalamityMod.Items.Weapons.Rogue { public class FrostyFlare : RogueWeapon { - public override void SetStaticDefaults() - { - Item.ResearchUnlockCount = 99; - } - public override void SetDefaults() { Item.width = 10; Item.height = 22; - Item.damage = 32; + Item.damage = 37; Item.noUseGraphic = true; Item.noMelee = true; Item.useAnimation = Item.useTime = 13; @@ -27,12 +22,10 @@ namespace CalamityMod.Items.Weapons.Rogue Item.UseSound = SoundID.Item1; Item.autoReuse = true; Item.knockBack = 2f; - Item.value = Item.buyPrice(0, 0, 8, 0); + Item.value = CalamityGlobalItem.RarityLightPurpleBuyPrice; Item.rare = ItemRarityID.LightPurple; Item.shoot = ModContent.ProjectileType(); Item.shootSpeed = 22f; - Item.maxStack = Item.CommonMaxStack; - Item.consumable = true; Item.DamageType = RogueDamageClass.Instance; } diff --git a/Items/Weapons/Rogue/GelDart.cs b/Items/Weapons/Rogue/GelDart.cs index c01f1fb608..53b4185afa 100644 --- a/Items/Weapons/Rogue/GelDart.cs +++ b/Items/Weapons/Rogue/GelDart.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Items.Weapons.Rogue CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Rogue/GhoulishGouger.cs b/Items/Weapons/Rogue/GhoulishGouger.cs index e3b26d6f38..86dce8ed23 100644 --- a/Items/Weapons/Rogue/GhoulishGouger.cs +++ b/Items/Weapons/Rogue/GhoulishGouger.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class GhoulishGouger : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 74; diff --git a/Items/Weapons/Rogue/HeavenfallenStardisk.cs b/Items/Weapons/Rogue/HeavenfallenStardisk.cs index 92de798ec1..6d7330fa64 100644 --- a/Items/Weapons/Rogue/HeavenfallenStardisk.cs +++ b/Items/Weapons/Rogue/HeavenfallenStardisk.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 44; Item.height = 48; - Item.damage = 165; + Item.damage = 160; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 40; @@ -32,26 +32,10 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - { - int proj = Projectile.NewProjectile(source, position, velocity.Length() * -Vector2.UnitY, type, damage, knockback, player.whoAmI); - if (proj.WithinBounds(Main.maxProjectiles)) - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - if (player.Calamity().StealthStrikeAvailable()) //setting the stealth strike - { - int spread = 15; - for (int i = 0; i < 2; i++) - { - Vector2 perturbedspeed = new Vector2(velocity.X + Main.rand.Next(-8, 8), velocity.Y + Main.rand.Next(-2, 3)).RotatedBy(MathHelper.ToRadians(spread)); - Projectile.NewProjectile(source, position, perturbedspeed.Length() * -Vector2.UnitY, type, (int)(damage * 0.3), knockback, player.whoAmI); - if (proj.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); - } - spread -= Main.rand.Next(5, 8); - } - } - return false; - } + int proj = Projectile.NewProjectile(source, position, velocity.Length() * -Vector2.UnitY, type, damage, knockback, player.whoAmI); + if (proj.WithinBounds(Main.maxProjectiles)) + Main.projectile[proj].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + return false; } } } diff --git a/Items/Weapons/Rogue/Icebreaker.cs b/Items/Weapons/Rogue/Icebreaker.cs index 2e7bee34db..c0074f74c9 100644 --- a/Items/Weapons/Rogue/Icebreaker.cs +++ b/Items/Weapons/Rogue/Icebreaker.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Icebreaker : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 60; diff --git a/Items/Weapons/Rogue/InfernalKris.cs b/Items/Weapons/Rogue/InfernalKris.cs index 13ec831929..a253fb640c 100644 --- a/Items/Weapons/Rogue/InfernalKris.cs +++ b/Items/Weapons/Rogue/InfernalKris.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 38; - Item.damage = 23; + Item.damage = 21; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 18; @@ -35,7 +35,10 @@ namespace CalamityMod.Items.Weapons.Rogue { int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); if (p.WithinBounds(Main.maxProjectiles)) + { Main.projectile[p].Calamity().stealthStrike = true; + Main.projectile[p].penetrate = 1; + } return false; } return true; diff --git a/Items/Weapons/Rogue/InfestedClawmerang.cs b/Items/Weapons/Rogue/InfestedClawmerang.cs index 829c59c962..347338642b 100644 --- a/Items/Weapons/Rogue/InfestedClawmerang.cs +++ b/Items/Weapons/Rogue/InfestedClawmerang.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue [LegacyName("Shroomerang")] public class InfestedClawmerang : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 26; diff --git a/Items/Weapons/Rogue/KelvinCatalyst.cs b/Items/Weapons/Rogue/KelvinCatalyst.cs index dc3bf49211..cfcd7844f7 100644 --- a/Items/Weapons/Rogue/KelvinCatalyst.cs +++ b/Items/Weapons/Rogue/KelvinCatalyst.cs @@ -44,7 +44,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void AddRecipes() { CreateRecipe(). - AddIngredient(100). + AddIngredient(). AddIngredient(). AddIngredient(). AddIngredient(). diff --git a/Items/Weapons/Rogue/LeonidProgenitor.cs b/Items/Weapons/Rogue/LeonidProgenitor.cs index 7918e2eded..26a17019bd 100644 --- a/Items/Weapons/Rogue/LeonidProgenitor.cs +++ b/Items/Weapons/Rogue/LeonidProgenitor.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 48; - Item.damage = 64; + Item.damage = 57; Item.DamageType = RogueDamageClass.Instance; Item.knockBack = 3f; Item.useAnimation = Item.useTime = 15; @@ -38,9 +38,9 @@ namespace CalamityMod.Items.Weapons.Rogue Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; } + public override float StealthDamageMultiplier => 1.25f; public override bool AltFunctionUse(Player player) => true; - public override bool CanUseItem(Player player) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) @@ -56,35 +56,23 @@ namespace CalamityMod.Items.Weapons.Rogue return base.CanUseItem(player); } - public override float UseSpeedMultiplier(Player player) - { - if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) - return 1f; - return 0.8f; - } - - public override float StealthDamageMultiplier => 1.25f; - - public override void ModifyStatsExtra(Player player, ref Vector2 position, ref Vector2 velocity, ref int type, ref int damage, ref float knockback) - { - if (!player.Calamity().StealthStrikeAvailable() && player.altFunctionUse == 2) - damage = (int)(damage * 0.5f); - } - public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { if (player.Calamity().StealthStrikeAvailable() || player.altFunctionUse != 2) { int bomb = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI); - if (bomb.WithinBounds(Main.maxProjectiles)) - Main.projectile[bomb].Calamity().stealthStrike = player.Calamity().StealthStrikeAvailable(); + if (bomb.WithinBounds(Main.maxProjectiles) && player.Calamity().StealthStrikeAvailable()) + { + Main.projectile[bomb].Calamity().stealthStrike = true; + Main.projectile[bomb].extraUpdates = 1; + } return false; } else { - for (float i = -2.5f; i < 3f; ++i) + for (int i = 0; i < 2; i++) { - Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians(i)); + Vector2 perturbedSpeed = velocity.RotatedBy(MathHelper.ToRadians((i - 0.5f) * 2)); Projectile.NewProjectile(source, position, perturbedSpeed, type, damage, knockback, player.whoAmI); } } diff --git a/Items/Weapons/Rogue/LeviathanTeeth.cs b/Items/Weapons/Rogue/LeviathanTeeth.cs index adc05255a4..fb6f34714a 100644 --- a/Items/Weapons/Rogue/LeviathanTeeth.cs +++ b/Items/Weapons/Rogue/LeviathanTeeth.cs @@ -9,11 +9,15 @@ namespace CalamityMod.Items.Weapons.Rogue { public class LeviathanTeeth : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 36; Item.height = 38; - Item.damage = 44; + Item.damage = 43; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 9; @@ -21,35 +25,24 @@ namespace CalamityMod.Items.Weapons.Rogue Item.knockBack = 1f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; - Item.maxStack = 1; Item.value = CalamityGlobalItem.RarityLimeBuyPrice; Item.rare = ItemRarityID.Lime; Item.shoot = ModContent.ProjectileType(); - Item.shootSpeed = 5.5f; + Item.shootSpeed = 7.5f; Item.DamageType = RogueDamageClass.Instance; } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - bool stealthStrike = false; - if (player.Calamity().StealthStrikeAvailable()) - stealthStrike = true; - for (int i = 0; i < 2; i++) { - if (stealthStrike) - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity * 1.5f, type, damage, knockback * 12, player.whoAmI); - tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 140; - tooth.ai[1] = 4; - return false; // This makes it not fire 2 with the for loop, thanks Angel lol - } - else - { - Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.7f, 1f), type, damage, knockback, player.whoAmI); - tooth.ai[1] = Main.rand.Next(1, 3 + 1); - } + Projectile tooth = Projectile.NewProjectileDirect(source, position, velocity.SafeNormalize(Vector2.UnitX), ModContent.ProjectileType(), damage, 0, player.whoAmI, 0, 0); + tooth.Calamity().stealthStrike = true; + } + else + { + for (int i = 0; i < 2; i++) + Projectile.NewProjectile(source, position, velocity.RotatedByRandom(0.05f + i * 0.15f) * Main.rand.NextFloat(0.8f, 1f), type, damage, knockback, player.whoAmI, 0f, Main.rand.Next(1, 3+1)); } return false; } diff --git a/Items/Weapons/Rogue/MeteorFist.cs b/Items/Weapons/Rogue/MeteorFist.cs index 3fe824bcf6..514769e61b 100644 --- a/Items/Weapons/Rogue/MeteorFist.cs +++ b/Items/Weapons/Rogue/MeteorFist.cs @@ -13,9 +13,9 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 22; Item.height = 28; - Item.damage = 37; + Item.damage = 31; Item.DamageType = RogueDamageClass.Instance; - Item.useAnimation = Item.useTime = 28; + Item.useAnimation = Item.useTime = 25; Item.knockBack = 5.75f; Item.shootSpeed = 4f; @@ -31,8 +31,6 @@ namespace CalamityMod.Items.Weapons.Rogue Item.shoot = ModContent.ProjectileType(); } - public override float StealthDamageMultiplier => 1.15f; - public override void HoldItem(Player player) => player.Calamity().mouseWorldListener = true; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) diff --git a/Items/Weapons/Rogue/MoltenAmputator.cs b/Items/Weapons/Rogue/MoltenAmputator.cs index 6b61c1d864..ef1ddd4839 100644 --- a/Items/Weapons/Rogue/MoltenAmputator.cs +++ b/Items/Weapons/Rogue/MoltenAmputator.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -14,6 +15,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class MoltenAmputator : RogueWeapon { public float speed = 16; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 92; diff --git a/Items/Weapons/Rogue/Mycoroot.cs b/Items/Weapons/Rogue/Mycoroot.cs index 7adee86c42..0975e41c26 100644 --- a/Items/Weapons/Rogue/Mycoroot.cs +++ b/Items/Weapons/Rogue/Mycoroot.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.StatBuffs; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Mycoroot : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; @@ -17,8 +22,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.damage = 12; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 5; - Item.useAnimation = 5; + Item.useTime = 6; + Item.useAnimation = 6; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 1.5f; Item.UseSound = SoundID.Item1; @@ -36,12 +41,9 @@ namespace CalamityMod.Items.Weapons.Rogue if (player.Calamity().StealthStrikeAvailable() && player.ownedProjectileCounts[ModContent.ProjectileType()] < 20 && stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].Calamity().stealthStrike = true; - int projAmt = Main.rand.Next(7, 11); - for (int i = 0; i < projAmt; i++) + for (int i = 0; i < 8; i++) { - int spore = Projectile.NewProjectile(source, player.Center, velocity, ModContent.ProjectileType(), (int)(damage * 0.5f), knockback, player.whoAmI); - if (spore.WithinBounds(Main.maxProjectiles)) - Main.projectile[spore].ai[1] = 1f; + int spore = Projectile.NewProjectile(source, player.Center, velocity, ModContent.ProjectileType(), damage, knockback, player.whoAmI, 0f, 1f); } foreach (Player other in Main.ActivePlayers) { diff --git a/Items/Weapons/Rogue/PhantasmalRuin.cs b/Items/Weapons/Rogue/PhantasmalRuin.cs index c00e7059f6..59195398eb 100644 --- a/Items/Weapons/Rogue/PhantasmalRuin.cs +++ b/Items/Weapons/Rogue/PhantasmalRuin.cs @@ -16,13 +16,12 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 108; Item.height = 114; - Item.damage = 152; + Item.damage = 140; Item.knockBack = 8f; Item.useStyle = ItemUseStyleID.Swing; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = 30; - Item.useAnimation = 30; + Item.useTime = Item.useAnimation = 30; Item.autoReuse = true; Item.shootSpeed = 12f; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Rogue/RegulusRiot.cs b/Items/Weapons/Rogue/RegulusRiot.cs index 02c40309ce..9aa73883e5 100644 --- a/Items/Weapons/Rogue/RegulusRiot.cs +++ b/Items/Weapons/Rogue/RegulusRiot.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class RegulusRiot : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 28; diff --git a/Items/Weapons/Rogue/RotBall.cs b/Items/Weapons/Rogue/RotBall.cs index 374b63d451..64b31ae366 100644 --- a/Items/Weapons/Rogue/RotBall.cs +++ b/Items/Weapons/Rogue/RotBall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class RotBall : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 30; @@ -46,15 +51,5 @@ namespace CalamityMod.Items.Weapons.Rogue } return true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 4). - AddIngredient(12). - AddIngredient(ItemID.RottenChunk, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index 5d8628eb35..763489019b 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -1,4 +1,5 @@ -using CalamityMod.NPCs.NormalNPCs; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class Sacrifice : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 68; diff --git a/Items/Weapons/Rogue/ScourgeoftheDesert.cs b/Items/Weapons/Rogue/ScourgeoftheDesert.cs index 3686253aea..5b26a0f0e6 100644 --- a/Items/Weapons/Rogue/ScourgeoftheDesert.cs +++ b/Items/Weapons/Rogue/ScourgeoftheDesert.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +11,11 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ScourgeoftheDesert : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } + public override void SetDefaults() { Item.width = 112; diff --git a/Items/Weapons/Rogue/ScourgeoftheSeas.cs b/Items/Weapons/Rogue/ScourgeoftheSeas.cs index 73754f4fb0..2bdbb91d65 100644 --- a/Items/Weapons/Rogue/ScourgeoftheSeas.cs +++ b/Items/Weapons/Rogue/ScourgeoftheSeas.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ScourgeoftheSeas : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 64; diff --git a/Items/Weapons/Rogue/SludgeSplotch.cs b/Items/Weapons/Rogue/SludgeSplotch.cs index d3f9b71e46..e90b104126 100644 --- a/Items/Weapons/Rogue/SludgeSplotch.cs +++ b/Items/Weapons/Rogue/SludgeSplotch.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 30; - Item.damage = 41; + Item.damage = 30; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 18; diff --git a/Items/Weapons/Rogue/SpearofDestiny.cs b/Items/Weapons/Rogue/SpearofDestiny.cs index e99ea4e662..c1f007aef6 100644 --- a/Items/Weapons/Rogue/SpearofDestiny.cs +++ b/Items/Weapons/Rogue/SpearofDestiny.cs @@ -19,7 +19,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 52; Item.height = 52; - Item.damage = 75; + Item.damage = 70; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = Item.useTime = 41; diff --git a/Items/Weapons/Rogue/StellarKnife.cs b/Items/Weapons/Rogue/StellarKnife.cs index b8f8e6eb71..abe77f582a 100644 --- a/Items/Weapons/Rogue/StellarKnife.cs +++ b/Items/Weapons/Rogue/StellarKnife.cs @@ -15,12 +15,11 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 34; - Item.damage = 82; + Item.damage = 69; Item.noMelee = true; Item.noUseGraphic = true; - Item.useAnimation = 9; + Item.useTime = Item.useAnimation = 9; Item.useStyle = ItemUseStyleID.Swing; - Item.useTime = 9; Item.knockBack = 4f; Item.UseSound = SoundID.Item1; Item.autoReuse = true; diff --git a/Items/Weapons/Rogue/TerrorTalons.cs b/Items/Weapons/Rogue/TerrorTalons.cs index 72246ccf3b..d1aa786d2e 100644 --- a/Items/Weapons/Rogue/TerrorTalons.cs +++ b/Items/Weapons/Rogue/TerrorTalons.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 40; Item.height = 24; - Item.damage = 50; + Item.damage = 47; Item.noMelee = true; Item.noUseGraphic = true; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Rogue/TheFinalDawn.cs b/Items/Weapons/Rogue/TheFinalDawn.cs index e85e7b59a3..2500dc9318 100644 --- a/Items/Weapons/Rogue/TheFinalDawn.cs +++ b/Items/Weapons/Rogue/TheFinalDawn.cs @@ -12,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue public class TheFinalDawn : RogueWeapon { public static readonly SoundStyle UseSound = new("CalamityMod/Sounds/Item/FinalDawnSlash"); + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 78; diff --git a/Items/Weapons/Rogue/TheSyringe.cs b/Items/Weapons/Rogue/TheSyringe.cs index 0275281647..d367bb675f 100644 --- a/Items/Weapons/Rogue/TheSyringe.cs +++ b/Items/Weapons/Rogue/TheSyringe.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,7 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public static float Knockback = 5f; public static float Speed = 15f; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 14; diff --git a/Items/Weapons/Rogue/ToothBall.cs b/Items/Weapons/Rogue/ToothBall.cs index 686a7719a8..3a7602e4bb 100644 --- a/Items/Weapons/Rogue/ToothBall.cs +++ b/Items/Weapons/Rogue/ToothBall.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Melee; using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ToothBall : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 30; @@ -46,15 +51,5 @@ namespace CalamityMod.Items.Weapons.Rogue } return true; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Rogue/TotalityBreakers.cs b/Items/Weapons/Rogue/TotalityBreakers.cs index d531ffe9ce..f606cd97b4 100644 --- a/Items/Weapons/Rogue/TotalityBreakers.cs +++ b/Items/Weapons/Rogue/TotalityBreakers.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Rogue { Item.width = 32; Item.height = 42; - Item.damage = 50; + Item.damage = 64; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 28; diff --git a/Items/Weapons/Rogue/ToxicantTwister.cs b/Items/Weapons/Rogue/ToxicantTwister.cs index df12311f53..653b69f403 100644 --- a/Items/Weapons/Rogue/ToxicantTwister.cs +++ b/Items/Weapons/Rogue/ToxicantTwister.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Rogue { public class ToxicantTwister : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 42; diff --git a/Items/Weapons/Rogue/Whitewater.cs b/Items/Weapons/Rogue/Whitewater.cs index b8831ffa01..7bdce47561 100644 --- a/Items/Weapons/Rogue/Whitewater.cs +++ b/Items/Weapons/Rogue/Whitewater.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,14 +12,18 @@ namespace CalamityMod.Items.Weapons.Rogue public class Whitewater : RogueWeapon { public bool splitDirection = false; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 36; Item.height = 40; - Item.damage = 120; + Item.damage = 80; Item.noMelee = true; Item.noUseGraphic = true; - Item.useTime = Item.useAnimation = 42; + Item.useTime = Item.useAnimation = 34; Item.useStyle = ItemUseStyleID.Swing; Item.knockBack = 6.5f; Item.UseSound = SoundID.Item106 with { Volume = 0.7f }; @@ -30,7 +35,7 @@ namespace CalamityMod.Items.Weapons.Rogue Item.DamageType = RogueDamageClass.Instance; } - public override float StealthDamageMultiplier => 0.85f; + public override float StealthDamageMultiplier => 0.9f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/Wrathwing.cs b/Items/Weapons/Rogue/Wrathwing.cs index 649e31cfba..dbfb608a2e 100644 --- a/Items/Weapons/Rogue/Wrathwing.cs +++ b/Items/Weapons/Rogue/Wrathwing.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Rogue; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Rogue; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Rogue [LegacyName("ProfanedTrident")] public class Wrathwing : RogueWeapon { + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 152; diff --git a/Items/Weapons/Rogue/WulfrumKnife.cs b/Items/Weapons/Rogue/WulfrumKnife.cs index 440167f3fd..6852ff4bf0 100644 --- a/Items/Weapons/Rogue/WulfrumKnife.cs +++ b/Items/Weapons/Rogue/WulfrumKnife.cs @@ -7,6 +7,7 @@ using Terraria.Audio; using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; +using Terraria.Utilities; namespace CalamityMod.Items.Weapons.Rogue { @@ -50,13 +51,28 @@ namespace CalamityMod.Items.Weapons.Rogue stealthStrikeStarted = false; Item.UseSound = Throw3Sound; - - if (Item.stack == 2) - Item.UseSound = Throw2Sound; - if (Item.stack == 1) - Item.UseSound = Throw1Sound; } + public override void HoldItem(Player player) + { + if (player.controlUseTile && !player.mouseInterface && !player.ItemAnimationActive) + { + if (Main.rand.NextBool(7)) + { + Particle streak = new ManaDrainStreak(player, Main.rand.NextFloat(0.2f, 0.5f), Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(170f, 670f), Main.rand.NextFloat(30f, 44f), Color.GreenYellow, Color.DeepSkyBlue, Main.rand.Next(15, 30)); + GeneralParticleHandler.SpawnParticle(streak); + } + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType() && item.owner == player.whoAmI && item.ai[0] > 0) + { + item.ai[0] = -1; + } + } + } + } + public override bool AltFunctionUse(Player player) => false; + public override float StealthDamageMultiplier => 1.5f; public override bool AdditionalStealthCheck() => stealthStrikeStarted; @@ -71,6 +87,17 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { + if (player.altFunctionUse == 2) + { + foreach (var item in Main.ActiveProjectiles) + { + if (item.type == ModContent.ProjectileType() && item.owner == player.whoAmI && item.ai[0] > 0) + { + item.ai[0] = -1; + } + } + return false; + } if (player.Calamity().StealthStrikeAvailable() || stealthStrikeStarted) { stealthStrikeStarted = true; diff --git a/Items/Weapons/Summon/AmphibiansGuitar.cs b/Items/Weapons/Summon/AmphibiansGuitar.cs index 1957f73d79..a385e088b1 100644 --- a/Items/Weapons/Summon/AmphibiansGuitar.cs +++ b/Items/Weapons/Summon/AmphibiansGuitar.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - Item.damage = 200; + Item.damage = 54; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); diff --git a/Items/Weapons/Summon/BorealisBomber.cs b/Items/Weapons/Summon/BorealisBomber.cs index d3fdc3a340..4de6655254 100644 --- a/Items/Weapons/Summon/BorealisBomber.cs +++ b/Items/Weapons/Summon/BorealisBomber.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -13,15 +14,16 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { Item.width = 48; Item.height = 56; - Item.damage = 35; + Item.damage = 34; Item.mana = 10; - Item.useAnimation = Item.useTime = 19; + Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Shoot; Item.noMelee = true; Item.knockBack = 5f; diff --git a/Items/Weapons/Summon/BrittleStarStaff.cs b/Items/Weapons/Summon/BrittleStarStaff.cs index a69c43a5a0..4e39fe3f72 100644 --- a/Items/Weapons/Summon/BrittleStarStaff.cs +++ b/Items/Weapons/Summon/BrittleStarStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; using Terraria; @@ -36,6 +38,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.staff[Type] = true; ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Summon/CadaverousCarrion.cs b/Items/Weapons/Summon/CadaverousCarrion.cs index e2ff231070..db5db6b8fb 100644 --- a/Items/Weapons/Summon/CadaverousCarrion.cs +++ b/Items/Weapons/Summon/CadaverousCarrion.cs @@ -11,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class CadaverousCarrion : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 54; diff --git a/Items/Weapons/Summon/CorroslimeStaff.cs b/Items/Weapons/Summon/CorroslimeStaff.cs index bdaf95d306..de17dde940 100644 --- a/Items/Weapons/Summon/CorroslimeStaff.cs +++ b/Items/Weapons/Summon/CorroslimeStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class CorroslimeStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 52; diff --git a/Items/Weapons/Summon/Cosmilamp.cs b/Items/Weapons/Summon/Cosmilamp.cs index e1a878b754..b4c43ed83f 100644 --- a/Items/Weapons/Summon/Cosmilamp.cs +++ b/Items/Weapons/Summon/Cosmilamp.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -19,7 +20,11 @@ namespace CalamityMod.Items.Weapons.Summon public const float LanternSummonCost = 2f; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Summon/CrimslimeStaff.cs b/Items/Weapons/Summon/CrimslimeStaff.cs index 24fa2614c3..3e7129a037 100644 --- a/Items/Weapons/Summon/CrimslimeStaff.cs +++ b/Items/Weapons/Summon/CrimslimeStaff.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class CrimslimeStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 52; diff --git a/Items/Weapons/Summon/CryogenicStaff.cs b/Items/Weapons/Summon/CryogenicStaff.cs index 8408855e68..56285668c0 100644 --- a/Items/Weapons/Summon/CryogenicStaff.cs +++ b/Items/Weapons/Summon/CryogenicStaff.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 82; Item.height = 84; - Item.damage = 50; + Item.damage = 30; Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; diff --git a/Items/Weapons/Summon/DankStaff.cs b/Items/Weapons/Summon/DankStaff.cs index 9f99226039..d67006f38b 100644 --- a/Items/Weapons/Summon/DankStaff.cs +++ b/Items/Weapons/Summon/DankStaff.cs @@ -1,4 +1,6 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DankStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 58; @@ -43,15 +49,5 @@ namespace CalamityMod.Items.Weapons.Summon } return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.DemoniteBar, 4). - AddIngredient(12). - AddIngredient(ItemID.RottenChunk, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Summon/DazzlingStabberStaff.cs b/Items/Weapons/Summon/DazzlingStabberStaff.cs index 147aaa5450..93cff97797 100644 --- a/Items/Weapons/Summon/DazzlingStabberStaff.cs +++ b/Items/Weapons/Summon/DazzlingStabberStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,6 +14,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DazzlingStabberStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 56; diff --git a/Items/Weapons/Summon/DeepseaStaff.cs b/Items/Weapons/Summon/DeepseaStaff.cs index b68a90c690..07c7018c5d 100644 --- a/Items/Weapons/Summon/DeepseaStaff.cs +++ b/Items/Weapons/Summon/DeepseaStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DeepseaStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 44; diff --git a/Items/Weapons/Summon/DormantBrimseeker.cs b/Items/Weapons/Summon/DormantBrimseeker.cs index 1dbc591245..52a09aff36 100644 --- a/Items/Weapons/Summon/DormantBrimseeker.cs +++ b/Items/Weapons/Summon/DormantBrimseeker.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class DormantBrimseeker : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 32; diff --git a/Items/Weapons/Summon/DreadmineStaff.cs b/Items/Weapons/Summon/DreadmineStaff.cs index e26467a1f2..672105c7df 100644 --- a/Items/Weapons/Summon/DreadmineStaff.cs +++ b/Items/Weapons/Summon/DreadmineStaff.cs @@ -16,7 +16,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 44; Item.height = 44; - Item.damage = 60; + Item.damage = 40; Item.mana = 10; Item.useAnimation = Item.useTime = 25; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/EntropysVigil.cs b/Items/Weapons/Summon/EntropysVigil.cs index 676648fcab..286efcaa94 100644 --- a/Items/Weapons/Summon/EntropysVigil.cs +++ b/Items/Weapons/Summon/EntropysVigil.cs @@ -1,4 +1,6 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -16,13 +18,14 @@ namespace CalamityMod.Items.Weapons.Summon { Item.staff[Type] = true; ItemID.Sets.StaffMinionSlotsRequired[Type] = 2f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); } public override void SetDefaults() { Item.width = 52; Item.height = 52; - Item.damage = 47; + Item.damage = 42; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); Item.knockBack = 2f; diff --git a/Items/Weapons/Summon/EtherealSubjugator.cs b/Items/Weapons/Summon/EtherealSubjugator.cs index e1103cbc49..9edd09c593 100644 --- a/Items/Weapons/Summon/EtherealSubjugator.cs +++ b/Items/Weapons/Summon/EtherealSubjugator.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -12,7 +13,10 @@ namespace CalamityMod.Items.Weapons.Summon public class EtherealSubjugator : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; diff --git a/Items/Weapons/Summon/FlarebatStaff.cs b/Items/Weapons/Summon/FlarebatStaff.cs index f94955710b..4ee88f1d16 100644 --- a/Items/Weapons/Summon/FlarebatStaff.cs +++ b/Items/Weapons/Summon/FlarebatStaff.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void SetDefaults() { - Item.damage = 18; + Item.damage = 20; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); Item.knockBack = 1f; diff --git a/Items/Weapons/Summon/FleshOfInfidelity.cs b/Items/Weapons/Summon/FleshOfInfidelity.cs index a7f73e84fa..671bec1cae 100644 --- a/Items/Weapons/Summon/FleshOfInfidelity.cs +++ b/Items/Weapons/Summon/FleshOfInfidelity.cs @@ -1,4 +1,5 @@ using CalamityMod.Items.Materials; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,7 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class FleshOfInfidelity : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 42; @@ -36,15 +40,5 @@ namespace CalamityMod.Items.Weapons.Summon Projectile.NewProjectile(source, player.ClampedMouseWorld(), Vector2.UnitY * -1f, type, damage, knockback, player.whoAmI); return false; } - - public override void AddRecipes() - { - CreateRecipe(). - AddIngredient(ItemID.CrimtaneBar, 4). - AddIngredient(12). - AddIngredient(ItemID.Vertebrae, 4). - AddTile(TileID.DemonAltar). - Register(); - } } } diff --git a/Items/Weapons/Summon/FuelCellBundle.cs b/Items/Weapons/Summon/FuelCellBundle.cs index 6e0f725d93..7fdcddc557 100644 --- a/Items/Weapons/Summon/FuelCellBundle.cs +++ b/Items/Weapons/Summon/FuelCellBundle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -9,6 +10,10 @@ namespace CalamityMod.Items.Weapons.Summon public class FuelCellBundle : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; diff --git a/Items/Weapons/Summon/GastricBelcherStaff.cs b/Items/Weapons/Summon/GastricBelcherStaff.cs index 4d2796f9cd..0d23ca4774 100644 --- a/Items/Weapons/Summon/GastricBelcherStaff.cs +++ b/Items/Weapons/Summon/GastricBelcherStaff.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,11 +12,15 @@ namespace CalamityMod.Items.Weapons.Summon public class GastricBelcherStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 66; Item.height = 70; - Item.damage = 60; + Item.damage = 50; Item.mana = 10; Item.useAnimation = Item.useTime = 20; Item.useStyle = ItemUseStyleID.Swing; diff --git a/Items/Weapons/Summon/HivePod.cs b/Items/Weapons/Summon/HivePod.cs index 8fdf65c7a8..5013bfe4c7 100644 --- a/Items/Weapons/Summon/HivePod.cs +++ b/Items/Weapons/Summon/HivePod.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 46; Item.height = 50; - Item.damage = 125; + Item.damage = 75; Item.mana = 10; Item.DamageType = DamageClass.Summon; Item.sentry = true; diff --git a/Items/Weapons/Summon/IgneousExaltation.cs b/Items/Weapons/Summon/IgneousExaltation.cs index 1fb197c03a..e91c75a2c7 100644 --- a/Items/Weapons/Summon/IgneousExaltation.cs +++ b/Items/Weapons/Summon/IgneousExaltation.cs @@ -1,6 +1,7 @@ using CalamityMod.Items.Materials; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.DataStructures; using Terraria.ID; @@ -10,10 +11,32 @@ namespace CalamityMod.Items.Weapons.Summon { public class IgneousExaltation : ModItem, ILocalizedModType { + public static int ChargeDuration = 30; + public static int ChargeCooldown = 120; public new string LocalizationCategory => "Items.Weapons.Summon"; + private static Texture2D BladeOutline = null; + public static Texture2D GetBladeOutlineTex() + { + if (BladeOutline == null) + { + var texture = ModContent.Request("CalamityMod/Projectiles/Summon/IgneousBlade").Value; + BladeOutline = new Texture2D(Main.graphics.GraphicsDevice, texture.Width, texture.Height); + + var BaseArray = new Color[BladeOutline.Width * BladeOutline.Height]; + var ColorArray = new Color[BladeOutline.Width * BladeOutline.Height]; + texture.GetData(BaseArray); + for (var i = 0; i < BaseArray.Length; i++) + { + ColorArray[i] = new Color(255, 255, 255) * (((float)BaseArray[i].A) / 255f); + } + BladeOutline.SetData(ColorArray); + } + return BladeOutline; + } public override void SetStaticDefaults() { Item.staff[Type] = true; + ItemID.Sets.ItemsThatAllowRepeatedRightClick[Type] = true; } public override void SetDefaults() @@ -34,54 +57,42 @@ namespace CalamityMod.Items.Weapons.Summon Item.shootSpeed = 10f; Item.DamageType = DamageClass.Summon; } + + public override bool AltFunctionUse(Player player) + { + return player.ownedProjectileCounts[Item.shoot] > 0; + } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - float totalMinionSlots = 0f; - foreach (Projectile pro in Main.ActiveProjectiles) + if (player.altFunctionUse == 2) { - if (pro.minion && pro.owner == player.whoAmI) + foreach (Projectile pro in Main.ActiveProjectiles) { - totalMinionSlots += pro.minionSlots; + if (pro.type == type && pro.owner == player.whoAmI && pro.ai[1] >= 0 && pro.ai[0] == 0) + { + pro.ModProjectile().CurrentState = IgneousBlade.AIState.TransitionToLaunch; + pro.netUpdate = true; + } } } - if (player.altFunctionUse != 2 && totalMinionSlots < player.maxMinions) + else { - position = player.ClampedMouseWorld(); - int p = Projectile.NewProjectile(source, position, Vector2.Zero, type, damage, knockback, player.whoAmI); + + int p = Projectile.NewProjectile(source, position, velocity, type, damage, knockback, player.whoAmI, 0f, 1f); if (Main.projectile.IndexInRange(p)) + { Main.projectile[p].originalDamage = Item.damage; - int swordCount = 0; + } + + int bladeIndex = 0; foreach (Projectile pro in Main.ActiveProjectiles) { if (pro.type == type && pro.owner == player.whoAmI) { - if ((pro.ModProjectile as IgneousBlade).Firing) - continue; - swordCount++; - for (int j = 0; j < 22; j++) - { - Dust dust = Dust.NewDustDirect(pro.position, pro.width, pro.height, DustID.Torch); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); - dust.noGravity = true; - } - } - } - float angleVariance = MathHelper.TwoPi / swordCount; - float angle = 0f; - foreach (Projectile pro in Main.ActiveProjectiles) - { - if (pro.type == type && pro.owner == player.whoAmI && pro.localAI[1] == 0f) - { - if ((pro.ModProjectile as IgneousBlade).Firing) - continue; - pro.ai[0] = angle; - angle += angleVariance; - for (int j = 0; j < 22; j++) - { - Dust dust = Dust.NewDustDirect(pro.position, pro.width, pro.height, DustID.Torch); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); - dust.noGravity = true; - } + pro.ModProjectile().BladeIndex = bladeIndex++; + pro.ModProjectile().AITimer = -ChargeCooldown; + pro.ModProjectile().CurrentState = IgneousBlade.AIState.CircleOwner; + pro.netUpdate = true; } } } @@ -91,6 +102,7 @@ namespace CalamityMod.Items.Weapons.Summon public override void AddRecipes() { CreateRecipe(). + AddIngredient(). AddIngredient(10). AddIngredient(5). AddTile(TileID.MythrilAnvil). diff --git a/Items/Weapons/Summon/InfectedRemote.cs b/Items/Weapons/Summon/InfectedRemote.cs index afde753a8f..a5391fa820 100644 --- a/Items/Weapons/Summon/InfectedRemote.cs +++ b/Items/Weapons/Summon/InfectedRemote.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -32,7 +33,12 @@ namespace CalamityMod.Items.Weapons.Summon public const float EnemyTargetingRange = 1300f; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + + } public override void SetDefaults() { diff --git a/Items/Weapons/Summon/MutatedTruffle.cs b/Items/Weapons/Summon/MutatedTruffle.cs index 145cc7d099..be68bf83a5 100644 --- a/Items/Weapons/Summon/MutatedTruffle.cs +++ b/Items/Weapons/Summon/MutatedTruffle.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -29,7 +30,11 @@ namespace CalamityMod.Items.Weapons.Summon #endregion - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Summon/Perdition.cs b/Items/Weapons/Summon/Perdition.cs index e610e10089..af0f2d7571 100644 --- a/Items/Weapons/Summon/Perdition.cs +++ b/Items/Weapons/Summon/Perdition.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -13,7 +14,11 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Summon/PuffShroom.cs b/Items/Weapons/Summon/PuffShroom.cs index b1e933d4d3..99690d4f50 100644 --- a/Items/Weapons/Summon/PuffShroom.cs +++ b/Items/Weapons/Summon/PuffShroom.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -10,6 +11,10 @@ namespace CalamityMod.Items.Weapons.Summon public class PuffShroom : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 32; diff --git a/Items/Weapons/Summon/SandSharknadoStaff.cs b/Items/Weapons/Summon/SandSharknadoStaff.cs index 5254fbb849..262bb00eb2 100644 --- a/Items/Weapons/Summon/SandSharknadoStaff.cs +++ b/Items/Weapons/Summon/SandSharknadoStaff.cs @@ -11,19 +11,14 @@ namespace CalamityMod.Items.Weapons.Summon public class SandSharknadoStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; - #region Other stats for easy modification - public const float ProjSpeed = 30f; - public const float FireSpeed = 50f; // In frames. 60 frames = 1 second. - #endregion - public override void SetDefaults() { Item.width = 48; Item.height = 56; - Item.damage = 94; + Item.damage = 71; Item.knockBack = 2f; Item.mana = 10; diff --git a/Items/Weapons/Summon/ScabRipper.cs b/Items/Weapons/Summon/ScabRipper.cs index 74d18a268c..9ddc38325c 100644 --- a/Items/Weapons/Summon/ScabRipper.cs +++ b/Items/Weapons/Summon/ScabRipper.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 66; Item.height = 70; - Item.damage = 16; + Item.damage = 15; Item.mana = 10; Item.useAnimation = Item.useTime = 30; Item.useStyle = ItemUseStyleID.Shoot; diff --git a/Items/Weapons/Summon/SlimePuppetStaff.cs b/Items/Weapons/Summon/SlimePuppetStaff.cs index 96f57f7c7c..aaae400ae7 100644 --- a/Items/Weapons/Summon/SlimePuppetStaff.cs +++ b/Items/Weapons/Summon/SlimePuppetStaff.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Summon CreateRecipe(). AddIngredient(18). AddIngredient(18). - AddTile(). + AddTile(TileID.Solidifier). Register(); } } diff --git a/Items/Weapons/Summon/SpikecragStaff.cs b/Items/Weapons/Summon/SpikecragStaff.cs index d9eb1fdafa..78b856a010 100644 --- a/Items/Weapons/Summon/SpikecragStaff.cs +++ b/Items/Weapons/Summon/SpikecragStaff.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class SpikecragStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 50; diff --git a/Items/Weapons/Summon/StaffoftheMechworm.cs b/Items/Weapons/Summon/StaffoftheMechworm.cs index bbd57dae6f..15ab023121 100644 --- a/Items/Weapons/Summon/StaffoftheMechworm.cs +++ b/Items/Weapons/Summon/StaffoftheMechworm.cs @@ -1,4 +1,5 @@ using System.Linq; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -12,6 +13,10 @@ namespace CalamityMod.Items.Weapons.Summon public class StaffoftheMechworm : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 68; diff --git a/Items/Weapons/Summon/StarspawnHelixStaff.cs b/Items/Weapons/Summon/StarspawnHelixStaff.cs index 333bdf5ce4..e687d10378 100644 --- a/Items/Weapons/Summon/StarspawnHelixStaff.cs +++ b/Items/Weapons/Summon/StarspawnHelixStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class StarspawnHelixStaff : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = 54; diff --git a/Items/Weapons/Summon/Vigilance.cs b/Items/Weapons/Summon/Vigilance.cs index 99845a7cb9..5b731630f0 100644 --- a/Items/Weapons/Summon/Vigilance.cs +++ b/Items/Weapons/Summon/Vigilance.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; using Terraria; @@ -11,6 +12,10 @@ namespace CalamityMod.Items.Weapons.Summon public class Vigilance : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Weapons.Summon"; + public override void SetStaticDefaults() + { + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { Item.width = Item.height = 32; diff --git a/Items/Weapons/Summon/VileFeeder.cs b/Items/Weapons/Summon/VileFeeder.cs index e584d973f4..db16a86ab9 100644 --- a/Items/Weapons/Summon/VileFeeder.cs +++ b/Items/Weapons/Summon/VileFeeder.cs @@ -17,7 +17,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 40; Item.height = 36; - Item.damage = 14; + Item.damage = 15; Item.DamageType = DamageClass.Summon; Item.shoot = ModContent.ProjectileType(); Item.knockBack = 0.5f; diff --git a/Items/Weapons/Summon/ViralSprout.cs b/Items/Weapons/Summon/ViralSprout.cs index 967ce92bd5..1c6f7c5669 100644 --- a/Items/Weapons/Summon/ViralSprout.cs +++ b/Items/Weapons/Summon/ViralSprout.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Items.Weapons.Summon { Item.width = 48; Item.height = 56; - Item.damage = 30; + Item.damage = 24; Item.mana = 10; Item.useAnimation = Item.useTime = 19; Item.useStyle = ItemUseStyleID.HoldUp; diff --git a/Items/Weapons/Summon/VoidConcentrationStaff.cs b/Items/Weapons/Summon/VoidConcentrationStaff.cs index 332e3bc54d..38ce3b2db3 100644 --- a/Items/Weapons/Summon/VoidConcentrationStaff.cs +++ b/Items/Weapons/Summon/VoidConcentrationStaff.cs @@ -1,4 +1,6 @@ using CalamityMod.Buffs.Summon; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -13,7 +15,11 @@ namespace CalamityMod.Items.Weapons.Summon { public new string LocalizationCategory => "Items.Weapons.Summon"; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 3f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Items/Weapons/Summon/YharonsKindleStaff.cs b/Items/Weapons/Summon/YharonsKindleStaff.cs index 104e4933e0..cffe7f5fb8 100644 --- a/Items/Weapons/Summon/YharonsKindleStaff.cs +++ b/Items/Weapons/Summon/YharonsKindleStaff.cs @@ -1,4 +1,5 @@ -using CalamityMod.Projectiles.Summon; +using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.Projectiles.Summon; using CalamityMod.Rarities; using CalamityMod.Sounds; using Microsoft.Xna.Framework; @@ -15,7 +16,11 @@ namespace CalamityMod.Items.Weapons.Summon public new string LocalizationCategory => "Items.Weapons.Summon"; public const float ReboundRamDamageFactor = 2f; - public override void SetStaticDefaults() => ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + public override void SetStaticDefaults() + { + ItemID.Sets.StaffMinionSlotsRequired[Type] = 5f; + ItemID.Sets.ShimmerTransformToItem[Type] = ModContent.ItemType(); + } public override void SetDefaults() { diff --git a/Localization/en-US/Mods.CalamityMod.Attunement.hjson b/Localization/en-US/Mods.CalamityMod.Attunement.hjson index a694250087..bb971a8498 100644 --- a/Localization/en-US/Mods.CalamityMod.Attunement.hjson +++ b/Localization/en-US/Mods.CalamityMod.Attunement.hjson @@ -138,7 +138,7 @@ PhoenixAttunement: { Swing the sword around you, accelerating over time The swirling nebula constantly emits homing cosmic bolts Release to hurl the sword toward the cursor alongside 6 gigantic cosmic bolts - The hurled sword erupts into a blazing flame pillar on enemy hits + The hurled sword erupts into a blazing tornado on enemy hits ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Buffs.hjson b/Localization/en-US/Mods.CalamityMod.Buffs.hjson index cbc1e06da4..0184d2fdb9 100644 --- a/Localization/en-US/Mods.CalamityMod.Buffs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Buffs.hjson @@ -675,7 +675,7 @@ AeolianEarthBuff: { Description: ''' You are strengthened by primordial powers - Damage reduction increased by {0}%, damage increased by {1}% + Damage reduction increased by {0}%, damage increased by {1}%, and massively buffed mana regen ''' } @@ -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 @@ -885,7 +880,7 @@ SandsWindBuff: { Description: ''' You are strengthened by the powers of sand - Defense increased by {0}, damage increased by {1}% + Defense increased by {0}, damage increased by {1}%, and greatly buffed mana regen ''' } @@ -896,7 +891,7 @@ SilvaRevival: { SpiritDefense: { DisplayName: Spirit Defense - Description: Defense increased by {0} and damage reduction increased by {1}% + Description: Defense increased by {0} } SpiritPower: { diff --git a/Localization/en-US/Mods.CalamityMod.Common.hjson b/Localization/en-US/Mods.CalamityMod.Common.hjson index 413fa82e21..73c97540be 100644 --- a/Localization/en-US/Mods.CalamityMod.Common.hjson +++ b/Localization/en-US/Mods.CalamityMod.Common.hjson @@ -1,3 +1,16 @@ +// Plain stat boosts +RogueDamage: "{0}% increased rogue damage" +RogueCrit: "{0}% increased rogue critical strike chance" +RogueVelocity: "{0}% increased rogue velocity" +RogueStealth: +{0} maximum stealth +// Armor Set Bonus key states +BothArmorSetBonusKeys: Press {0} or Double tap {1} +NoArmorSetBonusKey: Press the Armor Set Bonus key +ArmorSetBonusKey: Press {0} +DoubleTapDown: Double tap {0} +// Miscellaneous stats/info +AggroBoost: Enemies are more likely to target you +AggroReduction: Enemies are less likely to target you AbyssLightLevel1: Provides a small amount of light in the abyss AbyssLightLevel2: Provides a moderate amount of light in the abyss AbyssLightLevel3: Provides a large amount of light in the abyss @@ -8,12 +21,9 @@ AlcoholWarning: Drinking more than 3 different alcohols might not end well with ArmorPenetration: Ignores {0} points of enemy Defense CanMineUelibloom: Can mine Uelibloom Ore NotConsumable: Not consumable -RogueDamage: "{0}% increased rogue damage" -RogueCrit: "{0}% increased rogue critical strike chance" -RogueVelocity: "{0}% increased rogue velocity" SummonTagDamageFlat: "{0} summon tag damage" SummonTagDamageMult: "{0}x summon tag damage" -SummonTagCrit: "{0}% summon tag critcal strike chance" +SummonTagCrit: "{0}% summon tag critical strike chance" DodgeInformation: ''' Attacks that deal less than 5% of your max life in damage will not be dodged diff --git a/Localization/en-US/Mods.CalamityMod.Condition.hjson b/Localization/en-US/Mods.CalamityMod.Condition.hjson index f9e209883b..d99892c2dd 100644 --- a/Localization/en-US/Mods.CalamityMod.Condition.hjson +++ b/Localization/en-US/Mods.CalamityMod.Condition.hjson @@ -50,8 +50,8 @@ Drops: { } // Other conditions -PotionConfig: While the Town NPC Potion Selling configuration option is enabled HasFlareGun: While holding a Flare Gun upgrade +LacewingBestiary: When at least 40% of the Bestiary has been completed HasRogueArmor: While wearing rogue armor HasWings: While wearing wings InAstral: In the Astral Infection @@ -60,10 +60,3 @@ InSulph: In the Sulphurous Sea InSunken: In the Sunken Sea InRev: In Revengeance Mode InRevOrMM: In Revengeance Mode or in Master Mode -AlcoholPoison: While inflicted with Alcohol Poisoning -PostCal: After defeating Calamitas Clone -PostAureus: After defeating Astrum Aureus -PostPolter: After defeating Polterghast -PostOD: After defeating the Old Duke -PostDoG: After defeating the Devourer of Gods -PostYharon: After defeating Yharon diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index 89b05f4298..a86ca1bd36 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -7,7 +7,6 @@ CalamityClientConfig: { UI: UI Changes MeterPositions: Meter Positions MusicToggles: Music Toggles - Multithreading: Multi-Threading } AbyssLayer3Alt: { @@ -51,15 +50,6 @@ CalamityClientConfig: { ''' } - CalamityArmorSetBonusDoubleTap: { - Label: "[i:CalamityMod/DesertProwlerHat] Calamity Armor Set Bonuses Can Use Vanilla Hotkey" - Tooltip: - ''' - Allows Calamity armor set bonuses to be triggered by the vanilla double-tap DOWN hotkey (or UP depending on your settings). - Also allows vanilla armor set bonuses to be triggered by Calamity's armor set bonus hotkey. - ''' - } - ChargeMeter: { Label: "[i:CalamityMod/DraedonPowerCell] Display Charge Meter" Tooltip: @@ -137,7 +127,7 @@ CalamityClientConfig: { Label: "[i:CalamityMod/BallAndChain] Enable Fast Falling" Tooltip: ''' - When enabled, you can hold the DOWN key while in the air to accelerate downwards faster. + When enabled, you can hold the {$Key.DOWN} key while in the air to accelerate downwards faster. This config does not increase your maximum falling speed, just how quickly you accelerate to it. Calamity is balanced around this setting being enabled. ''' @@ -254,6 +244,21 @@ CalamityClientConfig: { ''' } + SetBonusDoubleTap: { + Label: "[i:VortexHelmet] Allow Double Tap for Armor Set Bonuses" + Tooltip: + ''' + Allows all armor set bonuses to be triggered by the vanilla double-tap {$Key.DOWN} hotkey (or {$Key.UP} depending on your settings). + Set to Auto to automatically turn off double-tap as long as Calamity's {$Keybinds.ArmorSetBonus.DisplayName} hotkey is bound. + ''' + + Options: { + On: Always On + Auto: Auto + Off: Always Off + } + } + ShopNewAlert: { Label: "[i:GoldChest] New Shop Inventory Alerts" Tooltip: Adds an icon that appears over Town NPCs when they have new items in their shops. @@ -389,21 +394,6 @@ CalamityClientConfig: { Label: "[i:Book] Wiki Status Message" Tooltip: Enable or disable the status message promoting the Official Calamity Wiki that plays on world entry. } - - MultiThreadingType: { - Label: Sunken Sea Multi-Threading Option - Tooltip: - ''' - Option 0 will disable worldgen multi-threading. - Option 1 will enable ReLogic's multi-threading. - Option 2 will enable custom multi-threading. - ''' - } - - SunkenSeaMultiThreading: { - Label: Sunken Sea Multi Threading - Tooltip: "" - } } CalamityServerConfig: { @@ -567,3 +557,5 @@ CalamityServerConfig: { ''' } } + +SetBonusDoubleTapOptions.Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson index fe2992f93b..461cdbb7d6 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Accessories.hjson @@ -29,9 +29,8 @@ AbyssalDivingSuit: { The suit's armored plates increase damage reduction by 15% Wearing this suit grants 15% damage reduction for hits under 50 damage The suit can absorb up to 3 hits over 50 damage, and will take 3 minutes to regenerate - Reduces the damage caused by drowning in the abyss, and removes the bleed effect in the upper layers Grants the ability to swim, extends underwater breathing, emits light underwater, and improves mobility on ice - Provides a moderate amount of light and reduces breath loss in the abyss + Provides a moderate amount of light, reduces breath loss, and reduces damage caused by drowning in the abyss Abyss creatures are less likely to see you, mitigates the abyss' defense reduction, and lets you sink faster in liquids Grants immunity to the sulphurous waters and Crush Depth's increased breath loss Grants resistance to the increased breath loss caused by Hadopelagic Pressure @@ -66,7 +65,7 @@ AeroStone: { Affliction: { DisplayName: Affliction - Tooltip: Gives all teammates +0.5 HP/s life regen, +10% max life, 7% damage reduction, 13 defense and 10% increased damage + Tooltip: Gives all teammates +0.5 HP/s life regen, +10% max life, 7% damage reduction, 9 defense and 10% increased damage } AlchemicalFlask: { @@ -343,7 +342,7 @@ BloodPact: { BloodstainedGlove: { DisplayName: Bloodstained Glove - Tooltip: Stealth strikes have +8 armor penetration and heal for 2 HP + Tooltip: Stealth strikes have +8 armor penetration and heal for 5 HP } BloodyWormScarf: { @@ -555,8 +554,8 @@ DarkSunRing: { HoldShiftTooltip: ''' During the day, grants +2 HP/s life regen - During the night, grants +20 defense - During an eclipse, grants +1 HP/s life regen and +10 defense + During the night, grants +16 defense + During an eclipse, grants +1 HP/s life regen and +8 defense ''' FlavorTooltip: "'Contains the power of the dark sun'" } @@ -596,11 +595,26 @@ DepthCharm: { Tooltip: ''' Reduces the damage caused by drowning in the abyss - Removes the bleed effect caused by the upper layers of the abyss Removes the increased breath loss of Crush Depth ''' } +DiamondOfTheDeep: { + DisplayName: Diamond of the Deep + Tooltip: + ''' + Multiplies all water debuff damage by 1.6x + Slowly accrue up to three different abyssal spirits + Dash to disperse the spirits and have them attack enemies + When dispersed [c/CB7AD7:below 50% life], the spirits support you instead + The spirits appear in order and have different effects based on color: + [c/3CB371: Explodes on impact and inflicts Crush Depth] / [c/CB7AD7:Heals for 8 HP] + [c/FF4500: Pierces enemies and inflicts Hellfire] / [c/CB7AD7:Increases defense by 10 temporarily] + [c/1E90FF: Hits multiple times and inflicts Hadopelagic Pressure] / [c/CB7AD7:Heals 5% of max HP] + Spirits are transparent and silent when visibility is toggled off + ''' +} + DimensionalSoulArtifact: { DisplayName: Dimensional Soul Artifact Tooltip: @@ -688,7 +702,7 @@ ElectriciansGlove: { DisplayName: Electrician's Glove Tooltip: ''' - Stealth strikes summon sparks on enemy hits and heal you for 2 HP + Stealth strikes summon sparks on enemy hits and heal you for 10 HP Stealth strikes also have +8 armor penetration and deal 8% more damage ''' } @@ -819,7 +833,7 @@ FrostFlare: { All attacks and projectiles inflict Frostbite Grants immunity to Frostburn, Chilled and Frozen Being above 50% life grants 10% increased damage - Being below 50% life grants 20 defense and 15% increased max movement speed and acceleration + Being below 50% life grants 15 defense and 15% increased max movement speed and acceleration Grants resistance against cold attacks ''' } @@ -838,7 +852,7 @@ FungalSymbiote: { Tooltip: ''' You grow mushrooms on the grass beneath you - Consuming mushrooms provides the Mushy buff, granting 8 defense and +1 HP/s life regen + Consuming mushrooms provides the Mushy buff, granting 5 defense and +1 HP/s life regen 10% increased damage while you have the Mushy buff ''' } @@ -884,7 +898,11 @@ GladiatorsLocket: { GloveOfPrecision: { DisplayName: Glove of Precision - Tooltip: Decreases rogue attack speed by 15%, but increases damage by 10%, crit by 15% and velocity by 15% + Tooltip: + ''' + Decreases rogue attack speed by 15% + Increases rogue damage and critical strike chance by 10%, and velocity by 15% + ''' } GloveOfRecklessness: { @@ -917,7 +935,7 @@ HallowedRune: { HoldShiftTooltip: ''' [c/8ce0ff: Hallowed Power] [c/ccf1ff: grants 10% increased summon damage and rains stars on enemies] - [c/d08aff: Hallowed Defense] [c/eed4ff: grants 8 defense and 4% damage reduction] + [c/d08aff: Hallowed Defense] [c/eed4ff: grants 4 defense and 4% damage reduction] [c/ff8cb5: Hallowed Regen] [c/ffccde: grants +1.5 HP/s life regen] ''' } @@ -957,7 +975,7 @@ HoneyDew: { DisplayName: Honey Dew Tooltip: ''' - +30 max life + +10 max life Grants +1 HP/s life regen, and +1 HP/s life regen when inflicted with a damaging debuff Standing still in Honey grants +1.5 HP/s life regen Sickness debuff durations are halved @@ -988,10 +1006,10 @@ InfectedJewel: { Tooltip: ''' Passively grants +1 HP/s life regen - Grants 16 defense and +2 HP/s life regen while afflicted with any debuff + Grants 12 defense and +2 HP/s life regen while afflicted with any debuff Massively boosts natural life regen while afflicted with any debuff Granted defense fades away quickly when not afflicted with any debuffs - Each debuff beyond the first grants 5 additional defense + Each debuff beyond the first grants 4 additional defense Nullifies the Astral Infection debuff 'A beautiful gemstone tarnished by spaceborne rot' ''' @@ -1001,8 +1019,10 @@ InkBomb: { DisplayName: Ink Bomb Tooltip: ''' - Throws several ink bombs when hit that explode into ink - Gain a lot of stealth and confuse enemies when struck + +10 maximum stealth + Stealth generates 7% faster + Throws several ink bombs when hit that explode into ink and confuse enemies + Gain a lot of stealth when struck This effect has a 20 second cooldown before it can occur again ''' } @@ -1012,7 +1032,7 @@ InterstellarStompers: { Tooltip: ''' 6% increased movement speed, 20% increased jump speed, and negates fall damage - Hold DOWN to increase your maximum fall speed + Hold {$Key.DOWN} to increase your maximum fall speed Pressing [KEY] while midair charges up a superspeed slam over 0.33 seconds While falling, you ram through enemies and don't take contact damage Once you hit the ground, you create an explosion at your feet @@ -1025,7 +1045,7 @@ IronBoots: { DisplayName: Iron Boots Tooltip: ''' - Hold DOWN to increase your maximum fall speed, even in water + Hold {$Key.DOWN} to increase your maximum fall speed, even in water Upon hitting the ground, a shockwave is created at your feet The shockwave scales in both damage and size the longer you fall for Negates fall damage @@ -1078,29 +1098,13 @@ LivingDew: { DisplayName: Living Dew Tooltip: ''' - +50 max life + +25 max life Grants +1 HP/s life regen and an additional 1 HP/s life regen when inflicted with a damaging debuff Standing still in Honey grants +1.5 HP/s life regen Fire and sickness debuff durations are halved ''' } -DiamondOfTheDeep: { - DisplayName: Diamond of the Deep - Tooltip: - ''' - Multiplies all water debuff damage by 1.75x - Slowly accrue up to three different abyssal spirits - Dash to disperse the spirits and have them attack enemies - When dispersed [c/CB7AD7:below 50% life], the spirits support you instead - The spirits appear in order and have different effects based on color: - [c/3CB371: Explodes on impact and inflicts Crush Depth] / [c/CB7AD7:Heals for 8 HP] - [c/FF4500: Pierces enemies and inflicts Hellfire] / [c/CB7AD7:Increases defense by 15 temporarily] - [c/1E90FF: Hits multiple times and inflicts Hadopelagic Pressure] / [c/CB7AD7:Heals 5% of max HP] - Spirits are transparent and silent when visibility is toggled off - ''' -} - LuxorsGift: { DisplayName: Luxor's Gift Tooltip: @@ -1421,8 +1425,8 @@ Radiance: { [c/CDF69C:Recover an additional 6 HP/s while inflicted with a debuff] [c/CDF69C:This eventually slows to 1.33 HP/s when debuffed for an extended time period] [c/CDF69C:Standing still provides +2 HP/s life regen and faster natural regen recovery] - [c/CDF69C:+20 defense and faster natural regen recovery while afflicted with any debuff] - [c/CDF69C:Each additional debuff grants 8 defense, which slowly decays while not debuffed] + [c/CDF69C:+15 defense and faster natural regen recovery while afflicted with any debuff] + [c/CDF69C:Each additional debuff grants 5 defense, which slowly decays while not debuffed] [c/CDF69C:Weak damaging debuffs are harmless and halves the duration of most other debuffs] ''' } @@ -1451,7 +1455,7 @@ RampartofDeities: { This effect scales from 10 frames at full HP to 40 frames at 25% or less HP Being struck for over 200 damage grants 30 additional invincibility frames Grants immunity to knockback - Puts a shell around the owner when below 50% life that reduces damage taken + Puts a shell around the owner when below 50% life that reduces damage by 25% Absorbs 25% of damage done to players on your team when above 25% life ''' } @@ -1466,8 +1470,8 @@ ReaperToothNecklace: { ''' } -Regenator: { - DisplayName: Regenator +Regenerator: { + DisplayName: Regenerator Tooltip: ''' Your health cannot exceed 50% of its maximum @@ -1507,7 +1511,7 @@ RoverDrive: { DisplayName: Rover Drive Tooltip: ''' - Gain a barrier with 20 health, which grants 10 defense while active + Gain a barrier with 20 health [ADREN] If depleted, the barrier's health regenerates after not receiving damage for 10 seconds Getting hit resets the timer @@ -1531,7 +1535,7 @@ SandCloak: { ''' Dashing creates a large protective sand veil which damages enemies inside it The sand veil lasts 15 seconds, but dissipates early if you dash again - The veil slowly follows you, and any player inside it gains 10 defense and 1.75x acceleration + The veil slowly follows you, and any player inside it gains 4 defense and 1.75x acceleration After dissipating, the sand veil has a 15 second cooldown before it can be used again ''' } @@ -1684,7 +1688,7 @@ SpiritGlyph: { HoldShiftTooltip: ''' [c/8ce0ff: Spirit Power] [c/ccf1ff:grants 10% increased summon damage] - [c/d08aff: Spirit Defense] [c/eed4ff:grants 6 defense and 3% damage reduction] + [c/d08aff: Spirit Defense] [c/eed4ff:grants 4 defense] [c/ff8cb5: Spirit Regen] [c/ffccde:grants +1 HP/s life regeneration] ''' } @@ -1822,9 +1826,9 @@ StatMeter: { AbyssStats: ''' Abyss Light Strength: {0} - Breath Lost Per Tick: {1} | Breath Loss Rate: {2} - Life Lost Per Tick at Zero Breath: {3} - Defense Lost From Pressure: {4} + Breath Loss Rate: {1} + Life Lost Per Tick at Zero Breath: {2} + Defense Lost From Pressure: {3} ''' AbyssStatsHidden: Abyss stats are only displayed while in the Abyss } @@ -1953,8 +1957,8 @@ TheSponge: { Tooltip: ''' Grants immunity to knockback - Gain a barrier with 180 health - The barrier grants 20 defense and 10% damage reduction while active + Gain a barrier with 120 health + The barrier grants 10% damage reduction while active [ADREN] The barrier will regenerate 8 seconds after being hit, taking 10 seconds to completely regenerate Getting hit resets the timer @@ -2000,7 +2004,7 @@ TrinketofChi: { ''' Increases damage reduction by 8% if you avoid taking damage for 10 seconds This buff expires on hit - +1 HP/s life regen for teammates + +1 HP/s life regen for you and your teammates ''' } @@ -2103,9 +2107,9 @@ WulfrumAcrobaticsPack: { This slingshot's stats scale with your equipped hook If the hook has special effects, the slingshot also benefits from them The slingshot allows for advanced rope-swinging physics - Hold UP or DOWN to retract or extend the slingshot's rope + Hold {$Key.UP} or {$Key.DOWN} to retract or extend the slingshot's rope Automatically grapples nearby walls if a lethal fall is detected - This safety feature won't activate if DOWN is held + This safety feature won't activate if {$Key.DOWN} is held 8% increased movement speed ''' } @@ -2161,6 +2165,11 @@ HapuFruit: { Tooltip: "'A fruit that calms your nerves (may have unintended side effects)'" } +LucisSight: { + DisplayName: Luci's Sight + Tooltip: "'Fashionable glasses? In Earthia's current economy?!'" +} + OracleHeadphones: { DisplayName: Oracle Headphones Tooltip: "'Hey game's over!'" @@ -2203,7 +2212,7 @@ XyksBlessingBlue: { DisplayName: Xyk's Blessing (Blue) Tooltip: ''' - Applies visual effects to your dashes and deaths + Applies visual effects to your dashes, wings, and deaths to transform 'It's simply too much to turn back now; passion and time have long since stained it. [c/5f8ae1:Have I always been so selfish?'] @@ -2214,7 +2223,7 @@ XyksBlessingOrange: { DisplayName: Xyk's Blessing (Orange) Tooltip: ''' - Applies visual effects to your dashes and deaths + Applies visual effects to your dashes, wings, and deaths to transform 'Even so, the march of time waits for none. Recall that feeling of fulfillment, and show it to the world. [c/E1B65F:Prove that it was never a waste.'] diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson index 23e2a20942..83259b00ce 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Hardmode.hjson @@ -2,21 +2,21 @@ AstralBreastplate: { DisplayName: Astral Breastplate Tooltip: ''' - 7% increased damage - +80 max mana and +20 max life + {$CommonItemTooltip.IncreasesMaxManaBy} + {$CommonItemTooltip.PercentIncreasedDamage@1} ''' } AstralHelm: { DisplayName: Astral Helm - Tooltip: 5% increased damage and 10% increased critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamage} and {$CommonItemTooltip.PercentIncreasedCritChance}" SetBonus: ''' - +3 max minions - 10% increased damage and critical strike chance + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedDamageCritChance@1} Detects nearby creatures, enemy projectiles, danger sources, and treasure Whenever you crit an enemy, a barrage of stars will rain down - This effect has a 1 second cooldown before it can trigger again + This effect has a {2} {^2:second;seconds} cooldown before it can trigger again ''' } @@ -24,8 +24,8 @@ AstralLeggings: { DisplayName: Astral Leggings Tooltip: ''' - 5% increased damage - 15% increased movement speed + {$CommonItemTooltip.PercentIncreasedDamage} + {$CommonItemTooltip.PercentIncreasedMovementSpeed@1} ''' } @@ -54,7 +54,7 @@ BrimflameScowl: { SetBonus: ''' Grants an additional 15% increased magic damage and critical strike chance - Press {0} to trigger a brimflame frenzy effect + {0} to trigger a brimflame frenzy effect While under this effect, you get an additional 40% increase to magic damage However, this inflicts rapid life loss and disables mana regeneration and mana potions This can be toggled off, however, brimflame frenzy has a 30 second cooldown @@ -160,7 +160,6 @@ FathomSwarmerBreastplate: { DisplayName: Fathom Swarmer Breastplate Tooltip: ''' - 6% increased damage reduction Increases your max number of minions by 1 10% increased summon damage Reduces defense loss within the Abyss @@ -190,7 +189,7 @@ ForbiddenCirclet: { SetBonus: ''' +40 maximum stealth - Press {0} to call an ancient storm to the cursor location + {0} to call an ancient storm to the cursor location The ancient storm costs {1} mana and benefits from both summon and rogue bonuses Rogue stealth strikes spawn homing eaters on enemy hits Rogue and summon attacks will scale off of the stat with a higher boost @@ -200,11 +199,7 @@ ForbiddenCirclet: { HydrothermicArmor: { DisplayName: Hydrothermic Armor - Tooltip: - ''' - +20 max life - 8% increased damage and 4% increased critical strike chance - ''' + Tooltip: 8% increased damage and 4% increased critical strike chance CommonSetBonus: ''' Inferno effect when below 50% life @@ -391,11 +386,7 @@ PlaguebringerPistons: { PlaguebringerVisor: { DisplayName: Plaguebringer Visor - Tooltip: - ''' - 15% increased summon damage - +20 max life - ''' + Tooltip: 15% increased summon damage SetBonus: ''' Grants a plague dash which can slam through enemies without taking damage @@ -412,8 +403,8 @@ PlagueReaperMask: { 25% reduced ammo usage and 5% increased flight time Enemies receive 10% more damage from ranged projectiles when afflicted by the Plague Getting hit causes plague cinders to rain from above - Press {0} to blind yourself for 5 seconds but massively boost your ranged damage - This has a 25 second cooldown. + {0} to blind yourself for 5 seconds but massively boost your ranged damage + This has a 25 second cooldown ''' } @@ -480,14 +471,12 @@ ReaverHeadTank: { ''' 15% increased damage reduction but 30% decreased damage +50 max life - Restores 1 HP every second, this applies separately from life regen ''' SetBonus: ''' - +10 defense and +1.5 HP/s life regen + +10 defense and +5 HP/s life regen Enemies are more likely to target you Reduces the life regen lost from damage over time debuffs by 20% - All attacks steal life and speed up the rate of life regen 30% decreased movement speed and flight time Enemy damage is reflected and summons a thorn spike Reaver Rage activates when you are damaged @@ -496,11 +485,7 @@ ReaverHeadTank: { ReaverScaleMail: { DisplayName: Reaver Scale Mail - Tooltip: - ''' - 9% increased damage and 4% increased critical strike chance - +20 max life - ''' + Tooltip: 9% increased damage and 4% increased critical strike chance } TitanHeartBoots: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson index 3f5b3eb4a3..b43be68354 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PostMoonLord.hjson @@ -17,13 +17,13 @@ AuricTeslaCuisses: { ''' } -AuricTeslaHoodedFacemask: { +AuricTeslaHeadRanged: { DisplayName: Auric Tesla Hooded Facemask Tooltip: 30% increased ranged damage and critical strike chance SetBonus: ''' Ranged Tarragon, Bloodflare and God Slayer armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -45,7 +45,7 @@ AuricTeslaHoodedFacemask: { ''' } -AuricTeslaPlumedHelm: { +AuricTeslaHeadRogue: { DisplayName: Auric Tesla Plumed Helm Tooltip: ''' @@ -56,7 +56,7 @@ AuricTeslaPlumedHelm: { ''' +130 maximum stealth Rogue Tarragon, Bloodflare and God Slayer armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -78,7 +78,7 @@ AuricTeslaPlumedHelm: { ''' } -AuricTeslaRoyalHelm: { +AuricTeslaHeadMelee: { DisplayName: Auric Tesla Royal Helm Tooltip: ''' @@ -90,7 +90,7 @@ AuricTeslaRoyalHelm: { Enemies are more likely to target you 28% increased melee speed Melee Tarragon, Bloodflare and God Slayer effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -112,7 +112,7 @@ AuricTeslaRoyalHelm: { ''' } -AuricTeslaSpaceHelmet: { +AuricTeslaHeadSummon: { DisplayName: Auric Tesla Space Helmet Tooltip: 15% increased summon damage SetBonus: @@ -120,7 +120,7 @@ AuricTeslaSpaceHelmet: { Max run speed and acceleration boosted by 5% +6 max minions and 75% increased summon damage Summoner Tarragon, Bloodflare and Silva armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -142,14 +142,14 @@ AuricTeslaSpaceHelmet: { ''' } -AuricTeslaWireHemmedVisage: { +AuricTeslaHeadMagic: { DisplayName: Auric Tesla Wire-Hemmed Visage Tooltip: 30% increased magic damage, 20% increased magic critical strike chance, +100 max mana and 20% reduced mana usage SetBonus: ''' Max run speed and acceleration boosted by 5% Magic Tarragon, Bloodflare and Silva armor effects - Hold SHIFT to view these set bonus details and Press SHIFT repeatedly to cycle through them + Hold Shift to view these set bonus details and press Shift repeatedly to cycle through them ''' SetBonus1: ''' @@ -176,7 +176,7 @@ BloodflareBodyArmor: { Tooltip: ''' 12% increased damage and 8% increased critical strike chance - +40 max life + +25 max life ''' CommonSetBonus: ''' @@ -213,7 +213,6 @@ BloodflareHeadMelee: { ''' SetBonusEffect: ''' - True melee strikes will heal you After striking an enemy 15 times with true melee you will enter a blood frenzy for 5 seconds During this you will gain 25% increased melee damage, critical strike chance, and contact damage is halved This effect has a 30 second cooldown @@ -226,7 +225,7 @@ BloodflareHeadRanged: { SetBonus: "{$BloodflareHeadRanged.SetBonusEffect}" SetBonusEffect: ''' - Press {0} to unleash the lost souls of polterghast to destroy your enemies + {0} to unleash the lost souls of polterghast to destroy your enemies This effect has a 30 second cooldown Ranged weapons fire bloodsplosion orbs every 2.5 seconds ''' @@ -248,7 +247,8 @@ BloodflareHeadRogue: { ''' Being over 80% life boosts your defense by 30 and rogue crit by 5% Being below 80% life boosts your rogue damage by 10% - Rogue critical strikes heal you + Rogue critical strikes burst into blood orbs + Picking up these blood orbs reduces the duration of [Potion Sickness] ''' } @@ -274,7 +274,7 @@ DemonshadeBreastplate: { ''' 25% increased melee speed, 15% increased damage and critical strike chance Enemies take ungodly damage when they touch you - Increased max life and mana by 200 + Increased max life by 50 and max mana by 200 Standing still absorbs shadows to grant exponentially accelerating life regen ''' } @@ -292,7 +292,7 @@ DemonshadeHelm: { 100% increased summon damage and +10 max minions Shadowbeams and demon scythes will fire down when you are hit A friendly red devil follows you around - Press {0} to enrage nearby enemies with a dark magic spell for 10 seconds + {0} to enrage nearby enemies with a dark magic spell for 10 seconds This makes them take {1}x total damage, but they will deal {2}x damage to you ''' } @@ -302,7 +302,6 @@ EmpyreanCloak: { Tooltip: ''' Armor of the cosmos - +20 max life 7% increased rogue damage and critical strike chance ''' } @@ -417,15 +416,15 @@ GodSlayerChestplate: { DisplayName: God Slayer Chestplate Tooltip: ''' - +60 max life + +50 max life Enemies take damage when they hit you 11% increased damage and 8% increased critical strike chance ''' CommonSetBonus: ''' - Pressing {0} allows you to dash towards your cursor for 2.5 seconds + Pressing {0} allows you to dash towards your cursor for 2 seconds Enemies you dash through take massive damage - During the dash you are immune to most debuffs + During the dash you are immune to damage and most debuffs The dash has a {1} second cooldown ''' } @@ -506,7 +505,7 @@ OmegaBlueHelmet: { ''' 10% increased damage and critical strike chance and +2 max minions Short-ranged tentacles heal you by sucking enemy life - Press {0} to activate abyssal madness for 5 seconds + {0} to activate abyssal madness for 5 seconds Abyssal madness increases damage and critical strike chance by 10% It also increases tentacle aggression and range, and allows them to critically strike This effect has a 25 second cooldown @@ -545,7 +544,7 @@ PrismaticHelmet: { ''' +40 max mana and 15% reduced mana cost Increased mana regeneration rate - Press {0} to unleash a barrage of death lasers at the cursor for the next 5 seconds + {0} to unleash a barrage of death lasers at the cursor for the next 5 seconds This has a 30 second cooldown ''' } @@ -556,7 +555,7 @@ PrismaticRegalia: { ''' 12% increased magic damage and 15% increased magic crit 20% decreased non-magic damage - +20 max life and +40 max mana + +40 max mana Magic attacks occasionally fire a pair of homing rockets ''' } @@ -565,12 +564,12 @@ SilvaArmor: { DisplayName: Silva Armor Tooltip: ''' - +80 max life + +50 max life 11% increased damage and 8% increased critical strike chance ''' CommonSetBonus: ''' - All projectiles spawn healing leaf orbs on enemy hits + +3 HP/s life regen Max run speed and acceleration boosted by 5% Taking fatal damage will revive you and make you invulnerable to all damage for 5 seconds This effect has a 5 minute cooldown, which does not decrement if any bosses or events are active @@ -617,7 +616,6 @@ TarragonBreastplate: { ''' CommonSetBonus: ''' - Reduces enemy spawn rates Increased heart pickup range Enemies have a chance to drop extra hearts on death ''' @@ -631,12 +629,7 @@ TarragonHeadMagic: { 10% increased damage reduction, +100 max mana, and 15% reduced mana usage ''' SetBonus: "{$TarragonHeadMagic.SetBonusEffect}" - SetBonusEffect: - ''' - On every 5th critical strike you will fire a leaf storm - Magic projectiles heal you on enemy hits - Amount healed is based on projectile damage - ''' + SetBonusEffect: On every 5th critical strike you will fire a leaf storm } TarragonHeadMelee: { @@ -655,7 +648,7 @@ TarragonHeadMelee: { SetBonusEffect: ''' Taking damage gives the Tarra Life buff, which grants +1.5 HP/s life regen - Press {0} to cloak yourself in life energy that heavily reduces enemy contact damage for 10 seconds + {0} to cloak yourself in life energy that heavily reduces enemy contact damage for 10 seconds This has a 30 second cooldown ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson index 3095f99502..442d7f4bda 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.PreHardmode.hjson @@ -1,147 +1,155 @@ AerospecBreastplate: { DisplayName: Aerospec Breastplate - Tooltip: 3% increased damage and critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedDamageCritChance}" CommonSetBonus: ''' - Taking over 25 damage in one hit will cause a spread of homing feathers to fall + Taking over {0} damage in one hit will cause a spread of homing feathers to fall Allows you to fall more quickly and disables fall damage ''' } -AerospecHat: { +AerospecHeadMagic: { DisplayName: Aerospec Hat - Tooltip: 10% increased magic damage and +30 max mana + Tooltip: + ''' + {$CommonItemTooltip.IncreasesMaxManaBy} + {$CommonItemTooltip.PercentIncreasedMagicDamage@1} + ''' SetBonus: ''' - 8% reduced mana cost - 5% increased movement speed and magic critical strike chance + {$CommonItemTooltip.PercentReducedManaCost} + {1}% increased movement speed and magic critical strike chance ''' } -AerospecHeadgear: { +AerospecHeadRogue: { DisplayName: Aerospec Headgear - Tooltip: 10% increased rogue damage and 5% increased movement speed + Tooltip: "{$Common.RogueDamage} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@1}" SetBonus: ''' - 5% increased movement speed and rogue critical strike chance - +80 maximum stealth + {$Common.RogueStealth} + {1}% increased movement speed and rogue critical strike chance ''' } -AerospecHelm: { +AerospecHeadMelee: { DisplayName: Aerospec Helm - Tooltip: 10% increased melee damage + Tooltip: "{$CommonItemTooltip.PercentIncreasedMeleeDamage}" SetBonus: ''' - 5% increased movement speed and melee critical strike chance - Enemies are more likely to target you + {0}% increased movement speed and melee critical strike chance + {$Common.AggroBoost} ''' } -AerospecHelmet: { +AerospecHeadSummon: { DisplayName: Aerospec Helmet - Tooltip: 10% increased summon damage and 5% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedSummonDamage} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@1}" SetBonus: ''' - 11% increased summon damage and +1 max minion + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a valkyrie to protect you ''' } -AerospecHood: { +AerospecHeadRanged: { DisplayName: Aerospec Hood - Tooltip: 10% increased ranged damage - SetBonus: 5% increased movement speed and ranged critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedDamage}" + SetBonus: "{0}% increased movement speed and ranged critical strike chance" } AerospecLeggings: { DisplayName: Aerospec Leggings - Tooltip: 12% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedMovementSpeed}" } DesertProwlerHat: { DisplayName: Desert Prowler Hat - Tooltip: 4% increased ranged critical strike chance and 20% chance to not consume ammo - SetBonus: Ranged attacks deal an extra {0} flat damage - AbilityBrief: Sandsmoke Bomb - Double tap {0} to shroud yourself in a small cloud of sand - AbilityDescription: + Tooltip: "{$Common.RogueCrit}" + SetBonus: ''' - While the sand cloud is active, gain increased mobility but heavily reduced defense - Using a ranged weapon instantly dispels the sand cloak, but guarantees a supercrit for {0}% damage - The super crit applies only as long as the resulting hit wouldn't exceed {1} damage - Landing the killing blow on an enemy with this shot shortens the ability's cooldown to {2} seconds + {$Common.RogueStealth} + [c/{1}:Sandsmoke Bomb - {2} to shroud yourself in a small cloud of sand] + [c/CCB648:While the sand cloud is active, gain increased mobility but heavily reduced defense] + [c/CCB648:Using a rogue weapon instantly dispels the sand cloak, but guarantees a supercrit for {3}% damage] + [c/CCB648:The supercrit applies only as long as the resulting hit wouldn't exceed {4} damage] + [c/CCB648:Landing the killing blow on an enemy with this shot shortens the ability's cooldown to {5} {^5:second;seconds}] ''' } DesertProwlerPants: { DisplayName: Desert Prowler Pants - Tooltip: 10% increased movement speed and immunity to the Mighty Wind debuff + Tooltip: + ''' + {$Common.RogueCrit} + Grants immunity to {$BuffName.WindPushed} + ''' } DesertProwlerShirt: { DisplayName: Desert Prowler Shirt - Tooltip: 5% increased ranged critical strike chance + Tooltip: "{$Common.RogueDamage}" } MarniteArchitectHeadgear: { DisplayName: Marnite Architect Headgear - Tooltip: Increases block placement & tool range by 5 - AbilityBrief: Marnite Lift - You can summon a lift under your feet to reach higher up - AbilityDescription: + Tooltip: Increases block placement & tool range by {0} + SetBonus: ''' - The lift gets summoned when the mount hotkey gets pressed [c/D4C870:without any mounts equipped] - Using the Up and Down keys can change the lift's height + [c/{0}:Marnite Lift - You can summon a lift under your feet to reach higher up] + [c/91C5EF:The lift gets summoned when the mount hotkey gets pressed] [c/D4C870:without any mounts equipped] + [c/91C5EF:Press {$Key.UP} and {$Key.DOWN} to change the lift's height, reaching up to {1} tiles above ground] ''' } MarniteArchitectToga: { DisplayName: Marnite Architect Toga - Tooltip: Increases block & wall placement speed by 50% + Tooltip: Increases block & wall placement speed by {0}% } SnowRuffianChestplate: { DisplayName: Snow Ruffian Chestplate - Tooltip: 3% increased rogue critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianGreaves: { DisplayName: Snow Ruffian Greaves - Tooltip: 5% increased movement speed + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" } SnowRuffianMask: { DisplayName: Snow Ruffian Mask - Tooltip: 2% increased rogue damage + Tooltip: "{$CommonItemTooltip.PercentIncreasedRangedCritChance}" SetBonus: ''' - 5% increased rogue damage - +50 maximum stealth You can glide to negate fall damage + Ranged critical strikes frostburn enemies for {0} {^0:second;seconds} ''' } StatigelArmor: { DisplayName: Statigel Armor - Tooltip: 5% increased critical strike chance + Tooltip: "{$CommonItemTooltip.PercentIncreasedCritChance}" CommonSetBonus: ''' - When you take over 100 damage in one hit you become immune to damage for an extended period of time + When you take over {0} damage in one hit you become immune to damage for an extended period of time Grants an extra jump and increased jump height - 12% increased jump speed + {1}% increased jump speed ''' } StatigelGreaves: { DisplayName: Statigel Greaves - Tooltip: 5% increased damage and movement speed + Tooltip: "{0}% increased damage and movement speed" } StatigelHeadMagic: { DisplayName: Statigel Cap Tooltip: ''' - 10% increased magic damage and 10% reduced mana cost - 7% increased magic critical strike chance and +40 max mana + {$CommonItemTooltip.IncreasesMaxManaBy} and {$CommonItemTooltip.PercentReducedManaCost@1} + {$CommonItemTooltip.PercentIncreasedMagicDamage@2} and {$CommonItemTooltip.PercentIncreasedMagicCritChance@3} ''' } @@ -149,18 +157,18 @@ StatigelHeadMelee: { DisplayName: Statigel Helm Tooltip: ''' - 10% increased melee damage and melee speed - 7% increased melee critical strike chance + {0}% increased melee damage and melee speed + {$CommonItemTooltip.PercentIncreasedMeleeCritChance@1} ''' - SetBonus: Enemies are more likely to target you + SetBonus: "{$Common.AggroBoost}" } StatigelHeadRanged: { DisplayName: Statigel Headgear Tooltip: ''' - 10% increased ranged damage - 7% increased ranged critical strike chance + {$CommonItemTooltip.PercentIncreasedRangedDamage} + {$CommonItemTooltip.PercentIncreasedRangedCritChance@1} ''' } @@ -168,10 +176,10 @@ StatigelHeadRogue: { DisplayName: Statigel Mask Tooltip: ''' - 10% increased rogue damage - 7% increased rogue critical strike chance and 5% increased movement speed + {$Common.RogueDamage} + {$Common.RogueCrit@1} and {$CommonItemTooltip.PercentIncreasedMovementSpeed@2} ''' - SetBonus: +90 maximum stealth + SetBonus: "{$Common.RogueStealth}" } StatigelHeadSummon: { @@ -179,40 +187,36 @@ StatigelHeadSummon: { Tooltip: Increased minion knockback SetBonus: ''' - 18% increased summon damage and +1 max minion + {$CommonItemTooltip.IncreasesMaxMinionsBy} + {$CommonItemTooltip.PercentIncreasedSummonDamage@1} Summons a mini paladin to fight for you, the type depends on what world evil you have ''' } SulphurousBreastplate: { DisplayName: Sulphurous Breastplate - Tooltip: 6% increased rogue damage and 4% increased rogue critical strike chance + Tooltip: "{$Common.RogueDamage}" } SulphurousHelmet: { DisplayName: Sulphurous Helmet Tooltip: ''' - 4% increased rogue damage - 2% increased rogue critical strike chance + {$Common.RogueCrit} Grants underwater breathing ''' SetBonus: ''' - +65 maximum stealth - Attacking and being attacked by enemies inflicts poison + {$Common.RogueStealth} + Attacking and being attacked by enemies inflicts poison for {1} {^1:second;seconds} Grants an additional jump that summons a sulphurous bubble - Provides increased underwater mobility and reduces the severity of the sulphuric waters + Reduces the severity of the sulphuric waters ''' } SulphurousLeggings: { DisplayName: Sulphurous Leggings - Tooltip: - ''' - Movement speed increased by 10% - Movement speed increased an additional 25% while submerged in liquid - ''' + Tooltip: "{$Common.RogueDamage}" } VictideBreastplate: { @@ -296,25 +300,24 @@ WulfrumHat: { DisplayName: Wulfrum Hat & Goggles Tooltip: ''' - 10% increased summon damage + {$CommonItemTooltip.PercentIncreasedSummonDamage} Comes equipped with hair extensions ''' - SetBonus: +1 max minion - AbilityBrief: Wulfrum Bastion - Double tap {0} while dismounted to equip wulfrum power armor - AbilityDescription: + SetBonus: ''' - While the armor is active, you can only use the integrated fusion cannon, but your defensive stats are increased - Calling down the armor consumes one piece of {0}, and the armor will lose durability faster when hit + [c/{0}:Wulfrum Bastion - {1} to equip a power armor, costing one] [i:CalamityMod/WulfrumMetalScrap] [c/{0}:{$Items.Materials.WulfrumMetalScrap.DisplayName}] + [c/6EC05D:While active, you can only use the integrated fusion cannon, but your defensive stats are increased] + [c/6EC05D:The armor lasts up to {2} {^2:second;seconds}, but each hit loses {3} {^3:second;seconds} of duration] + [c/BEBEBE:Hold Shift to see the stats of the fusion cannon] ''' - ShiftToExpand: Hold SHIFT to see the stats of the fusion cannon } WulfrumJacket: { DisplayName: Wulfrum Jacket - Tooltip: 5% increased damage reduction + Tooltip: "{$CommonItemTooltip.IncreasesMaxMinionsBy}" } WulfrumOveralls: { DisplayName: Wulfrum Overalls - Tooltip: Movement speed increased by 5% + Tooltip: "{$CommonItemTooltip.PercentIncreasedSummonDamage}" } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson index 7ac8dddb6c..dbcac168c2 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Armor.Vanity.hjson @@ -128,6 +128,21 @@ LeviathanMask: { Tooltip: "" } +LucisBoots: { + DisplayName: Luci's Boots + Tooltip: "'One small step a time, you can do this.'" +} + +LucisHairstyle: { + DisplayName: Luci's Hairstyle + Tooltip: "'Hero of Light, Luci Skyshot.'" +} + +LucisMilitaryUniform: { + DisplayName: Luci's Military Uniform + Tooltip: "'Bearing the iconic Liberation Army insignia of freedom.'" +} + OldDukeMask: { DisplayName: Old Duke Mask Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Dyes.hjson b/Localization/en-US/Mods.CalamityMod.Items.Dyes.hjson index 5ccba37d5d..9b45147d45 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Dyes.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Dyes.hjson @@ -123,6 +123,11 @@ WingTimeHairDye: { Tooltip: "" } +InvisibleDye: { + DisplayName: Invisible Dye + Tooltip: "" +} + LivingShardDye: { DisplayName: Living Shard Dye Tooltip: "" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson index 4cdeb69161..75375242bb 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Fishing.hjson @@ -102,7 +102,7 @@ DragoonDrizzlefish: { ''' Fires an assortment of hellfire and brimstone fireballs Sometimes fires a larger splitting fireball - Right click to feed the little boy some tasty gel + to feed the little boy some tasty gel 'He is a hungry boy' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson b/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson index eeb8cd9033..e5e5499fae 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Lore.hjson @@ -1,7 +1,7 @@ ShortTooltip: ''' [c/E3AF40:Whispers from on high dance in your ears...] - [c/BEBEBE:Press "Left Shift" to listen closer] + [c/BEBEBE:Hold Shift to listen closer] ''' LoreAbyss: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson index 5856fdccf4..020e9628dd 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Materials.hjson @@ -53,11 +53,6 @@ BloodOrb: { Tooltip: "" } -BloodSample: { - DisplayName: Blood Sample - Tooltip: "" -} - Bloodstone: { DisplayName: Bloodstone Tooltip: "" @@ -247,11 +242,6 @@ ReaperTooth: { Tooltip: Sharp enough to cut diamonds } -RottenMatter: { - DisplayName: Rotten Matter - Tooltip: "" -} - RuinousSoul: { DisplayName: Ruinous Soul Tooltip: A shard of the distant past diff --git a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson index 670ed554a6..dde7b09dae 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Misc.hjson @@ -383,12 +383,12 @@ VoodooDemonVoodooDoll: { ExhumeShortTooltip: ''' [c/C61B40:'Ah, are you curious what I saw within this item?'] - [c/BABABA:Press "Left Shift" to listen] + [c/BABABA:Hold Shift to listen] ''' LegendaryShortTooltip: ''' [c/FF6F00:Tales of legends past radiate around you...] - [c/BABABA:Press "Left Shift" to listen closer] + [c/BABABA:Hold Shift to listen closer] ''' BallAndChain: { @@ -415,6 +415,17 @@ ColdheartIcicle: { Tooltip: "'N(ice) work'" } +DisgustingMeat: { + DisplayName: Disgusting Meat + Tooltip: + ''' + Debug item, spawn and use to remove permanent upgrades + will remove health and mana upgrades, use with no Calamity upgrades to remove vanilla upgrades + will remove rage and adrenaline upgrades, plus other miscellaneous boosters + Removed boosters will be vomited out of you as items + ''' +} + MomentumCapacitor: { DisplayName: Momentum Capacitor GFBName: Burden Breaker @@ -503,6 +514,7 @@ SuperDummy: { Creates a super dummy Regenerates 1 million life per second Will not die when taking damage over time from debuffs - Right click to kill all super dummies + to kill all super dummies + Can only spawn 50 super dummies at once ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson b/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson index bedd4c182b..28ecd49ad7 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Mounts.hjson @@ -32,7 +32,7 @@ GazeOfCrysthamyr: { Tooltip: ''' Summons a rideable shadow dragon mount - Hold Up to ascend faster + Hold {$Key.UP} to ascend faster ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson index cf192272c0..12a943c834 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Placeables.hjson @@ -82,6 +82,7 @@ PlaguebringerBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" PlagueChargerBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" PlagueshellBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" PrismBackBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" +ProbesnoutBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ProfanedEnergyBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" RadiatorBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ReaperSharkBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" @@ -96,6 +97,7 @@ ScryllarBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SeaFloatyBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SeaMinnowBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SeaSerpentBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" +SharkoonBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ShockstormShuttleBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" ShroombleBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" SightseerColliderBanner.DisplayName: "{$Items.Placeables.FormattedBannerName}" @@ -499,7 +501,7 @@ CalamityCanvas2023: { to make the focus follow the cursor, again to set it Arrow keys can also be used to manually adjust the focus point The scroll wheel zooms the focus in and out - Hold SHIFT to hide the UI without closing it + Hold Shift to hide the UI without closing it 'Embrace chaos' ''' } @@ -512,7 +514,7 @@ CalamityCanvas2024: { to make the focus follow the cursor, again to set it Arrow keys can also be used to manually adjust the focus point The scroll wheel zooms the focus in and out - Hold SHIFT to hide the UI without closing it + Hold Shift to hide the UI without closing it 'Embrace havoc' ''' } @@ -704,21 +706,11 @@ AltarOfTheAccursedItem: { ''' } -AncientAltar: { - DisplayName: Ancient Altar - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - AshenAltar: { DisplayName: Ashen Altar Tooltip: "{$CommonItemTooltip.SpecialCrafting}" } -BotanicPlanter: { - DisplayName: Botanic Planter - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - CosmicAnvilItem: { DisplayName: Cosmic Anvil Tooltip: @@ -737,21 +729,6 @@ DraedonsForge: { ''' } -EffulgentManipulator: { - DisplayName: Effulgent Manipulator - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - -EutrophicShelf: { - DisplayName: Eutrophic Shelf - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - -MonolithAmalgam: { - DisplayName: Monolith Amalgam - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - PlagueInfuser: { DisplayName: Plague Infuser Tooltip: "{$CommonItemTooltip.SpecialCrafting}" @@ -762,21 +739,11 @@ ProfanedCrucible: { Tooltip: "{$CommonItemTooltip.SpecialCrafting}" } -StaticRefiner: { - DisplayName: Static Refiner - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - VoidCondenser: { DisplayName: Void Condenser Tooltip: "{$CommonItemTooltip.SpecialCrafting}" } -WulfrumLabstationItem: { - DisplayName: Wulfrum Labstation - Tooltip: "{$CommonItemTooltip.SpecialCrafting}" -} - CrimsonEffigy: { DisplayName: Crimson Effigy Tooltip: @@ -793,7 +760,7 @@ ThankYouPainting: { ''' Thanks to the entire team, everyone who supported, and those who all play the mod and keep it alive! The confines of this painting is not enough to fit the entire team - Hold SHIFT to see a list of past and current developers + Hold Shift to see a list of past and current developers ''' } @@ -892,6 +859,11 @@ KelpTorch: { Tooltip: Can be placed in water } +OldDukeMonolith: { + DisplayName: Elden Diorama + Tooltip: "" +} + OtonilouStatue: { DisplayName: Otonilou Memorial Tooltip: "" @@ -1194,7 +1166,7 @@ VigorousCandle: { Tooltip: ''' when placed to regenerate {0}% of your maximum health per second - This regeneration is at full power even while moving and bypasses Revengeance Mode caps + This regeneration is at full power even while moving This cannot be stacked with other Candle buffs 'Its brilliant light suffuses those nearby with hope' ''' @@ -1419,6 +1391,11 @@ AcidwoodWorkBench: { Tooltip: "" } +AncientAltar: { + DisplayName: Ancient Altar + Tooltip: "" +} + AncientBasin: { DisplayName: Ancient Basin Tooltip: "" @@ -1758,6 +1735,11 @@ BotanicPiano: { Tooltip: "" } +BotanicPlanter: { + DisplayName: Botanic Planter + Tooltip: "" +} + BotanicPlatform: { DisplayName: Botanic Platform Tooltip: "" @@ -1888,103 +1870,308 @@ CosmiliteWorkBench: { Tooltip: "" } +DriftwoodBaroqueCello: { + DisplayName: Driftwood Baroque Cello + Tooltip: "" +} + +DriftwoodBathtub: { + DisplayName: Driftwood Bathtub + Tooltip: "" +} + +DriftwoodBed: { + DisplayName: Driftwood Bed + Tooltip: "" +} + +DriftwoodBookcase: { + DisplayName: Driftwood Bookcase + Tooltip: "" +} + +DriftwoodCandelabra: { + DisplayName: Driftwood Candelabra + Tooltip: "" +} + +DriftwoodCandle: { + DisplayName: Driftwood Candle + Tooltip: "" +} + +DriftwoodChair: { + DisplayName: Driftwood Chair + Tooltip: "" +} + +DriftwoodChandelier: { + DisplayName: Driftwood Chandelier + Tooltip: "" +} + +DriftwoodChest: { + DisplayName: Driftwood Chest + Tooltip: "" +} + +DriftwoodDoor: { + DisplayName: Driftwood Door + Tooltip: "" +} + +DriftwoodDresser: { + DisplayName: Driftwood Dresser + Tooltip: "" +} + +DriftwoodLamp: { + DisplayName: Driftwood Lamp + Tooltip: "" +} + +DriftwoodLantern: { + DisplayName: Driftwood Lantern + Tooltip: "" +} + +DriftwoodPlatform: { + DisplayName: Driftwood Platform + Tooltip: "" +} + +DriftwoodSink: { + DisplayName: Driftwood Sink + Tooltip: Counts as a water source +} + +DriftwoodSofa: { + DisplayName: Driftwood Sofa + Tooltip: "" +} + +DriftwoodSundial: { + DisplayName: Driftwood Sundial + Tooltip: "" +} + +DriftwoodTable: { + DisplayName: Driftwood Table + Tooltip: "" +} + +DriftwoodToilet: { + DisplayName: Driftwood Toilet + Tooltip: "" +} + +DriftwoodWorkBench: { + DisplayName: Driftwood Work Bench + Tooltip: "" +} + +AncientNavystoneBathtub: { + DisplayName: Ancient Navystone Bathtub + Tooltip: "" +} + +AncientNavystoneBed: { + DisplayName: Ancient Navystone Bed + Tooltip: "" +} + +AncientNavystoneBench: { + DisplayName: Ancient Navystone Bench + Tooltip: "" +} + +AncientNavystoneBookcase: { + DisplayName: Ancient Navystone Bookcase + Tooltip: "" +} + +AncientNavystoneCandelabra: { + DisplayName: Ancient Navystone Candelabra + Tooltip: "" +} + +AncientNavystoneCandle: { + DisplayName: Ancient Navystone Candle + Tooltip: "" +} + +AncientNavystoneChair: { + DisplayName: Ancient Navystone Chair + Tooltip: "" +} + +AncientNavystoneChandelier: { + DisplayName: Ancient Navystone Chandelier + Tooltip: "" +} + +AncientNavystoneChest: { + DisplayName: Ancient Navystone Chest + Tooltip: "" +} + +AncientNavystoneClock: { + DisplayName: Ancient Navystone Clock + Tooltip: "" +} + +AncientNavystoneDoor: { + DisplayName: Ancient Navystone Door + Tooltip: "" +} + +AncientNavystoneDresser: { + DisplayName: Ancient Navystone Dresser + Tooltip: "" +} + +AncientNavystoneLamp: { + DisplayName: Ancient Navystone Lamp + Tooltip: "" +} + +AncientNavystoneLantern: { + DisplayName: Ancient Navystone Lantern + Tooltip: "" +} + +AncientNavystonePiano: { + DisplayName: Ancient Navystone Piano + Tooltip: "" +} + +AncientNavystonePlatform: { + DisplayName: Ancient Navystone Platform + Tooltip: "" +} + +AncientNavystoneSink: { + DisplayName: Ancient Navystone Sink + Tooltip: Counts as a water source +} + +AncientNavystoneTable: { + DisplayName: Ancient Navystone Table + Tooltip: "" +} + +AncientNavystoneWorkBench: { + DisplayName: Ancient Navystone Work Bench + Tooltip: "" +} + AncientSmoothNavystone: { DisplayName: Ancient Smooth Navystone Tooltip: "" } -EutrophicBathtub: { - DisplayName: Eutrophic Bathtub +EutrophicShelf: { + DisplayName: Eutrophic Shelf Tooltip: "" } -EutrophicBed: { - DisplayName: Eutrophic Bed +NavystoneBathtub: { + DisplayName: Navystone Bathtub Tooltip: "" } -EutrophicBench: { - DisplayName: Eutrophic Bench +NavystoneBed: { + DisplayName: Navystone Bed Tooltip: "" } -EutrophicBookcase: { - DisplayName: Eutrophic Bookcase +NavystoneBookcase: { + DisplayName: Navystone Bookcase Tooltip: "" } -EutrophicCandelabra: { - DisplayName: Eutrophic Candelabra +NavystoneCandelabra: { + DisplayName: Navystone Candelabra Tooltip: "" } -EutrophicCandle: { - DisplayName: Eutrophic Candle +NavystoneCandle: { + DisplayName: Navystone Candle Tooltip: "" } -EutrophicChair: { - DisplayName: Eutrophic Chair +NavystoneChair: { + DisplayName: Navystone Chair Tooltip: "" } -EutrophicChandelier: { - DisplayName: Eutrophic Chandelier +NavystoneChandelier: { + DisplayName: Navystone Chandelier Tooltip: "" } -EutrophicChest: { - DisplayName: Eutrophic Chest +NavystoneChest: { + DisplayName: Navystone Chest Tooltip: "" } -EutrophicClock: { - DisplayName: Eutrophic Clock +NavystoneClock: { + DisplayName: Navystone Clock Tooltip: "" } -EutrophicDoor: { - DisplayName: Eutrophic Door +NavystoneDoor: { + DisplayName: Navystone Door Tooltip: "" } -EutrophicDresser: { - DisplayName: Eutrophic Dresser +NavystoneDresser: { + DisplayName: Navystone Dresser Tooltip: "" } -EutrophicLamp: { - DisplayName: Eutrophic Lamp +NavystoneLamp: { + DisplayName: Navystone Lamp Tooltip: "" } -EutrophicLantern: { - DisplayName: Eutrophic Lantern +NavystoneLantern: { + DisplayName: Navystone Lantern Tooltip: "" } -EutrophicPiano: { - DisplayName: Eutrophic Piano +NavystoneLyre: { + DisplayName: Navystone Lyre Tooltip: "" } -EutrophicPlatform: { - DisplayName: Eutrophic Platform +NavystonePlatform: { + DisplayName: Navystone Platform Tooltip: "" } -EutrophicSink: { - DisplayName: Eutrophic Sink +NavystoneSink: { + DisplayName: Navystone Sink Tooltip: Counts as a water source } -EutrophicTable: { - DisplayName: Eutrophic Table +NavystoneTable: { + DisplayName: Navystone Table Tooltip: "" } -EutrophicWorkBench: { - DisplayName: Eutrophic Work Bench +NavystoneToilet: { + DisplayName: Navystone Toilet + Tooltip: "" +} + +NavystoneTriclinium: { + DisplayName: Navystone Triclinium + Tooltip: "" +} + +NavystoneWorkBench: { + DisplayName: Navystone Work Bench Tooltip: "" } @@ -2248,6 +2435,11 @@ PolishedMarniteWall: { Tooltip: "" } +MonolithAmalgam: { + DisplayName: Monolith Amalgam + Tooltip: "" +} + MonolithBathtub: { DisplayName: Monolith Bathtub Tooltip: "" @@ -2792,6 +2984,11 @@ SacrilegiousWorkBench: { Tooltip: "" } +SilvaBasin: { + DisplayName: Silva Basin + Tooltip: "" +} + SilvaBathtub: { DisplayName: Silva Bathtub Tooltip: "" @@ -2892,6 +3089,11 @@ SilvaWorkBench: { Tooltip: "" } +StaticRefiner: { + DisplayName: Static Refiner + Tooltip: "" +} + StatigelBathtub: { DisplayName: Statigel Bathtub Tooltip: "" @@ -3202,6 +3404,16 @@ VoidWorkBench: { Tooltip: "" } +ChargedWulfrumEnergyBarrier: { + DisplayName: Charged Wulfrum Energy Barrier + Tooltip: "" +} + +ChargedWulfrumWallMountedBulb: { + DisplayName: Charged Wulfrum Wall Mounted Bulb + Tooltip: "" +} + WulfrumBathtub: { DisplayName: Wulfrum Bathtub Tooltip: "" @@ -3247,6 +3459,16 @@ WulfrumDresser: { Tooltip: "" } +WulfrumEnergyBarrier: { + DisplayName: Wulfrum Energy Barrier + Tooltip: "" +} + +WulfrumLabstationItem: { + DisplayName: Wulfrum Labstation + Tooltip: "" +} + WulfrumLamp: { DisplayName: Wulfrum Lamp Tooltip: "" @@ -3257,19 +3479,39 @@ WulfrumLantern: { Tooltip: "" } +WulfrumPanels: { + DisplayName: Wulfrum Panels + Tooltip: "" +} + WulfrumPiano: { DisplayName: Wulfrum Piano Tooltip: "" } +WulfrumPlatform: { + DisplayName: Wulfrum Platform + Tooltip: "" +} + WulfrumPlating: { DisplayName: Wulfrum Plating Tooltip: "" } +WulfrumSheets: { + DisplayName: Wulfrum Sheets + Tooltip: "" +} + +WulfrumSiding: { + DisplayName: Wulfrum Siding + Tooltip: "" +} + WulfrumSink: { DisplayName: Wulfrum Sink - Tooltip: "" + Tooltip: Counts as a water source } WulfrumSofa: { @@ -3287,11 +3529,121 @@ WulfrumToilet: { Tooltip: "" } +WulfrumWallMountedBulb: { + DisplayName: Wulfrum Wall Mounted Bulb + Tooltip: "" +} + WulfrumWorkBench: { DisplayName: Wulfrum Work Bench Tooltip: "" } +AnodizedWulfrumBathtub: { + DisplayName: Anodized Wulfrum Bathtub + Tooltip: "" +} + +AnodizedWulfrumBookcase: { + DisplayName: Anodized Wulfrum Bookcase + Tooltip: "" +} + +AnodizedWulfrumChair: { + DisplayName: Anodized Wulfrum Chair + Tooltip: "" +} + +AnodizedWulfrumChandelier: { + DisplayName: Anodized Wulfrum Chandelier + Tooltip: "" +} + +AnodizedWulfrumChest: { + DisplayName: Anodized Wulfrum Chest + Tooltip: "" +} + +AnodizedWulfrumDeskLight: { + DisplayName: Anodized Wulfrum Desk Light + Tooltip: "" +} + +AnodizedWulfrumDoor: { + DisplayName: Anodized Wulfrum Door + Tooltip: "" +} + +AnodizedWulfrumDresser: { + DisplayName: Anodized Wulfrum Dresser + Tooltip: "" +} + +AnodizedWulfrumJukebox: { + DisplayName: Anodized Wulfrum Jukebox + Tooltip: "" +} + +AnodizedWulfrumLamp: { + DisplayName: Anodized Wulfrum Lamp + Tooltip: "" +} + +AnodizedWulfrumLantern: { + DisplayName: Anodized Wulfrum Lantern + Tooltip: "" +} + +AnodizedWulfrumPanels: { + DisplayName: Anodized Wulfrum Panels + Tooltip: "" +} + +AnodizedWulfrumPlatform: { + DisplayName: Anodized Wulfrum Platform + Tooltip: "" +} + +AnodizedWulfrumSink: { + DisplayName: Anodized Wulfrum Sink + Tooltip: Counts as a water source +} + +AnodizedWulfrumSleepingPod: { + DisplayName: Anodized Wulfrum Sleeping Pod + Tooltip: "" +} + +AnodizedWulfrumSofa: { + DisplayName: Anodized Wulfrum Sofa + Tooltip: "" +} + +AnodizedWulfrumTable: { + DisplayName: Anodized Wulfrum Table + Tooltip: "" +} + +AnodizedWulfrumTrim: { + DisplayName: Anodized Wulfrum Trim + Tooltip: "" +} + +AnodizedWulfrumToilet: { + DisplayName: Anodized Wulfrum Toilet + Tooltip: "" +} + +AnodizedWulfrumWorkBench: { + DisplayName: Anodized Wulfrum Work Bench + Tooltip: "" +} + +RoundedAnodizedWulfrumPanels: { + DisplayName: Rounded Anodized Wulfrum Panels + Tooltip: "" +} + HardenedAstralSand: { DisplayName: Hardened Astral Sand Tooltip: "" @@ -3511,6 +3863,11 @@ Driftwood: { Tooltip: "" } +Dunesand: { + DisplayName: Dunesand + Tooltip: "" +} + Navystone: { DisplayName: Navystone Tooltip: "" @@ -3598,6 +3955,11 @@ VolcanicSand: { // End of Sunken Sea +Dreadstone: { + DisplayName: Dreadstone + Tooltip: "" +} + UelibloomBrick: { DisplayName: Uelibloom Brick Tooltip: "" @@ -3628,6 +3990,11 @@ AerialiteBrickWall: { Tooltip: "" } +AncientSmoothNavystoneWall: { + DisplayName: Ancient Smooth Navystone Wall + Tooltip: "" +} + AshenSlabWall: { DisplayName: Ashen Slab Wall Tooltip: "" @@ -3747,6 +4114,16 @@ RustedPlatingWall: { // End of Draedon +AnodizedWulfrumTrimWall: { + DisplayName: Anodized Wulfrum Trim Wall + Tooltip: "" +} + +ChargedWulfrumEnergyBarrierWall: { + DisplayName: Charged Wulfrum Energy Barrier Wall + Tooltip: "" +} + DriftwoodWall: { DisplayName: Driftwood Wall Tooltip: "" @@ -3757,6 +4134,11 @@ ElumplateWall: { Tooltip: "" } +EutrophicGlassWall: { + DisplayName: Eutrophic Glass Wall + Tooltip: "" +} + EutrophicSandWall: { DisplayName: Unsafe Eutrophic Sand Wall Tooltip: "" @@ -3797,6 +4179,11 @@ HavocplateWall: { Tooltip: "" } +LimestoneWall: { + DisplayName: Limestone Wall + Tooltip: "" +} + NavyplateWall: { DisplayName: Navyplate Wall Tooltip: "" @@ -3862,6 +4249,16 @@ PyreMantleWall: { Tooltip: "" } +RoundedAnodizedWulfrumPanelWall: { + DisplayName: Rounded Anodized Wulfrum Panel Wall + Tooltip: "" +} + +RunestoneWall: { + DisplayName: Runestone Wall + Tooltip: "" +} + RunicProfanedBrickWall: { DisplayName: Runic Profaned Brick Wall Tooltip: "" @@ -3952,11 +4349,41 @@ VoidstoneWall: { Tooltip: "" } +WulfrumComplexPanelWall: { + DisplayName: Wulfrum Complex Panel Wall + Tooltip: "" +} + +WulfrumEnergyBarrierWall: { + DisplayName: Wulfrum Energy Barrier Wall + Tooltip: "" +} + +WulfrumPanelWall: { + DisplayName: Wulfrum Panel Wall + Tooltip: "" +} + +WulfrumPillar: { + DisplayName: Wulfrum Pillar + Tooltip: "" +} + WulfrumPlatingWall: { DisplayName: Wulfrum Plating Wall Tooltip: "" } +WulfrumSheetWall: { + DisplayName: Wulfrum Sheet Wall + Tooltip: "" +} + +WulfrumSidingWall: { + DisplayName: Wulfrum Siding Wall + Tooltip: "" +} + FireTurret: { DisplayName: Fire Turret Tooltip: @@ -4197,140 +4624,22 @@ MiniAgedFloodlightItem: { Tooltip: "" } -ProbesnoutBanner.DisplayName: Probesnout Banner -SharkoonBanner.DisplayName: Sharkoon Banner - -LimestoneWall: { - DisplayName: Limestone Wall +AridSoil: { + DisplayName: Arid Soil Tooltip: "" } -RunestoneWall: { - DisplayName: Runestone Wall +RunestoneTerracotta: { + DisplayName: Runestone Terracotta Tooltip: "" } -WulfrumEnergyBarrier: { - DisplayName: Wulfrum Energy Barrier +ShellTrimBrick: { + DisplayName: Shell Trim Brick Tooltip: "" } -WulfrumPanels: { - DisplayName: Wulfrum Panels - Tooltip: "" -} - -ChargedWulfrumEnergyBarrier: { - DisplayName: Charged Wulfrum Energy Barrier - Tooltip: "" -} - -WulfrumEnergyBarrierWall: { - DisplayName: Wulfrum Energy Barrier Wall - Tooltip: "" -} - -ChargedWulfrumEnergyBarrierWall: { - DisplayName: Charged Wulfrum Energy Barrier Wall - Tooltip: "" -} - -WulfrumPlatform: { - DisplayName: Wulfrum Platform - Tooltip: "" -} - -WulfrumSheets: { - DisplayName: Wulfrum Sheets - Tooltip: "" -} - -WulfrumSiding: { - DisplayName: Wulfrum Siding - Tooltip: "" -} - -WulfrumPillar: { - DisplayName: Wulfrum Pillar - Tooltip: "" -} - -WulfrumComplexPanelWall: { - DisplayName: Wulfrum Complex Panel Wall - Tooltip: "" -} - -AnodizedWulfrumPlatform: { - DisplayName: Anodized Wulfrum Platform - Tooltip: "" -} - -AnodizedWulfrumTrim: { - DisplayName: Anodized Wulfrum Trim - Tooltip: "" -} - -RoundedAnodizedWulfrumPanels: { - DisplayName: Rounded Anodized Wulfrum Panels - Tooltip: "" -} - -AnodizedWulfrumTrimWall: { - DisplayName: Anodized Wulfrum Trim Wall - Tooltip: "" -} - -RoundedAnodizedWulfrumPanelWall: { - DisplayName: Rounded Anodized Wulfrum Panel Wall - Tooltip: "" -} - -AnodizedWulfrumPanels: { - DisplayName: Anodized Wulfrum Panels - Tooltip: "" -} - -WulfrumPanelWall: { - DisplayName: Wulfrum Panel Wall - Tooltip: "" -} - -ChargedWulfrumWallMountedBulb: { - DisplayName: Mods.CalamityMod.Items.Placeables.ChargedWulfrumWallMountedBulb.DisplayName - Tooltip: "" -} - -WulfrumWallMountedBulb: { - DisplayName: Mods.CalamityMod.Items.Placeables.WulfrumWallMountedBulb.DisplayName - Tooltip: "" -} - -WulfrumSheetWall: { - DisplayName: Wulfrum Sheet Wall - Tooltip: "" -} - -WulfrumSidingWall: { - DisplayName: Wulfrum Siding Wall - Tooltip: "" -} - -Dunesand: { - DisplayName: Dunesand - Tooltip: "" -} - -EutrophicGlassWall: { - DisplayName: Eutrophic Glass Wall - Tooltip: "" -} - -Dreadstone: { - DisplayName: Dreadstone - Tooltip: "" -} - -OldDukeMonolith: { - DisplayName: Elden Diorama +ShellTrimBrickWall: { + DisplayName: Shell Trim Brick Wall Tooltip: "" } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson index 7b35e3cf51..1083e38f93 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Tools.hjson @@ -111,7 +111,7 @@ DriftwoodPickaxe: { FellerofEvergreens: { DisplayName: Feller of Evergreens - Tooltip: "" + Tooltip: Occasionally drops extra fruits from shaking trees } Gelpick: { diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson index 9c176472a5..a1ee116328 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.DraedonsArsenal.hjson @@ -10,6 +10,29 @@ AerialTracker: { ''' } +Auger: { + DisplayName: P-GSS: Auger + Tooltip: + ''' + A wrist-mounted device which emits a magnetic energy blade + to create a brief magnetic pull at your cursor and amplify your next slash + [c/1FFBFF:'Initially manufactured to serrate and separate chunks of raw material for transport.] + [c/1FFBFF:Keeping both hands free without compromising on power made it exceptionally ergonomic.'] + ''' +} + +CountermeasureMitt: { + DisplayName: B-LSR: Countermeasure Mitt + Tooltip: + ''' + A precision welding glove with laser emitters in each fingertip + to focus all emitters into a short range palm blast that always critically strikes + Palm blasts have a cooldown which is significantly shorter if they miss + [c/1FFBFF:'Most battalions prefer to either spread attacks widely, or focus on a singular target.] + [c/1FFBFF:This glove caters to both, though it will never bridge the gap between their strategies.'] + ''' +} + GalvanizingGlaive: { DisplayName: Galvanizing Glaive Tooltip: @@ -21,15 +44,6 @@ GalvanizingGlaive: { ''' } -GatlingLaser: { - DisplayName: Gatling Laser - Tooltip: - ''' - Fires a rapid barrage of accelerated lasers to annihilate foes - [c/1FFBFF:'Developed to be used primarily by Yharim's fleet and base defense force.'] - ''' -} - GaussDagger: { DisplayName: Gauss Dagger Tooltip: @@ -39,18 +53,8 @@ GaussDagger: { ''' } -GaussPistol: { - DisplayName: Gauss Pistol - Tooltip: - ''' - Fires a devastating high-velocity blast with extreme knockback - [c/1FFBFF:'Though this arcane pistol may seem mundane, it is deceivingly powerful.] - [c/1FFBFF:One of the many advantages of magical firearms is that size does not equal power.'] - ''' -} - -HolofiberImmolator: { - DisplayName: R-PMA: Holofiber Immolator +HolofibreImmolator: { + DisplayName: R-PMA: Holofibre Immolator Tooltip: ''' Fires three gravity-affected plasma drops which dissolve through foes @@ -265,3 +269,16 @@ WavePounder: { Stealth strikes emit absurdly powerful shockwaves ''' } + +Vulcan: { + DisplayName: R-GSS: Vulcan + Tooltip: + ''' + A mana-fueled Gatling cannon that fires in bursts + Press to launch a magnetic harpoon which attracts your shots + Launching a harpoon makes burst fire mode last longer + When a harpoon expires, all magnetized shots launch at nearby enemies with increased damage + [c/1FFBFF:'Originally a ceiling mounted mining beam, the removal of its battery reduced its heft only marginally.] + [c/1FFBFF:It saw little use and many complaints from the battlemage corps.'] + ''' +} diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Magic.hjson index 427c9585ef..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: ''' @@ -246,7 +247,7 @@ DeathValleyDuster: { ''' Casts an enchanted blast of sand that passes through enemies and tiles Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the Sand's Wind Buff - The Sand's Wind Buff increases your defense by 10 and damage by 12% + The Sand's Wind Buff increases your defense by 10, damage by 12%, and greatly buffs mana regen ''' } @@ -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' ''' } @@ -654,7 +656,7 @@ PrimordialAncient: { ''' Casts five primordial sand blasts that converge at your cursor after a moment and create a giant explosion Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.AeolianEarthBuff.DisplayName} buff - The {$Buffs.AeolianEarthBuff.DisplayName} buff increases your damage reduction by {0}% and damage by {1}% + The {$Buffs.AeolianEarthBuff.DisplayName} buff increases your damage reduction by {0}%, damage by {1}%, and massively buffs mana regen ''' } @@ -664,7 +666,7 @@ PrimordialEarth: { ''' Casts two enchanted blasts of sand that coverge with each other and explode Casting this spell at max mana while without mana sickness will cause it to give you and any player it hits the {$Buffs.SandsWindBuff.DisplayName} buff - The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0} and damage by {1}% + The {$Buffs.SandsWindBuff.DisplayName} buff increases your defense by {0}, damage by {1}%, and greatly buffs mana regen ''' } @@ -784,7 +786,7 @@ SHPC: { Orbs emit seeking souls and lingering pickup souls after collapse Orbs have varying effects depending on Soul type used {0} - Press Right Click to use the machine as a vacuum, pulling in lingering souls + Press to use the machine as a vacuum, pulling in lingering souls Once released, a torrent of soul lasers is discharged scaling with the number of souls pulled in ''' // These are the soul effect descriptions, the number is the item ID of the soul diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 223e79060f..eefde30e9b 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -84,7 +84,7 @@ ArkoftheCosmos: { to snip out the scissor blades in front of you Hitting an enemy with it will parry them, granting you brief invulnerability You can also parry projectiles to make them deal 160 less damage for a short period - Parrying will empower the next 15 swings of the sword + Parrying will empower the next 16 swings of the sword ''' BlastInfo: Double with charges available to cause a Big Rip in spacetime and consume all charges } @@ -185,12 +185,7 @@ BladecrestOathsword: { BlightedCleaver: { DisplayName: Blighted Cleaver - Tooltip: - ''' - Fires homing blazing blades - Gives the player the Brutal Carnage buff on enemy hits - This buff increases melee damage by 20% - ''' + Tooltip: Fires homing blazing blades } Bonebreaker: { @@ -334,12 +329,7 @@ DeathsAscension: { DefiledGreatsword: { DisplayName: Defiled Greatsword - Tooltip: - ''' - Fires blazing, hyper, and sunlight blades - Gives the player the Brutal Carnage buff on enemy hits - This buff increases melee damage by 20% - ''' + Tooltip: Fires blazing, hyper, and sunlight blades } DepthCrusher: { @@ -695,7 +685,11 @@ GrandGuardian: { GreatswordofJudgement: { DisplayName: Greatsword of Judgement - Tooltip: Fires a piercing energy wave that releases homing stars as it flies + Tooltip: + ''' + Fires a piercing energy wave that releases homing stars as it flies + Hits with the blade summon two stronger stars from behind you + ''' } Greentide: { @@ -768,16 +762,6 @@ InsidiousImpaler: { ''' } -IridescentExcalibur: { - DisplayName: Iridescent Excalibur - Tooltip: - ''' - True melee strikes freeze enemies - Fires rainbow beams that change their behavior based on their color - Press for true melee - ''' -} - Lacerator: { DisplayName: Lacerator Tooltip: @@ -924,7 +908,7 @@ OldLordClaymore: { HoldShiftTooltip: ''' [c/df4420:A gift to outstanding Demons, a replica of the sword used by the greatest of all Demon Lords.] - [c/df4420:The prosperity he brought to their kind is unmatched even now that they alone rule the Undeworld.] + [c/df4420:The prosperity he brought to their kind is unmatched even now that they alone rule the Underworld.] ''' } @@ -958,7 +942,6 @@ Orderbringer: { Tooltip: ''' Fires piercing energy waves and summons four homing stars near your cursor - Energy waves deal more damage with each consecutive hit Hits with the blade summon two beams from the sky 'No matter where you may be you are never alone' ''' diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson index 319dace1d7..021008f3c8 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Ranged.hjson @@ -282,7 +282,7 @@ ClockworkBow: { DisplayName: Clockwork Bow Tooltip: ''' - Hold left click to load up to six precision bolts + Hold to load up to six precision bolts The more precision bolts are loaded, the harder they hit ''' } @@ -453,9 +453,11 @@ FirestormCannon: { DisplayName: Firestorm Cannon Tooltip: ''' - Releases a constant stream of weaponized flares - Press to fire a condensed spread of flares + Fires a rapid barrage of flares that builds up a searing heat in the weapon + Firing for too long overheats the weapon, leaving it unusable for a short period + Press to put away the weapon, which preserves its heat 70% chance to save ammo + 'What could go wrong?' ''' } @@ -557,7 +559,7 @@ HalleysInferno: { Press to zoom out Uses gel for ammo 50% chance to save ammo - 'Halley came sooner than expected' + 'Halley arrived sooner than expected' ''' } @@ -936,7 +938,7 @@ PolarisParrotfish: { ''' Rapidly fires an array of colorful star shots Firing speed increases the closer you are to an enemy - Right click to give the little girl some attention + to give the little girl some attention 'She is a happy girl' ''' } @@ -1154,8 +1156,13 @@ SpectralstormCannon: { DisplayName: Spectralstorm Cannon Tooltip: ''' - Fires a storm of lost souls and flares + Fires a barrage of spectral flares that builds up a searing heat in the weapon + While cooling down, heat-seeking phantoms are continuously released + Firing for too long overheats the weapon, leaving it unusable for a short period + However, triggering overheat releases a powerful burst of souls and resets heat + Press to put away the weapon, which preserves its heat 70% chance to save ammo + 'Ectoplasmic blast rated visor mandatory' ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson index 2037158363..4fe952f5bc 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Rogue.hjson @@ -195,7 +195,7 @@ CrushsawCrasher: { Tooltip: ''' Throws bouncing axes - Stealth strikes throw five at once + Stealth strikes throw six at once ''' GFBFirstWords: ''' @@ -276,8 +276,8 @@ DeepWounder: { DisplayName: Deep Wounder Tooltip: ''' - Throws an abyssal hatchet that inflicts Armor Crunch and Crush Depth to the enemies it hits - Stealth strikes cause the hatchet to stick to struck enemies, causing Heavy Bleeding and spawning a burst of water projectiles + Throws an abyssal hatchet that inflicts Heavy Bleeding and Crush Depth to the enemies it hits + Stealth strikes cause the hatchet to stick to struck enemies, releasing a barrage of water projectiles Water projectiles launch at the closest enemy after a brief delay ''' } @@ -449,7 +449,6 @@ FrostcrushValari: { ''' Fires a long ranged frosty boomerang that chips off homing icicles on hit Stealth strikes throw a boomerang which follows the cursor - This boomerang creates a freezing blast and chips off homing icicles on every hit ''' } @@ -458,7 +457,7 @@ FrostyFlare: { Tooltip: ''' Throw a flare that sticks to enemies and rains a hailstorm on them - Stealth strikes trail snowflakes and summon phantom copies instead of ice shards + Stealth strikes summon phantom copies instead of ice shards 'Do not insert in flare gun' ''' } @@ -556,7 +555,7 @@ HeavenfallenStardisk: { ''' Throws a stardisk upwards which then launches itself towards your mouse cursor Explodes into a star of astral bolts on hit - Stealth strikes throw three disks that rain astral energy bolts from the sky + Stealth strikes rain astral energy bolts from the sky ''' } @@ -600,8 +599,8 @@ InfernalKris: { DisplayName: Infernal Kris Tooltip: ''' - Throws a burning dagger that starts spinning after travelling a short distance, inflicting additional damage while spinning - Stealth strikes cause the dagger to be engulfed in flames, exploding on contact with walls and enemies + Rapidly throws burning daggers + Stealth strikes engulf the dagger in flames, exploding when hitting walls and enemies ''' } @@ -677,7 +676,7 @@ LeviathanTeeth: { ''' Rapidly throws a spread of teeth that stick into enemies After sticking to an enemy, the teeth will gouge through them and shoot out the other side - Stealth strikes throw a single piercing tooth that creates a jawline of teeth to maul your foes + Stealth strikes create a clamping jaw of teeth to maul your foes ''' } @@ -1392,7 +1391,8 @@ WulfrumKnife: { DisplayName: Wulfrum Knife Tooltip: ''' - Fires wulfrum knives in bursts of 3 + Fires wulfrum knives in bursts of 3 that stick in enemies Stealth strikes make the knife fly further and hit several times at once + to magnetize all stuck knives back to you, restoring stealth ''' } diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson index 571c8256a9..bca33b7c0a 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Summon.hjson @@ -51,7 +51,7 @@ AtlasMunitionsBeacon: { [c/F27049:If an enemy is in close proximity, it will enter Overdrive] [c/F27049:When in Overdrive the cannon uses its full power to bring down any foe] [c/F27049:While in Overdrive, the cannon will build up heat, eventually overheating] - [c/69F0DC:Press right click while holding this item to pick up the cannon and use it yourself] + [c/69F0DC:Press while holding this item to pick up the cannon and use it yourself] [c/69F0DC:When held, the cannon will always be in Overdrive] [c/69F0DC:If the cannon overheats while you hold it, you will be forced to drop it] [c/9AA4AE:Pressing allows you to drop it manually] @@ -91,7 +91,7 @@ BrittleStarStaff: { ''' Summons a small brittle starfish that will dash through enemies until it shatters Starfish will quickly regenerate after shattering - Holding right click will swap starfish between dashing and circling you + Holding will swap starfish between dashing and circling you When the starfish are circling, each one provides you with 4 defense ''' } @@ -364,7 +364,7 @@ FlamsteedRing: { Tooltip: ''' Summons a colossal controllable mech - Right click to display the mech's control panel + to display the mech's control panel The panel has 3 configurations, selected using the brackets on the edges of the UI Each bracket powers 2 out of 3 possible functions, represented by the circular icons The bottom left icon miniaturizes the mech to the size of a player, but weakens its weapons @@ -435,7 +435,7 @@ GlacialEmbrace: { For each minion slot used, you will gain an additional orbiting shield spike These spikes accelerate rapidly towards a nearby enemy to inflict heavy damage They take some time to regenerate after launching themselves at the target, however - On right click, summons a duplicate ring around the targeted enemy, which slowly converges before exploding + On , summons a duplicate ring around the targeted enemy, which slowly converges before exploding ''' } @@ -485,7 +485,7 @@ IgneousExaltation: { Tooltip: ''' Summons an Igneous blade that orbits around you - Right click to launch all blades towards the cursor + to launch all blades towards the cursor ''' } @@ -591,7 +591,7 @@ Perdition: { ''' {$CommonItemTooltip.Sentry} Summons a beacon at the position of the mouse - When a target is manually selected via right click it releases torrents of souls from below onto the target + When a target is manually selected via it releases torrents of souls from below onto the target Requires one sentry slot to summon, and only one beacon may exist at a time ''' } @@ -866,7 +866,7 @@ VoidConcentrationStaff: { Minion damage is increased by 5% while the aura is active Requires three minion slots to use There can only be one aura at a time - Right click to launch a black hole that grows in size + to launch a black hole that grows in size ''' } @@ -893,7 +893,7 @@ WulfrumController: { Tooltip: ''' Summons a wulfrum droid to fight for you - Hold right click while holding the remote to switch all of your drones into supercharge mode + Hold while holding the remote to switch all of your drones between regular and supercharge mode Supercharged droids will stop attacking and focus wulfrum energy onto you Supercharged droids provide +0.5 HP/s life regen and 3 defense per droid Can also be used to heal other players by keeping your mouse cursor close enough to them diff --git a/Localization/en-US/Mods.CalamityMod.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Misc.hjson index 9ba745308c..6ca2aa511e 100644 --- a/Localization/en-US/Mods.CalamityMod.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Misc.hjson @@ -3,14 +3,11 @@ RecipeGroup: { HardmodeAnvil: "{$LegacyMisc.37} Hardmode Anvil" HardmodeForge: "{$LegacyMisc.37} Hardmode Forge" - AnyLargeGem: "{$LegacyMisc.37} Large Gem" AnyFood: "{$LegacyMisc.37} Food Item" AnyEvilBar: "{$LegacyMisc.37} Evil Bar" - AnyEvilPowder: "{$LegacyMisc.37} Evil Powder" Boss2Material: Shadow Scale or Tissue Sample CursedFlameIchor: Cursed Flame or Ichor AnyEvilWater: "{$LegacyMisc.37} Evil Water" - AnyEvilFlask: "{$LegacyMisc.37} Evil Flask" AnyEvilBlock: "{$LegacyMisc.37} Evil Block" AnyGoodBlock: "{$LegacyMisc.37} Good Block" LunarPickaxe: "{$LegacyMisc.37} Lunar Pickaxe" @@ -43,7 +40,7 @@ Tier3KnowledgeTooltip: The Jungle schematic must be deciphered first Tier4KnowledgeTooltip: The Underworld schematic must be deciphered first Tier5KnowledgeTooltip: The Ice biome schematic must be deciphered first // Other CombatText uses and Item Messages -ShiftToExpand: Hold SHIFT to see an expanded description +ShiftToExpand: Hold Shift to see an expanded description LearnedSchematic: You learned how to create new things! CragmawVibeCheck: Vibe check. AutocannonHot: OUCH! HOT! diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index ca33d6a044..96f1f31200 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -147,7 +147,6 @@ AeroSlime.DisplayName: Aero Slime ArmoredDiggerHead.DisplayName: Armored Digger MechanizedSerpent: Mechanized Serpent AuroraSpirit.DisplayName: Aurora Spirit -BloodlettingServant.DisplayName: Bloodletting Servant BloomSlime.DisplayName: Bloom Slime Bohldohr.DisplayName: Bohldohr BucketZombie.DisplayName: "{$NPCName.Zombie}" @@ -168,7 +167,6 @@ CryoSlime.DisplayName: Cryo Slime EbonianBlightSlime.DisplayName: Ebonian Blight Slime Eidolist.DisplayName: Eidolist FearlessGoldfishWarrior.DisplayName: Fearless Goldfish Warrior -Foveanator.DisplayName: Foveanator Frogfish.DisplayName: Frogfish Horse.DisplayName: Earth Elemental IceClasper.DisplayName: Ice Clasper @@ -189,12 +187,6 @@ Rotdog.DisplayName: Rotdog ScornEater.DisplayName: Scorn Eater ShockstormShuttle.DisplayName: Shockstorm Shuttle Shroomble.DisplayName: Shroomble -SkeletronOmega.DisplayName: Skeletron Omega -OmegaSaw.DisplayName: Omega Saw -OmegaLaser.DisplayName: Omega Laser -SkeletronPrime2.DisplayName: Skeletron Alpha -AlphaVice.DisplayName: Alpha Vice -AlphaCannon.DisplayName: Alpha Cannon Stormlion.DisplayName: Stormlion StormlionSentry.DisplayName: Stormlion Sentry Sunskater.DisplayName: Sunskater @@ -568,3 +560,7 @@ SeaKing: { Princess_LovesNPC: "{NPCName} always smiles when I'm nearby, I like being around him just for that!" } } + +WildBumblebirb.DisplayName: Wild Bumblebirb +DraconicSwarmer.DisplayName: Draconic Swarmer +Dragonfolly.DisplayName: Dragonfolly diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson index 7947c1ccf2..b68715df12 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Boss.hjson @@ -63,9 +63,6 @@ FlareBomb.DisplayName: Flare Bomb FlareDust.DisplayName: Flare Dust FlareDust2.DisplayName: Flare Bomb Flarenado.DisplayName: Flarenado -FoveanatorEnergyBomb.DisplayName: Nebulous Energy Bomb -FoveanatorLaser.DisplayName: Nebulous Laser -FoveanatorFlamethrower.DisplayName: Nebulous Flames FrostMist.DisplayName: Frost Mist GooglyEye.DisplayName: Googly Eye GreatSandBlast.DisplayName: Great Sand Blast diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson index 211c3eb65d..e8077f1f00 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Healing.hjson @@ -1,5 +1,6 @@ AbsorberAura.DisplayName: Absorber Aura AltTransfusionTrail.DisplayName: Alt Transfusion Trail +BloodstoneHealOrb.DisplayName: Bloodstone Heal Orb BlueJellyAura.DisplayName: Blue Jelly Aura BurntSiennaProj.DisplayName: Sienna CactusHealOrb.DisplayName: Heal @@ -10,13 +11,9 @@ FungalHeal.DisplayName: Heal GladiatorHealOrb.DisplayName: Heal GreenJellyAura.DisplayName: Green Jelly Aura HydrothermicHealOrb.DisplayName: Hydrothermic Rejuvenation -IridescentExcaliburHeal.DisplayName: Iridescent Excalibur Heal ManaPolarizerHealOrb.DisplayName: Mana Polarizer Heal Orb PhantomicHeart.DisplayName: Phantomic Heart PinkJellyAura.DisplayName: Pink Jelly Aura -ReaverHealOrb.DisplayName: Reaver Heal Orb RoyalHeal.DisplayName: Heal ShinobiHealOrb.DisplayName: Blue Healing Orb -SilvaOrb.DisplayName: Silva Orb TransfusionTrail.DisplayName: Heal -BloodstoneHealOrb.DisplayName: Bloodstone Heal Orb diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson index c3c7de4c15..16d495a2de 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Magic.hjson @@ -214,8 +214,8 @@ SpiritDust.DisplayName: Spirit Dust Starblast.DisplayName: Star StardustElementalBeam.DisplayName: Stardust Beam StickyFeather.DisplayName: Feather -SylveBolt.DisplayName: Sylv Bolt -SylveRay.DisplayName: Sylv Ray +SylvBolt.DisplayName: Sylv Bolt +SylvRay.DisplayName: Sylv Ray TacticiansElectricBoom.DisplayName: Electric Explosion TacticiansTrumpCardProj.DisplayName: Trump Beam TearsofHeavenProjectile.DisplayName: Tears of Heaven @@ -261,5 +261,3 @@ WyvernFeatherPurple.DisplayName: Feather WyvernProjectile.DisplayName: Wyvern YharimsCrystalBeam.DisplayName: Yharim's Beam YharimsCrystalPrism.DisplayName: Yermes Christal -SylvBolt.DisplayName: Sylv Bolt -SylvRay.DisplayName: Sylv Ray diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson index fcf84f80e5..53e09e1f92 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Melee.hjson @@ -154,9 +154,6 @@ HolyColliderHolyFire.DisplayName: Holy Collider Fire IceBombFriendly.DisplayName: Ice Bomb IllustriousKnife.DisplayName: Illustrious Knife InsidiousHarpoon.DisplayName: Insidious Harpoon -IridescentExcaliburSlash.DisplayName: Iridescent Excalibur Slash -IridescentExcaliburSlash2.DisplayName: Iridescent Excalibur Slash -IridescentExcaliburSlash3.DisplayName: Iridescent Excalibur Slash JudgementProj.DisplayName: JUDGEMENT LamentationsOfTheChained.DisplayName: Lamentations of the Chained LaserFountain.DisplayName: Laser Fountain @@ -237,6 +234,7 @@ StarburstBeam.DisplayName: Star Shiv StarburstSHIV.DisplayName: SHIV StarnightBeam.DisplayName: Starnight Beam StarofJudgement.DisplayName: Star of Judgement +StarofOrder.DisplayName: Star of Order StellarContemptBlast.DisplayName: Stellar Blast StellarContemptEcho.DisplayName: Echoes of Contempt StellarContemptHammer.DisplayName: Stellar Contempt diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson index a72179f460..9dc5d84ee5 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Misc.hjson @@ -8,7 +8,10 @@ AnomalysNanogunHoldout.DisplayName: The Anomaly's Nanogun AnomalysNanogunMPFBBoom.DisplayName: MPFB Explosion AnomalysNanogunMPFBDevastator.DisplayName: MPFB Devastator AnomalysNanogunPlasmaBeam.DisplayName: Plasma Beam -GatlingLaserShot.DisplayName: Gatling Laser +AugerHoldout.DisplayName: P-GSS Auger +AugerSlash.DisplayName: Auger Slash +AugerPull.DisplayName: Auger Pull +CountermeasurePalmBlast.DisplayName: Palm Blast GaussEnergy.DisplayName: Gauss Energy GaussFlux.DisplayName: Gauss Flux GaussPistolShot.DisplayName: Gauss Shot @@ -46,6 +49,8 @@ SystemBaneProjectile.DisplayName: System Bane TeslaCannonShot.DisplayName: Tesla Beam UnstableMatter.DisplayName: Unstable Matter VoltageStream.DisplayName: Voltage Stream +VulcanProjectile.DisplayName: Vulcan Shot +VulcanSpear.DisplayName: Vulcanite Lance WavePounderBoom.DisplayName: Explosion WavePounderProjectile.DisplayName: Wave Pounder // Environmental diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson index 5533381a9d..c6be216f3d 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Ranged.hjson @@ -206,6 +206,7 @@ SicknessRound2.DisplayName: Round SlagRound.DisplayName: Slag Round SlimeBolt.DisplayName: Slime Bolt SparkSpreaderFire.DisplayName: Sparked Flames +SpectralFlare.DisplayName: Spectral Flare SpeedBlasterShot.DisplayName: Splatter Shot SporeBomb.DisplayName: Spore Bomb SproutingArrowMain.DisplayName: Sprouting Arrow diff --git a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson index 5328e2d17b..652d0084ee 100644 --- a/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson +++ b/Localization/en-US/Mods.CalamityMod.Projectiles.Rogue.hjson @@ -158,6 +158,7 @@ LeonidCometSmall.DisplayName: Leonid Comet LeonidProgenitorBombshell.DisplayName: Leonid Bombshell LeonidStar.DisplayName: Leonid Star LeviathanTooth.DisplayName: Leviathan Tooth +LeviathanToothStealth.DisplayName: Leviathan Jaw LionfishProj.DisplayName: Lionfish LostSoulFriendly.DisplayName: Lost Soul LuminousShard.DisplayName: Stardust Shard diff --git a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson index 474e9bf5e0..7fda7a31b1 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Boss.hjson @@ -3,9 +3,6 @@ SlimeGodRun: The Slime God flees to fight another day... // Cryogen CryogenBossText: Cryogen is derping out! PyrogenBossText: Pyrogen is derping out! -// Triplets -TripletsBossText: The Triplets have awoken! -TripletsDefeatName: The Triplets // Calamitas Clone CalamitasBossText: You underestimate my power... CalamitasBossText2: Rise again, my siblings. diff --git a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson index 60f47f43c5..693d421595 100644 --- a/Localization/en-US/Mods.CalamityMod.Status.Death.hjson +++ b/Localization/en-US/Mods.CalamityMod.Status.Death.hjson @@ -61,6 +61,7 @@ Dragonfire4: This was a fight {0} could not win. ElementalMix1: "{0} was reduced to technicolor confetti." ElementalMix2: "{0} was blasted apart by a harmonized elemental onslaught." ElementalMix3: "{0} was overwhelmed by elemental turbulence." +FlareGunOverheat: "{0}'s gun was simply too hot to handle." GodSlayerInferno1: "{0} imploded into nothingness." GodSlayerInferno2: "{0}'s body slipped into oblivion." GodSlayerInferno3: "{0} ceased being a part of our universe." diff --git a/Localization/en-US/Mods.CalamityMod.Tiles.hjson b/Localization/en-US/Mods.CalamityMod.Tiles.hjson index 32316202fc..a88b068345 100644 --- a/Localization/en-US/Mods.CalamityMod.Tiles.hjson +++ b/Localization/en-US/Mods.CalamityMod.Tiles.hjson @@ -9,6 +9,8 @@ PirateCrate: Abandoned Crate // Basic Calamity Furniture Basin: Basin LavaFountain: Lava Fountain +BaroqueCello: Baroque Cello +Jukebox: Jukebox PipeOrgan: Pipe Organ Sconce: Sconce // Draedon Lab Furniture diff --git a/Localization/en-US/Mods.CalamityMod.UI.hjson b/Localization/en-US/Mods.CalamityMod.UI.hjson index a3db5b2517..21ba79f713 100644 --- a/Localization/en-US/Mods.CalamityMod.UI.hjson +++ b/Localization/en-US/Mods.CalamityMod.UI.hjson @@ -12,13 +12,13 @@ Charge: Current Charge DefenseDamage: Defense Damage SulphurousWater: Sulphuric Poisoning Stealth: Stealth -StealthShiftText: Hold SHIFT for more information on Rogue stealth +StealthShiftText: Hold Shift for more information on Rogue stealth StealthInfoText: ''' Rogue stealth builds while not attacking and slower while moving Once you have built max stealth, you will be able to perform a Stealth Strike Rogue stealth only reduces when you attack, it does not reduce while moving - The higher your rogue stealth the higher your rogue damage and crit + The higher your rogue stealth the higher your rogue damage Having more stealth regeneration slightly decreases the damage bonus from stealth This is offset by you being able to use stealth strikes far more often ''' @@ -27,15 +27,31 @@ DifficultyStatusText: "{0} is {1}." ModeAppend: "{0} Mode" Active: Active NotActive: Not active -DifficultyShiftText: "[c/737373:Hold the 'Shift' key for more information]" +DifficultyShiftText: "[c/737373:Hold Shift for more information]" CurrentlySelected: Currently Selected : {0} DifficultyClickText: "[c/919191:Click to select a difficulty mode]" ExpertDifficultyLock: "[c/919191:Higher difficulty modes can only be toggled in Expert Mode or above]" ChangingTheRules: "[c/919191:You cannot change the rules now!]" -NoDifficulty: None -NoDifficultyInfo: The classic Terraria experience, with no Calamity difficulty changes +DifficultySwitch: Difficulty changed from [c/{0}:{1}] to [c/{2}:{3}]. +ClassicInfo: Your Adventure Begins... A far more relaxed Terraria experience +ExpertShortInfo: "[c/FFBA75:Fortune & Glory, Kid. For those looking for a more difficult vanilla experience]" +ExpertExpandedInfo: + ''' + [c/A87A07:Most bosses gain new attacks and more difficult attack patterns] + [c/A87A07:Most enemies have twice as much health, deal twice as much damage and receive 10% less knockback] + [c/A87A07:Certain enemies have new attacks, can inflict new debuffs or have a higher chance of inflicting debuffs they already had] + [c/A87A07:Enemies drop more loot, as well as having higher chances] + [c/A87A07:Players drop more of their coins on death] + ''' +MasterShortInfo: "[c/1CFFAA:Game over man, game over! A tougher step up in stats from Expert Mode]" +MasterExpandedInfo: + ''' + [c/029C6D:Most enemies have even more health and knockback resistance added on from Expert Mode] + [c/029C6D:Bosses have new exclusive vanity rewards] + [c/029C6D:Players drop ALL their coins on death] + [c/029C6D:Players gain an additional accessory slot at the start of the game] + ''' Revengeance: Revengeance -RevengeanceEnabled: Revengeance Mode is enabled RevengeanceShortInfo: "[c/F54254:The intended Calamity experience! Can only be enabled in Expert Mode!]" RevengeanceExpandedInfo: ''' @@ -47,21 +63,17 @@ RevengeanceExpandedInfo: [c/B55362:Bosses have new AI mechanics, new phases, and will drop Master Mode loot. Enemies spawn more frequently] [c/F7342A:This mode is more difficult than Expert. Be sure to prepare for the challenge] ''' -RevengeanceActivate: Revengeance is active. -RevengeanceDeactivate: Revengeance is not active. Death: Death -DeathLegend: Death+Legend -DeathEnabled: Death Mode is enabled -DeathShortInfo: "[c/C82DF7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]" +DeathShortInfo: "[c/E066F7:A far more difficult challenge than Revengeance Mode! Can only be enabled in Master Mode!]" DeathExpandedInfo: ''' - [c/B834E0:All foes will pose a much larger threat with highly aggressive AIs and increased damage] + [c/B834E0:All foes will pose a much larger threat with highly aggressive AIs] [c/B834E0:Bosses have substantially harder AI changes. Enemies are even more numerous and can easily overwhelm you] [c/B834E0:Debuffs are especially lethal and the Abyss is significantly more dangerous] [c/E945FF:Vigilance and tenacity are crucial to survival] ''' -DeathActivate: Death is active; enjoy the fun. -DeathDeactivate: Death is not active; not fun enough for you? +// Legendary (FTW + Master) + Death Mode +Malice: Malice // Calamity Health Bar ExoTwinsNameNormal: XS-01 Artemis and XS-03 Apollo ExoTwinsNameHekate: Eyes of XB-∞ Hekate @@ -117,7 +129,7 @@ Cooldowns: { PrismaticLaser: Prismatic Laser Barrage Cooldown ProfanedSoulShieldDurability: Profaned Soul Shield Durability ProfanedSoulShieldRecharge: Profaned Soul Shield Recharge - RaiderBoost: Extra Critical Chance + RaidersBoost: Extra Critical Chance RelicOfResilienceCooldown: Relic of Resilience Cooldown RogueBooster: Rogue Booster Cooldown SandCloak: Sand Cloak Cooldown @@ -148,7 +160,7 @@ Evoke: Evoke Exit: Exit Communicate: Communicate ConfirmationText: Are you sure? -UpgradesRequired: Encryption unsolveable: Upgrades required. +UpgradesRequired: Encryption unsolvable: Upgrades required. ThanatosIcon: Thanatos, a serpentine terror with impervious armor and innumerable laser turrets. AresIcon: Ares, a heavyweight, diabolical monstrosity with four Exo superweapons. ArtemisApolloIcon: Artemis and Apollo, a pair of extremely persistent automatons with unstable energy reserves. @@ -640,8 +652,8 @@ SulphurSea2: Irradiating one of the oceans Roxcalibur: I wanna rock AuricLandMines: Setting god killing traps // Hold Shift tooltip default -HoldShiftTooltipExtensionIndicator: Hold "Left Shift" for more -HoldShiftTooltipReplacementIndicator: Hold "Left Shift" for details +HoldShiftTooltipExtensionIndicator: Hold Shift for more +HoldShiftTooltipReplacementIndicator: Hold Shift for details // Dev and Donor Items DevItemTooltip: - Dev Item - DonorItemTooltip: - Donor Item - diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson index 718270c4af..30f140caee 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.Armor.hjson @@ -28,7 +28,7 @@ SetBonus: { Melee: 10% increased melee damage } - Copper: Increases all damage by 2 + Copper: Increases all damage by {0} Crimson: ''' Greatly increased natural life regen @@ -39,7 +39,7 @@ SetBonus: { ''' Multiplies all cold-based debuff damage by 1.25x Cold enemies will deal reduced contact damage to the player - Provides immunity to the Chilled, Frozen, Frostburn and Glacial State debuffs + Provides immunity to the Chilled, Frozen, and Frostburn debuffs ''' Rain: ''' @@ -49,7 +49,7 @@ SetBonus: { ''' Forbidden: ''' - {$LegacyTooltip.48} {$ArmorSetBonus.Forbidden} + {$LegacyTooltip.48} {0} to call an ancient storm to the cursor location Minions no longer deal less damage while wielding magic weapons ''' Frost: @@ -60,27 +60,18 @@ SetBonus: { ''' Gladiator: ''' - +3 defense +60 maximum stealth 5% increased rogue damage and 10% increased velocity ''' Gold: ''' - All enemies have a 2% chance to drop 1 gold; bosses killed drop 3 gold - You gain 1% critical strike chance for every 10 gold in your inventory, capped at 7% - ''' - Iron: - ''' - Increases damage reduction by 6% - +1 HP/s life regen + All enemies have a {0}% chance to drop 1 extra gold + All bosses drop {1} extra gold + You gain {2}% critical strike chance for every gold in your inventory, capped at {3}% ''' + Iron: Multiplies all player-inflicted knockback by {0}x Jungle: 10% reduced mana costs - Lead: - ''' - Increases damage reduction by 4% - +0.5 HP/s life regen - Grants immunity to knockback - ''' + Lead: Grants immunity to knockback Meteor: All magic guns cost 33% mana Mining: Mining ore will sometimes have additional yield Molten: @@ -126,28 +117,20 @@ SetBonus: { Grants +2 HP/s life regeneration after striking an enemy This life regeneration bypasses negative life regeneration ''' - PlatinumChainmail: 3% increased critical strike chance - Platinum: - ''' - Every 10 extra defense gives you 1% increased damage - The 20 defense from the Platinum Armor itself does not contribute to this effect - Bonus damage caps at 50 extra defense - ''' + Platinum: Increases damage reduction by {0}% Silver: ''' - +0.5 HP/s life regen - Two seconds after getting hit for 20 or more damage, you heal for 10 + {0} seconds after getting hit for {1} or more damage, you heal for {2} Getting hit again resets the timer, delaying the heal ''' - Tin: Increases armor penetration by 5 - Tungsten: - ''' - Increases your critical strike chance by 100% of the knockback of your held weapon - This effect caps at Insane knockback, which gives 10% increased critical strike chance - Increases all knockback by 33%, this counts for the above boost - Current bonus: {0}% critical strike chance from {1} knockback - ''' + Tin: "{0}% increased critical strike chance" + Tungsten: Grappling hooks pull and retract {0}% faster MagicHat: Increases maximum mana by 40 + Vortex: + ''' + {$LegacyTooltip.48} {0} to toggle stealth, + increasing ranged ability and reducing chance for enemies to target you but slowing movement speed + ''' Wizard: 4% increased magic critical strike chance CrystalAssassin: ''' diff --git a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson index b037db0068..f4d2c3a12b 100644 --- a/Localization/en-US/Mods.CalamityMod.Vanilla.hjson +++ b/Localization/en-US/Mods.CalamityMod.Vanilla.hjson @@ -1,3 +1,4 @@ +DashKey: Press {0} while facing a direction DodgeInfo: ''' Grants the ability to dodge attacks @@ -14,7 +15,7 @@ AddedTooltip: { Enrages outside the Ocean ''' SlimeGun: Slimed enemies take more damage from fire-based debuffs - FleshKnucklesLine: Max life increased by 45 + FleshKnucklesLine: Max life increased by 25 RodofDiscord: Teleportation is disabled while Chaos State is active Pwnhammer: ''' @@ -27,7 +28,7 @@ AddedTooltip: { This grants +1.5 HP/s life regen and accelerates natural life regen Life drain stacks based on the number of enemies being hit ''' - WarmthPotion: Greatly reduces the duration of Chilled, Frozen, and Glacial State + WarmthPotion: Greatly reduces the duration of Chilled and Frozen HandWarmer: Provides a regeneration boost while wearing the Snow armor GoldenFishingRod: Its fishing line will never break // Step Stool @@ -46,7 +47,7 @@ AddedTooltip: { FairyBoots: ''' Fairies can spawn at any time on the surface and spawn far more frequently - Nearby fairies grant +2 HP/s life regen, 10 defense and 10% movement speed + Nearby fairies grant +2 HP/s life regen, 6 defense and 10% movement speed Fairies are immune to damage and will no longer flee ''' MoonStone: Reduces the damage of the Nightwither debuff @@ -59,29 +60,6 @@ AddedTooltip: { YoyoGlove: Secondary yoyos will do 50% less damage DefensePrefix: +{0}% damage reduction LuckyPrefix: +0.05 luck - /* - Armor - */ - CopperHelmet: 5% increased damage - CopperChainmail: 3% increased critical strike chance - CopperGreaves: 5% increased movement speed - TinHelmet: 3% increased critical strike chance - TinChainmail: +0.5 HP/s life regen - TinGreaves: 5% increased movement speed - IronPieces: Increases damage reduction by 3% - LeadPieces: Increases damage reduction by 2% - SilverHelmet: 5% increased critical strike chance - SilverChainmail: +1 HP/s life regen - SilverGreaves: 8% increased movement speed - TungstenHelmet: 7% increased damage - TungstenChainmail: +0.5 HP/s life regen - TungstenGreaves: 8% increased movement speed - GoldHelmet: 5% increased damage - GoldChainmail: Increases damage reduction by 5% - GoldGreaves: 10% increased movement speed - PlatinumHelmet: 6% increased damage - PlatinumChainmail: 3% increased critical strike chance - PlatinumGreaves: 10% increased movement speed CrimsonBreastplate: +1 HP/s life regen CrimsonOtherPieces: +0.5 HP/s life regen Picksaw: Can mine Scoria Ore located in the Abyss @@ -96,11 +74,7 @@ EditedTooltip: { Summons the Queen Bee when used in the Jungle Enrages outside the Underground Jungle ''' - BloodySpine: - ''' - Summons the Brain of Cthulhu when used in the Crimson - Enrages outside the Underground Crimson - ''' + BloodySpine: Summons the Brain of Cthulhu when used in the Crimson ClothierVoodooDoll: ''' While equipped, summons Skeletron when the Clothier is killed during nighttime @@ -118,32 +92,16 @@ EditedTooltip: { Summons the Golem when used at the Lihzahrd Altar Enrages outside the Jungle Temple ''' - MechanicalEye: - ''' - Summons The Twins when used during nighttime - Enrages during the day - ''' + MechanicalEye: Summons The Twins when used during nighttime MechanicalSkull: ''' Summons Skeletron Prime when used during nighttime Enrages during the day ''' - MechanicalWorm: - ''' - Summons The Destroyer when used during nighttime - Enrages during the day - ''' + MechanicalWorm: Summons The Destroyer when used during nighttime QueenSlimeCrystal: Summons Queen Slime when used in the Hallow - SuspiciousLookingEye: - ''' - Summons the Eye of Cthulhu when used during nighttime - Enrages during the day - ''' - WormFood: - ''' - Summons the Eater of Worlds when used in the Corruption - Enrages outside the Underground Corruption - ''' + SuspiciousLookingEye: Summons the Eye of Cthulhu when used during nighttime + WormFood: Summons the Eater of Worlds when used in the Corruption MasterExclusive: Master or Revengeance // Sparkle Slime Balloon GelBalloon: @@ -170,7 +128,6 @@ EditedTooltip: { // Arcane Crystal AegisCrystal: Permanently boosts natural life regeneration ArcheryPotion: 20% increased arrow speed and 5% increased arrow damage - IronskinPotion: Increase defense by {0} // Aerial Bane DD2BetsyBow: Shoots a tight spread of 6 splitting arrows AleSake: @@ -198,13 +155,12 @@ EditedTooltip: { // Soaring Insignia EmpressFlightBooster1: Increases wing flight time by 33% EmpressFlightBooster2: Increases movement and jump speed by 10% and acceleration by 1.25x - RifleScope1: Increase view range for guns (Right click to zoom out) + RifleScope1: Increase view range for guns ( to zoom out) RifleScope2: The scope effect can be toggled with visibility SniperScope: 12% increased ranged critical strike chance MagicQuiver: Increases arrow damage by 5% and greatly increases arrow speed MoltenQuiver1: Increases arrow damage by 7% and greatly increases arrow speed MoltenQuiver2: Lights wooden arrows ablaze and all arrows inflict Hellfire - MagicPowerPotion: 10% increased magic damage MagicHat: 6% increased magic critical strike chance PowerGlove: 10% increased melee speed, does not stack with downgrades BerserkerGlove: 10% increased true melee damage @@ -284,8 +240,8 @@ EditedTooltip: { Provides 32% increased jump speed and increased fall speed Provides a gravitational boost jump, which recharges whenever gravity is flipped Slightly improves wingless air movement speed - Press UP to change gravity - Press DOWN to fall faster + Press {$Key.UP} to change gravity + Press {$Key.DOWN} to fall faster ''' } @@ -295,7 +251,8 @@ BuffDescription: { BeetleMight: Melee damage and speed increase by {0}% and {1}% respectively ChaosState: Rod of Discord teleports are disabled LeafCrystal: Emits powerful life pulses at nearby enemies - WarmthExtra: Reduced durations of Chilled, Frozen, and Glacial State + Rabies: Decreased life regen, Causes status effects + WarmthExtra: Reduced durations of Chilled and Frozen WeaponImbueConfetti: All attacks cause confetti to appear WeaponImbueCursedFlames: Melee, Whip, and Rogue attacks inflict enemies with cursed flames WeaponImbueFire: Melee, Whip, and Rogue attacks set enemies on fire @@ -339,7 +296,6 @@ DemolitionistChat: { DryadChat: { DarksunEclipse: There's a dark solar energy emanating from the moths that appear during this time. What's up with moths getting stronger as you do too? Hardmode: That starborne illness sits upon this land like a blister. Do even more vile forces of corruption exist in worlds beyond? - DrunkPrincessShroom: "{0} put me up to this." Mushroom: I'm not here for any reason! Just picking up mushrooms for uh, later use. SulphurSea: My Goddess is resting deep below this sea. If you may excuse me, I wish to pay my respects to her alone. } @@ -377,7 +333,6 @@ MechanicChat: { MoonLordDefeated: What do you mean your traps aren't making the cut? Don't look at me! Eclipse: Um... should my nightlight be on? AcidRain: Maybe I should've waterproofed my gadgets... They're starting to corrode. - DrunkPrincess: Well, I like {0}, but I, ah... I have my eyes on someone else. } MerchantChat: { @@ -407,7 +362,6 @@ PainterChat: { } PartyGirlChat: { - DrunkPrincess: I have a feeling we're going to have absolutely fantastic parties with {0} around! Eclipse1: I think my light display is turning into an accidental bug zapper. At least the monsters are enjoying it. Eclipse2: Ooh! I love parties where everyone wears a scary costume! } @@ -415,7 +369,6 @@ PartyGirlChat: { PirateChat: { PreLeviathan: Aye, I've heard of a mythical creature in the oceans, singing with an alluring voice. Careful when yer fishin out there. WetScourgeDefeated: I have to thank ye again for takin' care of that sea serpent. Or was that another one... - DrunkPrincess: Twenty-nine bottles of beer on the wall... SeaKing: I remember legends about that {0}. He ain't quite how the stories make him out to be though. Ocean: Now this is a scene that I can admire any time! I feel like something is watching me though. SulphurSea1: It ain't much of a sight, but there's still life living in these waters. @@ -442,18 +395,12 @@ SteampunkerChat: { StylistChat: { Hardmode: Please don't catch space lice. Or {0} lice. Or just lice in general. - DrunkPrincess1: "{0} is always trying to brighten my mood... even though, deep down, I know she's sad..." - DrunkPrincess2: Sometimes I catch {0} sneaking up from behind me. - DrunkPrincess3: "{0} has been smiling more often lately, even without alcohol. I think I can thank you for that, at least somewhat." ProfanedSoulCrystal1: They look so cute and yet, I can feel their immense power just by being near them. What are you? ProfanedSoulCrystal2: I hate to break it to you, but you don't have hair to cut or style, hun. ProfanedDonuts: Aww, they're so cute, do they have names? } -TavernkeepChat: { - FullMoon: Care for a little Moonshine? - DrunkPrincess: Sheesh, {0} is a little cruel, isn't she? I never claimed to be an expert on anything but ale! -} +TavernkeepChat.FullMoon: Care for a little Moonshine? TaxCollectorChat: { DoGDefeated: Devourer of what, you said? Devourer of Funds, if its payroll is anything to go by! @@ -463,12 +410,7 @@ TaxCollectorChat: { Has100Plat: BAH! Doesn't seem like I'll ever be able to quarrel with the debts of the town again! } -TravellingMerchantChat.DrunkPrincessMerchant: Tell {0} I'll take up her offer and meet with her at the back of {1}'s house. - -TruffleChat: { - Normal: I don't feel very safe; I think there's pigs following me around and it frightens me. - DrunkPrincess: Sometimes, {0} just looks at me funny and I'm not sure how I feel about that. -} +TruffleChat.Normal: I don't feel very safe; I think there's pigs following me around and it frightens me. WitchDoctorChat: { BloodMoon: This is as good a time as any to pick up the best ingredients for potions. diff --git a/ModSupport/ExternalMods.cs b/ModSupport/ExternalMods.cs index 7518e201c1..f69d8d110d 100644 --- a/ModSupport/ExternalMods.cs +++ b/ModSupport/ExternalMods.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Terraria.ID; -using Terraria.ModLoader; +using Terraria.ModLoader; namespace CalamityMod { @@ -31,6 +25,7 @@ namespace CalamityMod internal static Mod magicStorage = null; internal static Mod overhaul = null; internal static Mod redemption = null; + internal static Mod remnants = null; internal static Mod soa = null; internal static Mod subworldLibrary = null; internal static Mod summonersAssociation = null; @@ -67,6 +62,8 @@ namespace CalamityMod ModLoader.TryGetMod("TerrariaOverhaul", out overhaul); redemption = null; ModLoader.TryGetMod("Redemption", out redemption); + remnants = null; + ModLoader.TryGetMod("Remnants", out remnants); soa = null; ModLoader.TryGetMod("SacredTools", out soa); subworldLibrary = null; @@ -97,6 +94,7 @@ namespace CalamityMod magicStorage = null; overhaul = null; redemption = null; + remnants = null; soa = null; subworldLibrary = null; summonersAssociation = null; diff --git a/ModSupport/ModCalls.cs b/ModSupport/ModCalls.cs index bce9cbdf27..ebf1420994 100644 --- a/ModSupport/ModCalls.cs +++ b/ModSupport/ModCalls.cs @@ -671,12 +671,6 @@ namespace CalamityMod p.Calamity().externalAbyssLight += add; } - public static void AddBreathLossMult(Player p, float add) - { - if (p != null) - p.Calamity().externalBreathLossMultBoost += add; - } - public static void AddBreathTick(Player p, float add) { if (p != null) @@ -1271,21 +1265,6 @@ namespace CalamityMod AddAbyssLightStrength(castPlayer(args[1]), light); return null; - case "BreathMult": - case "BreathLossMult": - case "AddBreathMult": - case "AddBreathLossMult": - if (args.Length < 2) - return new ArgumentNullException("ERROR: Must specify both a Player object (or int index of a Player) and breath loss mult change as a float."); - if (args.Length < 3) - return new ArgumentNullException("ERROR: Must specify breath loss mult change as a float."); - if (!(args[2] is float breathLossMult)) - return new ArgumentException("ERROR: The second argument to \"AddBreathLossMult\" must be a float."); - if (!isValidPlayerArg(args[1])) - return new ArgumentException("ERROR: The first argument to \"AddBreathLossMult\" must be a Player or an int."); - AddBreathLossMult(castPlayer(args[1]), breathLossMult); - return null; - case "BreathTick": case "AbyssBreathTick": case "AddBreathTick": diff --git a/ModSupport/WeakReferenceSupport.cs b/ModSupport/WeakReferenceSupport.cs index e5aaf5bc23..e31b109d66 100644 --- a/ModSupport/WeakReferenceSupport.cs +++ b/ModSupport/WeakReferenceSupport.cs @@ -460,9 +460,11 @@ namespace CalamityMod string entryName = "HiveMind"; BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); + Func IsCorruption = () => !WorldGen.crimson || Main.drunkWorld; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; AddBoss(bossChecklist, calamity, entryName, order, DownedHiveMind, type, new Dictionary() { + ["availability"] = IsCorruption, ["spawnInfo"] = GetSpawnInfo(entryName), ["despawnMessage"] = GetDespawnMessage(entryName), ["spawnItems"] = ItemType(), @@ -476,9 +478,11 @@ namespace CalamityMod string entryName = "Perforators"; BossChecklistProgressionValues.TryGetValue(entryName, out float order); int type = NPCType(); + Func IsCrimson = () => WorldGen.crimson || Main.drunkWorld; List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; AddBoss(bossChecklist, calamity, entryName, order, DownedPerforators, type, new Dictionary() { + ["availability"] = IsCrimson, ["displayName"] = GetDisplayName(entryName), ["spawnInfo"] = GetSpawnInfo(entryName), ["despawnMessage"] = GetDespawnMessage(entryName), @@ -741,7 +745,7 @@ namespace CalamityMod { string entryName = "Dragonfolly"; BossChecklistProgressionValues.TryGetValue(entryName, out float order); - int type = NPCType(); + int type = NPCType(); List collection = new List() { ItemType(), ItemType(), ItemType(), ItemType(), ItemType() }; AddBoss(bossChecklist, calamity, entryName, order, DownedDragonfolly, type, new Dictionary() { diff --git a/NPCs/Abyss/BabyCannonballJellyfish.cs b/NPCs/Abyss/BabyCannonballJellyfish.cs index 43e00656d4..2383bb5224 100644 --- a/NPCs/Abyss/BabyCannonballJellyfish.cs +++ b/NPCs/Abyss/BabyCannonballJellyfish.cs @@ -53,10 +53,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/Bloatfish.cs b/NPCs/Abyss/Bloatfish.cs index 002ff2ebce..56f82e1529 100644 --- a/NPCs/Abyss/Bloatfish.cs +++ b/NPCs/Abyss/Bloatfish.cs @@ -28,10 +28,10 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 74; NPC.height = 94; NPC.defense = 100; - NPC.lifeMax = 9000; + NPC.lifeMax = 7200; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.9f; @@ -42,10 +42,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/BobbitWormHead.cs b/NPCs/Abyss/BobbitWormHead.cs index b9218ec8df..682b2f106e 100644 --- a/NPCs/Abyss/BobbitWormHead.cs +++ b/NPCs/Abyss/BobbitWormHead.cs @@ -31,18 +31,16 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; NPC.damage = 150; NPC.width = 80; NPC.height = 40; NPC.defense = 50; - NPC.DR_NERD(0.25f); - NPC.lifeMax = 7500; + NPC.lifeMax = 6000; NPC.knockBackResist = 0f; AIType = -1; NPC.noGravity = true; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; @@ -52,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/BoxJellyfish.cs b/NPCs/Abyss/BoxJellyfish.cs index fb20344f3a..255c805081 100644 --- a/NPCs/Abyss/BoxJellyfish.cs +++ b/NPCs/Abyss/BoxJellyfish.cs @@ -29,12 +29,12 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 44; NPC.width = 30; NPC.height = 33; - NPC.defense = 5; - NPC.lifeMax = 115; + NPC.defense = 8; + NPC.lifeMax = 100; NPC.alpha = 20; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; @@ -44,10 +44,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/CannonballJellyfish.cs b/NPCs/Abyss/CannonballJellyfish.cs index ce1ea981bd..831ac54719 100644 --- a/NPCs/Abyss/CannonballJellyfish.cs +++ b/NPCs/Abyss/CannonballJellyfish.cs @@ -42,10 +42,10 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 54; NPC.height = 76; NPC.defense = 0; - NPC.lifeMax = 500; + NPC.lifeMax = 400; NPC.knockBackResist = 0f; NPC.alpha = 100; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; @@ -55,10 +55,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/ChaoticPuffer.cs b/NPCs/Abyss/ChaoticPuffer.cs index a050ec9730..68bb4d3709 100644 --- a/NPCs/Abyss/ChaoticPuffer.cs +++ b/NPCs/Abyss/ChaoticPuffer.cs @@ -41,11 +41,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 78; NPC.height = 78; NPC.defense = 50; - NPC.lifeMax = 7000; + NPC.lifeMax = 5600; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.HitSound = SoundID.NPCHit23; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; diff --git a/NPCs/Abyss/ColossalSquid.cs b/NPCs/Abyss/ColossalSquid.cs index 2b7e4564fa..7ae65a5c09 100644 --- a/NPCs/Abyss/ColossalSquid.cs +++ b/NPCs/Abyss/ColossalSquid.cs @@ -38,13 +38,12 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 180; NPC.height = 180; NPC.defense = 50; - NPC.DR_NERD(0.05f); NPC.lifeMax = 130000; // Previously 220,000 NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; NPC.timeLeft = NPC.activeTime * 30; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.HitSound = SoundID.NPCHit20; NPC.DeathSound = SoundID.NPCDeath23; NPC.rarity = 2; @@ -56,10 +55,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToWater = false; NPC.Calamity().canBreakPlayerDefense = true; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/Cuttlefish.cs b/NPCs/Abyss/Cuttlefish.cs index 3dde3202c5..149a80cc69 100644 --- a/NPCs/Abyss/Cuttlefish.cs +++ b/NPCs/Abyss/Cuttlefish.cs @@ -36,11 +36,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 58; NPC.height = 30; NPC.defense = 8; - NPC.lifeMax = 140; + NPC.lifeMax = 160; NPC.aiStyle = -1; AIType = -1; NPC.alpha = 150; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath28; NPC.knockBackResist = 0.3f; @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/DevilFish.cs b/NPCs/Abyss/DevilFish.cs index ab478d5acd..0688935939 100644 --- a/NPCs/Abyss/DevilFish.cs +++ b/NPCs/Abyss/DevilFish.cs @@ -46,15 +46,14 @@ namespace CalamityMod.NPCs.Abyss { NPC.noGravity = true; NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 90; NPC.width = 136; NPC.height = 62; NPC.defense = 999999; - NPC.lifeMax = 500; + NPC.lifeMax = 800; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; @@ -65,10 +64,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -109,7 +104,7 @@ namespace CalamityMod.NPCs.Abyss { brokenMask = true; NPC.HitSound = SoundID.NPCHit1; - NPC.defense = 15; + NPC.defense = 25; if (!Main.dedServ) { for (int i = 1; i < 4; i++) diff --git a/NPCs/Abyss/DevilFishAlt.cs b/NPCs/Abyss/DevilFishAlt.cs index f1be9b6e3a..1c3be97b1f 100644 --- a/NPCs/Abyss/DevilFishAlt.cs +++ b/NPCs/Abyss/DevilFishAlt.cs @@ -36,15 +36,14 @@ namespace CalamityMod.NPCs.Abyss { NPC.noGravity = true; NPC.lavaImmune = true; - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 90; NPC.width = 136; NPC.height = 62; NPC.defense = 999999; - NPC.lifeMax = 500; + NPC.lifeMax = 800; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; @@ -55,10 +54,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -91,7 +86,7 @@ namespace CalamityMod.NPCs.Abyss { brokenMask = true; NPC.HitSound = SoundID.NPCHit1; - NPC.defense = 15; + NPC.defense = 25; if (!Main.dedServ) { for (int i = 1; i < 4; i++) diff --git a/NPCs/Abyss/EidolonWyrmBody.cs b/NPCs/Abyss/EidolonWyrmBody.cs index 02450d05e6..46268d84d5 100644 --- a/NPCs/Abyss/EidolonWyrmBody.cs +++ b/NPCs/Abyss/EidolonWyrmBody.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Abyss NPC.dontCountMe = true; NPC.dontTakeDamage = true; NPC.chaseable = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/EidolonWyrmBodyAlt.cs b/NPCs/Abyss/EidolonWyrmBodyAlt.cs index bb6bcfa664..d63b9dd8ff 100644 --- a/NPCs/Abyss/EidolonWyrmBodyAlt.cs +++ b/NPCs/Abyss/EidolonWyrmBodyAlt.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Abyss NPC.dontCountMe = true; NPC.dontTakeDamage = true; NPC.chaseable = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/EidolonWyrmHead.cs b/NPCs/Abyss/EidolonWyrmHead.cs index 3ad3252016..b2baa46d7f 100644 --- a/NPCs/Abyss/EidolonWyrmHead.cs +++ b/NPCs/Abyss/EidolonWyrmHead.cs @@ -59,12 +59,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 126; //36 NPC.height = 76; //20 NPC.defense = 70; - NPC.DR_NERD(0.15f); NPC.lifeMax = 160000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -79,10 +78,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/EidolonWyrmTail.cs b/NPCs/Abyss/EidolonWyrmTail.cs index dba229a146..2b126c6a68 100644 --- a/NPCs/Abyss/EidolonWyrmTail.cs +++ b/NPCs/Abyss/EidolonWyrmTail.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Abyss NPC.dontCountMe = true; NPC.dontTakeDamage = true; NPC.chaseable = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/GiantSquid.cs b/NPCs/Abyss/GiantSquid.cs index 3a5ae03dcf..6dc686e1a9 100644 --- a/NPCs/Abyss/GiantSquid.cs +++ b/NPCs/Abyss/GiantSquid.cs @@ -2,6 +2,8 @@ using System.IO; using CalamityMod.BiomeManagers; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Cooldowns; +using CalamityMod.Items.Accessories; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.World; @@ -42,7 +44,7 @@ namespace CalamityMod.NPCs.Abyss NPC.lifeMax = 1000; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; @@ -52,10 +54,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -258,6 +256,7 @@ namespace CalamityMod.NPCs.Abyss { var postLevi = npcLoot.DefineConditionalDropSet(DropHelper.PostLevi()); npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.Blindfold, 100, 50)); + npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 5)); postLevi.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 2, 2, 4, 3, 6)); } diff --git a/NPCs/Abyss/GulperEelBody.cs b/NPCs/Abyss/GulperEelBody.cs index d8366f56db..959a7d3fd5 100644 --- a/NPCs/Abyss/GulperEelBody.cs +++ b/NPCs/Abyss/GulperEelBody.cs @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/GulperEelBodyAlt.cs b/NPCs/Abyss/GulperEelBodyAlt.cs index 8ffd9061fa..c09437ce55 100644 --- a/NPCs/Abyss/GulperEelBodyAlt.cs +++ b/NPCs/Abyss/GulperEelBodyAlt.cs @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/GulperEelHead.cs b/NPCs/Abyss/GulperEelHead.cs index 5c3bad9db5..b3db09830a 100644 --- a/NPCs/Abyss/GulperEelHead.cs +++ b/NPCs/Abyss/GulperEelHead.cs @@ -47,7 +47,6 @@ namespace CalamityMod.NPCs.Abyss public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 135; NPC.width = 40; //36 NPC.height = 84; //20 @@ -56,7 +55,7 @@ namespace CalamityMod.NPCs.Abyss NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 1, 0, 0); + NPC.value = Item.buyPrice(gold: 1); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -70,10 +69,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/GulperEelTail.cs b/NPCs/Abyss/GulperEelTail.cs index faae8d5302..0e4baffc0c 100644 --- a/NPCs/Abyss/GulperEelTail.cs +++ b/NPCs/Abyss/GulperEelTail.cs @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/Laserfish.cs b/NPCs/Abyss/Laserfish.cs index e15e91f222..086c106472 100644 --- a/NPCs/Abyss/Laserfish.cs +++ b/NPCs/Abyss/Laserfish.cs @@ -2,7 +2,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -34,11 +34,11 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 0; // 0 contact damage, laser damage is handled in the general swimming AI NPC.width = 58; NPC.height = 32; - NPC.defense = 15; + NPC.defense = 20; NPC.lifeMax = 600; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit51; NPC.DeathSound = SoundID.NPCDeath26; NPC.knockBackResist = 0.65f; @@ -50,10 +50,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/LuminousCorvina.cs b/NPCs/Abyss/LuminousCorvina.cs index 6b95e594c6..3e130f4f9e 100644 --- a/NPCs/Abyss/LuminousCorvina.cs +++ b/NPCs/Abyss/LuminousCorvina.cs @@ -44,11 +44,11 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 10; NPC.width = 68; NPC.height = 58; - NPC.defense = 12; - NPC.lifeMax = 1000; + NPC.defense = 18; + NPC.lifeMax = 800; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; @@ -59,10 +59,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/MirageJelly.cs b/NPCs/Abyss/MirageJelly.cs index 5147891755..a8082e8719 100644 --- a/NPCs/Abyss/MirageJelly.cs +++ b/NPCs/Abyss/MirageJelly.cs @@ -46,12 +46,12 @@ namespace CalamityMod.NPCs.Abyss NPC.damage = 100; NPC.width = 78; NPC.height = 170; - NPC.defense = 10; - NPC.lifeMax = 7500; + NPC.defense = 30; + NPC.lifeMax = 6000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 25, 0); + NPC.value = Item.buyPrice(silver: 25); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; @@ -61,10 +61,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/MorayEel.cs b/NPCs/Abyss/MorayEel.cs index 69c7dc7c72..030fa2cfde 100644 --- a/NPCs/Abyss/MorayEel.cs +++ b/NPCs/Abyss/MorayEel.cs @@ -2,7 +2,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; @@ -34,10 +34,10 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 136; NPC.height = 40; NPC.defense = 8; - NPC.lifeMax = 450; + NPC.lifeMax = 360; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.75f; @@ -49,10 +49,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/OarfishBody.cs b/NPCs/Abyss/OarfishBody.cs index b110c6b019..e87f136a82 100644 --- a/NPCs/Abyss/OarfishBody.cs +++ b/NPCs/Abyss/OarfishBody.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 16; //28 NPC.height = 16; //28 NPC.defense = 20; - NPC.lifeMax = 5000; + NPC.lifeMax = 4000; NPC.aiStyle = -1; //new AIType = -1; //new NPC.knockBackResist = 0f; @@ -41,10 +41,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/OarfishHead.cs b/NPCs/Abyss/OarfishHead.cs index 9d36a1bf4c..fec514fc15 100644 --- a/NPCs/Abyss/OarfishHead.cs +++ b/NPCs/Abyss/OarfishHead.cs @@ -43,11 +43,11 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 59; NPC.height = 38; NPC.defense = 10; - NPC.lifeMax = 5000; + NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -61,10 +61,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/OarfishTail.cs b/NPCs/Abyss/OarfishTail.cs index e18c3657b6..f4d57a3847 100644 --- a/NPCs/Abyss/OarfishTail.cs +++ b/NPCs/Abyss/OarfishTail.cs @@ -22,7 +22,7 @@ namespace CalamityMod.NPCs.Abyss NPC.width = 14; //28 NPC.height = 16; //28 NPC.defense = 30; - NPC.lifeMax = 5000; + NPC.lifeMax = 4000; NPC.aiStyle = -1; //new AIType = -1; //new NPC.knockBackResist = 0f; @@ -41,10 +41,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) diff --git a/NPCs/Abyss/ReaperShark.cs b/NPCs/Abyss/ReaperShark.cs index 6fb205d54a..c210ea3271 100644 --- a/NPCs/Abyss/ReaperShark.cs +++ b/NPCs/Abyss/ReaperShark.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.Abyss NPC.aiStyle = -1; AIType = -1; NPC.timeLeft = NPC.activeTime * 30; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.HitSound = SoundID.NPCHit56; NPC.DeathSound = SoundID.NPCDeath60; NPC.knockBackResist = 0f; @@ -70,10 +70,6 @@ namespace CalamityMod.NPCs.Abyss if (Main.zenithWorld) // legg NPC.height = (int)(NPC.height * 1.5f); - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -650,7 +646,7 @@ namespace CalamityMod.NPCs.Abyss { Vector2 direction = shorkCenter - player.Center; direction.Normalize(); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction * 10f, ProjectileID.DemonSickle, NPC.damage / 2, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction * 10f, ProjectileID.DemonSickle, 80, 0f, Main.myPlayer); } } } diff --git a/NPCs/Abyss/SlabCrab.cs b/NPCs/Abyss/SlabCrab.cs index b85836d81a..99d5a112fe 100644 --- a/NPCs/Abyss/SlabCrab.cs +++ b/NPCs/Abyss/SlabCrab.cs @@ -55,12 +55,12 @@ namespace CalamityMod.NPCs.Abyss NPC.height = 30; NPC.damage = BaseAttack; - NPC.lifeMax = 375; + NPC.lifeMax = 300; NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; @@ -77,10 +77,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToWater = false; NPC.GravityIgnoresLiquid = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/ToxicMinnow.cs b/NPCs/Abyss/ToxicMinnow.cs index 3fbf5c0ef8..00bc39d0ec 100644 --- a/NPCs/Abyss/ToxicMinnow.cs +++ b/NPCs/Abyss/ToxicMinnow.cs @@ -3,7 +3,7 @@ using System.IO; using CalamityMod.BiomeManagers; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Projectiles.Enemy; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Abyss NPC.lifeMax = 300; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.15f; @@ -58,10 +58,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Abyss/Viperfish.cs b/NPCs/Abyss/Viperfish.cs index 2fed796aaa..9a0f137dd9 100644 --- a/NPCs/Abyss/Viperfish.cs +++ b/NPCs/Abyss/Viperfish.cs @@ -4,7 +4,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Abyss NPC.lifeMax = 400; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.85f; @@ -58,10 +58,6 @@ namespace CalamityMod.NPCs.Abyss NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/AcidEel.cs b/NPCs/AcidRain/AcidEel.cs index feba4c4c47..e14f4b2d3c 100644 --- a/NPCs/AcidRain/AcidEel.cs +++ b/NPCs/AcidRain/AcidEel.cs @@ -59,7 +59,6 @@ namespace CalamityMod.NPCs.AcidRain if (DownedBossSystem.downedPolterghast) { - NPC.DR_NERD(0.05f); NPC.damage = 100; NPC.lifeMax = 2000; NPC.defense = 20; @@ -71,7 +70,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.lifeMax = 180; } - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.aiStyle = -1; AIType = -1; NPC.lavaImmune = false; @@ -85,10 +84,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -103,9 +98,6 @@ namespace CalamityMod.NPCs.AcidRain { NPC.TargetClosest(false); - // Fall through platforms. - NPC.Calamity().ShouldFallThroughPlatforms = true; - // Play a slither sound from time to time. if (Main.rand.NextBool(480)) SoundEngine.PlaySound(SoundID.Zombie32, NPC.Center); @@ -169,6 +161,8 @@ namespace CalamityMod.NPCs.AcidRain NPC.velocity.X = (NPC.velocity.X * 24f + NPC.direction * swimSpeed) / 25f; } + public override bool? CanFallThroughPlatforms() => true; + public override void ModifyNPCLoot(NPCLoot npcLoot) { npcLoot.Add(ModContent.ItemType(), 2, 1, 3); diff --git a/NPCs/AcidRain/CragmawMire.cs b/NPCs/AcidRain/CragmawMire.cs index 376a638d63..612dec6211 100644 --- a/NPCs/AcidRain/CragmawMire.cs +++ b/NPCs/AcidRain/CragmawMire.cs @@ -76,7 +76,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 66; NPC.lifeMax = 4000; NPC.defense = 25; - NPC.value = Item.buyPrice(0, 2, 0, 0); + NPC.value = Item.buyPrice(gold: 2); if (DownedBossSystem.downedPolterghast) { diff --git a/NPCs/AcidRain/FlakCrab.cs b/NPCs/AcidRain/FlakCrab.cs index c9505ec7fe..a2f6a64262 100644 --- a/NPCs/AcidRain/FlakCrab.cs +++ b/NPCs/AcidRain/FlakCrab.cs @@ -43,11 +43,10 @@ namespace CalamityMod.NPCs.AcidRain if (DownedBossSystem.downedPolterghast) { NPC.lifeMax = 4200; - NPC.DR_NERD(0.2f); } NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; @@ -60,10 +59,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/GammaSlime.cs b/NPCs/AcidRain/GammaSlime.cs index a901b64e48..c3bae2cc77 100644 --- a/NPCs/AcidRain/GammaSlime.cs +++ b/NPCs/AcidRain/GammaSlime.cs @@ -43,14 +43,13 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 110; NPC.lifeMax = 5000; - NPC.DR_NERD(0.15f); NPC.defense = 25; NPC.aiStyle = AIType = -1; NPC.knockBackResist = 0f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; @@ -64,10 +63,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/IrradiatedSlime.cs b/NPCs/AcidRain/IrradiatedSlime.cs index 4a47bcbc42..eee58ef4a5 100644 --- a/NPCs/AcidRain/IrradiatedSlime.cs +++ b/NPCs/AcidRain/IrradiatedSlime.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; AIType = NPCID.ToxicSludge; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/Mauler.cs b/NPCs/AcidRain/Mauler.cs index 0ab66f14c6..51ed39b3da 100644 --- a/NPCs/AcidRain/Mauler.cs +++ b/NPCs/AcidRain/Mauler.cs @@ -67,6 +67,10 @@ namespace CalamityMod.NPCs.AcidRain } } + public static int DropletDamage = 55; // 220 + public static int BubbleDamage = 55; // 220 + public static int GFBDeathBombDamage = 100; // 400 + public override void SetDefaults() { NPC.noGravity = true; @@ -74,11 +78,10 @@ namespace CalamityMod.NPCs.AcidRain NPC.width = 180; NPC.height = 90; NPC.defense = 50; - NPC.DR_NERD(0.05f); NPC.lifeMax = 90000; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 20, 0, 0); + NPC.value = Item.buyPrice(gold: 20); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath60; NPC.knockBackResist = 0f; @@ -194,12 +197,11 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { int bubbleShootType = ModContent.ProjectileType(); - int bubbleDamage = NPC.GetProjectileDamage(bubbleShootType); Vector2 baseBubbleShootVelocity = NPC.SafeDirectionTo(mouthPosition) * 13.5f; for (int i = 0; i < bubblesPerBurst; i++) { Vector2 bubbleShootVelocity = baseBubbleShootVelocity + Main.rand.NextVector2Circular(4f, 4f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, bubbleShootVelocity, bubbleShootType, bubbleDamage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), mouthPosition, bubbleShootVelocity, bubbleShootType, BubbleDamage, 0f); } // Get launched back after firing. This only happens if in water and there's no obstacles behind. @@ -290,10 +292,9 @@ namespace CalamityMod.NPCs.AcidRain if (Main.netMode != NetmodeID.MultiplayerClient) { int acidShootType = ModContent.ProjectileType(); - int acidDamage = NPC.GetProjectileDamage(acidShootType); Vector2 acidSpawnPosition = NPC.Center + Main.rand.NextVector2Circular(30f, 10f).RotatedBy(NPC.rotation); Vector2 acidShootVelocity = -Vector2.UnitY.RotatedByRandom(0.33f) * Main.rand.NextFloat(8f, 10.5f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), acidSpawnPosition, acidShootVelocity, acidShootType, acidDamage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), acidSpawnPosition, acidShootVelocity, acidShootType, DropletDamage, 0f); NPC.netUpdate = true; } } @@ -496,15 +497,14 @@ namespace CalamityMod.NPCs.AcidRain double deltaAngleBoom = spreadBoom / 8f; double offsetAngleBoom; int iBoom; - int damageBoom = Main.masterMode ? 127 : Main.expertMode ? 150 : 200; for (iBoom = 0; iBoom < 25; iBoom++) { int projectileType = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; if (Main.netMode != NetmodeID.MultiplayerClient) { - int boom1 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); - int boom2 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + int boom1 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * 6f), (float)(Math.Cos(offsetAngleBoom) * 6f), projectileType, GFBDeathBombDamage, 0f, Main.myPlayer, 0f, 0f); + int boom2 = Projectile.NewProjectile(NPC.GetSource_Death(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * 6f), (float)(-Math.Cos(offsetAngleBoom) * 6f), projectileType, GFBDeathBombDamage, 0f, Main.myPlayer, 0f, 0f); } } for (int i = 0; i < 25; i++) diff --git a/NPCs/AcidRain/NuclearTerror.cs b/NPCs/AcidRain/NuclearTerror.cs index 95dcf1abeb..60e00cc3cf 100644 --- a/NPCs/AcidRain/NuclearTerror.cs +++ b/NPCs/AcidRain/NuclearTerror.cs @@ -113,8 +113,7 @@ namespace CalamityMod.NPCs.AcidRain NPC.defense = 50; NPC.damage = 135; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 20, 0, 0); - NPC.DR_NERD(0.3f); + NPC.value = Item.buyPrice(gold: 20); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/AcidRain/NuclearToad.cs b/NPCs/AcidRain/NuclearToad.cs index 5f50419754..5e97dd2d05 100644 --- a/NPCs/AcidRain/NuclearToad.cs +++ b/NPCs/AcidRain/NuclearToad.cs @@ -77,7 +77,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.7f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; @@ -90,10 +90,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/Orthocera.cs b/NPCs/AcidRain/Orthocera.cs index ef3fd1d1f3..13eaba493e 100644 --- a/NPCs/AcidRain/Orthocera.cs +++ b/NPCs/AcidRain/Orthocera.cs @@ -47,18 +47,16 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 45; NPC.lifeMax = 280; NPC.defense = 15; - NPC.DR_NERD(0.075f); if (DownedBossSystem.downedPolterghast) { NPC.damage = 120; NPC.lifeMax = 3850; NPC.defense = 35; - NPC.DR_NERD(0.15f); } NPC.knockBackResist = 0.6f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; @@ -71,10 +69,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/Radiator.cs b/NPCs/AcidRain/Radiator.cs index 2aaa69c5f4..54e09b8fbb 100644 --- a/NPCs/AcidRain/Radiator.cs +++ b/NPCs/AcidRain/Radiator.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; @@ -58,10 +58,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/Skyfin.cs b/NPCs/AcidRain/Skyfin.cs index a1cf912c4f..5b8f9fe270 100644 --- a/NPCs/AcidRain/Skyfin.cs +++ b/NPCs/AcidRain/Skyfin.cs @@ -45,16 +45,14 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 88; NPC.lifeMax = 3025; NPC.defense = 18; - NPC.DR_NERD(0.05f); } else if (DownedBossSystem.downedAquaticScourge) { NPC.damage = 38; NPC.lifeMax = 220; - NPC.DR_NERD(0.05f); } - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = true; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AcidRain/SulphurousSkater.cs b/NPCs/AcidRain/SulphurousSkater.cs index 759e49aa4e..51a9914263 100644 --- a/NPCs/AcidRain/SulphurousSkater.cs +++ b/NPCs/AcidRain/SulphurousSkater.cs @@ -58,7 +58,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; @@ -73,10 +73,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) => writer.Write(Flying); @@ -103,7 +99,6 @@ namespace CalamityMod.NPCs.AcidRain public void JumpToDestination() { NPC.knockBackResist = 0.8f; - NPC.DR_NERD(0.35f); NPC.noGravity = false; Projectile closestBubble = SearchForNearestBubble(out float distanceToBubbele); @@ -161,7 +156,6 @@ namespace CalamityMod.NPCs.AcidRain public void DoFlyMovement() { NPC.knockBackResist = 0.5f; - NPC.DR_NERD(0f); float flySpeed = DownedBossSystem.downedPolterghast ? 17f : 14f; float flyInertia = DownedBossSystem.downedPolterghast ? 20f : 24.5f; diff --git a/NPCs/AcidRain/Trilobite.cs b/NPCs/AcidRain/Trilobite.cs index f85ec39507..4aea2a0687 100644 --- a/NPCs/AcidRain/Trilobite.cs +++ b/NPCs/AcidRain/Trilobite.cs @@ -39,7 +39,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.damage = 45; NPC.lifeMax = 300; NPC.defense = 15; - NPC.DR_NERD(0.25f); if (DownedBossSystem.downedPolterghast) { @@ -49,7 +48,7 @@ namespace CalamityMod.NPCs.AcidRain } NPC.knockBackResist = 0.2f; - NPC.value = Item.buyPrice(0, 0, 4, 0); + NPC.value = Item.buyPrice(silver: 4); NPC.lavaImmune = false; NPC.noGravity = true; NPC.noTileCollide = false; @@ -62,10 +61,6 @@ namespace CalamityMod.NPCs.AcidRain NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AquaticScourge/AquaticScourgeBody.cs b/NPCs/AquaticScourge/AquaticScourgeBody.cs index b0db3298e4..1b23cd079d 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBody.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBody.cs @@ -1,15 +1,19 @@ using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.NPCs.AquaticScourge { @@ -23,10 +27,12 @@ namespace CalamityMod.NPCs.AquaticScourge this.HideFromBestiary(); } + public static int ToothDamage = 25; // 100 + public override void SetDefaults() { + NPC.damage = 52; // 104 NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); NPC.width = 32; NPC.height = 32; NPC.defense = 20; @@ -36,7 +42,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; @@ -47,25 +53,20 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.dontCountMe = true; NPC.chaseable = false; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -89,7 +90,231 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { - AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, false); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + 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 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + { + if (nonHostile) + { + // Kiss my motherfucking ass you piece of shit game + NPC.timeLeft *= 20; + NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; + CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); + calamityGlobalNPC.KillTime = revKillTime; + calamityGlobalNPC.newAI[0] = 1f; + nonHostile = false; + NPC.chaseable = true; + NPC.netUpdate = true; + } + } + else + NPC.damage = 0; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases + bool phase2 = lifeRatio < 0.75f; + bool phase3 = lifeRatio < 0.5f; + bool phase4 = lifeRatio < 0.25f; + + // Set worm variable + if (NPC.ai[2] > 0f) + NPC.realLife = (int)NPC.ai[2]; + if (NPC.life > Main.npc[(int)NPC.ai[1]].life) + NPC.life = Main.npc[(int)NPC.ai[1]].life; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool notOcean = player.position.Y < 300f || + player.position.Y > Main.worldSurface * 16.0 || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + + // Check for the flipped Abyss + if (Main.remixWorld) + { + notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + } + + bool biomeEnraged = NPC.localAI[2] <= 0f; + float enrageScale = 0f; + if (biomeEnraged) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 2f; + } + + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = getFuckedAI; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + // Fire teeth + if (calamityGlobalNPC.newAI[0] == 1f && (!phase3 || phase4)) + { + NPC.localAI[0] += 1f; + float shootProjectile = 300; + float timer = NPC.ai[0] + 15f; + float divisor = timer + shootProjectile; + + if (NPC.localAI[0] % divisor == 0f && (NPC.ai[0] % 3f == 0f || getFuckedAI || !death)) + { + NPC.TargetClosest(); + if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) + { + SoundEngine.PlaySound(SoundID.Item17, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float toothVelocity = death ? 9f : 8f; + Vector2 projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY); + int type = ModContent.ProjectileType(); + float accelerate = phase4 ? 1f : 0f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * toothVelocity, type, ToothDamage, 0f, Main.myPlayer, accelerate, 0f); + } + + NPC.netUpdate = true; + } + } + } + + // Kill body and tail + bool shouldDespawn = true; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + { + shouldDespawn = false; + break; + } + } + if (!shouldDespawn) + { + if (NPC.ai[1] <= 0f) + shouldDespawn = true; + else if (Main.npc[(int)NPC.ai[1]].life <= 0) + shouldDespawn = true; + } + if (shouldDespawn) + { + NPC.life = 0; + NPC.HitEffect(0, 10.0); + NPC.checkDead(); + NPC.active = false; + } + + float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f; + if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged)) + { + calamityGlobalNPC.newAI[1] = 1f; + NPC.TargetClosest(false); + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + { + for (int a = 0; a < Main.npc.Length; a++) + { + int type = Main.npc[a].type; + if (AquaticScourgeIDList.Includes(type)) + Main.npc[a].active = false; + } + } + } + else + calamityGlobalNPC.newAI[1] = 0f; + + // Change direction + if (NPC.velocity.X < 0f) + NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; + + // Alpha changes + if (Main.npc[(int)NPC.ai[1]].alpha < 128) + { + NPC.alpha -= 42; + if (NPC.alpha < 0) + NPC.alpha = 0; + } + + Vector2 scourgePosition = NPC.Center; + Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + float scourgeTargetX = player.Center.X + predictionVector.X; + float scourgeTargetY = player.Center.Y + predictionVector.Y; + + // Velocity and movement + float scourgeMaxSpeed = 5f; + if (calamityGlobalNPC.newAI[0] == 1f) + { + scourgeMaxSpeed = revenge ? 14.4f : 12f; + if (expertMode) + scourgeMaxSpeed += 2.4f * (1f - lifeRatio); + scourgeMaxSpeed += 3f * enrageScale; + if (death || getFuckedAI) + { + scourgeMaxSpeed += 5f; + scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; + } + + if (CalamityWorld.LegendaryMode) + scourgeMaxSpeed *= 1.15f; + } + + scourgeTargetX = (int)(scourgeTargetX / 16f) * 16; + scourgeTargetY = (int)(scourgeTargetY / 16f) * 16; + scourgePosition.X = (int)(scourgePosition.X / 16f) * 16; + scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16; + scourgeTargetX -= scourgePosition.X; + scourgeTargetY -= scourgePosition.Y; + + if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length) + { + try + { + scourgePosition = NPC.Center; + scourgeTargetX = Main.npc[(int)NPC.ai[1]].Center.X - scourgePosition.X; + scourgeTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - scourgePosition.Y; + } + catch + { + } + + NPC.rotation = (float)Math.Atan2(scourgeTargetY, scourgeTargetX) + MathHelper.PiOver2; + float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY); + int scourgeWidth = NPC.width; + scourgeTargetDist = (scourgeTargetDist - scourgeWidth) / scourgeTargetDist; + scourgeTargetX *= scourgeTargetDist; + scourgeTargetY *= scourgeTargetDist; + NPC.velocity = Vector2.Zero; + NPC.position.X = NPC.position.X + scourgeTargetX; + NPC.position.Y = NPC.position.Y + scourgeTargetY; + + if (scourgeTargetX < 0f) + NPC.spriteDirection = -1; + else if (scourgeTargetX > 0f) + NPC.spriteDirection = 1; + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -139,7 +364,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs index ae65703e57..7a3404a557 100644 --- a/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs +++ b/NPCs/AquaticScourge/AquaticScourgeBodyAlt.cs @@ -1,11 +1,15 @@ -using System.IO; +using System; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; @@ -25,7 +29,8 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 48; // 96 + NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 32; NPC.height = 32; NPC.defense = 15; @@ -35,7 +40,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; @@ -46,25 +51,20 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.dontCountMe = true; NPC.chaseable = false; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -88,7 +88,202 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { - AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, false); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + 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 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + { + if (nonHostile) + { + // Kiss my motherfucking ass you piece of shit game + NPC.timeLeft *= 20; + NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; + CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); + calamityGlobalNPC.KillTime = revKillTime; + calamityGlobalNPC.newAI[0] = 1f; + nonHostile = false; + NPC.chaseable = true; + NPC.netUpdate = true; + } + } + else + NPC.damage = 0; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases + bool phase2 = lifeRatio < 0.75f; + bool phase3 = lifeRatio < 0.5f; + bool phase4 = lifeRatio < 0.25f; + + // Set worm variable + if (NPC.ai[2] > 0f) + NPC.realLife = (int)NPC.ai[2]; + if (NPC.life > Main.npc[(int)NPC.ai[1]].life) + NPC.life = Main.npc[(int)NPC.ai[1]].life; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool notOcean = player.position.Y < 300f || + player.position.Y > Main.worldSurface * 16.0 || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + + // Check for the flipped Abyss + if (Main.remixWorld) + { + notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + } + + bool biomeEnraged = NPC.localAI[2] <= 0f; + float enrageScale = 0f; + if (biomeEnraged) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 2f; + } + + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = getFuckedAI; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + // Kill body and tail + bool shouldDespawn = true; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + { + shouldDespawn = false; + break; + } + } + if (!shouldDespawn) + { + if (NPC.ai[1] <= 0f) + shouldDespawn = true; + else if (Main.npc[(int)NPC.ai[1]].life <= 0) + shouldDespawn = true; + } + if (shouldDespawn) + { + NPC.life = 0; + NPC.HitEffect(0, 10.0); + NPC.checkDead(); + NPC.active = false; + } + + float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f; + if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged)) + { + calamityGlobalNPC.newAI[1] = 1f; + NPC.TargetClosest(false); + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + { + for (int a = 0; a < Main.npc.Length; a++) + { + int type = Main.npc[a].type; + if (AquaticScourgeIDList.Includes(type)) + Main.npc[a].active = false; + } + } + } + else + calamityGlobalNPC.newAI[1] = 0f; + + // Change direction + if (NPC.velocity.X < 0f) + NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; + + // Alpha changes + if (Main.npc[(int)NPC.ai[1]].alpha < 128) + { + NPC.alpha -= 42; + if (NPC.alpha < 0) + NPC.alpha = 0; + } + + Vector2 scourgePosition = NPC.Center; + Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + float scourgeTargetX = player.Center.X + predictionVector.X; + float scourgeTargetY = player.Center.Y + predictionVector.Y; + + // Velocity and movement + float scourgeMaxSpeed = 5f; + if (calamityGlobalNPC.newAI[0] == 1f) + { + scourgeMaxSpeed = revenge ? 14.4f : 12f; + if (expertMode) + scourgeMaxSpeed += 2.4f * (1f - lifeRatio); + scourgeMaxSpeed += 3f * enrageScale; + if (death || getFuckedAI) + { + scourgeMaxSpeed += 5f; + scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; + } + + if (CalamityWorld.LegendaryMode) + scourgeMaxSpeed *= 1.15f; + } + + scourgeTargetX = (int)(scourgeTargetX / 16f) * 16; + scourgeTargetY = (int)(scourgeTargetY / 16f) * 16; + scourgePosition.X = (int)(scourgePosition.X / 16f) * 16; + scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16; + scourgeTargetX -= scourgePosition.X; + scourgeTargetY -= scourgePosition.Y; + + if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length) + { + try + { + scourgePosition = NPC.Center; + scourgeTargetX = Main.npc[(int)NPC.ai[1]].Center.X - scourgePosition.X; + scourgeTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - scourgePosition.Y; + } + catch + { + } + + NPC.rotation = (float)Math.Atan2(scourgeTargetY, scourgeTargetX) + MathHelper.PiOver2; + float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY); + int scourgeWidth = NPC.width; + scourgeTargetDist = (scourgeTargetDist - scourgeWidth) / scourgeTargetDist; + scourgeTargetX *= scourgeTargetDist; + scourgeTargetY *= scourgeTargetDist; + NPC.velocity = Vector2.Zero; + NPC.position.X = NPC.position.X + scourgeTargetX; + NPC.position.Y = NPC.position.Y + scourgeTargetY; + + if (scourgeTargetX < 0f) + NPC.spriteDirection = -1; + else if (scourgeTargetX > 0f) + NPC.spriteDirection = 1; + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -138,7 +333,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/AquaticScourge/AquaticScourgeHead.cs b/NPCs/AquaticScourge/AquaticScourgeHead.cs index 4acad4c1dc..98384f6683 100644 --- a/NPCs/AquaticScourge/AquaticScourgeHead.cs +++ b/NPCs/AquaticScourge/AquaticScourgeHead.cs @@ -1,5 +1,6 @@ using System.IO; using CalamityMod.BiomeManagers; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -16,13 +17,13 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.Abyss; using CalamityMod.NPCs.AcidRain; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; -using CalamityMod.NPCs.TownNPCs; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -30,6 +31,7 @@ using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Systems.Collections; namespace CalamityMod.NPCs.AquaticScourge { @@ -52,9 +54,12 @@ namespace CalamityMod.NPCs.AquaticScourge NPCID.Sets.MPAllowedEnemies[Type] = true; } + public static int MistDamage = 25; // 100 + public static int CloudDamage = 28; // 112; applies to both Sand and Toxic + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 90; NPC.height = 90; @@ -63,10 +68,10 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.aiStyle = -1; AIType = -1; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 16, 0, 0); + NPC.value = Item.buyPrice(gold: 12); NPC.behindTiles = true; NPC.chaseable = false; NPC.noGravity = true; @@ -75,16 +80,14 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.DeathSound = SoundID.NPCDeath1; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; @@ -92,9 +95,6 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -131,7 +131,447 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { - AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, true); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + 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 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + { + if (nonHostile) + { + // Kiss my motherfucking ass you piece of shit game + NPC.timeLeft *= 20; + NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; + CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); + calamityGlobalNPC.KillTime = revKillTime; + calamityGlobalNPC.newAI[0] = 1f; + nonHostile = false; + NPC.boss = true; + NPC.chaseable = true; + NPC.netUpdate = true; + } + } + else + NPC.damage = 0; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases + bool phase2 = lifeRatio < 0.75f; + bool phase3 = lifeRatio < 0.5f; + bool phase4 = lifeRatio < 0.25f; + + // Set worm variable + if (NPC.ai[2] > 0f) + NPC.realLife = (int)NPC.ai[2]; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool notOcean = player.position.Y < 300f || + player.position.Y > Main.worldSurface * 16.0 || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + + // Check for the flipped Abyss + if (Main.remixWorld) + { + notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + } + + // Enrage + if (notOcean && !player.Calamity().ZoneSulphur && !BossRushEvent.BossRushActive) + { + if (NPC.localAI[2] > 0f) + NPC.localAI[2] -= 1f; + } + else + NPC.localAI[2] = CalamityGlobalNPC.biomeEnrageTimerMax; + + bool biomeEnraged = NPC.localAI[2] <= 0f; + + float enrageScale = 0f; + if (biomeEnraged) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 2f; + } + + // Circular movement + float colorFadeTimeAfterSpiral = 90f; + float spiralGateValue = 480f; + bool doSpiral = false; + if (calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && (revenge || getFuckedAI)) + { + doSpiral = calamityGlobalNPC.newAI[1] == 0f && calamityGlobalNPC.newAI[3] >= spiralGateValue; + if (Vector2.Distance(NPC.Center, player.Center) < (getFuckedAI ? 1600f : 1000f) || doSpiral) + calamityGlobalNPC.newAI[3] += 1f; + + if (doSpiral) + { + NPC.localAI[3] = colorFadeTimeAfterSpiral; + + // Vomit acid mist + 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) + { + float mistVelocity = death ? 10f : 8f; + Vector2 projectileVelocity = (NPC.Center + NPC.velocity * 10f - NPC.Center).SafeNormalize(Vector2.UnitY); + int type = ModContent.ProjectileType(); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity * 5f, projectileVelocity * mistVelocity, type, MistDamage, 0f, Main.myPlayer); + Main.projectile[proj].tileCollide = false; + Main.projectile[proj].timeLeft = getFuckedAI ? 240 : 600; + } + } + + // Vomit circular spreads of acid clouds while in phase 3 + float toxicCloudBarfDivisor = death ? 30f : 40f; + if (calamityGlobalNPC.newAI[3] % toxicCloudBarfDivisor == 0f && phase3) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + int totalProjectiles = (phase4 ? 6 : 9) + (getFuckedAI ? Main.rand.Next(-2, 3) : (int)((calamityGlobalNPC.newAI[3] - spiralGateValue) / toxicCloudBarfDivisor) * (phase4 ? 2 : 3)); + float radians = MathHelper.TwoPi / totalProjectiles; + float cloudVelocity = 1f + enrageScale; + Vector2 spinningPoint = new Vector2(0f, -cloudVelocity); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 vector255 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, CloudDamage, 0f, Main.myPlayer); + } + } + } + + // Velocity boost + if (calamityGlobalNPC.newAI[3] == spiralGateValue) + { + NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY); + NPC.velocity *= 24f; + } + + // Spin velocity + float velocity = (float)(MathHelper.Pi * 2D) / 120f; + // In GFB, contracts the radius as the fight progresses + if (getFuckedAI) + velocity *= phase3 ? 1.5f : phase2 ? 1.25f : 1f; + NPC.velocity = NPC.velocity.RotatedBy(-(double)velocity * NPC.localAI[1]); + // Speed up even more in GFB for more radius + if (getFuckedAI && NPC.velocity.Length() <= 32f) + NPC.velocity *= 1.1f; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; + + // Reset and charge at target + // Don't reset in GFB + if (!getFuckedAI && calamityGlobalNPC.newAI[3] >= spiralGateValue + 120f) + { + calamityGlobalNPC.newAI[3] = 0f; + NPC.TargetClosest(); + } + } + else + { + if (!Collision.CanHit(NPC.Center, 1, 1, player.position, player.width, player.height) && calamityGlobalNPC.newAI[3] > 300f) + calamityGlobalNPC.newAI[3] -= 2f; + + if (NPC.localAI[3] > 0f) + NPC.localAI[3] -= 1f; + + NPC.localAI[1] = NPC.Center.X - player.Center.X < 0 ? 1f : -1f; + } + } + + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = doSpiral || getFuckedAI; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + // Spawn segments + if (calamityGlobalNPC.newAI[2] == 0f && NPC.ai[0] == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int maxLength = getFuckedAI ? 24 : death ? 80 : revenge ? 40 : expertMode ? 35 : 30; + int Previous = NPC.whoAmI; + for (int segments = 0; segments < maxLength; segments++) + { + int lol; + if (segments >= 0 && segments < maxLength - 1) + { + if (segments % 2 == 0) + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + else + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + } + else + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, ModContent.NPCType(), NPC.whoAmI); + + Main.npc[lol].realLife = NPC.whoAmI; + Main.npc[lol].ai[2] = NPC.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol); + Previous = lol; + } + } + + calamityGlobalNPC.newAI[2] = 1f; + } + + // Big barf attack + if (calamityGlobalNPC.newAI[0] == 1f && (!doSpiral && phase2) || (getFuckedAI && !phase3)) + { + NPC.localAI[0] += 1f; + if (NPC.localAI[0] >= (revenge ? 360f : 420f)) + { + if (Vector2.Distance(player.Center, NPC.Center) > 320f) + { + NPC.localAI[0] = 0f; + NPC.netUpdate = true; + SoundEngine.PlaySound(SoundID.NPCDeath13, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int totalProjectiles = expertMode ? 8 : 6; + if (phase3) + totalProjectiles *= 2; + + int type = ModContent.ProjectileType(); + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + velocity = velocity.SafeNormalize(Vector2.UnitY); + velocity *= Main.rand.Next(phase3 ? 300 : 100, 401) * 0.01f; + + float maximumVelocityMult = death ? 0.75f : 0.5f; + if (expertMode) + velocity *= 1f + (maximumVelocityMult * (0.5f - lifeRatio)); + + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + velocity.SafeNormalize(Vector2.UnitY) * 5f, velocity, type, CloudDamage, 0f, Main.myPlayer); + } + } + } + } + } + + if (NPC.life > Main.npc[(int)NPC.ai[0]].life) + NPC.life = Main.npc[(int)NPC.ai[0]].life; + + float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f; + if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged)) + { + calamityGlobalNPC.newAI[1] = 1f; + NPC.TargetClosest(false); + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + { + for (int a = 0; a < Main.npc.Length; a++) + { + int type = Main.npc[a].type; + if (AquaticScourgeIDList.Includes(type)) + Main.npc[a].active = false; + } + } + } + else + calamityGlobalNPC.newAI[1] = 0f; + + // Change direction + if (NPC.velocity.X < 0f) + NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; + + // Alpha changes + NPC.alpha -= 42; + if (NPC.alpha < 0) + NPC.alpha = 0; + + Vector2 scourgePosition = NPC.Center; + Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + float scourgeTargetX = player.Center.X + predictionVector.X; + float scourgeTargetY = player.Center.Y + predictionVector.Y; + + // Velocity and movement + float scourgeMaxSpeed = 5f; + float scourgeAcceleration = 0.08f; + if (calamityGlobalNPC.newAI[0] == 1f) + { + scourgeMaxSpeed = revenge ? 14.4f : 12f; + scourgeAcceleration = revenge ? 0.18f : 0.15f; + if (expertMode) + { + scourgeMaxSpeed += 2.4f * (1f - lifeRatio); + scourgeAcceleration += 0.03f * (1f - lifeRatio); + } + scourgeMaxSpeed += 3f * enrageScale; + scourgeAcceleration += 0.06f * enrageScale; + if (death || getFuckedAI) + { + scourgeMaxSpeed += 5f; + scourgeAcceleration -= getFuckedAI ? 0f : 0.03f; + scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; + scourgeAcceleration += Vector2.Distance(player.Center, NPC.Center) * 0.000045f; + } + + // Increase acceleration after spiral attack + if (NPC.localAI[3] > 0f) + { + float accelerationMultiplier = MathHelper.Lerp(1f, 2f, NPC.localAI[3] / colorFadeTimeAfterSpiral); + scourgeAcceleration *= accelerationMultiplier; + } + + if (CalamityWorld.LegendaryMode) + { + scourgeMaxSpeed *= 1.15f; + scourgeAcceleration *= 1.15f; + } + } + + if (!doSpiral) + { + if (calamityGlobalNPC.newAI[0] != 1f) + { + scourgeTargetY += 400; + if (Math.Abs(NPC.Center.X - player.Center.X) < 500f) + { + if (NPC.velocity.X > 0f) + scourgeTargetX = player.Center.X + 600f; + else + scourgeTargetX = player.Center.X - 600f; + } + } + + float scourgeHigherSpeed = scourgeMaxSpeed * 1.3f; + float scourgeLowerSpeed = scourgeMaxSpeed * 0.7f; + float scourgeSpeed = NPC.velocity.Length(); + if (scourgeSpeed > 0f) + { + if (scourgeSpeed > scourgeHigherSpeed) + { + NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY); + NPC.velocity *= scourgeHigherSpeed; + } + else if (scourgeSpeed < scourgeLowerSpeed) + { + NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY); + NPC.velocity *= scourgeLowerSpeed; + } + } + } + + scourgeTargetX = (int)(scourgeTargetX / 16f) * 16; + scourgeTargetY = (int)(scourgeTargetY / 16f) * 16; + scourgePosition.X = (int)(scourgePosition.X / 16f) * 16; + scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16; + scourgeTargetX -= scourgePosition.X; + scourgeTargetY -= scourgePosition.Y; + float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY); + + if (!doSpiral) + { + float scourgeAbsoluteTargetX = Math.Abs(scourgeTargetX); + float scourgeAbsoluteTargetY = Math.Abs(scourgeTargetY); + float scourgeTimeToReachTarget = scourgeMaxSpeed / scourgeTargetDist; + scourgeTargetX *= scourgeTimeToReachTarget; + scourgeTargetY *= scourgeTimeToReachTarget; + + if ((NPC.velocity.X > 0f && scourgeTargetX > 0f) || (NPC.velocity.X < 0f && scourgeTargetX < 0f) || (NPC.velocity.Y > 0f && scourgeTargetY > 0f) || (NPC.velocity.Y < 0f && scourgeTargetY < 0f)) + { + if (NPC.velocity.X < scourgeTargetX) + { + NPC.velocity.X += scourgeAcceleration; + } + else + { + if (NPC.velocity.X > scourgeTargetX) + NPC.velocity.X -= scourgeAcceleration; + } + + if (NPC.velocity.Y < scourgeTargetY) + { + NPC.velocity.Y += scourgeAcceleration; + } + else + { + if (NPC.velocity.Y > scourgeTargetY) + NPC.velocity.Y -= scourgeAcceleration; + } + + if (Math.Abs(scourgeTargetY) < scourgeMaxSpeed * 0.2 && ((NPC.velocity.X > 0f && scourgeTargetX < 0f) || (NPC.velocity.X < 0f && scourgeTargetX > 0f))) + { + if (NPC.velocity.Y > 0f) + NPC.velocity.Y += scourgeAcceleration * 2f; + else + NPC.velocity.Y -= scourgeAcceleration * 2f; + } + + if (Math.Abs(scourgeTargetX) < scourgeMaxSpeed * 0.2 && ((NPC.velocity.Y > 0f && scourgeTargetY < 0f) || (NPC.velocity.Y < 0f && scourgeTargetY > 0f))) + { + if (NPC.velocity.X > 0f) + NPC.velocity.X += scourgeAcceleration * 2f; + else + NPC.velocity.X -= scourgeAcceleration * 2f; + } + } + else + { + if (scourgeAbsoluteTargetX > scourgeAbsoluteTargetY) + { + if (NPC.velocity.X < scourgeTargetX) + NPC.velocity.X += scourgeAcceleration * 1.1f; + else if (NPC.velocity.X > scourgeTargetX) + NPC.velocity.X -= scourgeAcceleration * 1.1f; + + if ((Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < scourgeMaxSpeed * 0.5) + { + if (NPC.velocity.Y > 0f) + NPC.velocity.Y += scourgeAcceleration; + else + NPC.velocity.Y -= scourgeAcceleration; + } + } + else + { + if (NPC.velocity.Y < scourgeTargetY) + NPC.velocity.Y += scourgeAcceleration * 1.1f; + else if (NPC.velocity.Y > scourgeTargetY) + NPC.velocity.Y -= scourgeAcceleration * 1.1f; + + if ((Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < scourgeMaxSpeed * 0.5) + { + if (NPC.velocity.X > 0f) + NPC.velocity.X += scourgeAcceleration; + else + NPC.velocity.X -= scourgeAcceleration; + } + } + } + + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -205,13 +645,13 @@ namespace CalamityMod.NPCs.AquaticScourge if (spawnInfo.Player.Calamity().ZoneSulphur && spawnInfo.Water) { if (!NPC.AnyNPCs(ModContent.NPCType())) - return (Main.getGoodWorld ? 0.05f : 0.01f); + return (CalamityWorld.LegendaryMode ? 0.05f : 0.01f); } return 0f; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -303,7 +743,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/AquaticScourge/AquaticScourgeTail.cs b/NPCs/AquaticScourge/AquaticScourgeTail.cs index 989e090678..f5edca04e6 100644 --- a/NPCs/AquaticScourge/AquaticScourgeTail.cs +++ b/NPCs/AquaticScourge/AquaticScourgeTail.cs @@ -1,7 +1,9 @@ -using System.IO; +using System; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Events; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Systems.Collections; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -25,7 +27,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 36; // 72 NPC.width = 32; NPC.height = 32; NPC.defense = 25; @@ -35,7 +37,7 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.knockBackResist = 0f; NPC.alpha = 255; NPC.LifeMaxNERB(80000, 96000, 1000000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.behindTiles = true; NPC.noGravity = true; @@ -46,25 +48,20 @@ namespace CalamityMod.NPCs.AquaticScourge NPC.dontCountMe = true; NPC.chaseable = false; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.25f; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -88,7 +85,202 @@ namespace CalamityMod.NPCs.AquaticScourge public override void AI() { - AquaticScourgeAI.VanillaAquaticScourgeAI(NPC, Mod, false); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + 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 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) + { + if (nonHostile) + { + // Kiss my motherfucking ass you piece of shit game + NPC.timeLeft *= 20; + NPC.npcSlots = 16f; + NPC.damage = NPC.defDamage; + CalamityGlobalNPC.BossKillTimes.TryGetValue(NPC.type, out int revKillTime); + calamityGlobalNPC.KillTime = revKillTime; + calamityGlobalNPC.newAI[0] = 1f; + nonHostile = false; + NPC.chaseable = true; + NPC.netUpdate = true; + } + } + else + NPC.damage = 0; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases + bool phase2 = lifeRatio < 0.75f; + bool phase3 = lifeRatio < 0.5f; + bool phase4 = lifeRatio < 0.25f; + + // Set worm variable + if (NPC.ai[2] > 0f) + NPC.realLife = (int)NPC.ai[2]; + if (NPC.life > Main.npc[(int)NPC.ai[1]].life) + NPC.life = Main.npc[(int)NPC.ai[1]].life; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool notOcean = player.position.Y < 300f || + player.position.Y > Main.worldSurface * 16.0 || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + + // Check for the flipped Abyss + if (Main.remixWorld) + { + notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer || + (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); + } + + bool biomeEnraged = NPC.localAI[2] <= 0f; + float enrageScale = 0f; + if (biomeEnraged) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 2f; + } + + // Adjust slowing debuff immunity + bool immuneToSlowingDebuffs = getFuckedAI; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + // Kill body and tail + bool shouldDespawn = true; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) + { + shouldDespawn = false; + break; + } + } + if (!shouldDespawn) + { + if (NPC.ai[1] <= 0f) + shouldDespawn = true; + else if (Main.npc[(int)NPC.ai[1]].life <= 0) + shouldDespawn = true; + } + if (shouldDespawn) + { + NPC.life = 0; + NPC.HitEffect(0, 10.0); + NPC.checkDead(); + NPC.active = false; + } + + float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f; + if (player.dead || Vector2.Distance(NPC.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged)) + { + calamityGlobalNPC.newAI[1] = 1f; + NPC.TargetClosest(false); + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + NPC.velocity.Y += 2f; + + if (NPC.position.Y > Main.worldSurface * 16D) + { + for (int a = 0; a < Main.npc.Length; a++) + { + int type = Main.npc[a].type; + if (AquaticScourgeIDList.Includes(type)) + Main.npc[a].active = false; + } + } + } + else + calamityGlobalNPC.newAI[1] = 0f; + + // Change direction + if (NPC.velocity.X < 0f) + NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; + + // Alpha changes + if (Main.npc[(int)NPC.ai[1]].alpha < 128) + { + NPC.alpha -= 42; + if (NPC.alpha < 0) + NPC.alpha = 0; + } + + Vector2 scourgePosition = NPC.Center; + Vector2 predictionVector = CalamityWorld.MaliceMode ? Main.player[NPC.target].velocity * 20f : Vector2.Zero; + float scourgeTargetX = player.Center.X + predictionVector.X; + float scourgeTargetY = player.Center.Y + predictionVector.Y; + + // Velocity and movement + float scourgeMaxSpeed = 5f; + if (calamityGlobalNPC.newAI[0] == 1f) + { + scourgeMaxSpeed = revenge ? 14.4f : 12f; + if (expertMode) + scourgeMaxSpeed += 2.4f * (1f - lifeRatio); + scourgeMaxSpeed += 3f * enrageScale; + if (death || getFuckedAI) + { + scourgeMaxSpeed += 5f; + scourgeMaxSpeed += Vector2.Distance(player.Center, NPC.Center) * 0.001f; + } + + if (CalamityWorld.LegendaryMode) + scourgeMaxSpeed *= 1.15f; + } + + scourgeTargetX = (int)(scourgeTargetX / 16f) * 16; + scourgeTargetY = (int)(scourgeTargetY / 16f) * 16; + scourgePosition.X = (int)(scourgePosition.X / 16f) * 16; + scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16; + scourgeTargetX -= scourgePosition.X; + scourgeTargetY -= scourgePosition.Y; + + if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length) + { + try + { + scourgePosition = NPC.Center; + scourgeTargetX = Main.npc[(int)NPC.ai[1]].Center.X - scourgePosition.X; + scourgeTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - scourgePosition.Y; + } + catch + { + } + + NPC.rotation = (float)Math.Atan2(scourgeTargetY, scourgeTargetX) + MathHelper.PiOver2; + float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY); + int scourgeWidth = NPC.width; + scourgeTargetDist = (scourgeTargetDist - scourgeWidth) / scourgeTargetDist; + scourgeTargetX *= scourgeTargetDist; + scourgeTargetY *= scourgeTargetDist; + NPC.velocity = Vector2.Zero; + NPC.position.X = NPC.position.X + scourgeTargetX; + NPC.position.Y = NPC.position.Y + scourgeTargetY; + + if (scourgeTargetX < 0f) + NPC.spriteDirection = -1; + else if (scourgeTargetX > 0f) + NPC.spriteDirection = 1; + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -138,7 +330,6 @@ namespace CalamityMod.NPCs.AquaticScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) @@ -164,7 +355,7 @@ namespace CalamityMod.NPCs.AquaticScourge public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180, true); + target.AddBuff(ModContent.BuffType(), 300, true); } } } diff --git a/NPCs/Astral/Aries.cs b/NPCs/Astral/Aries.cs index 5dfecc0272..070908c158 100644 --- a/NPCs/Astral/Aries.cs +++ b/NPCs/Astral/Aries.cs @@ -33,28 +33,23 @@ namespace CalamityMod.NPCs.Astral NPC.width = 66; NPC.height = 64; NPC.aiStyle = NPCAIStyleID.Herpling; - NPC.defense = 14; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 380; + NPC.defense = 22; + NPC.lifeMax = 300; NPC.knockBackResist = 0.6f; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; - NPC.defense = 24; + NPC.defense = 32; NPC.knockBackResist = 0.5f; - NPC.lifeMax = 570; + NPC.lifeMax = 450; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Astraglomerate.cs b/NPCs/Astral/Astraglomerate.cs index 0be0820f7c..b6b8cd566f 100644 --- a/NPCs/Astral/Astraglomerate.cs +++ b/NPCs/Astral/Astraglomerate.cs @@ -37,18 +37,17 @@ namespace CalamityMod.NPCs.Astral NPC.height = 62; NPC.aiStyle = -1; NPC.damage = 0; - NPC.defense = 15; - NPC.DR_NERD(0.15f); + NPC.defense = 30; NPC.lifeMax = 600; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 25; + NPC.defense = 40; NPC.lifeMax = 900; } NPC.Calamity().VulnerableToHeat = true; @@ -58,10 +57,6 @@ namespace CalamityMod.NPCs.Astral { NPC.scale = 3f; } - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/AstralProbe.cs b/NPCs/Astral/AstralProbe.cs index 741efed4a0..dea2e8be53 100644 --- a/NPCs/Astral/AstralProbe.cs +++ b/NPCs/Astral/AstralProbe.cs @@ -36,13 +36,12 @@ namespace CalamityMod.NPCs.Astral NPC.damage = 0; // 0 contact damage, laser damage is handled separately NPC.width = 30; //324 NPC.height = 30; //216 - NPC.defense = 10; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 70; + NPC.defense = 20; + NPC.lifeMax = 120; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0.95f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.noGravity = true; NPC.noTileCollide = true; NPC.DeathSound = SoundID.NPCDeath14; @@ -51,17 +50,13 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 30; - NPC.defense = 20; + NPC.defense = 30; NPC.knockBackResist = 0.85f; - NPC.lifeMax = 105; + NPC.lifeMax = 180; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/AstralSlime.cs b/NPCs/Astral/AstralSlime.cs index 20af8be840..b192406b1f 100644 --- a/NPCs/Astral/AstralSlime.cs +++ b/NPCs/Astral/AstralSlime.cs @@ -26,10 +26,10 @@ namespace CalamityMod.NPCs.Astral NPC.width = 36; NPC.height = 31; NPC.aiStyle = NPCAIStyleID.Slime; - NPC.defense = 8; - NPC.lifeMax = 250; + NPC.defense = 18; + NPC.lifeMax = 240; NPC.knockBackResist = 0.6f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 60; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; @@ -39,16 +39,12 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 65; - NPC.defense = 18; - NPC.lifeMax = 375; + NPC.defense = 28; + NPC.lifeMax = 360; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/AstralachneaGround.cs b/NPCs/Astral/AstralachneaGround.cs index 13373f41c5..514c83b194 100644 --- a/NPCs/Astral/AstralachneaGround.cs +++ b/NPCs/Astral/AstralachneaGround.cs @@ -33,12 +33,11 @@ namespace CalamityMod.NPCs.Astral NPC.height = 34; NPC.aiStyle = NPCAIStyleID.Fighter; NPC.damage = 55; - NPC.defense = 20; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 630; + NPC.defense = 30; + NPC.lifeMax = 500; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.38f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.timeLeft = NPC.activeTime * 2; AnimationType = NPCID.WallCreeper; Banner = ModContent.NPCType(); @@ -46,16 +45,12 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 30; + NPC.defense = 40; NPC.knockBackResist = 0.28f; - NPC.lifeMax = 945; + NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Astral/AstralachneaWall.cs b/NPCs/Astral/AstralachneaWall.cs index 9cf146f5d7..a5beafb51f 100644 --- a/NPCs/Astral/AstralachneaWall.cs +++ b/NPCs/Astral/AstralachneaWall.cs @@ -40,13 +40,12 @@ namespace CalamityMod.NPCs.Astral NPC.height = 60; NPC.aiStyle = -1; NPC.damage = 55; - NPC.defense = 20; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 630; + NPC.defense = 30; + NPC.lifeMax = 500; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0f; NPC.noGravity = true; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.timeLeft = NPC.activeTime * 2; AnimationType = NPCID.BlackRecluseWall; Banner = NPC.type; @@ -54,16 +53,12 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 30; - NPC.lifeMax = 945; + NPC.defense = 40; + NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Atlas.cs b/NPCs/Astral/Atlas.cs index 363ff9bb8b..6e492d6f90 100644 --- a/NPCs/Astral/Atlas.cs +++ b/NPCs/Astral/Atlas.cs @@ -125,10 +125,9 @@ namespace CalamityMod.NPCs.Astral NPC.height = 88; NPC.damage = 70; NPC.defense = 40; - NPC.DR_NERD(0.15f); NPC.lifeMax = 1200; NPC.knockBackResist = 0.08f; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.aiStyle = -1; NPC.DeathSound = DeathSound; NPC.rarity = 1; @@ -154,10 +153,6 @@ namespace CalamityMod.NPCs.Astral NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/FusionFeeder.cs b/NPCs/Astral/FusionFeeder.cs index f9373dd5c2..b1b4c7c1a4 100644 --- a/NPCs/Astral/FusionFeeder.cs +++ b/NPCs/Astral/FusionFeeder.cs @@ -58,9 +58,8 @@ namespace CalamityMod.NPCs.Astral NPC.damage = 45; NPC.aiStyle = -1; NPC.lifeMax = 500; - NPC.defense = 12; - NPC.DR_NERD(0.15f); - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.defense = 28; + NPC.value = Item.buyPrice(silver: 8); NPC.knockBackResist = 0.8f; NPC.behindTiles = true; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; @@ -70,17 +69,13 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 65; - NPC.defense = 22; + NPC.defense = 38; NPC.knockBackResist = 0.7f; NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public static bool ValidMovementPosition(Tile tile) @@ -315,6 +310,7 @@ namespace CalamityMod.NPCs.Astral { npcLoot.Add(ItemID.SharkFin, 8); npcLoot.Add(DropHelper.NormalVsExpertQuantity(ModContent.ItemType(), 1, 2, 3, 3, 4)); + npcLoot.Add(ItemID.Nachos, 30); } } } diff --git a/NPCs/Astral/Glomerling.cs b/NPCs/Astral/Glomerling.cs index ccbe4388c2..c314049689 100644 --- a/NPCs/Astral/Glomerling.cs +++ b/NPCs/Astral/Glomerling.cs @@ -39,7 +39,7 @@ namespace CalamityMod.NPCs.Astral NPC.aiStyle = -1; NPC.damage = 30; NPC.defense = 0; - NPC.lifeMax = 190; + NPC.lifeMax = 160; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.5f; NPC.noGravity = true; @@ -50,15 +50,11 @@ namespace CalamityMod.NPCs.Astral NPC.damage = 50; NPC.defense = 8; NPC.knockBackResist = 0.4f; - NPC.lifeMax = 285; + NPC.lifeMax = 240; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Hadarian.cs b/NPCs/Astral/Hadarian.cs index 76e15717a4..c6c1c6c104 100644 --- a/NPCs/Astral/Hadarian.cs +++ b/NPCs/Astral/Hadarian.cs @@ -42,28 +42,23 @@ namespace CalamityMod.NPCs.Astral NPC.height = 40; NPC.aiStyle = -1; NPC.damage = 50; - NPC.defense = 8; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 420; + NPC.defense = 18; + NPC.lifeMax = 360; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.knockBackResist = 0.75f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 80; - NPC.defense = 18; + NPC.defense = 28; NPC.knockBackResist = 0.65f; - NPC.lifeMax = 630; + NPC.lifeMax = 540; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Mantis.cs b/NPCs/Astral/Mantis.cs index 07658108a6..3910718d16 100644 --- a/NPCs/Astral/Mantis.cs +++ b/NPCs/Astral/Mantis.cs @@ -38,33 +38,27 @@ namespace CalamityMod.NPCs.Astral public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.damage = 55; NPC.width = 60; NPC.height = 58; NPC.aiStyle = -1; - NPC.defense = 6; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 430; + NPC.defense = 22; + NPC.lifeMax = 400; NPC.knockBackResist = 0.2f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; - NPC.defense = 16; + NPC.defense = 32; NPC.knockBackResist = 0.1f; - NPC.lifeMax = 645; + NPC.lifeMax = 600; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/Nova.cs b/NPCs/Astral/Nova.cs index 31482df041..8737f78575 100644 --- a/NPCs/Astral/Nova.cs +++ b/NPCs/Astral/Nova.cs @@ -52,22 +52,21 @@ namespace CalamityMod.NPCs.Astral NPC.width = 78; NPC.height = 50; NPC.damage = 45; - NPC.defense = 15; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 290; + NPC.defense = 26; + NPC.lifeMax = 300; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 75; - NPC.defense = 25; + NPC.defense = 36; NPC.knockBackResist = 0.4f; - NPC.lifeMax = 435; + NPC.lifeMax = 450; } if (CalamityWorld.revenge) { @@ -82,10 +81,6 @@ namespace CalamityMod.NPCs.Astral NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/SightseerCollider.cs b/NPCs/Astral/SightseerCollider.cs index 3689d48278..ae8b05b1fb 100644 --- a/NPCs/Astral/SightseerCollider.cs +++ b/NPCs/Astral/SightseerCollider.cs @@ -40,30 +40,25 @@ namespace CalamityMod.NPCs.Astral NPC.width = 48; NPC.height = 40; NPC.damage = 38; - NPC.defense = 16; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 390; + NPC.defense = 28; + NPC.lifeMax = 320; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.58f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 58; - NPC.defense = 26; + NPC.defense = 38; NPC.knockBackResist = 0.48f; - NPC.lifeMax = 585; + NPC.lifeMax = 480; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/SightseerSpitter.cs b/NPCs/Astral/SightseerSpitter.cs index 7163f98338..17ac78ee83 100644 --- a/NPCs/Astral/SightseerSpitter.cs +++ b/NPCs/Astral/SightseerSpitter.cs @@ -42,30 +42,25 @@ namespace CalamityMod.NPCs.Astral NPC.width = 64; NPC.height = 56; NPC.damage = 50; - NPC.defense = 20; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 540; + NPC.defense = 35; + NPC.lifeMax = 500; NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; NPC.noGravity = true; NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.aiStyle = -1; Banner = NPC.type; BannerItem = ModContent.ItemType(); if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 85; - NPC.defense = 30; + NPC.defense = 45; NPC.knockBackResist = 0.7f; - NPC.lifeMax = 810; + NPC.lifeMax = 750; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Astral/StellarCulex.cs b/NPCs/Astral/StellarCulex.cs index f8ed4ceff0..3f4c651ee5 100644 --- a/NPCs/Astral/StellarCulex.cs +++ b/NPCs/Astral/StellarCulex.cs @@ -42,11 +42,10 @@ namespace CalamityMod.NPCs.Astral NPC.aiStyle = NPCAIStyleID.Bat; //bats NPC.npcSlots = 0.5f; //needed? NPC.damage = 55; - NPC.defense = 18; - NPC.DR_NERD(0.15f); + NPC.defense = 26; NPC.knockBackResist = 0.65f; - NPC.lifeMax = 270; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.lifeMax = 280; + NPC.value = Item.buyPrice(silver: 5); NPC.DeathSound = CommonCalamitySounds.AstralNPCDeathSound; AnimationType = NPCID.GiantFlyingFox; Banner = NPC.type; @@ -54,17 +53,13 @@ namespace CalamityMod.NPCs.Astral if (DownedBossSystem.downedAstrumAureus) { NPC.damage = 90; - NPC.defense = 28; + NPC.defense = 36; NPC.knockBackResist = 0.55f; - NPC.lifeMax = 405; + NPC.lifeMax = 420; } NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/AstrumAureus/AstrumAureus.cs b/NPCs/AstrumAureus/AstrumAureus.cs index ceada7f56a..a1e503856d 100644 --- a/NPCs/AstrumAureus/AstrumAureus.cs +++ b/NPCs/AstrumAureus/AstrumAureus.cs @@ -19,12 +19,13 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; -using CalamityMod.NPCs.TownNPCs; +using CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using System; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -87,35 +88,35 @@ namespace CalamityMod.NPCs.AstrumAureus } } + public static int LaserDamage = 24; // 96 + public static int CrystalDamage = 30; // 120 + public override void SetDefaults() { NPC.lavaImmune = true; NPC.noGravity = true; NPC.npcSlots = 15f; - NPC.GetNPCDamage(); + NPC.damage = 80; // 160 NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 374; NPC.height = 374; NPC.defense = 40; - NPC.DR_NERD(0.4f); - NPC.LifeMaxNERB(120000, 140000, 740000); // 30 seconds in boss rush + NPC.DR_NERD(0.1f); + NPC.LifeMaxNERB(100000, 120000, 740000); // 30 seconds in boss rush NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 25, 0, 0); + NPC.value = Item.buyPrice(gold: 15); NPC.boss = true; NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; if (Main.zenithWorld) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -153,8 +154,926 @@ namespace CalamityMod.NPCs.AstrumAureus public override void AI() { - AstrumAureusAI.VanillaAstrumAureusAI(NPC, Mod); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + CalamityGlobalNPC.astrumAureus = NPC.whoAmI; + + // Variables + 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; + + // Phases + bool phase2 = lifeRatio < (revenge ? 0.85f : expertMode ? 0.8f : 0.75f); + bool phase3 = lifeRatio < (revenge ? 0.7f : expertMode ? 0.6f : 0.5f); + bool phase4 = lifeRatio < (revenge ? 0.5f : 0.4f) && expertMode; + bool phase5 = lifeRatio < 0.3f && revenge; + + // Exhaustion + bool exhausted = NPC.ai[2] >= (phase3 ? 2f : 1f); + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + // Despawn safety, make sure to target another player if the current player target is too far away + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + // Don't fire projectiles and don't increment phase timers for 4 seconds after the teleport phase to avoid cheap bullshit + float noProjectileOrPhaseIncrementTime = 240f; + + bool dontAttack = NPC.localAI[3] > 0f; + if (dontAttack) + { + NPC.localAI[3] -= 1f; + if (NPC.Distance(player.Center) < 240f) + NPC.localAI[3] -= death ? 4f : expertMode ? 2f : 1f; + } + + float enrageScale = 0f; + if (Main.IsItDay() && !player.Calamity().ZoneAstral) + { + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + enrageScale += 1f; + } + + float astralFlameBarrageTimerIncrement = 1f; + if (expertMode) + astralFlameBarrageTimerIncrement += death ? (float)Math.Round(3f * (1f - lifeRatio)) : (float)Math.Round(2f * (1f - lifeRatio)); + + float walkingVelocity = CalamityWorld.MaliceMode ? 6f : 5f; + walkingVelocity += 3f * enrageScale; + if (phase5) + walkingVelocity += 2f; + if (expertMode) + walkingVelocity += 1.5f * (1f - lifeRatio); + if (revenge) + walkingVelocity += Math.Abs(NPC.Center.X - player.Center.X) * 0.0025f; + if (CalamityWorld.LegendaryMode) + walkingVelocity *= 1.15f; + + float walkingProjectileVelocity = walkingVelocity * 0.8f; + + // Direction + NPC.spriteDirection = (NPC.direction > 0) ? 1 : -1; + + // Used to reduce Aureus' fall speed + bool reduceFallSpeed = NPC.velocity.Y > 0f && Collision.SolidCollision(NPC.position + Vector2.UnitY * 1.1f * NPC.velocity.Y, NPC.width, NPC.height) && NPC.ai[0] == 4f; + + // Despawn + bool despawnDistance = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; + if (!player.active || player.dead || despawnDistance) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + if (!player.active || player.dead || despawnDistance) + { + NPC.noTileCollide = true; + + if (NPC.velocity.Y < -3f) + NPC.velocity.Y = -3f; + NPC.velocity.Y += 0.1f; + if (NPC.velocity.Y > 12f) + NPC.velocity.Y = 12f; + + if (NPC.timeLeft > 60) + NPC.timeLeft = 60; + + if (NPC.ai[0] != 0f) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.localAI[2] = 0f; + NPC.localAI[3] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[1] = 0f; + NPC.netUpdate = true; + } + return; + } + } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; + + bool geldonPhase1 = lifeRatio > 0.6f && lifeRatio <= 0.7f; + bool geldonPhase2 = lifeRatio <= 0.1f; + if (Main.zenithWorld && (geldonPhase1 || geldonPhase2)) + { + slimeProjCounter++; + if (slimeProjCounter % 180 == 0) + { + SoundEngine.PlaySound(SoundID.Item33, NPC.Center); // Intentionally keeping the old laser sound in GFB + + if (slimePhase == 1) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + int totalProjectiles = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; + float radians = MathHelper.TwoPi / totalProjectiles; + float velocity = 10f; + Vector2 spinningPoint = new Vector2(0f, -velocity); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, CrystalDamage, 0f, Main.myPlayer, 0f, 1f); + } + } + slimePhase = 0; + } + else + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + float aureusLaserSpeed = 7f; + float aureusLaserTargetX = player.Center.X - NPC.Center.X; + float aureusLaserTargetY = player.Center.Y - NPC.Center.Y; + float aureusLaserTargetDist = (float)Math.Sqrt(aureusLaserTargetX * aureusLaserTargetX + aureusLaserTargetY * aureusLaserTargetY); + aureusLaserTargetDist = aureusLaserSpeed / aureusLaserTargetDist; + aureusLaserTargetX *= aureusLaserTargetDist; + aureusLaserTargetY *= aureusLaserTargetDist; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX, aureusLaserTargetY, type, LaserDamage, 0f, Main.myPlayer); + for (int i = 0; i < 4; i++) + { + Vector2 offset = new Vector2(Main.rand.Next(-6, 7), Main.rand.Next(-6, 7)); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y, aureusLaserTargetX + offset.X, aureusLaserTargetY + offset.Y, type, LaserDamage, 0f, Main.myPlayer); + } + } + slimePhase = 1; + } + } + RevengeanceAndDeathAI.BuffedMimicAI(NPC, Mod); + NPC.noGravity = false; + NPC.noTileCollide = false; + return; + } + else + { + NPC.noGravity = true; + } + + // Emit light when not Idle + if (NPC.ai[0] != 1f) + Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1.3f, 0.5f, 0f); + + // Fire projectiles while walking, teleporting, or falling + if (NPC.ai[0] == 2f || NPC.ai[0] >= 5f) + { + if (!dontAttack) + NPC.localAI[0] += NPC.ai[0] == 2f ? 1f : astralFlameBarrageTimerIncrement; + + float astralFlameBarrageGateValue = phase4 ? 30f : 60f; + if (NPC.localAI[0] >= astralFlameBarrageGateValue) + { + // Fire astral flames while teleporting + if (NPC.ai[0] >= 5f && NPC.ai[0] != 7) + { + NPC.localAI[0] = 0f; + SoundEngine.PlaySound(FlameCrystalSound, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float velocity = death ? (8f + NPC.localAI[2] * 0.025f) : 7f; + int type = ModContent.ProjectileType(); + float spreadLimit = (phase4 ? 100f : 50f) + enrageScale * 50f; + float randomSpread = (Main.rand.NextFloat() - 0.5f) * spreadLimit; + Vector2 spawnVector = new Vector2(NPC.Center.X, NPC.Center.Y - 80f * NPC.scale); + Vector2 destination = new Vector2(spawnVector.X + randomSpread, spawnVector.Y - 100f * NPC.scale); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, Vector2.Normalize(destination - spawnVector) * velocity, type, CrystalDamage, 0f, Main.myPlayer); + } + } + } + + float laserBarrageGateValue = phase5 ? 160f : phase3 ? 120f : phase2 ? 80f : 60f; + if (NPC.localAI[0] >= laserBarrageGateValue) + { + // Fire astral lasers while walking + if (NPC.ai[0] == 2f) + { + NPC.localAI[0] = 0f; + + SoundEngine.PlaySound(LaserSound, NPC.Center); + + if (calamityGlobalNPC.newAI[2] == 0f) + { + calamityGlobalNPC.newAI[2] = 1f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int maxProjectiles = !phase2 ? 3 : 5; + int spread = !phase2 ? 8 : 10; + + int type = ModContent.ProjectileType(); + Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * walkingProjectileVelocity; + float rotation = MathHelper.ToRadians(spread); + for (int i = 0; i < maxProjectiles; i++) + { + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, LaserDamage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); + } + + if (phase3) + { + float flameVelocity = walkingProjectileVelocity; + maxProjectiles = 2; + spread = 45; + + type = ModContent.ProjectileType(); + projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * flameVelocity; + rotation = MathHelper.ToRadians(spread); + for (int i = 0; i < maxProjectiles; i++) + { + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, CrystalDamage, 0f, Main.myPlayer); + } + } + } + } + else + { + calamityGlobalNPC.newAI[2] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int maxProjectiles = !phase3 ? (death ? 11 : 9) : (death ? 17 : 15); + int spread = !phase3 ? (death ? 18 : 16) : (death ? 22 : 20); + + int type = ModContent.ProjectileType(); + int centralLaser = maxProjectiles / 2; + int[] lasersToNotFire = new int[6] { centralLaser - 3, centralLaser - 2, centralLaser - 1, centralLaser + 1, centralLaser + 2, centralLaser + 3 }; + Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * walkingProjectileVelocity; + float rotation = MathHelper.ToRadians(spread); + for (int i = 0; i < maxProjectiles; i++) + { + if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3] && i != lasersToNotFire[4] && i != lasersToNotFire[5]) + { + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, LaserDamage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); + } + } + } + } + } + } + } + else + NPC.localAI[0] = 0f; + + // Start up + if (NPC.ai[0] == 0f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.ai[0] = 1f; + NPC.netUpdate = true; + CustomGravity(); + } + + // Idle + else if (NPC.ai[0] == 1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + // Slow down + NPC.velocity.X *= 0.8f; + + // Stay vulnerable for 3 seconds + NPC.ai[1] += 1f; + if (NPC.Distance(player.Center) < 240f) + NPC.ai[1] += death ? 4f : expertMode ? 2f : 1f; + + if (NPC.ai[1] >= 180f) + { + // Set AI to random state and reset other AI arrays + NPC.TargetClosest(); + switch (Main.rand.Next(phase3 ? 3 : 2)) + { + case 0: + NPC.ai[0] = 2f; + break; + + case 1: + NPC.ai[0] = 3f; + break; + + case 2: + NPC.ai[0] = 5f; + break; + + default: + break; + } + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + // Stop colliding with tiles if entering walking phase + NPC.noTileCollide = NPC.ai[0] == 2f; + + NPC.netUpdate = true; + } + else + CustomGravity(); + } + + // Walk + else if (NPC.ai[0] == 2f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + // Set walking direction + if (Math.Abs(NPC.Center.X - player.Center.X) < 200f * NPC.scale) + { + NPC.velocity.X *= 0.8f; + if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) + NPC.velocity.X = 0f; + } + else + { + float playerLocation = NPC.Center.X - player.Center.X; + NPC.direction = playerLocation < 0 ? 1 : -1; + + if (NPC.direction > 0) + NPC.velocity.X = (NPC.velocity.X * 20f + walkingVelocity) / 21f; + if (NPC.direction < 0) + NPC.velocity.X = (NPC.velocity.X * 20f - walkingVelocity) / 21f; + } + + if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.Center, 1, 1) && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height) && player.position.Y <= NPC.position.Y + NPC.height && !NPC.collideX) + { + CustomGravity(); + NPC.noTileCollide = false; + } + else + { + NPC.noTileCollide = true; + + // Walk through tiles if colliding with tiles and player is out of reach + int aureusHitboxWidth = 80; + int aureusHitboxHeight = 20; + Vector2 aureusHitboxTileCollideSize = new Vector2(NPC.Center.X - (aureusHitboxWidth / 2), NPC.position.Y + NPC.height - aureusHitboxHeight); + + bool nearPlayerWalkingThroughTiles = false; + if (NPC.position.X < player.position.X && NPC.position.X + NPC.width > player.position.X + player.width && NPC.position.Y + NPC.height < player.position.Y + player.height - 16f) + nearPlayerWalkingThroughTiles = true; + + if (nearPlayerWalkingThroughTiles) + { + NPC.velocity.Y += 0.5f; + } + else if (Collision.SolidCollision(aureusHitboxTileCollideSize, aureusHitboxWidth, aureusHitboxHeight)) + { + if (NPC.velocity.Y > 0f) + NPC.velocity.Y = 0f; + + if (NPC.velocity.Y > -0.2) + NPC.velocity.Y -= 0.025f; + else + NPC.velocity.Y -= 0.2f; + + if (NPC.velocity.Y < -4f) + NPC.velocity.Y = -4f; + } + else + { + if (NPC.velocity.Y < 0f) + NPC.velocity.Y = 0f; + + if (NPC.velocity.Y < 0.1) + NPC.velocity.Y += 0.025f; + else + NPC.velocity.Y += 0.5f; + } + } + + // Walk for a maximum of 6 seconds + if (!dontAttack) + { + NPC.ai[1] += 1f; + if (NPC.Distance(player.Center) < 240f) + NPC.ai[1] += death ? 4f : expertMode ? 2f : 1f; + } + + if (NPC.ai[1] >= (360f - (death ? 90f * (1f - lifeRatio) : 0f))) + { + // Collide with tiles again + NPC.noTileCollide = false; + + // Set AI to next phase (Jump) and reset other AI + NPC.TargetClosest(); + NPC.ai[0] = exhausted ? 1f : 3f; + NPC.ai[1] = 0f; + NPC.ai[2] += 1f; + NPC.netUpdate = true; + } + + // Limit downward velocity + if (NPC.velocity.Y > 10f) + NPC.velocity.Y = 10f; + } + + // Jump + else if (NPC.ai[0] == 3f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.noTileCollide = false; + + if (NPC.velocity.Y == 0f) + { + // Slow down + NPC.velocity.X *= 0.8f; + + // Half second delay before jumping + if (!dontAttack) + NPC.ai[1] += 1f; + + if (NPC.ai[1] >= 30f) + { + NPC.ai[1] = -20f; + } + else if (NPC.ai[1] == -1f) + { + // Set damage + NPC.damage = NPC.defDamage; + + // Set jump velocity, reset and set AI to next phase (Stomp) + float distanceFromPlayerOnXAxis = NPC.Center.X - player.Center.X; + NPC.direction = distanceFromPlayerOnXAxis < 0 ? 1 : -1; + calamityGlobalNPC.newAI[3] = NPC.direction; + + // The limit for how much Aureus can multiply its jump velocity + float speedMultLimit = 1f; + + // Maxes out when the player is a full 2000 pixels away from or above Aureus + float multiplier = 1f / 2000f; + + // Increase Aureus jump velocity X if it's far enough away from the player + float distanceAwayFromTarget = Math.Abs(distanceFromPlayerOnXAxis); + float distanceGateValue = 400f; + bool increaseJumpVelocityX = distanceAwayFromTarget > distanceGateValue && expertMode; + if (increaseJumpVelocityX) + { + calamityGlobalNPC.newAI[0] = (distanceAwayFromTarget - distanceGateValue) * multiplier; + if (calamityGlobalNPC.newAI[0] > speedMultLimit) + calamityGlobalNPC.newAI[0] = speedMultLimit; + } + + // Increase Aureus jump velocity Y if it's far enough above the player + float distanceBelowTarget = NPC.position.Y - (player.position.Y + 80f); + bool increaseJumpVelocityY = distanceBelowTarget > 0f && revenge; + if (increaseJumpVelocityY) + { + calamityGlobalNPC.newAI[1] = distanceBelowTarget * multiplier; + if (calamityGlobalNPC.newAI[1] > speedMultLimit) + calamityGlobalNPC.newAI[1] = speedMultLimit; + } + + float velocity = CalamityWorld.MaliceMode ? 27f : 20f; + velocity += 6f * enrageScale; + if (expertMode) + velocity += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); + if (CalamityWorld.LegendaryMode) + velocity *= 1.15f; + + NPC.velocity = (new Vector2(player.Center.X, player.Center.Y - 500f) - NPC.Center).SafeNormalize(Vector2.Zero) * velocity; + NPC.velocity *= new Vector2(calamityGlobalNPC.newAI[0] + 1f, calamityGlobalNPC.newAI[1] + 1f); + + NPC.noTileCollide = true; + + NPC.ai[0] = 4f; + NPC.ai[1] = 0f; + + SoundEngine.PlaySound(JumpSound, NPC.Center); + + NPC.netUpdate = true; + } + } + + // Don't run custom gravity when starting a jump + if (NPC.ai[0] != 4f) + CustomGravity(); + } + + // Stomp + else if (NPC.ai[0] == 4f) + { + if (NPC.velocity.Y == 0f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + // Play stomp sound. Gotta specify the filepath to avoid confusion between the namespace and NPC + SoundStyle soundToPlay = Main.zenithWorld ? ExoMechs.Ares.AresGaussNuke.NukeExplosionSound : StompSound; + SoundEngine.PlaySound(soundToPlay, NPC.Center); + + if (Main.zenithWorld) + { + float screenShakePower = 16 * Utils.GetLerpValue(1300f, 0f, NPC.Distance(Main.LocalPlayer.Center), true); + if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) + Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower; + } + + // Stomp and jump again, if stomped twice then reset and set AI to next phase (Teleport or Idle) + NPC.TargetClosest(); + NPC.localAI[1] += 1f; + float maxStompAmt = phase5 ? 5f : phase3 ? 2f : 3f; + if (NPC.localAI[1] >= maxStompAmt) + { + NPC.ai[0] = exhausted ? 1f : (phase3 ? 5f : 2f); + NPC.localAI[1] = 0f; + NPC.ai[2] += 1f; + NPC.ai[3] = 0f; + NPC.noTileCollide = false; + NPC.netUpdate = true; + } + else + { + float playerLocation = NPC.Center.X - player.Center.X; + NPC.direction = playerLocation < 0 ? 1 : -1; + NPC.ai[0] = 3f; + NPC.ai[3] = 0f; + NPC.netUpdate = true; + } + + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + + // Spawn dust for visual effect + for (int i = (int)NPC.position.X - 20; i < (int)NPC.position.X + NPC.width + 40; i += 20) + { + for (int j = 0; j < 4; j++) + { + int stompDust = Dust.NewDust(new Vector2(NPC.position.X - 20f, NPC.position.Y + NPC.height), NPC.width + 20, 4, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); + Main.dust[stompDust].velocity *= 0.2f; + } + } + + // Fire lasers or flames on stomp + SoundEngine.PlaySound(LaserSound, NPC.Center); + + if (Main.zenithWorld) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + bool crystal = Main.rand.NextBool(); + int type = crystal ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = crystal ? CrystalDamage : LaserDamage; + int totalProjectiles = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; + float radians = MathHelper.TwoPi / totalProjectiles; + float velocity = 10f; + Vector2 spinningPoint = new Vector2(0f, -velocity); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 1f); + } + } + } + else if (calamityGlobalNPC.newAI[2] == 0f && phase2) + { + calamityGlobalNPC.newAI[2] = 1f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float flameVelocity = 6f; + int maxProjectiles = death ? 3 : 2; + int spread = death ? 28 : 20; + + int type = ModContent.ProjectileType(); + Vector2 spawnVector = new Vector2(NPC.Center.X, NPC.Center.Y - 80f * NPC.scale); + Vector2 destination = new Vector2(spawnVector.X, spawnVector.Y + 100f * NPC.scale); + Vector2 projectileVelocity = Vector2.Normalize(destination - spawnVector) * flameVelocity; + float rotation = MathHelper.ToRadians(spread); + for (int i = 0; i < maxProjectiles; i++) + { + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector + Vector2.Normalize(perturbedSpeed) * 100f, perturbedSpeed, type, CrystalDamage, 0f, Main.myPlayer); + } + } + } + else + { + calamityGlobalNPC.newAI[2] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float laserVelocity = CalamityWorld.MaliceMode ? 7f : death ? 6f : 5f; + int maxProjectiles = !phase3 ? (death ? 11 : 9) : (death ? 15 : 13); + int spread = !phase3 ? (death ? 18 : 16) : (death ? 22 : 20); + + int type = ModContent.ProjectileType(); + int[] lasersToNotFire = new int[4] { 1, 3, maxProjectiles - 2, maxProjectiles - 4 }; + Vector2 projectileVelocity = Vector2.Normalize(player.Center - NPC.Center) * laserVelocity; + float rotation = MathHelper.ToRadians(spread); + for (int i = 0; i < maxProjectiles; i++) + { + if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3]) + { + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, LaserDamage, 0f, Main.myPlayer, 0f, laserVelocity * 2f); + } + } + } + } + } + else + { + // Set damage + NPC.damage = NPC.defDamage; + + // Set velocities while falling, this happens before the stomp + // Fall through + if (!player.dead) + { + if ((player.position.Y > NPC.Bottom.Y && NPC.velocity.Y > 0f) || (player.position.Y < NPC.Bottom.Y && NPC.velocity.Y < 0f)) + NPC.noTileCollide = true; + else if ((NPC.velocity.Y > 0f && NPC.Bottom.Y > Main.player[NPC.target].Top.Y) || (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].Center, 1, 1) && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height))) + NPC.noTileCollide = false; + } + + if (NPC.position.X < player.position.X && NPC.position.X + NPC.width > player.position.X + player.width) + { + // Make sure Aureus falls quickly when directly on top of or below the player + if (NPC.ai[3] < 30f) + NPC.ai[3] = 30f; + + NPC.velocity.X *= 0.8f; + + if (NPC.Bottom.Y < player.position.Y) + { + // Make sure Aureus falls rather quickly + if (NPC.velocity.Y < -3f) + NPC.velocity.Y = -3f; + + float fallSpeed = 1.2f; + fallSpeed += 0.36f * enrageScale; + if (expertMode) + fallSpeed += death ? 0.36f * (1f - lifeRatio) : 0.24f * (1f - lifeRatio); + if (CalamityWorld.MaliceMode) + fallSpeed += 0.5f; + + if (calamityGlobalNPC.newAI[1] > 0f) + fallSpeed *= calamityGlobalNPC.newAI[1] + 1f; + + NPC.velocity.Y += fallSpeed; + } + } + else + { + // Push Aureus towards the player on the X axis if he's not directly on top of or below the player + float velocityXChange = 0.2f + Math.Abs(NPC.Center.X - player.Center.X) * 0.0001f; + velocityXChange += 0.1f * enrageScale; + + if (calamityGlobalNPC.newAI[0] > 0f) + velocityXChange *= calamityGlobalNPC.newAI[0] + 1f; + + if (NPC.direction < 0) + NPC.velocity.X -= velocityXChange; + else if (NPC.direction > 0) + NPC.velocity.X += velocityXChange; + + float velocityXCap = 12f; + velocityXCap += 3.6f * enrageScale; + if (expertMode) + velocityXCap += death ? 3.6f * (1f - lifeRatio) : 2.4f * (1f - lifeRatio); + if (CalamityWorld.MaliceMode) + velocityXCap += 5f; + + if (calamityGlobalNPC.newAI[0] > 0f) + velocityXCap *= calamityGlobalNPC.newAI[0] + 1f; + + float playerLocation = NPC.Center.X - player.Center.X; + int directionRelativeToTarget = playerLocation < 0 ? 1 : -1; + bool slowDown = directionRelativeToTarget != calamityGlobalNPC.newAI[3]; + + if (slowDown) + velocityXCap *= 0.333f; + + if (NPC.velocity.X < -velocityXCap) + NPC.velocity.X = -velocityXCap; + if (NPC.velocity.X > velocityXCap) + NPC.velocity.X = velocityXCap; + } + + // Don't start falling quickly until half a second has passed + NPC.ai[3] += 1f; + if (NPC.ai[3] > 30f) + CustomGravity(); + } + } + + // Teleport + else if (NPC.ai[0] == 5f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + // Slow down + NPC.velocity.X *= 0.8f; + + // Start teleport + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.localAI[1] += 1f; + if (death) + NPC.localAI[2] += 1.25f; + + if (phase4) + { + NPC.localAI[1] += 1f; + if (death) + NPC.localAI[2] += 1.25f; + } + + if (NPC.localAI[1] >= (death ? 180f : 240f)) + { + // Reset localAI and find a teleport destination + NPC.TargetClosest(); + NPC.localAI[1] = 0f; + + Vector2 vectorAimedAheadOfTarget = Main.player[NPC.target].Center + new Vector2((float)Math.Round(Main.player[NPC.target].velocity.X), 0f).SafeNormalize(Vector2.Zero) * 1000f; + Point point4 = vectorAimedAheadOfTarget.ToTileCoordinates(); + int teleportTries = 0; + while (teleportTries < 100) + { + teleportTries++; + int teleportTileX = Main.rand.Next(point4.X - 5, point4.X + 6); + int teleportTileY = Main.rand.Next(point4.Y - 5, point4.Y); + + if (!Main.tile[teleportTileX, teleportTileY].HasUnactuatedTile) + { + NPC.ai[1] = teleportTileX * 16 + 8; + NPC.ai[3] = teleportTileY * 16 + 16; + break; + } + } + + // Default teleport if the above conditions aren't met in 100 iterations + if (teleportTries >= 100) + { + Vector2 bottom = Main.player[Player.FindClosest(NPC.position, NPC.width, NPC.height)].Bottom; + NPC.ai[1] = bottom.X; + NPC.ai[3] = bottom.Y; + } + + // Set AI to next phase (Mid-teleport) + NPC.ai[0] = 6f; + NPC.netUpdate = true; + } + } + + CustomGravity(); + } + + // Mid-teleport + else if (NPC.ai[0] == 6f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (death) + NPC.localAI[2] += 1.25f; + + if (phase4) + { + if (death) + NPC.localAI[2] += 1.25f; + } + + // Turn invisible + NPC.alpha += 10; + if (NPC.alpha >= 255) + { + // Set position to teleport destination + NPC.Bottom = new Vector2(NPC.ai[1], NPC.ai[3]); + + // Reset alpha and set AI to next phase (End of teleport) + NPC.alpha = 255; + NPC.ai[0] = 7f; + NPC.localAI[2] = 0f; + NPC.netUpdate = true; + } + + // Play sound for cool effect + if (NPC.soundDelay == 0) + { + NPC.soundDelay = 15; + SoundEngine.PlaySound(TeleportSound, NPC.Center); + } + + // Emit dust to make the teleport pretty + for (int i = 0; i < 10; i++) + { + int teleportDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), NPC.velocity.X, NPC.velocity.Y, 255, default, 2f); + Main.dust[teleportDust].noGravity = true; + Main.dust[teleportDust].velocity *= 0.5f; + } + + CustomGravity(); + } + + // End of teleport + else if (NPC.ai[0] == 7f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + // Turn visible + NPC.alpha -= 10; + if (NPC.alpha <= 0) + { + // Spawn Aureus Spawns + bool spawnFlag = expertMode; + if (NPC.CountNPCS(ModContent.NPCType()) >= 2) + spawnFlag = false; + + if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) + { + int aureusSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y - 25f * NPC.scale), ModContent.NPCType()); + Main.npc[aureusSpawn].velocity.Y = -10f; + Main.npc[aureusSpawn].netUpdate = true; + if (revenge) + { + aureusSpawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y - 25f * NPC.scale), ModContent.NPCType()); + Main.npc[aureusSpawn].velocity.Y = -15f; + Main.npc[aureusSpawn].netUpdate = true; + } + + if (death) + { + int damageAmt = NPC.lifeMax / 50; + NPC.life -= damageAmt; + if (NPC.life < 1) + NPC.life = 1; + + NPC.DamageEffect(damageAmt); + } + } + + // Reset alpha and set AI to next phase (Idle) + NPC.alpha = 0; + NPC.ai[0] = exhausted ? 1f : 2f; + NPC.ai[1] = 0f; + NPC.ai[2] += 1f; + NPC.localAI[3] = noProjectileOrPhaseIncrementTime; + + // Stop colliding with tiles if entering walking phase + NPC.noTileCollide = NPC.ai[0] == 2f; + + NPC.netUpdate = true; + } + + // Play sound at teleport destination for cool effect + if (NPC.soundDelay == 0) + { + NPC.soundDelay = 15; + SoundEngine.PlaySound(SoundID.Item109, NPC.Center); + } + + // Emit dust to make the teleport pretty + for (int i = 0; i < 10; i++) + { + int teleportDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, ModContent.DustType(), NPC.velocity.X, NPC.velocity.Y, 255, default, 2f); + Main.dust[teleportDust].noGravity = true; + Main.dust[teleportDust].velocity *= 0.5f; + } + + CustomGravity(); + } + + void CustomGravity() + { + float gravity = 0.36f + 0.12f * enrageScale; + float maxFallSpeed = reduceFallSpeed ? 12f : 12f + 4f * enrageScale; + + if (calamityGlobalNPC.newAI[1] > 0f && !reduceFallSpeed) + maxFallSpeed *= calamityGlobalNPC.newAI[1] + 1f; + + if (CalamityWorld.LegendaryMode && !reduceFallSpeed) + { + gravity *= 1.15f; + maxFallSpeed *= 1.15f; + } + + NPC.velocity.Y += gravity; + if (NPC.velocity.Y > maxFallSpeed) + NPC.velocity.Y = maxFallSpeed; + } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override void FindFrame(int frameHeight) { @@ -372,7 +1291,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; } @@ -511,7 +1430,6 @@ namespace CalamityMod.NPCs.AstrumAureus public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } // Can only hit the target if within certain distance diff --git a/NPCs/AstrumAureus/AureusSpawn.cs b/NPCs/AstrumAureus/AureusSpawn.cs index 3daa83d2c7..c0d00b5ab8 100644 --- a/NPCs/AstrumAureus/AureusSpawn.cs +++ b/NPCs/AstrumAureus/AureusSpawn.cs @@ -35,9 +35,9 @@ namespace CalamityMod.NPCs.AstrumAureus public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 55; // 110 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 90; NPC.height = 60; NPC.Opacity = 0f; @@ -308,11 +308,10 @@ namespace CalamityMod.NPCs.AstrumAureus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 36 : (3 + (int)((NPC.scale - 1f) * 3)); + int totalProjectiles = CalamityWorld.LegendaryMode ? 36 : (3 + (int)((NPC.scale - 1f) * 3)); double radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage2 = NPC.GetProjectileDamage(type); - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10f : 6f; + float velocity = CalamityWorld.LegendaryMode ? 10f : 6f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); @@ -320,7 +319,7 @@ namespace CalamityMod.NPCs.AstrumAureus for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, damage2, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, vector255, type, AstrumAureus.LaserDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/AstrumDeus/AstrumDeusBody.cs b/NPCs/AstrumDeus/AstrumDeusBody.cs index ecfa2a3a11..594be9b998 100644 --- a/NPCs/AstrumDeus/AstrumDeusBody.cs +++ b/NPCs/AstrumDeus/AstrumDeusBody.cs @@ -1,13 +1,16 @@ -using System.IO; +using System; +using System.IO; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; @@ -51,9 +54,13 @@ namespace CalamityMod.NPCs.AstrumDeus } } + public static int LaserDamage = 30; // 120 + public static int HelixLaserDamage = 40; // 160 + public static int MineDamage = 40; // 160 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 70; // 140 NPC.npcSlots = 5f; NPC.width = 38; NPC.height = 44; @@ -64,9 +71,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.5f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.4f; else if (CalamityWorld.revenge) NPC.scale *= 1.35f; @@ -84,9 +89,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.dontCountMe = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -112,7 +114,315 @@ namespace CalamityMod.NPCs.AstrumDeus public override void AI() { - AstrumDeusAI.VanillaAstrumDeusAI(NPC, Mod, false); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + // Difficulty variables + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + + float enrageScale = 0f; + if (Main.IsItDay()) + { + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + enrageScale += 1.5f; + } + + // Deus cannot hit for 3 seconds or while invulnerable + bool doNotDealDamage = calamityGlobalNPC.newAI[1] < 180f || NPC.dontTakeDamage; + if (doNotDealDamage) + NPC.damage = 0; + else + NPC.damage = NPC.defDamage; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool increaseSpeed = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles; + bool increaseSpeedMore = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; + + // Inflict Extreme Gravity to nearby players + if (revenge) + { + if (!Main.dedServ) + { + if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) + Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); + } + } + + // Life + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases based on life percentage + bool halfHealth = lifeRatio < 0.5f; + bool doubleWormPhase = calamityGlobalNPC.newAI[0] != 0f; + bool startFlightPhase = lifeRatio < 0.8f || death || doubleWormPhase; + bool phase2 = lifeRatio < 0.5f && doubleWormPhase && expertMode; + bool phase3 = lifeRatio < 0.2f && doubleWormPhase && expertMode; + bool splittingMines = lifeRatio < 0.7f; + bool movingMines = lifeRatio < 0.3f && doubleWormPhase && expertMode; + bool deathModeEnragePhase_Head = calamityGlobalNPC.newAI[0] == 3f; + bool deathModeEnragePhase_BodyAndTail = false; + + // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing + float resistanceTime = doubleWormPhase ? 300f : 600f; + + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; + + // Flight timer + float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + + calamityGlobalNPC.newAI[3] += 1f; + if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) + calamityGlobalNPC.newAI[3] = 0f; + // Sound effect for swapping between attack behaviors in phase 2 + if (doubleWormPhase && calamityGlobalNPC.newAI[3] % aiSwitchTimer == 0f && !(deathModeEnragePhase_Head || deathModeEnragePhase_BodyAndTail)) + SoundEngine.PlaySound(AstrumDeusHead.SplitSound with { Pitch = -0.2f, Volume = 0.9f }, player.Center); + + // Phase for flying at the player + bool flyAtTarget = calamityGlobalNPC.newAI[3] >= (aiSwitchTimer * 0.5f) && startFlightPhase; + + // Length of worms + int phase1Length = death ? 80 : revenge ? 70 : expertMode ? 60 : 50; + int phase2Length = death ? 40 : revenge ? 35 : expertMode ? 30 : 25; + int gfbLength = death ? 8 : revenge ? 7 : expertMode ? 6 : 5; + int maxLength = Main.zenithWorld && doubleWormPhase ? gfbLength : doubleWormPhase ? phase2Length : phase1Length; + + // Become gradually more pissed as more worms are killed + int gfbMaxWormCount = 10; + int gfbWormCount = 0; + if (CalamityWorld.MaliceMode) + gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); + if (gfbWormCount > gfbMaxWormCount) + gfbWormCount = gfbMaxWormCount; + if (gfbWormCount > 0) + enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; + + // Copy dontTakeDamage and Opacity from head + NPC.dontTakeDamage = Main.npc[(int)NPC.ai[2]].dontTakeDamage; + NPC.Opacity = Main.npc[(int)NPC.ai[2]].Opacity; + deathModeEnragePhase_BodyAndTail = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; + if (deathModeEnragePhase_BodyAndTail) + { + NPC.defense = 25; + calamityGlobalNPC.DR = 0.15f; + } + + // Set worm variable + if (NPC.ai[2] > 0f) + NPC.realLife = (int)NPC.ai[2]; + + // Alpha effects + if (Main.npc[(int)NPC.ai[1]].alpha < 128 && !NPC.dontTakeDamage) + { + NPC.alpha -= 42; + if (NPC.alpha < 0) + NPC.alpha = 0; + } + + // Check if other segments are still alive, if not, die + bool shouldDespawn = true; + int headType = ModContent.NPCType(); + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].type != headType || !Main.npc[i].active) + continue; + shouldDespawn = false; + break; + } + if (shouldDespawn) + { + if (Main.npc.IndexInRange((int)NPC.ai[1]) && Main.npc[(int)NPC.ai[1]].active && Main.npc[(int)NPC.ai[1]].life > 0) + shouldDespawn = false; + } + if (shouldDespawn) + { + NPC.life = 0; + NPC.HitEffect(0, 10.0); + NPC.checkDead(); + NPC.active = false; + NPC.ForceNetUpdate(false); + } + + // Direction + if (NPC.velocity.X < 0f) + NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; + + if (NPC.life > Main.npc[(int)NPC.ai[1]].life) + NPC.life = Main.npc[(int)NPC.ai[1]].life; + + bool hasJustSpawned = calamityGlobalNPC.newAI[1] < resistanceTime * 0.4f && !doubleWormPhase; // Speed boost for the first 4 seconds after spawning + float segmentVelocity = hasJustSpawned ? 25f : deathModeEnragePhase_Head ? 19f : death ? 17.5f : 16f; + + float segmentVelocityBoost = 5f * (1f - lifeRatio); + segmentVelocity += segmentVelocityBoost; + segmentVelocity += 4f * enrageScale; + + if (revenge) + { + float revMultiplier = 1.1f; + segmentVelocity *= revMultiplier; + } + + // Shoot lasers + NPC.localAI[0] += 1f; + + int shootTime = (doubleWormPhase && expertMode) ? 2 : 1; + float shootProjectile = (doubleWormPhase && expertMode) ? 200 : 400; + float timer = NPC.ai[0] + 15f; + float divisor = timer + shootProjectile; + bool canFireProjectiles = NPC.Opacity >= 1f; + bool shootGodRays = phase2 || deathModeEnragePhase_BodyAndTail; + + if (canFireProjectiles) + { + if (!flyAtTarget || deathModeEnragePhase_BodyAndTail) + { + float laserDivisor = (phase2 && !deathModeEnragePhase_BodyAndTail) ? 4f : 2f; + if (NPC.localAI[0] % divisor == 0f && NPC.ai[0] % laserDivisor == 0f) + { + NPC.TargetClosest(); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (deathModeEnragePhase_BodyAndTail) + { + Vector2 velocity = Vector2.Zero; + if (movingMines) + { + Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + randomMineMovement.Normalize(); + randomMineMovement *= Main.rand.Next(90, 121) * 0.01f; + velocity = randomMineMovement; + } + + int type = ModContent.ProjectileType(); + float split = (splittingMines && NPC.ai[0] % 3f == 0f) ? 1f : 0f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, MineDamage, 0f, Main.myPlayer, split, 0f); + } + } + + if (Vector2.Distance(player.Center, NPC.Center) > 80f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float deusLaserSpeed = (death ? 16f : revenge ? 14f : 13f) + enrageScale * 4f; + + Vector2 deusLaserCenter = NPC.Center; + float deusLaserTargetX = player.Center.X - deusLaserCenter.X; + float deusLaserTargetY = player.Center.Y - deusLaserCenter.Y; + float deusLaserTargetDist = (float)Math.Sqrt(deusLaserTargetX * deusLaserTargetX + deusLaserTargetY * deusLaserTargetY); + deusLaserTargetDist = deusLaserSpeed / deusLaserTargetDist; + deusLaserTargetX *= deusLaserTargetDist; + deusLaserTargetY *= deusLaserTargetDist; + deusLaserCenter.X += deusLaserTargetX * 5f; + deusLaserCenter.Y += deusLaserTargetY * 5f; + + Vector2 shootDirection = new Vector2(deusLaserTargetX, deusLaserTargetY).SafeNormalize(Vector2.UnitY); + Vector2 laserVelocity = shootDirection * deusLaserSpeed; + + int type = shootGodRays ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = shootGodRays ? HelixLaserDamage : LaserDamage; + if (shootGodRays) + { + SoundEngine.PlaySound(AstrumDeusHead.GodRaySound, NPC.Center); + // Waving beams need to start offset so they cross each other neatly. + float waveSideOffset = Main.rand.NextFloat(9f, 14f); + Vector2 perp = shootDirection.RotatedBy(-MathHelper.PiOver2) * waveSideOffset; + + for (int i = -1; i <= 1; i += 2) + { + Vector2 laserStartPos = deusLaserCenter + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); + Projectile godRay = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), laserStartPos, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + + // Tell this Phased God Ray exactly which way it should be waving. + godRay.localAI[1] = i * 0.5f; + } + } + else + { + SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); + Projectile.NewProjectile(NPC.GetSource_FromAI(), deusLaserCenter, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); + } + } + } + } + } + else + { + if (NPC.localAI[0] % divisor == 0f && NPC.ai[0] % 2f == 0f) + { + Vector2 velocity = Vector2.Zero; + if (movingMines) + { + Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); + randomMineMovement.Normalize(); + randomMineMovement *= Main.rand.Next(30, 121) * 0.01f; + velocity = randomMineMovement; + } + + int type = ModContent.ProjectileType(); + float split = (splittingMines && NPC.ai[0] % 3f == 0f) ? 1f : 0f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, MineDamage, 0f, Main.myPlayer, split, 0f); + } + } + } + + // Follow the head + Vector2 segmentCenter = NPC.Center; + float segmentTargetX = player.Center.X; + float segmentTargetY = player.Center.Y; + segmentTargetX = (int)(segmentTargetX / 16f) * 16; + segmentTargetY = (int)(segmentTargetY / 16f) * 16; + segmentCenter.X = (int)(segmentCenter.X / 16f) * 16; + segmentCenter.Y = (int)(segmentCenter.Y / 16f) * 16; + segmentTargetX -= segmentCenter.X; + segmentTargetY -= segmentCenter.Y; + + if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length) + { + try + { + segmentCenter = NPC.Center; + segmentTargetX = Main.npc[(int)NPC.ai[1]].Center.X - segmentCenter.X; + segmentTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - segmentCenter.Y; + } + catch + { + } + + NPC.rotation = (float)Math.Atan2(segmentTargetY, segmentTargetX) + MathHelper.PiOver2; + float segmentTargetDist = (float)Math.Sqrt(segmentTargetX * segmentTargetX + segmentTargetY * segmentTargetY); + int segmentWidth = NPC.width; + segmentTargetDist = (segmentTargetDist - segmentWidth) / segmentTargetDist; + segmentTargetX *= segmentTargetDist; + segmentTargetY *= segmentTargetDist; + NPC.velocity = Vector2.Zero; + NPC.position.X = NPC.position.X + segmentTargetX; + NPC.position.Y = NPC.position.Y + segmentTargetY; + + if (segmentTargetX < 0f) + NPC.spriteDirection = -1; + else if (segmentTargetX > 0f) + NPC.spriteDirection = 1; + } + + // Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer + if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase) + { + SoundEngine.PlaySound(AstrumDeusHead.SpawnSound, NPC.Center); + calamityGlobalNPC.newAI[1] = 1f; + } + + // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing + if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) + calamityGlobalNPC.newAI[1] += 1f; } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -130,7 +440,7 @@ namespace CalamityMod.NPCs.AstrumDeus // Need segment amount to get a smooth transition down the worm based on length int segmentAmt = Main.zenithWorld ? (CalamityWorld.death ? 8 : CalamityWorld.revenge ? 7 : Main.expertMode ? 6 : 5) : (CalamityWorld.death ? 40 : CalamityWorld.revenge ? 35 : Main.expertMode ? 30 : 25); - float cyanThreshold = Main.getGoodWorld ? 300f : 600f; + float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; float transitionStart = MathHelper.Lerp(cyanThreshold * 0.75f, cyanThreshold * 0.95f, 1f - (NPC.ai[3] / (float)segmentAmt)); float transitionEnd = MathHelper.Lerp(cyanThreshold * 0.8f, cyanThreshold, 1f - (NPC.ai[3] / (float)segmentAmt)); bool drawCyan = NPC.Calamity().newAI[3] >= transitionEnd && NPC.Calamity().newAI[3] <= cyanThreshold + transitionEnd; @@ -259,7 +569,6 @@ namespace CalamityMod.NPCs.AstrumDeus public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/AstrumDeus/AstrumDeusHead.cs b/NPCs/AstrumDeus/AstrumDeusHead.cs index eb5c436317..bdb41f24a9 100644 --- a/NPCs/AstrumDeus/AstrumDeusHead.cs +++ b/NPCs/AstrumDeus/AstrumDeusHead.cs @@ -1,6 +1,7 @@ -using System.IO; -using CalamityMod.BiomeManagers; +using System; +using System.IO; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Accessories; @@ -17,8 +18,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Packets; using CalamityMod.UI.VanillaBossBars; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -78,7 +78,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 120; // 240 NPC.npcSlots = 5f; NPC.width = 56; NPC.height = 56; @@ -89,9 +89,7 @@ namespace CalamityMod.NPCs.AstrumDeus AIType = -1; NPC.knockBackResist = 0f; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.5f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.4f; else if (CalamityWorld.revenge) NPC.scale *= 1.35f; @@ -100,7 +98,7 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); - NPC.value = Item.buyPrice(0, 50, 0, 0); + NPC.value = Item.buyPrice(gold: 50); NPC.alpha = 255; NPC.behindTiles = true; NPC.noGravity = true; @@ -119,9 +117,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.value /= 5; } - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -149,7 +144,639 @@ namespace CalamityMod.NPCs.AstrumDeus public override void AI() { - AstrumDeusAI.VanillaAstrumDeusAI(NPC, Mod, true); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + // Difficulty variables + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + + float enrageScale = 0f; + if (Main.IsItDay()) + { + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + enrageScale += 1.5f; + } + + // Deus cannot hit for 3 seconds or while invulnerable + bool doNotDealDamage = calamityGlobalNPC.newAI[1] < 180f || NPC.dontTakeDamage; + if (doNotDealDamage) + NPC.damage = 0; + else + NPC.damage = NPC.defDamage; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool increaseSpeed = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles; + bool increaseSpeedMore = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; + + // Despawn safety, make sure to target another player if the current player target is too far away + if (increaseSpeedMore) + NPC.TargetClosest(); + + // Inflict Extreme Gravity to nearby players + if (revenge) + { + if (!Main.dedServ) + { + if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) + Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); + } + } + + // Life + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases based on life percentage + bool halfHealth = lifeRatio < 0.5f; + bool doubleWormPhase = calamityGlobalNPC.newAI[0] != 0f; + bool startFlightPhase = lifeRatio < 0.8f || death || doubleWormPhase; + bool phase2 = lifeRatio < 0.5f && doubleWormPhase && expertMode; + bool phase3 = lifeRatio < 0.2f && doubleWormPhase && expertMode; + bool splittingMines = lifeRatio < 0.7f; + bool movingMines = lifeRatio < 0.3f && doubleWormPhase && expertMode; + bool deathModeEnragePhase_Head = calamityGlobalNPC.newAI[0] == 3f; + bool deathModeEnragePhase_BodyAndTail = false; + + // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing + float resistanceTime = doubleWormPhase ? 300f : 600f; + + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; + + // Flight timer + float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + + calamityGlobalNPC.newAI[3] += 1f; + if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) + calamityGlobalNPC.newAI[3] = 0f; + // Sound effect for swapping between attack behaviors in phase 2 + if (doubleWormPhase && calamityGlobalNPC.newAI[3] % aiSwitchTimer == 0f && !(deathModeEnragePhase_Head || deathModeEnragePhase_BodyAndTail)) + SoundEngine.PlaySound(SplitSound with { Pitch = -0.2f, Volume = 0.9f }, player.Center); + + // Phase for flying at the player + bool flyAtTarget = calamityGlobalNPC.newAI[3] >= (aiSwitchTimer * 0.5f) && startFlightPhase; + + // Length of worms + int phase1Length = death ? 80 : revenge ? 70 : expertMode ? 60 : 50; + int phase2Length = death ? 40 : revenge ? 35 : expertMode ? 30 : 25; + int gfbLength = death ? 8 : revenge ? 7 : expertMode ? 6 : 5; + int maxLength = Main.zenithWorld && doubleWormPhase ? gfbLength : doubleWormPhase ? phase2Length : phase1Length; + + // Become gradually more pissed as more worms are killed + int gfbMaxWormCount = 10; + int gfbWormCount = 0; + if (CalamityWorld.MaliceMode) + gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); + if (gfbWormCount > gfbMaxWormCount) + gfbWormCount = gfbMaxWormCount; + if (gfbWormCount > 0) + enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; + + // Split into two worms + float splitAnimationTime = 180f; + bool oneWormAlive = NPC.CountNPCS(ModContent.NPCType()) < 2; + bool deathModeFinalWormEnrage = death && doubleWormPhase && oneWormAlive && calamityGlobalNPC.newAI[1] >= resistanceTime; + if (deathModeFinalWormEnrage) + { + if (calamityGlobalNPC.newAI[0] != 3f) + { + SoundEngine.PlaySound(SplitSound, player.Center); + calamityGlobalNPC.newAI[0] = 3f; + NPC.defense = 12; + calamityGlobalNPC.DR = 0.075f; + + // Despawns the other deus worm segments + int bodyID = ModContent.NPCType(); + int tailID = ModContent.NPCType(); + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC wormseg = Main.npc[i]; + if (!wormseg.active) + continue; + + if ((wormseg.type == bodyID || wormseg.type == tailID) && Main.npc[(int)wormseg.ai[2]].Calamity().newAI[0] != 3f) + { + wormseg.life = 0; + wormseg.active = false; + } + } + } + + calamityGlobalNPC.newAI[2] += 10f; + if (calamityGlobalNPC.newAI[2] > 162f) + calamityGlobalNPC.newAI[2] = 162f; + + NPC.Opacity = MathHelper.Clamp(1f - (calamityGlobalNPC.newAI[2] / splitAnimationTime), 0f, 1f); + } + + bool despawnRemainingWorm = doubleWormPhase && oneWormAlive && !death; + if ((halfHealth && calamityGlobalNPC.newAI[0] == 0f) || despawnRemainingWorm) + { + NPC.dontTakeDamage = true; + + calamityGlobalNPC.newAI[2] += despawnRemainingWorm ? 10f : 1f; + NPC.Opacity = MathHelper.Clamp(1f - (calamityGlobalNPC.newAI[2] / splitAnimationTime), 0f, 1f); + + bool despawning = calamityGlobalNPC.newAI[2] == splitAnimationTime; + + // + // CODE TWEAKED BY: OZZATRON + // September 20th, 2020 + // reason: fixing Astrum Deus death mode NPC cap bug + // + + // Despawn the unsplit Astrum Deus and spawn two half-size Astrum Deus worms. + if (despawning) + { + // If this is already a split worm (newAI[0] != 0f) then don't do anything. At all. + if (doubleWormPhase) + return; + + // Mark all existing body and tail segments as inactive. This instantly frees up their NPC slots for the freshly spawned worms. + int bodyID = ModContent.NPCType(); + int tailID = ModContent.NPCType(); + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC wormseg = Main.npc[i]; + if (!wormseg.active) + continue; + if (wormseg.type == bodyID || wormseg.type == tailID) + { + wormseg.life = 0; + wormseg.active = false; + } + } + + // The unsplit Astrum Deus worm head will die next frame. + NPC.life = 0; + + // Do not spawn worms client side. The server handles this. + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int wormamt = Main.zenithWorld ? 5 : 1; + for (int i = 0; i < wormamt; i++) + { + // Now that the original worm doesn't exist, startCount can be zero. + // int startCount = NPC.whoAmI + phase1Length + 1; + int startIndexHeadOne = 1; + int headOneID = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPC.type, startIndexHeadOne); + Main.npc[headOneID].Calamity().newAI[0] = 1f; + Main.npc[headOneID].velocity = Vector2.Normalize(player.Center - Main.npc[headOneID].Center) * 16f; + Main.npc[headOneID].timeLeft *= 20; + Main.npc[headOneID].ForceNetUpdate(); + + // On server, immediately send the correct extra AI of this head to clients. + if (Main.dedServ) + { + SyncCalamityNPCAIArrayPacket.Send(Main.npc[headOneID]); + } + + // Make sure the second split worm is also contiguous. + int startIndexHeadTwo = startIndexHeadOne + phase2Length + 1; + int headTwoID = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPC.type, startIndexHeadTwo); + Main.npc[headTwoID].Calamity().newAI[0] = 2f; + Main.npc[headTwoID].Calamity().newAI[3] = CalamityWorld.LegendaryMode ? 300f : 600f; + Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f; + Main.npc[headTwoID].timeLeft *= 20; + Main.npc[headTwoID].ForceNetUpdate(); + + // On server, immediately send the correct extra AI of this head to clients. + if (Main.dedServ) + { + SyncCalamityNPCAIArrayPacket.Send(Main.npc[headTwoID]); + } + } + + SoundEngine.PlaySound(AstrumDeusHead.SplitSound, player.Center); + } + return; + } + } + + if (Main.zenithWorld && calamityGlobalNPC.newAI[1] < 10f) // desync the deuses + { + float pushForce = 0.25f; + for (int k = 0; k < Main.maxNPCs; k++) + { + NPC otherDeus = Main.npc[k]; + // Short circuits to make the loop as fast as possible + if (!otherDeus.active || k == NPC.whoAmI) + continue; + + // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. + bool sameProjType = otherDeus.type == NPC.type; + float taxicabDist = Vector2.Distance(NPC.Center, otherDeus.Center); + float distancegate = 320f; + if (sameProjType && taxicabDist < distancegate) + { + if (NPC.position.X < otherDeus.position.X) + NPC.velocity.X -= pushForce; + else + NPC.velocity.X += pushForce; + + if (NPC.position.Y < otherDeus.position.Y) + NPC.velocity.Y -= pushForce; + else + NPC.velocity.Y += pushForce; + } + } + } + + // Set worm variable + if (NPC.ai[2] > 0f) + NPC.realLife = (int)NPC.ai[2]; + + // Alpha effects + NPC.alpha -= 42; + if (NPC.alpha < 0) + NPC.alpha = 0; + + // Direction + if (NPC.velocity.X < 0f) + NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (NPC.ai[0] == 0f) + { + int Previous = NPC.whoAmI; + int bodyType = ModContent.NPCType(); + int tailType = ModContent.NPCType(); + for (int segments = 0; segments < maxLength; segments++) + { + int lol; + if (segments >= 0 && segments < maxLength - 1) + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, bodyType, NPC.whoAmI); + else + lol = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, tailType, NPC.whoAmI); + + if (segments % 2 == 0) + Main.npc[lol].localAI[3] = 1f; + + Main.npc[lol].realLife = NPC.whoAmI; + Main.npc[lol].Calamity().newAI[0] = Main.npc[Previous].Calamity().newAI[0]; + Main.npc[lol].Calamity().newAI[3] = Main.npc[Previous].Calamity().newAI[3]; + + if (Main.dedServ) + { + SyncCalamityNPCAIArrayPacket.Send(Main.npc[lol]); + } + + Main.npc[lol].ai[3] = segments + 1; + Main.npc[lol].ai[2] = NPC.whoAmI; + Main.npc[lol].ai[1] = Previous; + Main.npc[Previous].ai[0] = lol; + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol); + Previous = lol; + } + } + } + + if (NPC.life > Main.npc[(int)NPC.ai[0]].life) + NPC.life = Main.npc[(int)NPC.ai[0]].life; + + bool hasJustSpawned = calamityGlobalNPC.newAI[1] < resistanceTime * 0.4f && !doubleWormPhase; // Speed boost for the first 4 seconds after spawning + float segmentVelocity = hasJustSpawned ? 25f : deathModeEnragePhase_Head ? 19f : death ? 17.5f : 16f; + + float segmentVelocityBoost = 5f * (1f - lifeRatio); + segmentVelocity += segmentVelocityBoost; + segmentVelocity += 4f * enrageScale; + + if (revenge) + { + float revMultiplier = 1.1f; + segmentVelocity *= revMultiplier; + } + + int headTilePositionX = (int)(NPC.position.X / 16f) - 1; + int headTileWidthPosX = (int)((NPC.position.X + NPC.width) / 16f) + 2; + int headTilePositionY = (int)(NPC.position.Y / 16f) - 1; + int headTileWidthPosY = (int)((NPC.position.Y + NPC.height) / 16f) + 2; + + if (headTilePositionX < 0) + headTilePositionX = 0; + if (headTileWidthPosX > Main.maxTilesX) + headTileWidthPosX = Main.maxTilesX; + if (headTilePositionY < 0) + headTilePositionY = 0; + if (headTileWidthPosY > Main.maxTilesY) + headTileWidthPosY = Main.maxTilesY; + + // Fly or not + bool shouldFly = flyAtTarget; + if (!shouldFly) + { + for (int k = headTilePositionX; k < headTileWidthPosX; k++) + { + for (int l = headTilePositionY; l < headTileWidthPosY; l++) + { + if (Main.tile[k, l] != null && ((Main.tile[k, l].HasUnactuatedTile && (Main.tileSolid[Main.tile[k, l].TileType] || (Main.tileSolidTop[Main.tile[k, l].TileType] && Main.tile[k, l].TileFrameY == 0))) || Main.tile[k, l].LiquidAmount > 64)) + { + Vector2 vector2; + vector2.X = k * 16f; + vector2.Y = l * 16f; + if (NPC.position.X + NPC.width > vector2.X && NPC.position.X < vector2.X + 16f && NPC.position.Y + NPC.height > vector2.Y && NPC.position.Y < vector2.Y + 16f) + { + shouldFly = true; + break; + } + } + } + } + } + + // Start flying if target is not within a certain distance + if (!shouldFly) + { + NPC.localAI[1] = 1f; + + Rectangle rectangle = new Rectangle((int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height); + int noFlyZone = 200; + int heightReduction = death ? 130 : (int)(130f * (1f - lifeRatio)); + int height = 400 - heightReduction; + bool outsideNoFlyZone = true; + + if (NPC.position.Y > player.position.Y) + { + for (int m = 0; m < Main.maxPlayers; m++) + { + if (Main.player[m].active) + { + Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - noFlyZone, (int)Main.player[m].position.Y - noFlyZone, noFlyZone * 2, height); + if (rectangle.Intersects(rectangle2)) + { + outsideNoFlyZone = false; + break; + } + } + } + + if (outsideNoFlyZone) + shouldFly = true; + } + } + else + NPC.localAI[1] = 0f; + + // Despawn + if (player.dead) + { + shouldFly = false; + float velocity = 2f; + NPC.velocity.Y -= velocity; + if ((double)NPC.position.Y < Main.topWorld + 16f) + { + segmentVelocity *= 2f; + NPC.velocity.Y -= velocity; + } + + int headType = ModContent.NPCType(); + int bodyType = ModContent.NPCType(); + int tailType = ModContent.NPCType(); + if ((double)NPC.position.Y < Main.topWorld + 16f) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].type == headType || Main.npc[i].type == bodyType || Main.npc[i].type == tailType) + { + Main.npc[i].active = false; + Main.npc[i].ForceNetUpdate(false); + } + } + } + } + + // Speed and movement + float speedBoost = death ? (0.1f * (1f - lifeRatio)) : (0.13f * (1f - lifeRatio)); + float turnSpeedBoost = death ? (0.18f * (1f - lifeRatio)) : (0.2f * (1f - lifeRatio)); + float speed = (hasJustSpawned ? 0.26f : deathModeEnragePhase_Head ? 0.2f : death ? 0.18f : 0.13f) + speedBoost; + float turnSpeed = (hasJustSpawned ? 0.3f : deathModeEnragePhase_Head ? 0.27f : death ? 0.25f : 0.2f) + turnSpeedBoost; + speed += 0.05f * enrageScale; + turnSpeed += 0.08f * enrageScale; + + if (flyAtTarget) + { + float speedMultiplier = deathModeEnragePhase_Head ? 1.25f : doubleWormPhase ? (phase3 ? 1.25f : phase2 ? 1.2f : 1.15f) : 1f; + speed *= speedMultiplier; + } + + if (revenge) + { + float revMultiplier = 1.1f; + speed *= revMultiplier; + turnSpeed *= revMultiplier; + } + + speed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; + turnSpeed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; + + if (CalamityWorld.LegendaryMode) + { + speed *= 1.15f; + turnSpeed *= 1.15f; + } + + Vector2 deusCenter = NPC.Center; + float deusTargetX = player.Center.X; + float deusTargetY = player.Center.Y; + deusTargetX = (int)(deusTargetX / 16f) * 16; + deusTargetY = (int)(deusTargetY / 16f) * 16; + deusCenter.X = (int)(deusCenter.X / 16f) * 16; + deusCenter.Y = (int)(deusCenter.Y / 16f) * 16; + deusTargetX -= deusCenter.X; + deusTargetY -= deusCenter.Y; + + if (!shouldFly) + { + NPC.velocity.Y += 0.15f; + if (NPC.velocity.Y > segmentVelocity) + NPC.velocity.Y = segmentVelocity; + + // This bool exists to stop the strange wiggle behavior when worms are falling down + bool slowXVelocity = Math.Abs(NPC.velocity.X) > speed; + if ((Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < segmentVelocity * 0.4) + { + if (NPC.velocity.X < 0f) + NPC.velocity.X -= speed * 1.1f; + else + NPC.velocity.X += speed * 1.1f; + } + else if (NPC.velocity.Y == segmentVelocity) + { + if (slowXVelocity) + { + if (NPC.velocity.X < deusTargetX) + NPC.velocity.X += speed; + else if (NPC.velocity.X > deusTargetX) + NPC.velocity.X -= speed; + } + else + NPC.velocity.X = 0f; + } + else if (NPC.velocity.Y > 4f) + { + if (slowXVelocity) + { + if (NPC.velocity.X < 0f) + NPC.velocity.X += speed * 0.9f; + else + NPC.velocity.X -= speed * 0.9f; + } + else + NPC.velocity.X = 0f; + } + } + else + { + float deusTargetDist = (float)Math.Sqrt(deusTargetX * deusTargetX + deusTargetY * deusTargetY); + float deusAbsoluteTargetX = Math.Abs(deusTargetX); + float deusAbsoluteTargetY = Math.Abs(deusTargetY); + float deusTimeToReachTarget = segmentVelocity / deusTargetDist; + deusTargetX *= deusTimeToReachTarget; + deusTargetY *= deusTimeToReachTarget; + + bool speedUpWhileFlying = false; + if (flyAtTarget) + { + if (((NPC.velocity.X > 0f && deusTargetX < 0f) || (NPC.velocity.X < 0f && deusTargetX > 0f) || (NPC.velocity.Y > 0f && deusTargetY < 0f) || (NPC.velocity.Y < 0f && deusTargetY > 0f)) && Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y) > speed / 2f && deusTargetDist < 400f) + { + speedUpWhileFlying = true; + + if (Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y) < segmentVelocity) + NPC.velocity *= 1.1f; + } + + if (NPC.position.Y > player.position.Y) + { + speedUpWhileFlying = true; + + if (Math.Abs(NPC.velocity.X) < segmentVelocity / 2f) + { + if (NPC.velocity.X == 0f) + NPC.velocity.X -= NPC.direction; + + NPC.velocity.X *= 1.1f; + } + else if (NPC.velocity.Y > -segmentVelocity) + NPC.velocity.Y -= speed; + } + } + + if (!speedUpWhileFlying) + { + if (!flyAtTarget) + { + if (((NPC.velocity.X > 0f && deusTargetX > 0f) || (NPC.velocity.X < 0f && deusTargetX < 0f)) && ((NPC.velocity.Y > 0f && deusTargetY > 0f) || (NPC.velocity.Y < 0f && deusTargetY < 0f))) + { + if (NPC.velocity.X < deusTargetX) + NPC.velocity.X += turnSpeed; + else if (NPC.velocity.X > deusTargetX) + NPC.velocity.X -= turnSpeed; + + if (NPC.velocity.Y < deusTargetY) + NPC.velocity.Y += turnSpeed; + else if (NPC.velocity.Y > deusTargetY) + NPC.velocity.Y -= turnSpeed; + } + } + + if ((NPC.velocity.X > 0f && deusTargetX > 0f) || (NPC.velocity.X < 0f && deusTargetX < 0f) || (NPC.velocity.Y > 0f && deusTargetY > 0f) || (NPC.velocity.Y < 0f && deusTargetY < 0f)) + { + if (NPC.velocity.X < deusTargetX) + NPC.velocity.X += speed; + else if (NPC.velocity.X > deusTargetX) + NPC.velocity.X -= speed; + + if (NPC.velocity.Y < deusTargetY) + NPC.velocity.Y += speed; + else if (NPC.velocity.Y > deusTargetY) + NPC.velocity.Y -= speed; + + if (Math.Abs(deusTargetY) < segmentVelocity * 0.2 && ((NPC.velocity.X > 0f && deusTargetX < 0f) || (NPC.velocity.X < 0f && deusTargetX > 0f))) + { + if (NPC.velocity.Y > 0f) + NPC.velocity.Y += speed * 2f; + else + NPC.velocity.Y -= speed * 2f; + } + + if (Math.Abs(deusTargetX) < segmentVelocity * 0.2 && ((NPC.velocity.Y > 0f && deusTargetY < 0f) || (NPC.velocity.Y < 0f && deusTargetY > 0f))) + { + if (NPC.velocity.X > 0f) + NPC.velocity.X += speed * 2f; + else + NPC.velocity.X -= speed * 2f; + } + } + else if (deusAbsoluteTargetX > deusAbsoluteTargetY) + { + if (NPC.velocity.X < deusTargetX) + NPC.velocity.X += speed * 1.1f; + else if (NPC.velocity.X > deusTargetX) + NPC.velocity.X -= speed * 1.1f; + + if ((Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < segmentVelocity * 0.5) + { + if (NPC.velocity.Y > 0f) + NPC.velocity.Y += speed; + else + NPC.velocity.Y -= speed; + } + } + else + { + if (NPC.velocity.Y < deusTargetY) + NPC.velocity.Y += speed * 1.1f; + else if (NPC.velocity.Y > deusTargetY) + NPC.velocity.Y -= speed * 1.1f; + + if ((Math.Abs(NPC.velocity.X) + Math.Abs(NPC.velocity.Y)) < segmentVelocity * 0.5) + { + if (NPC.velocity.X > 0f) + NPC.velocity.X += speed; + else + NPC.velocity.X -= speed; + } + } + } + } + + if (shouldFly) + { + if (NPC.localAI[0] != 1f) + NPC.ForceNetUpdate(false); + + NPC.localAI[0] = 1f; + } + else + { + if (NPC.localAI[0] != 0f) + NPC.ForceNetUpdate(false); + + NPC.localAI[0] = 0f; + } + + if (((NPC.velocity.X > 0f && NPC.oldVelocity.X < 0f) || (NPC.velocity.X < 0f && NPC.oldVelocity.X > 0f) || (NPC.velocity.Y > 0f && NPC.oldVelocity.Y < 0f) || (NPC.velocity.Y < 0f && NPC.oldVelocity.Y > 0f)) && !NPC.justHit) + NPC.ForceNetUpdate(false); + + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; + + // Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer + if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase) + { + SoundEngine.PlaySound(SpawnSound, NPC.Center); + calamityGlobalNPC.newAI[1] = 1f; + } + + // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing + if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) + calamityGlobalNPC.newAI[1] += 1f; } public override bool CheckActive() @@ -172,7 +799,7 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = NPC.Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - float cyanThreshold = Main.getGoodWorld ? 300f : 600f; + float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; // Head is always the last segment to visually transition float transitionStart = cyanThreshold * 0.95f; bool drawCyan = NPC.Calamity().newAI[3] >= cyanThreshold; @@ -272,9 +899,9 @@ 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); + public static bool ShouldNotDropThings(NPC NPC) => NPC.Calamity().newAI[0] == 0f || ((CalamityWorld.death || BossRushEvent.BossRushActive) && NPC.Calamity().newAI[0] != 3f); public override bool SpecialOnKill() { diff --git a/NPCs/AstrumDeus/AstrumDeusTail.cs b/NPCs/AstrumDeus/AstrumDeusTail.cs index 127a782e6c..ea8c9438e3 100644 --- a/NPCs/AstrumDeus/AstrumDeusTail.cs +++ b/NPCs/AstrumDeus/AstrumDeusTail.cs @@ -1,13 +1,15 @@ -using System.IO; +using System; +using System.IO; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Dusts; using CalamityMod.Events; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.ID; using Terraria.Localization; @@ -39,7 +41,7 @@ namespace CalamityMod.NPCs.AstrumDeus public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 60; // 120 NPC.npcSlots = 5f; NPC.width = 52; NPC.height = 68; @@ -50,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; @@ -70,9 +70,6 @@ namespace CalamityMod.NPCs.AstrumDeus NPC.dontCountMe = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -96,7 +93,211 @@ namespace CalamityMod.NPCs.AstrumDeus public override void AI() { - AstrumDeusAI.VanillaAstrumDeusAI(NPC, Mod, false); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + // Difficulty variables + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + + float enrageScale = 0f; + if (Main.IsItDay()) + { + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive; + enrageScale += 1.5f; + } + + // Deus cannot hit for 3 seconds or while invulnerable + bool doNotDealDamage = calamityGlobalNPC.newAI[1] < 180f || NPC.dontTakeDamage; + if (doNotDealDamage) + NPC.damage = 0; + else + NPC.damage = NPC.defDamage; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool increaseSpeed = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles; + bool increaseSpeedMore = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; + + // Inflict Extreme Gravity to nearby players + if (revenge) + { + if (!Main.dedServ) + { + if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) + Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); + } + } + + // Life + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases based on life percentage + bool halfHealth = lifeRatio < 0.5f; + bool doubleWormPhase = calamityGlobalNPC.newAI[0] != 0f; + bool startFlightPhase = lifeRatio < 0.8f || death || doubleWormPhase; + bool phase2 = lifeRatio < 0.5f && doubleWormPhase && expertMode; + bool phase3 = lifeRatio < 0.2f && doubleWormPhase && expertMode; + bool splittingMines = lifeRatio < 0.7f; + bool movingMines = lifeRatio < 0.3f && doubleWormPhase && expertMode; + bool deathModeEnragePhase_Head = calamityGlobalNPC.newAI[0] == 3f; + bool deathModeEnragePhase_BodyAndTail = false; + + // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing + float resistanceTime = doubleWormPhase ? 300f : 600f; + + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; + + // Flight timer + float aiSwitchTimer = doubleWormPhase ? (CalamityWorld.LegendaryMode ? 600f : 1200f) : (CalamityWorld.LegendaryMode ? 900f : 1800f); + + calamityGlobalNPC.newAI[3] += 1f; + if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) + calamityGlobalNPC.newAI[3] = 0f; + // Sound effect for swapping between attack behaviors in phase 2 + if (doubleWormPhase && calamityGlobalNPC.newAI[3] % aiSwitchTimer == 0f && !(deathModeEnragePhase_Head || deathModeEnragePhase_BodyAndTail)) + SoundEngine.PlaySound(AstrumDeusHead.SplitSound with { Pitch = -0.2f, Volume = 0.9f }, player.Center); + + // Phase for flying at the player + bool flyAtTarget = calamityGlobalNPC.newAI[3] >= (aiSwitchTimer * 0.5f) && startFlightPhase; + + // Length of worms + int phase1Length = death ? 80 : revenge ? 70 : expertMode ? 60 : 50; + int phase2Length = death ? 40 : revenge ? 35 : expertMode ? 30 : 25; + int gfbLength = death ? 8 : revenge ? 7 : expertMode ? 6 : 5; + int maxLength = Main.zenithWorld && doubleWormPhase ? gfbLength : doubleWormPhase ? phase2Length : phase1Length; + + // Become gradually more pissed as more worms are killed + int gfbMaxWormCount = 10; + int gfbWormCount = 0; + if (CalamityWorld.MaliceMode) + gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); + if (gfbWormCount > gfbMaxWormCount) + gfbWormCount = gfbMaxWormCount; + if (gfbWormCount > 0) + enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; + + // Copy dontTakeDamage and Opacity from head + NPC.dontTakeDamage = Main.npc[(int)NPC.ai[2]].dontTakeDamage; + NPC.Opacity = Main.npc[(int)NPC.ai[2]].Opacity; + deathModeEnragePhase_BodyAndTail = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; + if (deathModeEnragePhase_BodyAndTail) + { + NPC.defense = 25; + calamityGlobalNPC.DR = 0.15f; + } + + // Set worm variable + if (NPC.ai[2] > 0f) + NPC.realLife = (int)NPC.ai[2]; + + // Alpha effects + if (Main.npc[(int)NPC.ai[1]].alpha < 128 && !NPC.dontTakeDamage) + { + NPC.alpha -= 42; + if (NPC.alpha < 0) + NPC.alpha = 0; + } + + // Check if other segments are still alive, if not, die + bool shouldDespawn = true; + int headType = ModContent.NPCType(); + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].type != headType || !Main.npc[i].active) + continue; + shouldDespawn = false; + break; + } + if (shouldDespawn) + { + if (Main.npc.IndexInRange((int)NPC.ai[1]) && Main.npc[(int)NPC.ai[1]].active && Main.npc[(int)NPC.ai[1]].life > 0) + shouldDespawn = false; + } + if (shouldDespawn) + { + NPC.life = 0; + NPC.HitEffect(0, 10.0); + NPC.checkDead(); + NPC.active = false; + NPC.ForceNetUpdate(false); + } + + // Direction + if (NPC.velocity.X < 0f) + NPC.spriteDirection = -1; + else if (NPC.velocity.X > 0f) + NPC.spriteDirection = 1; + + if (NPC.life > Main.npc[(int)NPC.ai[1]].life) + NPC.life = Main.npc[(int)NPC.ai[1]].life; + + bool hasJustSpawned = calamityGlobalNPC.newAI[1] < resistanceTime * 0.4f && !doubleWormPhase; // Speed boost for the first 4 seconds after spawning + float segmentVelocity = hasJustSpawned ? 25f : deathModeEnragePhase_Head ? 19f : death ? 17.5f : 16f; + + float segmentVelocityBoost = 5f * (1f - lifeRatio); + segmentVelocity += segmentVelocityBoost; + segmentVelocity += 4f * enrageScale; + + if (revenge) + { + float revMultiplier = 1.1f; + segmentVelocity *= revMultiplier; + } + + // Follow the head + Vector2 segmentCenter = NPC.Center; + float segmentTargetX = player.Center.X; + float segmentTargetY = player.Center.Y; + segmentTargetX = (int)(segmentTargetX / 16f) * 16; + segmentTargetY = (int)(segmentTargetY / 16f) * 16; + segmentCenter.X = (int)(segmentCenter.X / 16f) * 16; + segmentCenter.Y = (int)(segmentCenter.Y / 16f) * 16; + segmentTargetX -= segmentCenter.X; + segmentTargetY -= segmentCenter.Y; + + if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length) + { + try + { + segmentCenter = NPC.Center; + segmentTargetX = Main.npc[(int)NPC.ai[1]].Center.X - segmentCenter.X; + segmentTargetY = Main.npc[(int)NPC.ai[1]].Center.Y - segmentCenter.Y; + } + catch + { + } + + NPC.rotation = (float)Math.Atan2(segmentTargetY, segmentTargetX) + MathHelper.PiOver2; + float segmentTargetDist = (float)Math.Sqrt(segmentTargetX * segmentTargetX + segmentTargetY * segmentTargetY); + int segmentWidth = NPC.width; + segmentTargetDist = (segmentTargetDist - segmentWidth) / segmentTargetDist; + segmentTargetX *= segmentTargetDist; + segmentTargetY *= segmentTargetDist; + NPC.velocity = Vector2.Zero; + NPC.position.X = NPC.position.X + segmentTargetX; + NPC.position.Y = NPC.position.Y + segmentTargetY; + + if (segmentTargetX < 0f) + NPC.spriteDirection = -1; + else if (segmentTargetX > 0f) + NPC.spriteDirection = 1; + } + + // Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer + if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase) + { + SoundEngine.PlaySound(AstrumDeusHead.SpawnSound, NPC.Center); + calamityGlobalNPC.newAI[1] = 1f; + } + + // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing + if (calamityGlobalNPC.newAI[1] < resistanceTime && ((NPC.position - NPC.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) + calamityGlobalNPC.newAI[1] += 1f; } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -111,7 +312,7 @@ namespace CalamityMod.NPCs.AstrumDeus bool deathModeEnragePhase = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] == 3f; bool doubleWormPhase = NPC.Calamity().newAI[0] != 0f && !deathModeEnragePhase; - float cyanThreshold = Main.getGoodWorld ? 300f : 600f; + float cyanThreshold = CalamityWorld.LegendaryMode ? 300f : 600f; // Tail is always the first segment to visually transition float transitionStart = cyanThreshold * 0.75f; float transitionEnd = cyanThreshold * 0.8f; @@ -205,13 +406,12 @@ namespace CalamityMod.NPCs.AstrumDeus public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 180); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/BrimstoneElemental/Brimling.cs b/NPCs/BrimstoneElemental/Brimling.cs index 478a14704b..b6b30908e0 100644 --- a/NPCs/BrimstoneElemental/Brimling.cs +++ b/NPCs/BrimstoneElemental/Brimling.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { NPC.aiStyle = -1; AIType = -1; - NPC.damage = 0; // 0 contact damage, projectile damage values are pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 60; NPC.height = 60; NPC.defense = 0; @@ -93,25 +93,18 @@ namespace CalamityMod.NPCs.BrimstoneElemental } // Variables for buffing the AI - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining for Brim float lifeRatio = Main.npc[CalamityGlobalNPC.brimstoneElemental].life / (float)Main.npc[CalamityGlobalNPC.brimstoneElemental].lifeMax; // Enraged Brim checks - bool biomeEnraged = Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().newAI[3] <= 0f || bossRush; - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged && (!Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].ZoneUnderworldHeight || bossRush)) - { - Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().CurrentlyEnraged = !bossRush; + bool biomeEnraged = Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().newAI[3] <= 0f; + float enrageScale = 0f; + if (biomeEnraged && !Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].ZoneUnderworldHeight) enrageScale += 1f; - } - if (biomeEnraged && (!Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Calamity().ZoneCalamity || bossRush)) - { - Main.npc[CalamityGlobalNPC.brimstoneElemental].Calamity().CurrentlyEnraged = !bossRush; + if (biomeEnraged && !Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Calamity().ZoneCalamity) enrageScale += 1f; - } // Brim phase checks bool brimIsAboutToTeleport = Main.npc[CalamityGlobalNPC.brimstoneElemental].ai[0] == 1f && Main.npc[CalamityGlobalNPC.brimstoneElemental].alpha == 0; @@ -153,7 +146,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { float projectileVelocity = 5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = BrimstoneElemental.DartDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Center - NPC.Center) * projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocity * 3f); } } @@ -246,7 +239,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental { float projectileVelocity = 5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = BrimstoneElemental.HellfireballDamage; SoundEngine.PlaySound(BrimstoneElemental.HellfireballSound, NPC.Center); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].Center - NPC.Center) * projectileVelocity, type, damage, 0f, Main.myPlayer, Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].position.X, Main.player[Main.npc[CalamityGlobalNPC.brimstoneElemental].target].position.Y); } diff --git a/NPCs/BrimstoneElemental/BrimstoneElemental.cs b/NPCs/BrimstoneElemental/BrimstoneElemental.cs index 7a5a563e17..6b54e1fb30 100644 --- a/NPCs/BrimstoneElemental/BrimstoneElemental.cs +++ b/NPCs/BrimstoneElemental/BrimstoneElemental.cs @@ -15,10 +15,12 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Projectiles.Enemy; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -63,14 +65,21 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPCID.Sets.MPAllowedEnemies[Type] = true; } + // These values are all applied alongside their respective GFB attacks (too many to list) + public static int DartDamage = 19; // 76 + public static int HellblastDamage = 22; // 88 + public static int HellfireballDamage = 22; // 88 + public static int RayDamage = 35; // 140 + public override void SetDefaults() { NPC.npcSlots = 64f; - NPC.GetNPCDamage(); + NPC.damage = 52; // 104 + NPC.Calamity().canBreakPlayerDefense = true; NPC.width = 100; NPC.height = 150; NPC.defense = 15; - NPC.value = Item.buyPrice(0, 16, 0, 0); + NPC.value = Item.buyPrice(gold: 12); NPC.LifeMaxNERB(41000, 49200, 500000); NPC.DR_NERD(0.2f); NPC.knockBackResist = 0f; @@ -86,9 +95,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -123,7 +129,691 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void AI() { - BrimstoneElementalAI.VanillaBrimstoneElementalAI(NPC, Mod); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + // Used for Brimling AI states + CalamityGlobalNPC.brimstoneElemental = NPC.whoAmI; + + // Emit light + Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1.2f, 0f, 0f); + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + bool despawnDistance = Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; + + if (!player.active || player.dead || despawnDistance) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + if (!player.active || player.dead || despawnDistance) + { + NPC.rotation = NPC.velocity.X * 0.04f; + + if (NPC.velocity.Y > 3f) + NPC.velocity.Y = 3f; + NPC.velocity.Y -= 0.1f; + if (NPC.velocity.Y < -12f) + NPC.velocity.Y = -12f; + + if (NPC.timeLeft > 60) + NPC.timeLeft = 60; + + if (NPC.ai[0] != 0f) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.localAI[0] = 0f; + NPC.localAI[1] = 0f; + NPC.netUpdate = true; + } + return; + } + } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; + + // Reset defense + NPC.defense = NPC.defDefense; + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = NPC.ai[0] == 4f; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Variables for buffing the AI + 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) && !BossRushEvent.BossRushActive) + { + if (calamityGlobalNPC.newAI[3] > 0f) + calamityGlobalNPC.newAI[3] -= 1f; + } + else + calamityGlobalNPC.newAI[3] = CalamityGlobalNPC.biomeEnrageTimerMax; + + bool biomeEnraged = calamityGlobalNPC.newAI[3] <= 0f; + + float enrageScale = 0f; + if (biomeEnraged && !player.ZoneUnderworldHeight) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 0.5f; + } + if (biomeEnraged && !player.Calamity().ZoneCalamity) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 1f; + } + + NPC.Calamity().DR = NPC.ai[0] == 4f ? 0.6f : 0.2f; + + // Emit dust + int dustAmt = (NPC.ai[0] == 2f) ? 2 : 1; + int size = (NPC.ai[0] == 2f) ? 50 : 35; + if (NPC.ai[0] != 1f) + { + for (int i = 0; i < 2; i++) + { + if (Main.rand.Next(3) < dustAmt) + { + int dust = Dust.NewDust(NPC.Center - new Vector2(size), size * 2, size * 2, DustID.LifeDrain, NPC.velocity.X * 0.5f, NPC.velocity.Y * 0.5f, 90, default, 1.5f); + Main.dust[dust].noGravity = true; + Main.dust[dust].velocity *= 0.2f; + Main.dust[dust].fadeIn = 1f; + } + } + } + + // Distance from destination where Brimmy stops moving + float movementDistanceGateValue = 100f; + + // How fast Brimmy moves to the destination + float baseVelocity = (death ? 6f : revenge ? 5.5f : expertMode ? 5f : 4.5f) * (NPC.ai[0] == 5f ? 0.05f : NPC.ai[0] == 3f ? 1.5f : 1f); + baseVelocity += 3f * enrageScale; + if (expertMode) + baseVelocity += death ? 3f * (1f - lifeRatio) : 2f * (1f - lifeRatio); + + float baseAcceleration = (death ? 0.12f : 0.1f) * (NPC.ai[0] == 5f ? 0.5f : NPC.ai[0] == 3f ? 1.5f : 1f); + baseAcceleration += 0.06f * enrageScale; + if (expertMode) + baseAcceleration += 0.03f * (1f - lifeRatio); + + // This is where Brimmy should be + Vector2 destination = NPC.ai[0] != 3f ? player.Center : new Vector2(player.Center.X, player.Center.Y - 300f); + + // How far Brimmy is from where she's supposed to be + Vector2 distanceFromDestination = destination - NPC.Center; + + // Movement + if (NPC.ai[0] != 4f) + CalamityUtils.SmoothMovement(NPC, movementDistanceGateValue, distanceFromDestination, baseVelocity, baseAcceleration, true); + + // Rotation and direction + if (NPC.ai[0] <= 2f || NPC.ai[0] == 5f) + { + NPC.rotation = NPC.velocity.X * 0.04f; + if (NPC.ai[0] != 5 || (NPC.ai[1] < 180f && NPC.ai[0] == 5f)) + { + float playerLocation = NPC.Center.X - player.Center.X; + NPC.direction = playerLocation < 0f ? 1 : -1; + NPC.spriteDirection = NPC.direction; + } + } + + if (Main.zenithWorld) // in gfb, Brimmy channels the power of the other elementals. + { + int newMode; + if (lifeRatio <= 0.8f && lifeRatio > 0.6f) + { + newMode = 1; // Sand + } + else if (lifeRatio <= 0.6f && lifeRatio > 0.4f) + { + newMode = 2; // Rare Sand + } + else if (lifeRatio <= 0.4f && lifeRatio > 0.2f) + { + newMode = 3; // Cloud + } + else if (lifeRatio <= 0.2f) + { + newMode = 4; // Water + } + else + { + newMode = 0; // Brimstone, default + } + if (newMode != currentMode) + { + SoundEngine.PlaySound(SoundID.Item29, NPC.Center); + } + currentMode = newMode; + } + + if (NPC.ai[0] == -1f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int phase; + int random = phase2 ? 6 : 5; + do phase = Main.rand.Next(random); + while (phase == NPC.ai[1] || (phase == 0 && phase3 && revenge) || phase == 1 || phase == 2 || (phase == 4 && NPC.localAI[3] != 0f)); + + NPC.ai[0] = phase; + NPC.ai[1] = 0f; + + // Cocoon phase cooldown + if (NPC.localAI[3] > 0f) + NPC.localAI[3] -= 1f; + else if (phase == 4) + { + NPC.localAI[3] = 3f; + SoundEngine.PlaySound(HideInShellSound, player.Center); + } + + // Prevent netUpdate from being blocked by the spam counter. + // A phase switch sync is a critical operation that must be synced. + NPC.ForceNetUpdate(false); + } + } + + // Pick a location to teleport to + else if (NPC.ai[0] == 0f) + { + NPC.chaseable = true; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.localAI[1] += 1f; + + if (NPC.localAI[1] >= (death ? 120f : 180f)) + { + NPC.TargetClosest(); + NPC.localAI[1] = 0f; + int timer = 0; + int playerPosX; + int playerPosY; + while (true) + { + timer++; + playerPosX = (int)player.Center.X / 16; + playerPosY = (int)player.Center.Y / 16; + + int min = 12; + int max = 16; + + if (Main.rand.NextBool()) + playerPosX += Main.rand.Next(min, max); + else + playerPosX -= Main.rand.Next(min, max); + + if (Main.rand.NextBool()) + playerPosY += Main.rand.Next(min, max); + else + playerPosY -= Main.rand.Next(min, max); + + if (!WorldGen.SolidTile(playerPosX, playerPosY)) + break; + + if (timer > 100) + return; + } + NPC.ai[0] = 1f; + NPC.ai[1] = playerPosX; + NPC.ai[2] = playerPosY; + NPC.netUpdate = true; + } + } + } + + // Teleport to location + else if (NPC.ai[0] == 1f) + { + // Disable contact damage for some time while fading away + NPC.damage = 0; + + NPC.chaseable = true; + Vector2 position = new Vector2(NPC.ai[1] * 16f - (NPC.width / 2), NPC.ai[2] * 16f - (NPC.height / 2)); + for (int m = 0; m < 5; m++) + { + int dust = Dust.NewDust(position, NPC.width, NPC.height, DustID.LifeDrain, 0f, -1f, 90, default, 2f); + Main.dust[dust].noGravity = true; + Main.dust[dust].fadeIn = 1f; + } + NPC.alpha += death ? 5 : revenge ? 4 : expertMode ? 3 : 2; + if (NPC.alpha >= 255) + { + int spawnType = currentMode == 3 ? NPCID.AngryNimbus : ModContent.NPCType(); + int enemyCount = currentMode == 3 ? 3 : 1; // 3 angry nimbi if cloud, otherwise 1 brimling + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(spawnType) < (death ? 1 : 2) && revenge && currentMode != 2) // dont spawn anything if gfb rare sand + { + for (int i = 0; i < enemyCount; i++) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, spawnType); + } + SoundEngine.PlaySound(TeleportSound, NPC.Center); + NPC.alpha = 255; + NPC.position = position; + for (int n = 0; n < 15; n++) + { + int warpDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.LifeDrain, 0f, -1f, 90, default, 3f); + Main.dust[warpDust].noGravity = true; + } + NPC.ai[0] = 2f; + NPC.netUpdate = true; + } + } + + // Either teleport again or go to next AI state + else if (NPC.ai[0] == 2f) + { + if (NPC.alpha >= 255) + { + if (Main.zenithWorld) + { + SoundEngine.PlaySound(SoundID.Item68, NPC.Center); + int type = ModContent.ProjectileType(); + int damage = RayDamage; + Vector2 pos = NPC.Center; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), pos, new Vector2(0, 1), type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), pos, new Vector2(0, -1), type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), pos, new Vector2(1, 0), type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), pos, new Vector2(-1, 0), type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + } + if (currentMode >= 1 && currentMode <= 3) + { + int tornadoType = currentMode == 3 ? ModContent.ProjectileType() : ProjectileID.SandnadoHostileMark; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), pos, Vector2.Zero, tornadoType, damage, 0f, Main.myPlayer, 0f, 0f); + } + } + if (currentMode == 2) + { + int healAmt = NPC.lifeMax / 25; + if (healAmt > 0) + { + NPC.life += healAmt; + NPC.HealEffect(healAmt, true); + NPC.netUpdate = true; + } + } + } + } + + NPC.alpha -= 50; + if (NPC.alpha <= 0) + { + // Restore contact damage once returned to proper opacity + NPC.damage = NPC.defDamage; + NPC.chaseable = true; + NPC.ai[3] += 1f; + NPC.alpha = 0; + if (NPC.ai[3] >= 2f || phase2 || CalamityWorld.LegendaryMode) + { + NPC.ai[0] = -1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + } + else + { + NPC.ai[0] = 0f; + } + NPC.netUpdate = true; + } + } + + // Float above target and fire projectiles + else if (NPC.ai[0] == 3f) + { + NPC.chaseable = true; + NPC.rotation = NPC.velocity.X * 0.04f; + + float playerLocation = NPC.Center.X - player.Center.X; + NPC.direction = playerLocation < 0f ? 1 : -1; + NPC.spriteDirection = NPC.direction; + + NPC.ai[1] += 1f; + float divisor = expertMode ? (death ? 80f : revenge ? 45f : 50f) - (float)Math.Ceiling(10f * (1f - lifeRatio)) : 50f; + divisor -= 3f * enrageScale; + float divisor2 = divisor * 2f; + + if (NPC.ai[1] % divisor == divisor - 1f) + { + float velocity = (death ? 7f : revenge ? 6f : 5f) + (2f * enrageScale) + (expertMode ? 3f * (1f - lifeRatio) : 0f); + int type = ModContent.ProjectileType(); + int damage = HellfireballDamage; + if (currentMode == 4) + { + type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SoundID.Item30, player.Center); + } + else + { + SoundEngine.PlaySound(HellfireballSound, player.Center); + } + Vector2 projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 5f, projectileVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); + Main.projectile[proj].timeLeft = 240; + if (CalamityWorld.MaliceMode) + Main.projectile[proj].extraUpdates += 1; + } + + if (NPC.ai[1] % divisor2 == divisor2 - 1f) + { + velocity = (death ? 5f : 4f) + 2f * enrageScale; + type = ModContent.ProjectileType(); + damage = DartDamage; + if (currentMode == 4) + { + type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SoundID.Item21, player.Center); + } + else + { + SoundEngine.PlaySound(DartSound, player.Center); + } + projectileVelocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; + int numProj = death ? 8 : 4; + int spread = death ? 90 : 45; + if (CalamityWorld.LegendaryMode) + { + numProj *= 3; + spread *= 2; + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float rotation = MathHelper.ToRadians(spread); + float projectileVelocityToPass = velocity * 3f; + for (int i = 0; i < numProj; i++) + { + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); + int proj2 = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); + if (CalamityWorld.MaliceMode) + Main.projectile[proj2].extraUpdates += 1; + } + } + } + } + + if (NPC.ai[1] >= divisor * (death ? 5f : 10f)) + { + NPC.TargetClosest(); + NPC.ai[0] = -1f; + NPC.ai[1] = 3f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.netUpdate = true; + } + } + + // Cocoon bullet hell + else if (NPC.ai[0] == 4f) + { + NPC.defense = NPC.defDefense * 4; + + NPC.chaseable = false; + NPC.localAI[0] += 1f; + if (CalamityWorld.LegendaryMode) + NPC.localAI[0] += 2f; + if (expertMode) + NPC.localAI[0] += 1f - lifeRatio; + NPC.localAI[0] += enrageScale; + + if (NPC.localAI[0] >= 120f) + { + NPC.localAI[0] = 0f; + + float projectileSpeed = death ? 9f : revenge ? 8f : 6f; + projectileSpeed += 2f * enrageScale; + + Vector2 projectileVelocity = player.Center - NPC.Center; + + float radialOffset = 0.2f; + float diameter = 80f; + + projectileVelocity = projectileVelocity.SafeNormalize(Vector2.UnitY) * projectileSpeed; + + Vector2 velocity = projectileVelocity; + velocity = velocity.SafeNormalize(Vector2.UnitY); + velocity *= diameter; + + int totalProjectiles = 6; + float offsetAngle = MathHelper.Pi * radialOffset; + int type = ModContent.ProjectileType(); + int damage = HellblastDamage; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int j = 0; j < totalProjectiles; j++) + { + float radians = j - (totalProjectiles - 1f) / 2f; + Vector2 offset = velocity.RotatedBy(offsetAngle * radians); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); + Main.projectile[proj].timeLeft = 300; + Main.projectile[proj].tileCollide = false; + if (CalamityWorld.MaliceMode) + Main.projectile[proj].extraUpdates += 1; + } + } + + totalProjectiles = 12; + float radians2 = MathHelper.TwoPi / totalProjectiles; + type = ModContent.ProjectileType(); + damage = DartDamage; + if (currentMode == 4) + { + type = ModContent.ProjectileType(); + SoundEngine.PlaySound(SoundID.Item26, player.Center); + } + else + { + SoundEngine.PlaySound(ShellFireSound, player.Center); + } + double angleA = radians2 * 0.5; + double angleB = MathHelper.ToRadians(90f) - angleA; + float velocityX = (float)(projectileSpeed * Math.Sin(angleA) / Math.Sin(angleB)); + Vector2 spinningPoint = NPC.localAI[2] % 2f == 0f ? new Vector2(0f, -projectileSpeed) : new Vector2(-velocityX, -projectileSpeed); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float projectileVelocityToPass = projectileSpeed * 3f; + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); + if (CalamityWorld.MaliceMode) + Main.projectile[proj].extraUpdates += 1; + } + + if (death) + { + spinningPoint = NPC.localAI[2] % 2f == 0f ? new Vector2(-velocityX, -projectileSpeed) : new Vector2(0f, -projectileSpeed); + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); + if (CalamityWorld.MaliceMode) + Main.projectile[proj].extraUpdates += 1; + } + } + } + + NPC.localAI[2] += 1f; + } + + NPC.velocity *= 0.95f; + NPC.rotation = NPC.velocity.X * 0.04f; + float playerLocation = NPC.Center.X - player.Center.X; + NPC.direction = playerLocation < 0f ? 1 : -1; + NPC.spriteDirection = NPC.direction; + + NPC.ai[1] += 1f; + if (NPC.ai[1] >= (death ? 240f : 300f)) + { + NPC.TargetClosest(); + NPC.ai[0] = -1f; + NPC.ai[1] = 4f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.localAI[0] = 0f; + NPC.netUpdate = true; + } + } + + // Laser beam attack + else if (NPC.ai[0] == 5f) + { + NPC.chaseable = true; + + NPC.defense = NPC.defDefense * 2; + + Vector2 source = new Vector2(NPC.Center.X + (NPC.spriteDirection > 0 ? 34f : -34f), NPC.Center.Y - 74f); + Vector2 aimAt = player.Center + player.velocity * 20f; + float aimResponsiveness = (NPC.ai[2] == 1f || death) ? 0.1f : 0.25f; + + Vector2 aimVector = (aimAt - source).SafeNormalize(Vector2.UnitY); + if (aimVector.HasNaNs()) + aimVector = -Vector2.UnitY; + aimVector = Vector2.Lerp(aimVector, NPC.velocity.SafeNormalize(Vector2.UnitY), aimResponsiveness).SafeNormalize(Vector2.UnitY); + aimVector *= 6f; + + Vector2 laserVelocity = aimVector.SafeNormalize(Vector2.UnitY); + if (laserVelocity.HasNaNs()) + laserVelocity = -Vector2.UnitY; + + calamityGlobalNPC.newAI[1] = laserVelocity.X; + calamityGlobalNPC.newAI[2] = laserVelocity.Y; + + // Rev = 190 + 165 = 355 + // Death = 165 + + NPC.ai[1] += 1f; + if (NPC.ai[1] >= 240f) + { + NPC.TargetClosest(); + NPC.ai[2] += 1f; + NPC.localAI[0] = 0f; + NPC.localAI[1] = 0f; + if (NPC.ai[2] >= (death ? 1f : 2f)) + { + NPC.ai[0] = -1f; + NPC.ai[1] = 5f; + NPC.ai[2] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + } + else + { + NPC.ai[1] = 0f; + calamityGlobalNPC.newAI[0] = 0f; + } + } + else if (NPC.ai[1] >= 180f) + { + NPC.velocity *= 0.95f; + if (NPC.ai[1] == 180f) + { + SoundEngine.PlaySound(SoundID.Item68, source); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Vector2 laserVelocity2 = new Vector2(NPC.localAI[0], NPC.localAI[1]); + laserVelocity2 = laserVelocity2.SafeNormalize(Vector2.UnitY); + int type = ModContent.ProjectileType(); + int damage = RayDamage; + + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + if (CalamityWorld.LegendaryMode) + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + + if (Main.zenithWorld) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, new Vector2(-laserVelocity2.X, laserVelocity2.Y), type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, new Vector2(laserVelocity2.X, -laserVelocity2.Y), type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + } + } + } + } + else + { + float playSoundTimer = 30f; + if (NPC.ai[1] < 150f) + { + switch ((int)NPC.ai[2]) + { + case 0: + NPC.ai[1] += 0.5f; + break; + case 1: + NPC.ai[1] += 1f; + playSoundTimer = 40f; + break; + } + if (death) + { + NPC.ai[1] += 0.5f; + playSoundTimer += 10f; + } + } + + if (NPC.ai[1] % playSoundTimer == 0f) + SoundEngine.PlaySound(SoundID.Item20, NPC.Center); + + if (NPC.ai[1] < 150f && calamityGlobalNPC.newAI[0] == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + if (CalamityWorld.LegendaryMode) + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, -laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + + if (Main.zenithWorld) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, new Vector2(-laserVelocity.X, laserVelocity.Y), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, new Vector2(laserVelocity.X, -laserVelocity.Y), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, NPC.whoAmI); + } + } + + calamityGlobalNPC.newAI[0] = 1f; + } + else + { + if (NPC.ai[1] == 150f) + { + NPC.localAI[0] = laserVelocity.X; + NPC.localAI[1] = laserVelocity.Y; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, NPC.localAI[0], NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); + if (CalamityWorld.LegendaryMode) + Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, -NPC.localAI[0], -NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); + + if (Main.zenithWorld) + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, -NPC.localAI[0], NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source.X, source.Y, NPC.localAI[0], -NPC.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, NPC.whoAmI); + } + } + } + } + } + } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -134,7 +824,7 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 240); } public override void FindFrame(int frameHeight) // 9 total frames @@ -186,7 +876,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; } @@ -255,7 +945,6 @@ namespace CalamityMod.NPCs.BrimstoneElemental public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Bumblebirb/Bumblefuck.cs b/NPCs/Bumblebirb/Bumblefuck.cs deleted file mode 100644 index a5b097b190..0000000000 --- a/NPCs/Bumblebirb/Bumblefuck.cs +++ /dev/null @@ -1,539 +0,0 @@ -using System; -using System.IO; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Events; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Armor.Vanity; -using CalamityMod.Items.LoreItems; -using CalamityMod.Items.Materials; -using CalamityMod.Items.Mounts; -using CalamityMod.Items.Placeables.Furniture.BossRelics; -using CalamityMod.Items.Placeables.Furniture.DevPaintings; -using CalamityMod.Items.Placeables.Furniture.Trophies; -using CalamityMod.Items.Potions; -using CalamityMod.Items.TreasureBags; -using CalamityMod.Items.Weapons.Magic; -using CalamityMod.Items.Weapons.Melee; -using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.GameContent.Bestiary; -using Terraria.GameContent.ItemDropRules; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.Bumblebirb -{ - [AutoloadBossHead] - public class Bumblefuck : ModNPC - { - public static Asset GlowTexture; - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 6; - NPCID.Sets.TrailingMode[Type] = 1; - NPCID.Sets.BossBestiaryPriority.Add(Type); - NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() - { - Scale = 0.5f, - PortraitScale = 0.85f, - PortraitPositionYOverride = 14f - }; - value.Position.X += 20f; - value.Position.Y += 8f; - NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - NPCID.Sets.MPAllowedEnemies[Type] = true; - if (!Main.dedServ) - { - GlowTexture = ModContent.Request("CalamityMod/NPCs/Bumblebirb/BirbGlow", AssetRequestMode.AsyncLoad); - } - } - - public override string Texture => "CalamityMod/NPCs/Bumblebirb/Birb"; - public override string BossHeadTexture => "CalamityMod/NPCs/Bumblebirb/Birb_Head_Boss"; - - public override void SetDefaults() - { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.npcSlots = 32f; - NPC.aiStyle = -1; - AIType = -1; - NPC.GetNPCDamage(); - NPC.width = 130; - NPC.height = 100; - NPC.defense = 40; - NPC.DR_NERD(0.1f); - NPC.LifeMaxNERB(187500, 225000, 300000); // Old HP - 227500, 252500 - NPC.knockBackResist = 0f; - NPC.boss = true; - NPC.noTileCollide = true; - NPC.lavaImmune = true; - NPC.noGravity = true; - NPC.value = Item.buyPrice(1, 0, 0, 0); - NPC.HitSound = SoundID.NPCHit51; - NPC.DeathSound = SoundID.NPCDeath46; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToSickness = true; - NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); - } - - public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) - { - bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] - { - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.Bumblefuck") - }); - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(NPC.localAI[0]); - writer.Write(NPC.localAI[1]); - writer.Write(NPC.localAI[2]); - writer.Write(NPC.localAI[3]); - for (int i = 0; i < 4; i++) - writer.Write(NPC.Calamity().newAI[i]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - NPC.localAI[0] = reader.ReadSingle(); - NPC.localAI[1] = reader.ReadSingle(); - NPC.localAI[2] = reader.ReadSingle(); - NPC.localAI[3] = reader.ReadSingle(); - for (int i = 0; i < 4; i++) - NPC.Calamity().newAI[i] = reader.ReadSingle(); - } - - public override void AI() - { - BumblebirbAI.VanillaBumblebirbAI(NPC, Mod); - } - - public override void FindFrame(int frameHeight) - { - CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - - // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; - - // Phases - bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f) || death; - bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f); - bool birbSpawn = NPC.ai[0] == 4f && NPC.ai[1] > 0f; - - // Animation goes nyoom - if (Main.zenithWorld) - { - NPC.frameCounter += 4; - } - - float newPhaseTimer = 180f; - bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || - (phase3 && calamityGlobalNPC.newAI[1] < newPhaseTimer && calamityGlobalNPC.newAI[3] != 1f); - - if (phaseSwitchPhase || birbSpawn) - { - float frameGateValue = birbSpawn ? NPC.ai[1] : phase3 ? calamityGlobalNPC.newAI[1] : calamityGlobalNPC.newAI[0]; - int frameTimer = 180; - if (frameGateValue < (frameTimer - 60) || frameGateValue > (frameTimer - 20)) - { - NPC.frameCounter += 1D; - if (NPC.frameCounter > 5D) - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - } - if (NPC.frame.Y >= frameHeight * 5) - { - NPC.frame.Y = 0; - } - } - else - { - NPC.frame.Y = frameHeight * 4; - if (frameGateValue > (frameTimer - 50) && frameGateValue < (frameTimer - 25)) - { - NPC.frame.Y = frameHeight * 5; - } - } - } - else if (NPC.ai[0] == 5f) - { - int otherFrameTimer = 120; - if (NPC.ai[1] < (otherFrameTimer - 50) || NPC.ai[1] > (otherFrameTimer - 10)) - { - NPC.frameCounter += 1D; - if (NPC.frameCounter > 5D) - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - } - if (NPC.frame.Y >= frameHeight * 5) - { - NPC.frame.Y = 0; - } - } - else - { - NPC.frame.Y = frameHeight * 4; - if (NPC.ai[1] > (otherFrameTimer - 40) && NPC.ai[1] < (otherFrameTimer - 15)) - { - NPC.frame.Y = frameHeight * 5; - } - } - } - else - { - NPC.frameCounter += (NPC.ai[0] == 3.2f ? 1.5 : 1D); - if (NPC.frameCounter > 4D) //iban said the time between frames was 5 so using that as a base - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - } - if (NPC.frame.Y >= frameHeight * 5) - { - NPC.frame.Y = 0; - } - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - - bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - - // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; - - // Phases - bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f) || death; - bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f); - - float newPhaseTimer = 180f; - bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || - (phase3 && calamityGlobalNPC.newAI[1] < newPhaseTimer && calamityGlobalNPC.newAI[3] != 1f); - - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = TextureAssets.Npc[Type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); - Color color = drawColor; - Color altColor = Color.White; - - float lerpDrawTransition = 0f; - int newAITracker = 120; - int buffColorDampener = 60; - - if (phase3 && calamityGlobalNPC.newAI[3] == 1f) - { - color = CalamityGlobalNPC.buffColor(color, 0.9f, 0.6f, 0.2f, 1f); - } - else if (phase2 && calamityGlobalNPC.newAI[2] == 1f) - { - color = CalamityGlobalNPC.buffColor(color, 0.7f, 0.7f, 0.3f, 1f); - } - else if (phase2 && calamityGlobalNPC.newAI[0] > (float)newAITracker) - { - float phase2TranBuff = calamityGlobalNPC.newAI[0] - (float)newAITracker; - phase2TranBuff /= (float)buffColorDampener; - color = CalamityGlobalNPC.buffColor(color, 1f - 0.3f * phase2TranBuff, 1f - 0.3f * phase2TranBuff, 1f - 0.7f * phase2TranBuff, 1f); - } - - int afterimageAmt = 10; - int afterimageIncrement = 2; - if (NPC.ai[0] == 0f || NPC.ai[0] == 3.1f || NPC.ai[0] == 4f || NPC.ai[0] == 4.2f) - { - afterimageAmt = 4; - } - if (NPC.ai[0] == 1f || NPC.ai[0] == 3f || NPC.ai[0] == 4.1f) - { - afterimageAmt = 7; - } - if (NPC.ai[0] == 2f || NPC.ai[0] == 3.2f || (phase2 && calamityGlobalNPC.newAI[2] == 1f)) - { - altColor = Color.Yellow; - lerpDrawTransition = 0.5f; - } - else - { - color = altColor; - } - - if (CalamityClientConfig.Instance.Afterimages) - { - for (int i = 1; i < afterimageAmt; i += afterimageIncrement) - { - Color afterimageColor = color; - afterimageColor = Color.Lerp(afterimageColor, altColor, lerpDrawTransition); - afterimageColor = NPC.GetAlpha(afterimageColor); - afterimageColor *= (float)(afterimageAmt - i) / 15f; - Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; - afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - } - } - - int extraAfterimageAmt = 0; - float extraAfterimageDampener = 0f; - float afterimageScaler = 0f; - - if (NPC.ai[0] == 0f || NPC.ai[0] == 3.1f || NPC.ai[0] == 4f || NPC.ai[0] == 4.2f) - { - extraAfterimageAmt = 4; - } - - if (NPC.ai[0] == 5f) - { - if (NPC.ai[1] > 60f) - { - extraAfterimageAmt = 6; - extraAfterimageDampener = 1f - (float)Math.Cos((double)((NPC.ai[1] - 60f) / 30f * MathHelper.TwoPi)); - extraAfterimageDampener /= 3f; - afterimageScaler = 40f; - } - } - - if (phaseSwitchPhase) - { - if (phase3 && calamityGlobalNPC.newAI[1] > (float)newAITracker) - { - extraAfterimageAmt = 6; - extraAfterimageDampener = 1f - (float)Math.Cos((double)((calamityGlobalNPC.newAI[1] - (float)newAITracker) / (float)buffColorDampener * MathHelper.TwoPi)); - extraAfterimageDampener /= 3f; - afterimageScaler = 60f; - } - else if (phase2 && calamityGlobalNPC.newAI[0] > (float)newAITracker) - { - extraAfterimageAmt = 6; - extraAfterimageDampener = 1f - (float)Math.Cos((double)((calamityGlobalNPC.newAI[0] - (float)newAITracker) / (float)buffColorDampener * MathHelper.TwoPi)); - extraAfterimageDampener /= 3f; - afterimageScaler = 60f; - } - } - - if (CalamityClientConfig.Instance.Afterimages) - { - for (int j = 0; j < extraAfterimageAmt; j++) - { - Color extraAfterimageColor = altColor; - extraAfterimageColor = Color.Lerp(extraAfterimageColor, altColor, lerpDrawTransition); - extraAfterimageColor = NPC.GetAlpha(extraAfterimageColor); - extraAfterimageColor *= 1f - extraAfterimageDampener; - Vector2 extraAfterimageDrawPos = NPC.Center + ((float)j / (float)extraAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScaler * extraAfterimageDampener - screenPos; - extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; - extraAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, extraAfterimageDrawPos, NPC.frame, extraAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - } - } - - Color mainDrawingColor = altColor; - mainDrawingColor = Color.Lerp(mainDrawingColor, altColor, lerpDrawTransition); - mainDrawingColor = NPC.GetAlpha(mainDrawingColor); - Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; - drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, (phase3 && calamityGlobalNPC.newAI[3] == 1f ? mainDrawingColor : NPC.GetAlpha(altColor)), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - - if (phase2) - { - texture2D15 = GlowTexture.Value; - Color glowmaskColor = Color.Lerp(Color.White, Color.Red, 0.5f); - altColor = Color.Red; - - lerpDrawTransition = 1f; - extraAfterimageDampener = 0.5f; - afterimageScaler = 10f; - afterimageIncrement = 1; - - if (phaseSwitchPhase) - { - float glowmaskDampener = (phase3 ? calamityGlobalNPC.newAI[1] : calamityGlobalNPC.newAI[0]) - (float)newAITracker; - glowmaskDampener /= (float)buffColorDampener; - altColor *= glowmaskDampener; - glowmaskColor *= glowmaskDampener; - } - - if (CalamityClientConfig.Instance.Afterimages) - { - for (int k = 1; k < afterimageAmt; k += afterimageIncrement) - { - Color glowmaskAfterimageColor = glowmaskColor; - glowmaskAfterimageColor = Color.Lerp(glowmaskAfterimageColor, altColor, lerpDrawTransition); - glowmaskAfterimageColor *= (float)(afterimageAmt - k) / 15f; - Vector2 glowmaskAfterimageDrawPos = NPC.oldPos[k] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; - glowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; - glowmaskAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, glowmaskAfterimageDrawPos, NPC.frame, glowmaskAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - } - - for (int l = 1; l < extraAfterimageAmt; l++) - { - Color extraGlowmaskAfterimageColor = glowmaskColor; - extraGlowmaskAfterimageColor = Color.Lerp(extraGlowmaskAfterimageColor, altColor, lerpDrawTransition); - extraGlowmaskAfterimageColor = NPC.GetAlpha(extraGlowmaskAfterimageColor); - extraGlowmaskAfterimageColor *= 1f - extraAfterimageDampener; - Vector2 extraGlowmaskAfterimageDrawPos = NPC.Center + ((float)l / (float)extraAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScaler * extraAfterimageDampener - screenPos; - extraGlowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; - extraGlowmaskAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, extraGlowmaskAfterimageDrawPos, NPC.frame, extraGlowmaskAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - } - } - - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - } - - return false; - } - - private static Color buffColor(Color newColor, float R, float G, float B, float A) - { - newColor.R = (byte)((float)newColor.R * R); - newColor.G = (byte)((float)newColor.G * G); - newColor.B = (byte)((float)newColor.B * B); - newColor.A = (byte)((float)newColor.A * A); - return newColor; - } - - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.SuperHealingPotion; - - public override void ModifyNPCLoot(NPCLoot npcLoot) - { - npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); - - // Normal drops: Everything that would otherwise be in the bag - var normalOnly = npcLoot.DefineNormalOnlyDropSet(); - { - // Weapons - int[] items = new int[] - { - ModContent.ItemType(), - ModContent.ItemType(), - ModContent.ItemType() - }; - normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); - normalOnly.Add(ModContent.ItemType(), 10); - - // Materials - normalOnly.Add(ModContent.ItemType(), 1, 25, 30); - - // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); - normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); - - // Vanity - normalOnly.Add(ModContent.ItemType(), 7); - normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); - } - - npcLoot.Add(ModContent.ItemType(), 10); - - // Relic - npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); - - // GFB Omega Healing Potion drop - npcLoot.DefineConditionalDropSet(DropHelper.GFB).Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 50, 100), true); - - // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType(), desc: DropHelper.FirstKillText); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), Main.zenithWorld ? 360 : 180); - } - - public override void OnKill() - { - // Don't bother running any of this in Boss Rush. - if (BossRushEvent.BossRushActive) - return; - - CalamityGlobalNPC.SetNewBossJustDowned(NPC); - - // Mark The Dragonfolly as dead - DownedBossSystem.downedDragonfolly = true; - CalamityNetcode.SyncWorld(); - - if (Main.zenithWorld) - { - int spacing = 40; - int amt = 7; - SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int i = 0; i < amt; i++) - { - Vector2 fireFrom = new Vector2(NPC.Center.X + (spacing * i) - (spacing * amt / 2), NPC.Center.Y - 900f); - Vector2 ai0 = NPC.Center - fireFrom; - float ai = Main.rand.Next(100); - Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), NPC.damage, 0f, Main.myPlayer, ai0.ToRotation(), ai); - } - } - } - - } - - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) - { - NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override void ModifyTypeName(ref string typeName) - { - if (Main.zenithWorld) - { - typeName = CalamityUtils.GetTextValue("NPCs.Bumblebirb"); - } - } - - public override void HitEffect(NPC.HitInfo hit) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); - } - if (NPC.life <= 0) - { - for (int k = 0; k < 50; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); - } - if (!Main.dedServ) - { - for (int i = 0; i < 6; i++) // 1 head, 1 wing, 4 legs = 6. one wing due to them being chonky boyes now - { - string gore = "Bumble"; - float randomSpread = Main.rand.Next(-200, 201) / 100f; - gore += i == 0 ? "Head" : i > 1 ? "Leg" : "Wing"; - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find(gore).Type, 1f); - } - } - } - } - } -} diff --git a/NPCs/Bumblebirb/Bumblefuck2.cs b/NPCs/Bumblebirb/Bumblefuck2.cs deleted file mode 100644 index ef8f02eaf5..0000000000 --- a/NPCs/Bumblebirb/Bumblefuck2.cs +++ /dev/null @@ -1,153 +0,0 @@ -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.Bumblebirb -{ - public class Bumblefuck2 : ModNPC - { - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 5; - NPCID.Sets.TrailingMode[Type] = 1; - this.HideFromBestiary(); - } - - public override string Texture => "CalamityMod/NPCs/Bumblebirb/BumbleFolly"; - - public override void SetDefaults() - { - NPC.npcSlots = 1f; - NPC.aiStyle = -1; - AIType = -1; - NPC.GetNPCDamage(); - NPC.width = 120; - NPC.height = 80; - NPC.defense = 20; - NPC.LifeMaxNERB(9375, 11250, 5000); - NPC.knockBackResist = 0.15f; - NPC.lavaImmune = true; - NPC.noTileCollide = true; - NPC.noGravity = true; - NPC.HitSound = SoundID.NPCHit51; - NPC.DeathSound = SoundID.NPCDeath46; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); - } - - public override void AI() - { - BumblebirbAI.VanillaBumblebirb2AI(NPC, Mod, true); - } - - public override void OnKill() - { - int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); - if (Main.rand.NextBool(4) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) - Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - - if (Main.zenithWorld) - { - SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int i = 0; i < 5; i++) - { - Vector2 fireFrom = new Vector2(NPC.Center.X + (40 * i) - 120, NPC.Center.Y - 900f); - Vector2 ai0 = NPC.Center - fireFrom; - float ai = Main.rand.Next(100); - Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), NPC.damage, 0f, Main.myPlayer, ai0.ToRotation(), ai); - } - } - } - } - - public override void FindFrame(int frameHeight) - { - NPC.frameCounter += NPC.ai[0] == 2.1f ? 1.5 : 1D; - if (Main.zenithWorld) - { - NPC.frameCounter += 2D; - } - if (NPC.frameCounter > 4D) //iban said the time between frames was 5 so using that as a base - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - } - if (NPC.frame.Y >= frameHeight * 4) - { - NPC.frame.Y = 0; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = TextureAssets.Npc[Type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); - int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0; - - if (CalamityClientConfig.Instance.Afterimages) - { - for (int i = 1; i < afterimageAmt; i += 2) - { - Color afterimageColor = drawColor; - afterimageColor = Color.Lerp(afterimageColor, Color.Gold, 0.5f); - afterimageColor = NPC.GetAlpha(afterimageColor); - afterimageColor *= (afterimageAmt - i) / 15f; - Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimageDrawPos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; - afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - } - } - - Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; - drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - - return false; - } - - public override void ModifyTypeName(ref string typeName) - { - if (Main.zenithWorld) - { - typeName = CalamityUtils.GetTextValue("NPCs.Bumblebirb"); - } - } - - public override void HitEffect(NPC.HitInfo hit) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); - } - if (NPC.life <= 0) - { - for (int k = 0; k < 50; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); - } - } - } - } -} diff --git a/NPCs/Bumblebirb/DraconicSwarmer.cs b/NPCs/Bumblebirb/DraconicSwarmer.cs new file mode 100644 index 0000000000..043af182c8 --- /dev/null +++ b/NPCs/Bumblebirb/DraconicSwarmer.cs @@ -0,0 +1,364 @@ +using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Bumblebirb +{ + public class DraconicSwarmer : ModNPC + { + public override void SetStaticDefaults() + { + Main.npcFrameCount[Type] = 5; + NPCID.Sets.TrailingMode[Type] = 1; + this.HideFromBestiary(); + } + + public override string Texture => "CalamityMod/NPCs/Bumblebirb/BumbleFolly"; + + public override void SetDefaults() + { + NPC.damage = 100; // 200 + NPC.npcSlots = 1f; + NPC.aiStyle = -1; + AIType = -1; + NPC.width = 120; + NPC.height = 80; + NPC.defense = 20; + NPC.LifeMaxNERB(9375, 11250, 5000); + NPC.knockBackResist = 0.15f; + NPC.lavaImmune = true; + NPC.noTileCollide = true; + NPC.noGravity = true; + NPC.HitSound = SoundID.NPCHit51; + NPC.DeathSound = SoundID.NPCDeath46; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToSickness = true; + } + + public override void AI() + { + Player player = Main.player[NPC.target]; + + float rotationMult = 4f; + float rotationAmt = 0.04f; + + if (Vector2.Distance(player.Center, NPC.Center) > 5600f) + { + if (NPC.timeLeft > 5) + NPC.timeLeft = 5; + } + + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt * 1.25f) / 10f; + + if (NPC.ai[0] == 0f || NPC.ai[0] == 1f) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + if (i != NPC.whoAmI && Main.npc[i].active && Main.npc[i].type == NPC.type) + { + Vector2 otherSwarmerDirection = Main.npc[i].Center - NPC.Center; + if (otherSwarmerDirection.Length() < (NPC.width + NPC.height)) + { + otherSwarmerDirection.Normalize(); + otherSwarmerDirection *= -0.1f; + NPC.velocity += otherSwarmerDirection; + NPC nPC6 = Main.npc[i]; + nPC6.velocity -= otherSwarmerDirection; + } + } + } + } + + if (NPC.target < 0 || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + { + NPC.TargetClosest(true); + Vector2 swarmerTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (Main.player[NPC.target].dead || swarmerTargetDist.Length() > 5600f) + NPC.ai[0] = -1f; + } + else + { + Vector2 swarmerCatchUpTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (NPC.ai[0] > 1f && swarmerCatchUpTargetDist.Length() > 3600f) + NPC.ai[0] = 1f; + } + + if (NPC.ai[0] == -1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + Vector2 swarmerDespawnVelMult = new Vector2(0f, -8f); + NPC.velocity = (NPC.velocity * 21f + swarmerDespawnVelMult) / 10f; + return; + } + + if (NPC.ai[0] == 0f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.TargetClosest(true); + NPC.spriteDirection = NPC.direction; + + Vector2 swarmerIdleTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (swarmerIdleTargetDist.Length() > 2800f) + { + NPC.ai[0] = 1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + } + else if (swarmerIdleTargetDist.Length() > 400f) + { + float swarmerIdleSpeed = 9f + swarmerIdleTargetDist.Length() / 100f + NPC.ai[1] / 15f; + swarmerIdleTargetDist.Normalize(); + swarmerIdleTargetDist *= swarmerIdleSpeed; + NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + } + else if (NPC.velocity.Length() > 2f) + NPC.velocity *= 0.95f; + else if (NPC.velocity.Length() < 1f) + NPC.velocity *= 1.05f; + + NPC.ai[1] += 1f; + if (NPC.ai[1] >= 90f) + { + NPC.ai[1] = 0f; + NPC.ai[0] = 2f; + } + } + else + { + if (NPC.ai[0] == 1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.target < 0 || !Main.player[NPC.target].active || Main.player[NPC.target].dead) + NPC.TargetClosest(true); + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt) / 10f; + + Vector2 swarmerChargeTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (swarmerChargeTargetDist.Length() < 800f && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + } + + NPC.ai[2] += 0.0166666675f; + float swarmerChargeSpeed = 12f + NPC.ai[2] + swarmerChargeTargetDist.Length() / 150f; + float swarmerChargeVelMult = 25f; + swarmerChargeTargetDist.Normalize(); + swarmerChargeTargetDist *= swarmerChargeSpeed; + NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + + NPC.ForceNetUpdate(); + + return; + } + + if (NPC.ai[0] == 2f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult * 0.75f + NPC.velocity.X * rotationAmt * 1.25f) / 8f; + + Vector2 swarmerDecelerateTargetDist = Main.player[NPC.target].Center - NPC.Center; + swarmerDecelerateTargetDist.Y -= 8f; + float swarmerDecelerateSpeed = 18f; + float swarmerDecelerateVelMult = 8f; + swarmerDecelerateTargetDist.Normalize(); + swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; + NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + + NPC.ai[1] += 1f; + if (NPC.ai[1] > 10f) + { + // Set damage + NPC.damage = NPC.defDamage; + + NPC.velocity = swarmerDecelerateTargetDist; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.ai[0] = 2.1f; + NPC.ai[1] = 0f; + } + } + else if (NPC.ai[0] == 2.1f) + { + // Set damage + NPC.damage = NPC.defDamage; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + + NPC.velocity *= 1.01f; + + NPC.ai[1] += 1f; + if (NPC.ai[1] > 30f) + { + if (!Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + return; + } + + if (NPC.ai[1] > 60f) + { + NPC.ai[0] = 1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + } + } + } + } + + public override void OnKill() + { + int closestPlayer = Player.FindClosest(NPC.Center, 1, 1); + if (Main.rand.NextBool(4) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) + Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); + + if (Main.zenithWorld) + { + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < 5; i++) + { + Vector2 fireFrom = new Vector2(NPC.Center.X + (40 * i) - 120, NPC.Center.Y - 900f); + Vector2 ai0 = NPC.Center - fireFrom; + float ai = Main.rand.Next(100); + Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), Dragonfolly.LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + } + } + } + } + + public override void FindFrame(int frameHeight) + { + NPC.frameCounter += NPC.ai[0] == 2.1f ? 1.5 : 1D; + if (Main.zenithWorld) + { + NPC.frameCounter += 2D; + } + if (NPC.frameCounter > 4D) //iban said the time between frames was 5 so using that as a base + { + NPC.frameCounter = 0D; + NPC.frame.Y += frameHeight; + } + if (NPC.frame.Y >= frameHeight * 4) + { + NPC.frame.Y = 0; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); + int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0; + + if (CalamityClientConfig.Instance.Afterimages) + { + for (int i = 1; i < afterimageAmt; i += 2) + { + Color afterimageColor = drawColor; + afterimageColor = Color.Lerp(afterimageColor, Color.Gold, 0.5f); + afterimageColor = NPC.GetAlpha(afterimageColor); + afterimageColor *= (afterimageAmt - i) / 15f; + Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; + afterimageDrawPos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; + afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + } + + Vector2 drawLocation = NPC.Center - screenPos; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; + drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + + return false; + } + + public override void ModifyTypeName(ref string typeName) + { + if (Main.zenithWorld) + { + typeName = CalamityUtils.GetTextValue("NPCs.Bumblebirb"); + } + } + + public override void HitEffect(NPC.HitInfo hit) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); + } + if (NPC.life <= 0) + { + for (int k = 0; k < 50; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); + } + } + } + } +} diff --git a/NPCs/Bumblebirb/Dragonfolly.cs b/NPCs/Bumblebirb/Dragonfolly.cs new file mode 100644 index 0000000000..656bbb41ee --- /dev/null +++ b/NPCs/Bumblebirb/Dragonfolly.cs @@ -0,0 +1,1352 @@ +using System; +using System.IO; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Events; +using CalamityMod.Items.Accessories; +using CalamityMod.Items.Armor.Vanity; +using CalamityMod.Items.LoreItems; +using CalamityMod.Items.Materials; +using CalamityMod.Items.Mounts; +using CalamityMod.Items.Placeables.Furniture.BossRelics; +using CalamityMod.Items.Placeables.Furniture.DevPaintings; +using CalamityMod.Items.Placeables.Furniture.Trophies; +using CalamityMod.Items.Potions; +using CalamityMod.Items.TreasureBags; +using CalamityMod.Items.Weapons.Magic; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.GameContent.Bestiary; +using Terraria.GameContent.ItemDropRules; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.NPCs.Bumblebirb +{ + [AutoloadBossHead] + public class Dragonfolly : ModNPC + { + public static Asset GlowTexture; + public override void SetStaticDefaults() + { + Main.npcFrameCount[Type] = 6; + NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.BossBestiaryPriority.Add(Type); + NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() + { + Scale = 0.5f, + PortraitScale = 0.85f, + PortraitPositionYOverride = 14f + }; + value.Position.X += 20f; + value.Position.Y += 8f; + NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; + NPCID.Sets.MPAllowedEnemies[Type] = true; + if (!Main.dedServ) + { + GlowTexture = ModContent.Request("CalamityMod/NPCs/Bumblebirb/BirbGlow", AssetRequestMode.AsyncLoad); + } + } + + public override string Texture => "CalamityMod/NPCs/Bumblebirb/Birb"; + public override string BossHeadTexture => "CalamityMod/NPCs/Bumblebirb/Birb_Head_Boss"; + + public static int FeatherDamage = 42; // 168 + public static int LightningDamage = 65; // 260 + + public override void SetDefaults() + { + NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 + NPC.npcSlots = 32f; + NPC.aiStyle = -1; + AIType = -1; + NPC.width = 130; + NPC.height = 100; + NPC.defense = 40; + NPC.DR_NERD(0.1f); + NPC.LifeMaxNERB(187500, 225000, 300000); // Old HP - 227500, 252500 + NPC.knockBackResist = 0f; + NPC.boss = true; + NPC.noTileCollide = true; + NPC.lavaImmune = true; + NPC.noGravity = true; + NPC.value = Item.buyPrice(platinum: 1); + NPC.HitSound = SoundID.NPCHit51; + NPC.DeathSound = SoundID.NPCDeath46; + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToSickness = true; + NPC.Calamity().VulnerableToElectricity = false; + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] + { + BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.Bumblefuck") + }); + } + + public override void SendExtraAI(BinaryWriter writer) + { + writer.Write(NPC.localAI[0]); + writer.Write(NPC.localAI[1]); + writer.Write(NPC.localAI[2]); + writer.Write(NPC.localAI[3]); + for (int i = 0; i < 4; i++) + writer.Write(NPC.Calamity().newAI[i]); + } + + public override void ReceiveExtraAI(BinaryReader reader) + { + NPC.localAI[0] = reader.ReadSingle(); + NPC.localAI[1] = reader.ReadSingle(); + NPC.localAI[2] = reader.ReadSingle(); + NPC.localAI[3] = reader.ReadSingle(); + for (int i = 0; i < 4; i++) + NPC.Calamity().newAI[i] = reader.ReadSingle(); + } + + public override void AI() + { + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + // Despawn safety, make sure to target another player if the current player target is too far away + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + // Variables + float rotationMult = 3f; + float rotationAmt = 0.03f; + 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; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; + NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; + + // If target is outside the jungle for more than 5 seconds, enrage + if (!player.ZoneJungle && !BossRushEvent.BossRushActive) + { + if (NPC.localAI[1] < CalamityGlobalNPC.biomeEnrageTimerMax) + NPC.localAI[1] += 1f; + } + else + NPC.localAI[1] = 0f; + + // If dragonfolly is off screen, enrage for the next couple attacks + if (Vector2.Distance(player.Center, NPC.Center) > 1200f) + NPC.localAI[2] = 2f; + + // Enrage scale + float enrageScale = death ? 1.5f : 1f; + if (NPC.localAI[1] >= CalamityGlobalNPC.biomeEnrageTimerMax) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 1f; + } + + if (NPC.localAI[2] > 0f) + enrageScale += 1f; + + if (CalamityWorld.LegendaryMode) + enrageScale += 0.5f; + + if (enrageScale > 3f) + enrageScale = 3f; + + // Despawn + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + { + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt) / 10f; + + if (NPC.velocity.Y > 3f) + NPC.velocity.Y = 3f; + NPC.velocity.Y -= 0.2f; + if (NPC.velocity.Y < -12f) + NPC.velocity.Y = -12f; + + if (NPC.timeLeft > 60) + NPC.timeLeft = 60; + + if (NPC.ai[0] != 0f) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + NPC.ForceNetUpdate(false); + } + + return; + } + } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases + bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f); + bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f) && expertMode; + + float birbSpawnPhaseTimer = 180f; + float newPhaseTimer = 180f; + 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 ? 0.55f : 0.1f; + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phaseSwitchPhase || NPC.ai[0] == 5f || enrageScale == 3f; + + int reducedSetDamage = (int)Math.Round(NPC.defDamage * 0.5); + + if (phaseSwitchPhase) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt) / 10f; + + if (phase3) + { + calamityGlobalNPC.newAI[1] += 1f; + + // Sound + if (calamityGlobalNPC.newAI[1] == newPhaseTimer - 60f) + { + float squawkpitch = Main.zenithWorld ? 1.3f : 0.25f; + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, NPC.Center); + + if (Main.zenithWorld) + { + int spacing = 20; + int amt = 5; + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < amt; i++) + { + Vector2 fireFrom = new Vector2(NPC.Center.X + (spacing * i) - (spacing * amt / 2), NPC.Center.Y - 900f); + Vector2 ai0 = NPC.Center - fireFrom; + float ai = Main.rand.Next(100); + Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + } + } + } + } + + if (calamityGlobalNPC.newAI[1] >= newPhaseTimer) + { + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 1f; + calamityGlobalNPC.newAI[3] = 1f; + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.SyncExtraAI(); + NPC.ForceNetUpdate(false); + } + } + else + { + calamityGlobalNPC.newAI[0] += 1f; + + // Sound + if (calamityGlobalNPC.newAI[0] == newPhaseTimer - 60f) + { + float squawkpitch = Main.zenithWorld ? 1.3f : 0.25f; + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, NPC.Center); + + if (Main.zenithWorld) + { + int spacing = 20; + int amt = 3; + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < amt; i++) + { + Vector2 fireFrom = new Vector2(NPC.Center.X + (spacing * i) - (spacing * amt / 2), NPC.Center.Y - 900f); + Vector2 ai0 = NPC.Center - fireFrom; + float ai = Main.rand.Next(100); + Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + } + } + } + } + + if (calamityGlobalNPC.newAI[0] >= newPhaseTimer) + { + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[2] = 1f; + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.SyncExtraAI(); + NPC.ForceNetUpdate(false); + } + } + + Vector2 follyTargetDirection = player.Center - NPC.Center; + float follyTargetDistance = 4f + follyTargetDirection.Length() / 100f; + float follyVelocityMult = 25f; + follyTargetDirection.Normalize(); + follyTargetDirection *= follyTargetDistance; + NPC.velocity = (NPC.velocity * (follyVelocityMult - 1f) + follyTargetDirection) / follyVelocityMult; + return; + } + + // Max spawn amount + int maxBirbs = CalamityWorld.MaliceMode ? 12 : revenge ? 3 : 2; + + // Variable for charging + float chargeDistance = 600f; + if (phase2) + chargeDistance -= 50f; + if (phase3) + chargeDistance -= 50f; + chargeDistance -= (enrageScale - 1f) * 100f; + + // Phase switch + if (NPC.ai[0] == 0f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.Center.X < player.Center.X - 2f) + NPC.direction = 1; + if (NPC.Center.X > player.Center.X + 2f) + NPC.direction = -1; + + // Direction and rotation + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt * 1.25f) / 10f; + + // Fly to target if target is too far away, otherwise get close to target and then slow down + Vector2 follyFlyTargetDirection = player.Center - NPC.Center; + follyFlyTargetDirection.Y -= 200f; + if (follyFlyTargetDirection.Length() > 2800f) + { + NPC.TargetClosest(); + NPC.ai[0] = 1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + else if (follyFlyTargetDirection.Length() > 240f) + { + float follyFlySpeed = 12f + (enrageScale - 1f) * 6f; + float follyFlyVelocityMult = 30f; + follyFlyTargetDirection.Normalize(); + follyFlyTargetDirection *= follyFlySpeed; + NPC.velocity = (NPC.velocity * (follyFlyVelocityMult - 1f) + follyFlyTargetDirection) / follyFlyVelocityMult; + } + else if (NPC.velocity.Length() > 2f) + NPC.velocity *= 0.95f; + else if (NPC.velocity.Length() < 1f) + NPC.velocity *= 1.05f; + + // Phase switch + NPC.ai[1] += 1f; + if (NPC.ai[1] >= 30f) + { + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + while (NPC.ai[0] == 0f) + { + if (phase2) + NPC.localAI[0] += 1f; + + if (NPC.localAI[0] >= (phase3 ? 7 : 9)) + { + NPC.TargetClosest(); + NPC.ai[0] = 5f; + NPC.localAI[0] = 0f; + + // Decrease the feather variable, feathers can be used again if it's at 0 + if (NPC.ai[3] > 0f) + NPC.ai[3] -= 1f; + + // Decrease enraged attacks by 1 + if (NPC.localAI[2] > 0f) + NPC.localAI[2] -= 1f; + + // Decrease amount of attacks until able to spawn small birbs again + if (NPC.localAI[3] > 0f) + NPC.localAI[3] -= 1f; + } + else + { + int follyAttackPicker = phase2 ? Main.rand.Next(2) + 1 : Main.rand.Next(3); + if (phase3) + follyAttackPicker = 1; + + float featherVelocity = 2f + (enrageScale - 1f); + int type = ModContent.ProjectileType(); + + if (follyAttackPicker == 0 && NPC.localAI[3] == 0f) + { + NPC.TargetClosest(); + NPC.ai[0] = 2f; + + // Decrease the feather variable, feathers can be used again if it's at 0 + if (NPC.ai[3] > 0f) + NPC.ai[3] -= 1f; + + // Decrease enraged attacks by 1 + if (NPC.localAI[2] > 0f) + NPC.localAI[2] -= 1f; + + // Birb will do at least 1 different attack before entering this phase again + NPC.localAI[3] = 1f; + } + else if (follyAttackPicker == 1) + { + NPC.TargetClosest(); + NPC.ai[0] = 3f; + + // Decrease enraged attacks by 1 + if (NPC.localAI[2] > 0f) + NPC.localAI[2] -= 1f; + + // Decrease amount of attacks until able to use other attacks again + if (NPC.localAI[3] > 0f) + NPC.localAI[3] -= 1f; + + if (phase2 && NPC.ai[3] == 0f) + { + NPC.ai[3] = 3f; + SoundEngine.PlaySound(SoundID.Item102, player.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int totalProjectiles = 40; + float radians = MathHelper.TwoPi / totalProjectiles; + int distance = 800; + bool spawnRight = player.velocity.X > 0f; + for (int i = 0; i < totalProjectiles; i++) + { + if (CalamityWorld.LegendaryMode) + { + if (i >= (int)(totalProjectiles * 0.125) && i <= (int)(totalProjectiles * 0.375)) + { + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; + Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); + } + if (i >= (int)(totalProjectiles * 0.625) && i <= (int)(totalProjectiles * 0.875)) + { + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; + Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); + } + } + else + { + if (spawnRight) + { + if (i >= (int)(totalProjectiles * 0.125) && i <= (int)(totalProjectiles * 0.375)) + { + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; + Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); + } + } + else + { + if (i >= (int)(totalProjectiles * 0.625) && i <= (int)(totalProjectiles * 0.875)) + { + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; + Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); + } + } + } + } + } + } + else + { + // Decrease the feather variable, feathers can be used again if it's at 0 + if (NPC.ai[3] > 0f) + NPC.ai[3] -= 1f; + } + } + else if (NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && NPC.localAI[3] == 0f) + { + NPC.TargetClosest(); + NPC.ai[0] = 4f; + + // Birb will do at least 2 different attacks before entering this phase again + NPC.localAI[3] = 2f; + + // Decrease enraged attacks by 1 + if (NPC.localAI[2] > 0f) + NPC.localAI[2] -= 1f; + + if (NPC.ai[3] == 0f) + { + NPC.ai[3] = 3f; + SoundEngine.PlaySound(SoundID.Item102, player.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int totalProjectiles = phase2 ? 40 : 48; + + if (CalamityWorld.LegendaryMode) + totalProjectiles *= 2; + + float radians = MathHelper.TwoPi / totalProjectiles; + int distance = phase2 ? 1200 : 1320; + + if (CalamityWorld.LegendaryMode) + distance *= 2; + + bool spawnRight = player.velocity.X > 0f; + for (int i = 0; i < totalProjectiles; i++) + { + if (spawnRight) + { + if (i >= totalProjectiles / 2) + break; + + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; + Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); + } + else + { + if (i >= totalProjectiles / 2) + { + Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; + Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, FeatherDamage, 0f, Main.myPlayer); + } + } + } + } + } + else + { + // Decrease the feather variable, feathers can be used again if it's at 0 + if (NPC.ai[3] > 0f) + NPC.ai[3] -= 1f; + } + } + } + } + + NPC.ForceNetUpdate(false); + NPC.SyncExtraAI(); + } + } + + // Fly to target + else if (NPC.ai[0] == 1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt) / 10f; + + Vector2 follyTargetDirection = player.Center - NPC.Center; + if (follyTargetDirection.Length() < 800f) + { + NPC.TargetClosest(); + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + NPC.ForceNetUpdate(false); + NPC.SyncExtraAI(); + } + + float velocity = 14f + (enrageScale - 1f) * 4f; + float follyTargetDistance = velocity + follyTargetDirection.Length() / 100f; + float follyVelocityMult = 25f; + follyTargetDirection.Normalize(); + follyTargetDirection *= follyTargetDistance; + NPC.velocity = (NPC.velocity * (follyVelocityMult - 1f) + follyTargetDirection) / follyVelocityMult; + } + + // Fly towards target quickly + else if (NPC.ai[0] == 2f) + { + // Set reduced damage + NPC.damage = reducedSetDamage; + + if (NPC.target < 0 || !player.active || player.dead) + { + NPC.TargetClosest(); + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + NPC.ForceNetUpdate(false); + NPC.SyncExtraAI(); + } + + if (player.Center.X - 10f < NPC.Center.X) + NPC.direction = -1; + else if (player.Center.X + 10f > NPC.Center.X) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult * 0.5f + NPC.velocity.X * rotationAmt * 1.25f) / 5f; + + Vector2 follyQuickFlyTargetDirection = player.Center - NPC.Center; + follyQuickFlyTargetDirection.Y -= 20f; + NPC.ai[2] += 0.0222222228f; + if (expertMode) + NPC.ai[2] += 0.0166666675f; + + float velocity = 8f + (enrageScale - 1f) * 2f; + float follyQuickFlySpeed = velocity + NPC.ai[2] + follyQuickFlyTargetDirection.Length() / 120f; + if (CalamityWorld.MaliceMode) + follyQuickFlySpeed *= 2f; + + float follyQuickFlyVelMult = 20f; + follyQuickFlyTargetDirection.Normalize(); + follyQuickFlyTargetDirection *= follyQuickFlySpeed; + NPC.velocity = (NPC.velocity * (follyQuickFlyVelMult - 1f) + follyQuickFlyTargetDirection) / follyQuickFlyVelMult; + + NPC.ai[1] += 1f; + if (NPC.ai[1] >= (CalamityWorld.MaliceMode ? 90f : 180f)) + { + NPC.TargetClosest(); + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + NPC.ForceNetUpdate(false); + NPC.SyncExtraAI(); + } + } + + // Line up charge + else if (NPC.ai[0] == 3f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult * 0.5f + NPC.velocity.X * rotationAmt * 0.85f) / 5f; + + Vector2 follyLineUpTargetDirection = player.Center - NPC.Center; + follyLineUpTargetDirection.Y -= 12f; + if (NPC.Center.X > player.Center.X) + follyLineUpTargetDirection.X += chargeDistance; + else + follyLineUpTargetDirection.X -= chargeDistance; + + float verticalDistanceGateValue = (phase3 ? 100f : 20f) + (enrageScale - 1f) * 20f; + if (Math.Abs(NPC.Center.X - player.Center.X) > chargeDistance - 50f && Math.Abs(NPC.Center.Y - player.Center.Y) < verticalDistanceGateValue) + { + NPC.ai[0] = 3.1f; + NPC.ai[1] = 0f; + + NPC.ForceNetUpdate(false); + NPC.SyncExtraAI(); + } + + NPC.ai[1] += 0.0333333351f; + float velocity = 16f + (enrageScale - 1f) * 4f; + float follyLineUpSpeed = velocity + NPC.ai[1]; + float follyLineUpVelMult = 4f; + follyLineUpTargetDirection.Normalize(); + follyLineUpTargetDirection *= follyLineUpSpeed; + NPC.velocity = (NPC.velocity * (follyLineUpVelMult - 1f) + follyLineUpTargetDirection) / follyLineUpVelMult; + } + + // Prepare to charge + else if (NPC.ai[0] == 3.1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.rotation = (NPC.rotation * rotationMult * 0.5f + NPC.velocity.X * rotationAmt * 0.85f) / 5f; + + Vector2 follyChargePrepareTargetDirection = player.Center - NPC.Center; + follyChargePrepareTargetDirection.Y -= 12f; + float follyChargePrepareSpeed = 28f + (enrageScale - 1f) * 4f; + float follyChargePrepareVelMult = 8f; + follyChargePrepareTargetDirection.Normalize(); + follyChargePrepareTargetDirection *= follyChargePrepareSpeed; + NPC.velocity = (NPC.velocity * (follyChargePrepareVelMult - 1f) + follyChargePrepareTargetDirection) / follyChargePrepareVelMult; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + + NPC.ai[1] += 1f; + if (NPC.ai[1] > 10f) + { + // Set damage + NPC.damage = NPC.defDamage; + + NPC.velocity = follyChargePrepareTargetDirection; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.ai[0] = 3.2f; + NPC.ai[1] = NPC.direction; + + NPC.ForceNetUpdate(false); + NPC.SyncExtraAI(); + } + } + + // Charge + else if (NPC.ai[0] == 3.2f) + { + // Set damage + NPC.damage = NPC.defDamage; + + NPC.ai[2] += 0.0333333351f; + float velocity = 28f + (enrageScale - 1f) * 4f; + NPC.velocity.X = (velocity + NPC.ai[2]) * NPC.ai[1]; + + if ((NPC.ai[1] > 0f && NPC.Center.X > player.Center.X + (chargeDistance - 140f)) || (NPC.ai[1] < 0f && NPC.Center.X < player.Center.X - (chargeDistance - 140f))) + { + if (!Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) + { + NPC.TargetClosest(); + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ForceNetUpdate(false); + } + else if (Math.Abs(NPC.Center.X - player.Center.X) > chargeDistance + 200f) + { + NPC.TargetClosest(); + NPC.ai[0] = 1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ForceNetUpdate(false); + } + } + + NPC.rotation = (NPC.rotation * rotationMult * 0.5f + NPC.velocity.X * rotationAmt * 0.85f) / 5f; + } + + // Birb spawn + else if (NPC.ai[0] == 4f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.ai[1] == 0f) + { + Vector2 destination2 = player.Center + new Vector2(0f, -200f); + Vector2 desiredVelocity2 = NPC.SafeDirectionTo(destination2, -Vector2.UnitY) * 18f; + NPC.SimpleFlyMovement(desiredVelocity2, 1.5f); + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + + NPC.ai[2] += 1f; + if (NPC.Distance(player.Center) < 600f || NPC.ai[2] >= 180f) + { + NPC.ai[1] = 1f; + NPC.ForceNetUpdate(false); + } + } + else + { + if (NPC.ai[1] < 90f) + NPC.velocity *= 0.95f; + else + NPC.velocity *= 0.98f; + + if (NPC.ai[1] == 90f) + { + if (NPC.velocity.Y > 0f) + NPC.velocity.Y /= 3f; + + NPC.velocity.Y -= 3f; + } + + // Sound + if (NPC.ai[1] == birbSpawnPhaseTimer - 60f) + { + float squawkpitch = Main.zenithWorld ? 1.3f : 0.25f; + SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, NPC.Center); + + if (Main.zenithWorld) + { + int spacing = 30; + int amt = 3; + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < amt; i++) + { + Vector2 fireFrom = new Vector2(NPC.Center.X + (spacing * i) - (spacing * amt / 2), NPC.Center.Y - 900f); + Vector2 ai0 = NPC.Center - fireFrom; + float ai = Main.rand.Next(100); + Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + } + } + } + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + bool gfbSpawnFlag = CalamityWorld.MaliceMode && (NPC.ai[1] == 145f || NPC.ai[1] == 150f || NPC.ai[1] == 160f || NPC.ai[1] == 165f); + bool spawnFlag = NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && (NPC.ai[1] == 140f || (revenge && NPC.ai[1] == 155f) || NPC.ai[1] == 170f || gfbSpawnFlag); + if (spawnFlag) + { + Vector2 follySpawnCenter = NPC.Center + (MathHelper.TwoPi * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 50f * (0.6f + Main.rand.NextFloat() * 0.4f); + if (Vector2.Distance(follySpawnCenter, player.Center) > 150f) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)follySpawnCenter.X, (int)follySpawnCenter.Y, ModContent.NPCType(), NPC.whoAmI); + + NPC.ForceNetUpdate(false); + } + } + + NPC.ai[1] += 1f; + } + + if (NPC.ai[1] >= birbSpawnPhaseTimer) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.TargetClosest(); + NPC.ForceNetUpdate(false); + } + } + + // Spit homing aura sphere + else if (NPC.ai[0] == 5f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + // Velocity + NPC.velocity *= 0.98f; + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt) / 10f; + + // Play sound + float aiGateValue = 120f; + if (NPC.ai[1] == aiGateValue - 30f) + { + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Vector2 follySpawnCenter = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; + float ai0 = (phase3 ? 2f : 0f) + (enrageScale - 1f); + if (ai0 > 3f) + ai0 = 3f; + + Projectile.NewProjectile(NPC.GetSource_FromAI(), follySpawnCenter.X, follySpawnCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, ai0, NPC.target + 1); + NPC.ForceNetUpdate(false); + } + + if (Main.zenithWorld) + { + int spacing = 30; + int amt = 3; + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < amt; i++) + { + Vector2 fireFrom = new Vector2(NPC.Center.X + (spacing * i) - (spacing * amt / 2), NPC.Center.Y - 900f); + Vector2 ai0 = NPC.Center - fireFrom; + float ai = Main.rand.Next(100); + Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + } + } + } + } + + NPC.ai[1] += 1f; + if (NPC.ai[1] >= aiGateValue) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ForceNetUpdate(false); + } + } + } + + public override void FindFrame(int frameHeight) + { + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases + bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f) || death; + bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f); + bool birbSpawn = NPC.ai[0] == 4f && NPC.ai[1] > 0f; + + // Animation goes nyoom + if (Main.zenithWorld) + { + NPC.frameCounter += 4; + } + + float newPhaseTimer = 180f; + bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || + (phase3 && calamityGlobalNPC.newAI[1] < newPhaseTimer && calamityGlobalNPC.newAI[3] != 1f); + + if (phaseSwitchPhase || birbSpawn) + { + float frameGateValue = birbSpawn ? NPC.ai[1] : phase3 ? calamityGlobalNPC.newAI[1] : calamityGlobalNPC.newAI[0]; + int frameTimer = 180; + if (frameGateValue < (frameTimer - 60) || frameGateValue > (frameTimer - 20)) + { + NPC.frameCounter += 1D; + if (NPC.frameCounter > 5D) + { + NPC.frameCounter = 0D; + NPC.frame.Y += frameHeight; + } + if (NPC.frame.Y >= frameHeight * 5) + { + NPC.frame.Y = 0; + } + } + else + { + NPC.frame.Y = frameHeight * 4; + if (frameGateValue > (frameTimer - 50) && frameGateValue < (frameTimer - 25)) + { + NPC.frame.Y = frameHeight * 5; + } + } + } + else if (NPC.ai[0] == 5f) + { + int otherFrameTimer = 120; + if (NPC.ai[1] < (otherFrameTimer - 50) || NPC.ai[1] > (otherFrameTimer - 10)) + { + NPC.frameCounter += 1D; + if (NPC.frameCounter > 5D) + { + NPC.frameCounter = 0D; + NPC.frame.Y += frameHeight; + } + if (NPC.frame.Y >= frameHeight * 5) + { + NPC.frame.Y = 0; + } + } + else + { + NPC.frame.Y = frameHeight * 4; + if (NPC.ai[1] > (otherFrameTimer - 40) && NPC.ai[1] < (otherFrameTimer - 15)) + { + NPC.frame.Y = frameHeight * 5; + } + } + } + else + { + NPC.frameCounter += (NPC.ai[0] == 3.2f ? 1.5 : 1D); + if (NPC.frameCounter > 4D) //iban said the time between frames was 5 so using that as a base + { + NPC.frameCounter = 0D; + NPC.frame.Y += frameHeight; + } + if (NPC.frame.Y >= frameHeight * 5) + { + NPC.frame.Y = 0; + } + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + // Phases + bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f) || death; + bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f); + + float newPhaseTimer = 180f; + bool phaseSwitchPhase = (phase2 && calamityGlobalNPC.newAI[0] < newPhaseTimer && calamityGlobalNPC.newAI[2] != 1f) || + (phase3 && calamityGlobalNPC.newAI[1] < newPhaseTimer && calamityGlobalNPC.newAI[3] != 1f); + + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); + Color color = drawColor; + Color altColor = Color.White; + + float lerpDrawTransition = 0f; + int newAITracker = 120; + int buffColorDampener = 60; + + if (phase3 && calamityGlobalNPC.newAI[3] == 1f) + { + color = CalamityGlobalNPC.buffColor(color, 0.9f, 0.6f, 0.2f, 1f); + } + else if (phase2 && calamityGlobalNPC.newAI[2] == 1f) + { + color = CalamityGlobalNPC.buffColor(color, 0.7f, 0.7f, 0.3f, 1f); + } + else if (phase2 && calamityGlobalNPC.newAI[0] > (float)newAITracker) + { + float phase2TranBuff = calamityGlobalNPC.newAI[0] - (float)newAITracker; + phase2TranBuff /= (float)buffColorDampener; + color = CalamityGlobalNPC.buffColor(color, 1f - 0.3f * phase2TranBuff, 1f - 0.3f * phase2TranBuff, 1f - 0.7f * phase2TranBuff, 1f); + } + + int afterimageAmt = 10; + int afterimageIncrement = 2; + if (NPC.ai[0] == 0f || NPC.ai[0] == 3.1f || NPC.ai[0] == 4f || NPC.ai[0] == 4.2f) + { + afterimageAmt = 4; + } + if (NPC.ai[0] == 1f || NPC.ai[0] == 3f || NPC.ai[0] == 4.1f) + { + afterimageAmt = 7; + } + if (NPC.ai[0] == 2f || NPC.ai[0] == 3.2f || (phase2 && calamityGlobalNPC.newAI[2] == 1f)) + { + altColor = Color.Yellow; + lerpDrawTransition = 0.5f; + } + else + { + color = altColor; + } + + if (CalamityClientConfig.Instance.Afterimages) + { + for (int i = 1; i < afterimageAmt; i += afterimageIncrement) + { + Color afterimageColor = color; + afterimageColor = Color.Lerp(afterimageColor, altColor, lerpDrawTransition); + afterimageColor = NPC.GetAlpha(afterimageColor); + afterimageColor *= (float)(afterimageAmt - i) / 15f; + Vector2 afterimageDrawPos = NPC.oldPos[i] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; + afterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; + afterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, afterimageDrawPos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + } + + int extraAfterimageAmt = 0; + float extraAfterimageDampener = 0f; + float afterimageScaler = 0f; + + if (NPC.ai[0] == 0f || NPC.ai[0] == 3.1f || NPC.ai[0] == 4f || NPC.ai[0] == 4.2f) + { + extraAfterimageAmt = 4; + } + + if (NPC.ai[0] == 5f) + { + if (NPC.ai[1] > 60f) + { + extraAfterimageAmt = 6; + extraAfterimageDampener = 1f - (float)Math.Cos((double)((NPC.ai[1] - 60f) / 30f * MathHelper.TwoPi)); + extraAfterimageDampener /= 3f; + afterimageScaler = 40f; + } + } + + if (phaseSwitchPhase) + { + if (phase3 && calamityGlobalNPC.newAI[1] > (float)newAITracker) + { + extraAfterimageAmt = 6; + extraAfterimageDampener = 1f - (float)Math.Cos((double)((calamityGlobalNPC.newAI[1] - (float)newAITracker) / (float)buffColorDampener * MathHelper.TwoPi)); + extraAfterimageDampener /= 3f; + afterimageScaler = 60f; + } + else if (phase2 && calamityGlobalNPC.newAI[0] > (float)newAITracker) + { + extraAfterimageAmt = 6; + extraAfterimageDampener = 1f - (float)Math.Cos((double)((calamityGlobalNPC.newAI[0] - (float)newAITracker) / (float)buffColorDampener * MathHelper.TwoPi)); + extraAfterimageDampener /= 3f; + afterimageScaler = 60f; + } + } + + if (CalamityClientConfig.Instance.Afterimages) + { + for (int j = 0; j < extraAfterimageAmt; j++) + { + Color extraAfterimageColor = altColor; + extraAfterimageColor = Color.Lerp(extraAfterimageColor, altColor, lerpDrawTransition); + extraAfterimageColor = NPC.GetAlpha(extraAfterimageColor); + extraAfterimageColor *= 1f - extraAfterimageDampener; + Vector2 extraAfterimageDrawPos = NPC.Center + ((float)j / (float)extraAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScaler * extraAfterimageDampener - screenPos; + extraAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; + extraAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, extraAfterimageDrawPos, NPC.frame, extraAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + } + + Color mainDrawingColor = altColor; + mainDrawingColor = Color.Lerp(mainDrawingColor, altColor, lerpDrawTransition); + mainDrawingColor = NPC.GetAlpha(mainDrawingColor); + Vector2 drawLocation = NPC.Center - screenPos; + drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; + drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, (phase3 && calamityGlobalNPC.newAI[3] == 1f ? mainDrawingColor : NPC.GetAlpha(altColor)), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + + if (phase2) + { + texture2D15 = GlowTexture.Value; + Color glowmaskColor = Color.Lerp(Color.White, Color.Red, 0.5f); + altColor = Color.Red; + + lerpDrawTransition = 1f; + extraAfterimageDampener = 0.5f; + afterimageScaler = 10f; + afterimageIncrement = 1; + + if (phaseSwitchPhase) + { + float glowmaskDampener = (phase3 ? calamityGlobalNPC.newAI[1] : calamityGlobalNPC.newAI[0]) - (float)newAITracker; + glowmaskDampener /= (float)buffColorDampener; + altColor *= glowmaskDampener; + glowmaskColor *= glowmaskDampener; + } + + if (CalamityClientConfig.Instance.Afterimages) + { + for (int k = 1; k < afterimageAmt; k += afterimageIncrement) + { + Color glowmaskAfterimageColor = glowmaskColor; + glowmaskAfterimageColor = Color.Lerp(glowmaskAfterimageColor, altColor, lerpDrawTransition); + glowmaskAfterimageColor *= (float)(afterimageAmt - k) / 15f; + Vector2 glowmaskAfterimageDrawPos = NPC.oldPos[k] + new Vector2((float)NPC.width, (float)NPC.height) / 2f - screenPos; + glowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; + glowmaskAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, glowmaskAfterimageDrawPos, NPC.frame, glowmaskAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + + for (int l = 1; l < extraAfterimageAmt; l++) + { + Color extraGlowmaskAfterimageColor = glowmaskColor; + extraGlowmaskAfterimageColor = Color.Lerp(extraGlowmaskAfterimageColor, altColor, lerpDrawTransition); + extraGlowmaskAfterimageColor = NPC.GetAlpha(extraGlowmaskAfterimageColor); + extraGlowmaskAfterimageColor *= 1f - extraAfterimageDampener; + Vector2 extraGlowmaskAfterimageDrawPos = NPC.Center + ((float)l / (float)extraAfterimageAmt * MathHelper.TwoPi + NPC.rotation).ToRotationVector2() * afterimageScaler * extraAfterimageDampener - screenPos; + extraGlowmaskAfterimageDrawPos -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; + extraGlowmaskAfterimageDrawPos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, extraGlowmaskAfterimageDrawPos, NPC.frame, extraGlowmaskAfterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + } + + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + + return false; + } + + private static Color buffColor(Color newColor, float R, float G, float B, float A) + { + newColor.R = (byte)((float)newColor.R * R); + newColor.G = (byte)((float)newColor.G * G); + newColor.B = (byte)((float)newColor.B * B); + newColor.A = (byte)((float)newColor.A * A); + return newColor; + } + + public override void BossLoot(ref int potionType) => potionType = ItemID.SuperHealingPotion; + + public override void ModifyNPCLoot(NPCLoot npcLoot) + { + npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); + + // Normal drops: Everything that would otherwise be in the bag + var normalOnly = npcLoot.DefineNormalOnlyDropSet(); + { + // Weapons + int[] items = new int[] + { + ModContent.ItemType(), + ModContent.ItemType(), + ModContent.ItemType() + }; + normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, items)); + normalOnly.Add(ModContent.ItemType(), 10); + + // Materials + normalOnly.Add(ModContent.ItemType(), 1, 25, 30); + + // Equipment + normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); + + // Vanity + normalOnly.Add(ModContent.ItemType(), 7); + normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); + } + + npcLoot.Add(ModContent.ItemType(), 10); + + // Relic + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); + + // GFB Omega Healing Potion drop + npcLoot.DefineConditionalDropSet(DropHelper.GFB).Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 50, 100), true); + + // Lore + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedDragonfolly, ModContent.ItemType(), desc: DropHelper.FirstKillText); + } + + public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) + { + if (hurtInfo.Damage > 0) + target.AddBuff(ModContent.BuffType(), Main.zenithWorld ? 360 : 180); + } + + public override void OnKill() + { + // Don't bother running any of this in Boss Rush. + if (BossRushEvent.BossRushActive) + return; + + CalamityGlobalNPC.SetNewBossJustDowned(NPC); + + // Mark The Dragonfolly as dead + DownedBossSystem.downedDragonfolly = true; + CalamityNetcode.SyncWorld(); + + if (Main.zenithWorld) + { + int spacing = 40; + int amt = 7; + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < amt; i++) + { + Vector2 fireFrom = new Vector2(NPC.Center.X + (spacing * i) - (spacing * amt / 2), NPC.Center.Y - 900f); + Vector2 ai0 = NPC.Center - fireFrom; + float ai = Main.rand.Next(100); + Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), LightningDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); + } + } + } + + } + + public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) + { + NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); + } + + public override void ModifyTypeName(ref string typeName) + { + if (Main.zenithWorld) + { + typeName = CalamityUtils.GetTextValue("NPCs.Bumblebirb"); + } + } + + public override void HitEffect(NPC.HitInfo hit) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); + } + if (NPC.life <= 0) + { + for (int k = 0; k < 50; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); + } + if (!Main.dedServ) + { + for (int i = 0; i < 6; i++) // 1 head, 1 wing, 4 legs = 6. one wing due to them being chonky boyes now + { + string gore = "Bumble"; + float randomSpread = Main.rand.Next(-200, 201) / 100f; + gore += i == 0 ? "Head" : i > 1 ? "Leg" : "Wing"; + Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity * randomSpread, Mod.Find(gore).Type, 1f); + } + } + } + } + } +} diff --git a/NPCs/CalClone/CalamitasClone.cs b/NPCs/CalClone/CalamitasClone.cs index 1fa25a84ae..b518d27391 100644 --- a/NPCs/CalClone/CalamitasClone.cs +++ b/NPCs/CalClone/CalamitasClone.cs @@ -14,14 +14,14 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; using CalamityMod.NPCs.TownNPCs; -using CalamityMod.Sounds; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using ReLogic.Utilities; +using System; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -61,10 +61,15 @@ namespace CalamityMod.NPCs.CalClone } } + public static int DartDamage = 22; // 88 + public static int HellblastDamage = 25; // 100 + public static int HellfireballDamage = 25; // 100 + public static int FireblastDamage = 35; // 140; Also applies to GFB Gigablasts + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 60; // 120 NPC.npcSlots = 14f; NPC.width = 120; NPC.height = 120; @@ -72,10 +77,9 @@ namespace CalamityMod.NPCs.CalClone if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 0.8f; - NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 12 : 25; - NPC.value = Item.buyPrice(0, 20, 0, 0); - NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.075f : 0.15f); - NPC.LifeMaxNERB(37500, 45000, 520000); + NPC.defense = 25; + NPC.value = Item.buyPrice(gold: 15); + NPC.LifeMaxNERB(39000, 46875, 520000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -87,9 +91,6 @@ namespace CalamityMod.NPCs.CalClone NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -134,7 +135,698 @@ namespace CalamityMod.NPCs.CalClone public override void AI() { - CalamitasCloneAI.VanillaCalamitasCloneAI(NPC, Mod, BulletHellWarnSlot); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + // Emit light + 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 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; + + // Phases + bool phase2 = lifeRatio < 0.7f || death; + bool phase3 = lifeRatio < 0.35f; + bool phase4 = lifeRatio <= 0.1f && death; + + // Don't take damage during bullet hells + NPC.dontTakeDamage = calamityGlobalNPC.newAI[2] > 0f; + + // Variable for live brothers + bool brotherAlive = false; + + // For seekers + CalamityGlobalNPC.calamitas = NPC.whoAmI; + + // Seeker ring + if (calamityGlobalNPC.newAI[1] == 0f && phase3 && expertMode) + { + SoundEngine.PlaySound(SoundID.Item72, NPC.Center); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int seekerAmt = death ? 10 : 5; + int seekerSpread = 360 / seekerAmt; + int seekerDistance = death ? 180 : 150; + for (int i = 0; i < seekerAmt; i++) + { + int spawn = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + (Math.Sin(i * seekerSpread) * seekerDistance)), (int)(NPC.Center.Y + (Math.Cos(i * seekerSpread) * seekerDistance)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); + Main.npc[spawn].ai[0] = i * seekerSpread; + } + } + + string key = "Mods.CalamityMod.Status.Boss.CalamitasBossText3"; + Color messageColor = Color.Orange; + CalamityUtils.DisplayLocalizedText(key, messageColor); + + calamityGlobalNPC.newAI[1] = 1f; + } + + // CIT 14SEP2024: Fixed bug where her phases would get offset by dealing a large amount of damage in a single hit to take her into a new phase. + // newAI[0] now starts at 1 and has 0.3 subtracted from it for each phase, instead of it storing her current health when she enters a new phase. + + // Do bullet hell or spawn brothers + if (calamityGlobalNPC.newAI[0] == 0f && NPC.life > 0) + calamityGlobalNPC.newAI[0] = 1f; + + // Bullet hells at 70% and 10%, brothers at 40% + if (NPC.life > 0) + { + int calClonePhaseThreshold = (int)(NPC.lifeMax * 0.3); + if (((NPC.life + calClonePhaseThreshold) / (float)NPC.lifeMax) < calamityGlobalNPC.newAI[0]) + { + calamityGlobalNPC.newAI[0] -= 0.3f; + if (calamityGlobalNPC.newAI[0] <= 0.1f) + { + SoundEngine.PlaySound(SoundID.Item109, NPC.Center); + calamityGlobalNPC.newAI[2] = 2f; + + if (CalamityWorld.MaliceMode) + calamityGlobalNPC.newAI[3] = 0f; + + SpawnDust(); + } + else if (calamityGlobalNPC.newAI[0] <= 0.4f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.position.Y + NPC.height, ModContent.NPCType(), NPC.whoAmI); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.position.Y + NPC.height, ModContent.NPCType(), NPC.whoAmI); + } + + string key = "Mods.CalamityMod.Status.Boss.CalamitasBossText2"; + Color messageColor = Color.Orange; + CalamityUtils.DisplayLocalizedText(key, messageColor); + + SpawnDust(); + } + else + { + SoundEngine.PlaySound(SoundID.Item109, NPC.Center); + calamityGlobalNPC.newAI[2] = 1f; + + if (CalamityWorld.MaliceMode) + calamityGlobalNPC.newAI[3] = 0f; + + SpawnDust(); + } + } + } + + // Immunity if brothers are alive + if (CalamityGlobalNPC.cataclysm != -1) + { + if (Main.npc[CalamityGlobalNPC.cataclysm].active) + brotherAlive = true; + } + if (CalamityGlobalNPC.catastrophe != -1) + { + if (Main.npc[CalamityGlobalNPC.catastrophe].active) + brotherAlive = true; + } + + if (brotherAlive) + NPC.dontTakeDamage = true; + + void SpawnDust() + { + int dustAmt = 50; + int random = 3; + + for (int j = 0; j < 10; j++) + { + random += j; + int dustAmtSpawned = 0; + int scale = random * 6; + float dustPositionX = NPC.Center.X - (scale / 2); + float dustPositionY = NPC.Center.Y - (scale / 2); + while (dustAmtSpawned < dustAmt) + { + float dustVelocityX = Main.rand.Next(-random, random); + float dustVelocityY = Main.rand.Next(-random, random); + float dustVelocityScalar = random * 2f; + float dustVelocity = (float)Math.Sqrt(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY); + dustVelocity = dustVelocityScalar / dustVelocity; + dustVelocityX *= dustVelocity; + dustVelocityY *= dustVelocity; + int dust = Dust.NewDust(new Vector2(dustPositionX, dustPositionY), scale, scale, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); + Main.dust[dust].noGravity = true; + Main.dust[dust].position.X = NPC.Center.X; + Main.dust[dust].position.Y = NPC.Center.Y; + Main.dust[dust].position.X += Main.rand.Next(-10, 11); + Main.dust[dust].position.Y += Main.rand.Next(-10, 11); + Main.dust[dust].velocity.X = dustVelocityX; + Main.dust[dust].velocity.Y = dustVelocityY; + dustAmtSpawned++; + } + } + } + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + // Target variable + Player player = Main.player[NPC.target]; + + float enrageScale = 0f; + if (Main.IsItDay()) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 2f; + } + + // Rotation + Vector2 npcCenter = new Vector2(NPC.Center.X, NPC.position.Y + NPC.height - 59f); + Vector2 lookAt = new Vector2(player.position.X - (player.width / 2), player.position.Y - (player.height / 2)); + Vector2 rotationVector = npcCenter - lookAt; + + float rotation = (float)Math.Atan2(rotationVector.Y, rotationVector.X) + MathHelper.PiOver2; + if (rotation < 0f) + rotation += MathHelper.TwoPi; + else if (rotation > MathHelper.TwoPi) + rotation -= MathHelper.TwoPi; + + float rotationAmt = 0.1f; + if (NPC.rotation < rotation) + { + if ((rotation - NPC.rotation) > MathHelper.Pi) + NPC.rotation -= rotationAmt; + else + NPC.rotation += rotationAmt; + } + else if (NPC.rotation > rotation) + { + if ((NPC.rotation - rotation) > MathHelper.Pi) + NPC.rotation += rotationAmt; + else + NPC.rotation -= rotationAmt; + } + + if (NPC.rotation > rotation - rotationAmt && NPC.rotation < rotation + rotationAmt) + NPC.rotation = rotation; + if (NPC.rotation < 0f) + NPC.rotation += MathHelper.TwoPi; + else if (NPC.rotation > MathHelper.TwoPi) + NPC.rotation -= MathHelper.TwoPi; + if (NPC.rotation > rotation - rotationAmt && NPC.rotation < rotation + rotationAmt) + NPC.rotation = rotation; + + // Despawn + if (!player.active || player.dead) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + if (!player.active || player.dead) + { + if (SoundEngine.TryGetActiveSound(BulletHellWarnSlot, out var warningSound) && warningSound.IsPlaying) + warningSound.Stop(); + + if (NPC.velocity.Y > 3f) + NPC.velocity.Y = 3f; + NPC.velocity.Y -= 0.1f; + if (NPC.velocity.Y < -12f) + NPC.velocity.Y = -12f; + + if (NPC.timeLeft > 60) + NPC.timeLeft = 60; + + if (NPC.ai[1] != 0f) + { + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + NPC.alpha = 0; + NPC.netUpdate = true; + } + return; + } + } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; + + // Distance from destination where Cal Clone stops moving + float movementDistanceGateValue = 100f; + + // How fast Cal Clone moves to the destination + float baseVelocity = (expertMode ? 10f : 8.5f) * (NPC.ai[1] == 4f ? 1.4f : 1f); + float baseAcceleration = (expertMode ? 0.18f : 0.155f) * (NPC.ai[1] == 4f ? 1.4f : 1f); + baseVelocity += 4f * enrageScale; + baseAcceleration += 0.1f * enrageScale; + if (revenge) + { + baseVelocity += 1.5f * (1f - lifeRatio); + baseAcceleration += 0.03f * (1f - lifeRatio); + } + if (death) + { + baseVelocity += 1.5f * (1f - lifeRatio); + baseAcceleration += 0.03f * (1f - lifeRatio); + } + if (CalamityWorld.LegendaryMode) + { + baseVelocity *= 1.15f; + baseAcceleration *= 1.15f; + } + + // What side Cal Clone should be on, relative to the target + int xPos = 1; + if (NPC.Center.X < player.Center.X) + xPos = -1; + + // How far Cal Clone should be from the target + float averageDistance = 500f; + float chargeDistance = phase4 ? 300f : 400f; + + // This is where Cal Clone should be + Vector2 destination = (calamityGlobalNPC.newAI[2] > 0f || NPC.ai[1] == 0f) ? new Vector2(player.Center.X, player.Center.Y - averageDistance) : + NPC.ai[1] == 1f ? new Vector2(player.Center.X + averageDistance * xPos, player.Center.Y) : + new Vector2(player.Center.X + chargeDistance * xPos, player.Center.Y); + + // Add some random distance to the destination after certain attacks + if (NPC.localAI[0] == 1f) + { + NPC.localAI[0] = 0f; + NPC.localAI[2] = Main.rand.Next(-50, 51); + NPC.localAI[3] = Main.rand.Next(-300, 301); + NPC.netUpdate = true; + } + + // Add a bit of randomness to the destination + if (death) + { + destination.X += NPC.ai[1] == 0f ? NPC.localAI[3] : NPC.localAI[2]; + destination.Y += NPC.ai[1] == 0f ? NPC.localAI[2] : NPC.localAI[3]; + } + + // How far Cal Clone is from where she's supposed to be + Vector2 distanceFromDestination = destination - NPC.Center; + + // Movement + if (NPC.ai[1] == 0f || NPC.ai[1] == 1f || NPC.ai[1] == 4f || calamityGlobalNPC.newAI[2] > 0f) + CalamityUtils.SmoothMovement(NPC, movementDistanceGateValue, distanceFromDestination, baseVelocity, baseAcceleration, true); + + // Bullet hell phase + if (calamityGlobalNPC.newAI[2] > 0f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (calamityGlobalNPC.newAI[3] < 900f) + { + calamityGlobalNPC.newAI[3] += 1f; + NPC.dontTakeDamage = true; + NPC.alpha = 255; + + float rotX = player.Center.X - NPC.Center.X; + float rotY = player.Center.Y - NPC.Center.Y; + NPC.rotation = (float)Math.Atan2(rotY, rotX) - MathHelper.PiOver2; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (calamityGlobalNPC.newAI[2] == 2f) + { + int type = ModContent.ProjectileType(); + int damage = FireblastDamage; + if (Main.zenithWorld) + type = ModContent.ProjectileType(); + + float gigaBlastFrequency = (CalamityWorld.LegendaryMode ? 120f : expertMode ? 180f : 240f) - enrageScale * 15f; + float projSpeed = 5f; + if (calamityGlobalNPC.newAI[3] <= 300f) + { + if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); + } + else if (calamityGlobalNPC.newAI[3] <= 600f && calamityGlobalNPC.newAI[3] > 300f) + { + if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from right + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -projSpeed, 0f, type, damage, 0f, Main.myPlayer); + } + else if (calamityGlobalNPC.newAI[3] > 600f) + { + if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); + } + } + } + + NPC.ai[0] += 1f; + float hellblastGateValue = (expertMode ? 12f : 16f) - enrageScale; + if (NPC.ai[0] >= hellblastGateValue) + { + NPC.ai[0] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + int damage = HellblastDamage; + float projSpeed = 4f; + // Blasts aimed directly at the player's horizontal position, does not spawn during the second bullet hell + if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f && calamityGlobalNPC.newAI[2] != 2f) + { + float distance = Main.rand.NextBool() ? -1000f : 1000f; + float velocity = distance == -1000f ? projSpeed : -projSpeed; + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + + if (calamityGlobalNPC.newAI[3] < 300f) // Blasts from above + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + else if (calamityGlobalNPC.newAI[3] < 600f) // Blasts from left and right + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 0.5f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 0.5f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + else // Blasts from above, left, and right + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed - 1f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 1f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 1f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + } + } + + if (calamityGlobalNPC.newAI[3] == 900f - 360f) + 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) + warningSound.Position = player.Center; + } + } + else + { + NPC.ai[0] = 0f; + NPC.ai[3] = 0f; + NPC.localAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + SoundEngine.PlaySound(CalamitasClone.BulletHellEnd with { Volume = 0.75f }, player.Center); + + // Prevent bullshit charge hits when second bullet hell ends. + if (phase4) + { + NPC.ai[1] = 4f; + NPC.ai[2] = -105f; + NPC.TargetClosest(); + } + else + { + if (death) + { + int AIState = Main.rand.Next(3); + switch (AIState) + { + case 0: + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + break; + case 1: + NPC.ai[1] = 1f; + NPC.ai[2] = 0f; + break; + case 2: + NPC.ai[1] = 4f; + NPC.ai[2] = -105f; + NPC.TargetClosest(); + break; + } + } + else + { + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + if (death) + NPC.localAI[0] = 1f; + } + + NPC.netUpdate = true; + + for (int x = 0; x < Main.maxProjectiles; x++) + { + Projectile projectile = Main.projectile[x]; + if (projectile.active) + { + if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) + { + if (projectile.timeLeft > 60) + projectile.timeLeft = 60; + } + else if (projectile.type == ModContent.ProjectileType()) + { + projectile.ai[2] = 1f; + + if (projectile.timeLeft > 60) + projectile.timeLeft = 60; + } + } + } + } + + return; + } + else if (CalamityWorld.MaliceMode) + { + if (calamityGlobalNPC.newAI[3] < 900f) + calamityGlobalNPC.newAI[3] += 1f; + else + calamityGlobalNPC.newAI[3] = 0f; + + NPC.ai[0] += 1f; + float hellblastGateValue = 30f - enrageScale; + if (NPC.ai[0] >= hellblastGateValue) + { + NPC.ai[0] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ModContent.ProjectileType(); + int damage = HellblastDamage; + float projSpeed = 4f; + if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) + { + float distance = Main.rand.NextBool() ? -1000f : 1000f; + float velocity = distance == -1000f ? projSpeed : -projSpeed; + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + + if (calamityGlobalNPC.newAI[3] < 300f) // Blasts from above + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + else if (calamityGlobalNPC.newAI[3] < 600f) // Blasts from left and right + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 0.5f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 0.5f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + else // Blasts from above, left, and right + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed - 1f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 1f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 1f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); + } + } + } + } + + NPC.alpha = NPC.dontTakeDamage ? 255 : 0; + + // Float above target and fire hellfireballs + if (NPC.ai[1] == 0f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.ai[2] += 1f; + float phaseTimer = 400f - (death ? 120f * (1f - lifeRatio) : 0f); + if (NPC.ai[2] >= phaseTimer || phase4) + { + // Prevent going to other positions during brothers phase + if (!brotherAlive) + NPC.ai[1] = death && !phase4 && Main.rand.NextBool() ? 4f : 1f; + + NPC.ai[2] = 0f; + if (death) + NPC.localAI[0] = 1f; + + NPC.netUpdate = true; + } + + if (Main.netMode != NetmodeID.MultiplayerClient && !brotherAlive) + { + NPC.localAI[1] += 1f; + if (expertMode) + NPC.localAI[1] += death ? 2f * (1f - lifeRatio) : 1f - lifeRatio; + if (revenge) + NPC.localAI[1] += 0.5f; + + if (NPC.localAI[1] >= 120f) + { + NPC.localAI[1] = 0f; + SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.HellfireballSound, NPC.Center); + + float projectileVelocity = expertMode ? 14f : 12.5f; + projectileVelocity += 3f * enrageScale; + int type = ModContent.ProjectileType(); + bool shootPredictiveShot = CalamityWorld.MaliceMode && Main.rand.NextBool(); + Vector2 predictionVector = shootPredictiveShot ? player.velocity * 20f : Vector2.Zero; + Vector2 fireballVelocity = Vector2.Normalize(player.Center + predictionVector - NPC.Center) * projectileVelocity; + Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, HellfireballDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); + Main.projectile[proj].netUpdate = true; + } + } + } + + // Float to the side of the target and fire + else if (NPC.ai[1] == 1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (Main.netMode != NetmodeID.MultiplayerClient && !brotherAlive) + { + NPC.localAI[1] += 1f; + if (revenge) + NPC.localAI[1] += 0.5f; + if (expertMode) + NPC.localAI[1] += 0.5f; + + if (NPC.localAI[1] >= 50f && Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) + { + NPC.localAI[1] = 0f; + + float projectileVelocity = expertMode ? 12.5f : 11f; + projectileVelocity += 3f * enrageScale; + int type = ModContent.ProjectileType(); + int damage = HellblastDamage; + Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity; + Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; + + if (!Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height)) + { + type = ModContent.ProjectileType(); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, HellfireballDamage, 0f, Main.myPlayer, player.position.X, player.position.Y); + } + else + { + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, 1f); + } + } + } + + NPC.ai[2] += 1f; + float phaseTimer = 240f - (death ? 60f * (1f - lifeRatio) : 0f); + if (NPC.ai[2] >= phaseTimer || phase4) + { + if (brotherAlive) + NPC.ai[1] = 0f; + else if (death && !phase4 && Main.rand.NextBool()) + NPC.ai[1] = 0f; + else + NPC.ai[1] = phase2 && revenge ? 4f : 0f; + + NPC.ai[2] = 0f; + if (death) + NPC.localAI[0] = 1f; + + NPC.netUpdate = true; + } + } + else if (NPC.ai[1] == 2f) + { + // Set damage + NPC.damage = NPC.defDamage; + SoundEngine.PlaySound(ChargeSound, NPC.Center); + NPC.rotation = rotation; + + float chargeVelocity = phase4 ? 30f : death ? 28f : 25f; + chargeVelocity += 5f * enrageScale; + + Vector2 vector = Vector2.Normalize(player.Center - NPC.Center); + NPC.velocity = vector * chargeVelocity; + + NPC.ai[1] = 3f; + NPC.netUpdate = true; + } + else if (NPC.ai[1] == 3f) + { + // Set damage + NPC.damage = NPC.defDamage; + + NPC.ai[2] += 1f; + + float chargeTime = phase4 ? 35f : death ? 40f : 45f; + if (NPC.ai[2] >= chargeTime) + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.velocity *= 0.9f; + if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) + NPC.velocity.X = 0f; + if (NPC.velocity.Y > -0.1 && NPC.velocity.Y < 0.1) + NPC.velocity.Y = 0f; + } + else + { + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) - MathHelper.PiOver2; + + // Leave behind slow hellblasts in Death Mode + if (Main.netMode != NetmodeID.MultiplayerClient && death && phase3 && NPC.ai[2] % (phase4 ? 6f : 10f) == 0f) + { + int type = ModContent.ProjectileType(); + Vector2 fireballVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : NPC.velocity * 0.01f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, HellblastDamage, 0f, Main.myPlayer, 1f, 0f); + } + } + + if (NPC.ai[2] >= chargeTime + 10f) + { + if (!phase4) + NPC.ai[3] += 1f; + + NPC.ai[2] = 0f; + + NPC.rotation = rotation; + NPC.netUpdate = true; + + if (NPC.ai[3] >= 2f) + { + NPC.TargetClosest(); + NPC.ai[1] = 0f; + NPC.ai[3] = 0f; + return; + } + + NPC.ai[1] = 4f; + } + } + else + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= (phase4 ? 15f : 30f)) + { + NPC.ai[1] = 2f; + NPC.ai[2] = 0f; + if (death) + NPC.localAI[0] = 1f; + + NPC.netUpdate = true; + } + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -215,7 +907,7 @@ namespace CalamityMod.NPCs.CalClone // Equipment normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); normalOnly.Add(ModContent.ItemType(), DropHelper.NormalWeaponDropRateFraction); - normalOnly.Add(ModContent.ItemType(), 10); + normalOnly.Add(ModContent.ItemType(), 10); // Materials normalOnly.Add(ModContent.ItemType(), 1, 8, 10); @@ -256,7 +948,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) { @@ -305,7 +997,6 @@ namespace CalamityMod.NPCs.CalClone public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -317,7 +1008,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 240); } } } diff --git a/NPCs/CalClone/Cataclysm.cs b/NPCs/CalClone/Cataclysm.cs index bec5c00aa9..fbbb1a72b2 100644 --- a/NPCs/CalClone/Cataclysm.cs +++ b/NPCs/CalClone/Cataclysm.cs @@ -4,11 +4,12 @@ using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Ranged; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using System; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -47,11 +48,13 @@ namespace CalamityMod.NPCs.CalClone } } + public static int FlamethrowerDamage = 30; // 120 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 45; // 90 NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -59,9 +62,8 @@ namespace CalamityMod.NPCs.CalClone if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; - NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 15 : 10; - NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.225f : 0.15f); - NPC.LifeMaxNERB(11000, 13200, 80000); + NPC.defense = 10; + NPC.LifeMaxNERB(8500, 10000, 80000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -109,7 +111,320 @@ namespace CalamityMod.NPCs.CalClone public override void AI() { - CalamitasCloneAI.VanillaCataclysmAI(NPC, Mod); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) + { + if (NPC.alpha < 255) + { + NPC.velocity *= 0.9f; + + NPC.alpha += 2; + if (NPC.alpha > 255) + NPC.alpha = 255; + + int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - NPC.alpha) / 255f)); + for (int i = 0; i < dustAmount; i++) + { + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); + Main.dust[dust].noGravity = true; + Main.dust[dust].fadeIn = 1f; + } + } + else + NPC.active = false; + + NPC.active = false; + return; + } + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + CalamityGlobalNPC.cataclysm = NPC.whoAmI; + + // Emit light + Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1f, 0f, 0f); + + 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) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + float enrageScale = 0f; + if (Main.IsItDay()) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 2f; + } + + float calCloneBroPlayerXDist = NPC.position.X + (NPC.width / 2) - player.position.X - (player.width / 2); + float calCloneBroPlayerYDist = NPC.position.Y + NPC.height - 59f - player.position.Y - (player.height / 2); + float calCloneBroRotation = (float)Math.Atan2(calCloneBroPlayerYDist, calCloneBroPlayerXDist) + MathHelper.PiOver2; + if (calCloneBroRotation < 0f) + calCloneBroRotation += MathHelper.TwoPi; + else if (calCloneBroRotation > MathHelper.TwoPi) + calCloneBroRotation -= MathHelper.TwoPi; + + float calCloneBroRotationSpeed = 0.15f; + if (NPC.rotation < calCloneBroRotation) + { + if ((calCloneBroRotation - NPC.rotation) > MathHelper.Pi) + NPC.rotation -= calCloneBroRotationSpeed; + else + NPC.rotation += calCloneBroRotationSpeed; + } + else if (NPC.rotation > calCloneBroRotation) + { + if ((NPC.rotation - calCloneBroRotation) > MathHelper.Pi) + NPC.rotation += calCloneBroRotationSpeed; + else + NPC.rotation -= calCloneBroRotationSpeed; + } + + if (NPC.rotation > calCloneBroRotation - calCloneBroRotationSpeed && NPC.rotation < calCloneBroRotation + calCloneBroRotationSpeed) + NPC.rotation = calCloneBroRotation; + if (NPC.rotation < 0f) + NPC.rotation += MathHelper.TwoPi; + else if (NPC.rotation > MathHelper.TwoPi) + NPC.rotation -= MathHelper.TwoPi; + if (NPC.rotation > calCloneBroRotation - calCloneBroRotationSpeed && NPC.rotation < calCloneBroRotation + calCloneBroRotationSpeed) + NPC.rotation = calCloneBroRotation; + + if (!player.active || player.dead) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + if (!player.active || player.dead) + { + if (NPC.velocity.Y > 3f) + NPC.velocity.Y = 3f; + NPC.velocity.Y -= 0.1f; + if (NPC.velocity.Y < -12f) + NPC.velocity.Y = -12f; + + if (NPC.timeLeft > 60) + NPC.timeLeft = 60; + + if (NPC.ai[1] != 0f) + { + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.netUpdate = true; + } + + return; + } + } + + if (NPC.ai[1] == 0f) + { + float calCloneBroProjAttackMaxSpeed = 5f; + float calCloneBroProjAttackAccel = 0.1f; + calCloneBroProjAttackMaxSpeed += 2f * enrageScale; + calCloneBroProjAttackAccel += 0.06f * enrageScale; + + if (CalamityWorld.LegendaryMode) + { + calCloneBroProjAttackMaxSpeed *= 1.15f; + calCloneBroProjAttackAccel *= 1.15f; + } + + int calCloneBroProjAttackDirection = 1; + if (NPC.position.X + (NPC.width / 2) < player.position.X + player.width) + calCloneBroProjAttackDirection = -1; + + Vector2 calCloneBroProjLocation = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); + float calCloneBroProjTargetX = player.position.X + (player.width / 2) + (calCloneBroProjAttackDirection * 180) - calCloneBroProjLocation.X; + float calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; + float calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); + + if (expertMode) + { + if (calCloneBroProjTargetDist > 300f) + calCloneBroProjAttackMaxSpeed += 0.5f; + if (calCloneBroProjTargetDist > 400f) + calCloneBroProjAttackMaxSpeed += 0.5f; + if (calCloneBroProjTargetDist > 500f) + calCloneBroProjAttackMaxSpeed += 0.55f; + if (calCloneBroProjTargetDist > 600f) + calCloneBroProjAttackMaxSpeed += 0.55f; + if (calCloneBroProjTargetDist > 700f) + calCloneBroProjAttackMaxSpeed += 0.6f; + if (calCloneBroProjTargetDist > 800f) + calCloneBroProjAttackMaxSpeed += 0.6f; + } + + calCloneBroProjTargetDist = calCloneBroProjAttackMaxSpeed / calCloneBroProjTargetDist; + calCloneBroProjTargetX *= calCloneBroProjTargetDist; + calCloneBroProjTargetY *= calCloneBroProjTargetDist; + + if (NPC.velocity.X < calCloneBroProjTargetX) + { + NPC.velocity.X += calCloneBroProjAttackAccel; + if (NPC.velocity.X < 0f && calCloneBroProjTargetX > 0f) + NPC.velocity.X += calCloneBroProjAttackAccel; + } + else if (NPC.velocity.X > calCloneBroProjTargetX) + { + NPC.velocity.X -= calCloneBroProjAttackAccel; + if (NPC.velocity.X > 0f && calCloneBroProjTargetX < 0f) + NPC.velocity.X -= calCloneBroProjAttackAccel; + } + if (NPC.velocity.Y < calCloneBroProjTargetY) + { + NPC.velocity.Y += calCloneBroProjAttackAccel; + if (NPC.velocity.Y < 0f && calCloneBroProjTargetY > 0f) + NPC.velocity.Y += calCloneBroProjAttackAccel; + } + else if (NPC.velocity.Y > calCloneBroProjTargetY) + { + NPC.velocity.Y -= calCloneBroProjAttackAccel; + if (NPC.velocity.Y > 0f && calCloneBroProjTargetY < 0f) + NPC.velocity.Y -= calCloneBroProjAttackAccel; + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= (240f - (death ? 120f * (1f - lifeRatio) : 0f))) + { + NPC.ai[1] = 1f; + NPC.ai[2] = 0f; + NPC.target = 255; + NPC.netUpdate = true; + } + + bool fireDelay = NPC.ai[2] > 120f || NPC.life < NPC.lifeMax * 0.9; + if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height) && fireDelay) + { + if (NPC.localAI[2] == 0f) + SoundEngine.PlaySound(Cataclysm.FlamethrowerStart, NPC.Center); + + NPC.localAI[2] += 1f; + if (NPC.localAI[2] > 30f) + { + NPC.localAI[2] = 1f; + SoundEngine.PlaySound(Cataclysm.FlamethrowerLoop, NPC.Center); + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.localAI[1] += 3f; + if (revenge) + NPC.localAI[1] += 1f; + + if (NPC.localAI[1] > 12f) + { + NPC.localAI[1] = 0f; + float calCloneBroProjSpeed = NPC.AnyNPCs(ModContent.NPCType()) ? 4f : 6f; + calCloneBroProjSpeed += enrageScale; + int type = ModContent.ProjectileType(); + calCloneBroProjLocation = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); + calCloneBroProjTargetX = player.position.X + (player.width / 2) - calCloneBroProjLocation.X; + calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; + calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); + calCloneBroProjTargetDist = calCloneBroProjSpeed / calCloneBroProjTargetDist; + calCloneBroProjTargetX *= calCloneBroProjTargetDist; + calCloneBroProjTargetY *= calCloneBroProjTargetDist; + calCloneBroProjTargetY += NPC.velocity.Y * 0.5f; + calCloneBroProjTargetX += NPC.velocity.X * 0.5f; + calCloneBroProjLocation.X -= calCloneBroProjTargetX; + calCloneBroProjLocation.Y -= calCloneBroProjTargetY; + Projectile.NewProjectile(NPC.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, FlamethrowerDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + else + { + if (NPC.ai[1] == 1f) + { + SoundEngine.PlaySound(SoundID.Roar, NPC.Center); + NPC.rotation = calCloneBroRotation; + + float calCloneBroChargeSpeed = 14f + (death ? 4f * (1f - lifeRatio) : 0f); + calCloneBroChargeSpeed += 3f * enrageScale; + if (expertMode) + calCloneBroChargeSpeed += 2f; + if (revenge) + calCloneBroChargeSpeed += 2f; + if (CalamityWorld.LegendaryMode) + calCloneBroChargeSpeed *= 1.25f; + + Vector2 calCloneBroChargeCenter = NPC.Center; + float calCloneBroChargeTargetXDist = player.Center.X - calCloneBroChargeCenter.X; + float calCloneBroChargeTargetYDist = player.Center.Y - calCloneBroChargeCenter.Y; + float calCloneBroChargeTargetDistance = (float)Math.Sqrt(calCloneBroChargeTargetXDist * calCloneBroChargeTargetXDist + calCloneBroChargeTargetYDist * calCloneBroChargeTargetYDist); + calCloneBroChargeTargetDistance = calCloneBroChargeSpeed / calCloneBroChargeTargetDistance; + NPC.velocity.X = calCloneBroChargeTargetXDist * calCloneBroChargeTargetDistance; + NPC.velocity.Y = calCloneBroChargeTargetYDist * calCloneBroChargeTargetDistance; + NPC.ai[1] = 2f; + + if (Main.zenithWorld) + { + SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, NPC.Center); + + int type = ModContent.ProjectileType(); + + int totalProjectiles = death ? 10 : revenge ? 8 : expertMode ? 6 : 4; + float radians = MathHelper.TwoPi / totalProjectiles; + float velocity = 5f; + Vector2 spinningPoint = new Vector2(0f, -velocity); + float projectileVelocityToPass = velocity * 3f; + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, CalamitasClone.DartDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + } + + for (int i = 0; i < 6; i++) + Dust.NewDust(NPC.position + NPC.velocity, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f); + } + return; + } + + if (NPC.ai[1] == 2f) + { + NPC.ai[2] += 1f + (death ? 0.5f * (1f - lifeRatio) : 0f); + if (expertMode) + NPC.ai[2] += 0.25f; + if (revenge) + NPC.ai[2] += 0.25f; + + if (NPC.ai[2] >= 75f) + { + NPC.velocity.X *= 0.93f; + NPC.velocity.Y *= 0.93f; + + if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) + NPC.velocity.X = 0f; + if (NPC.velocity.Y > -0.1 && NPC.velocity.Y < 0.1) + NPC.velocity.Y = 0f; + } + else + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) - MathHelper.PiOver2; + + if (NPC.ai[2] >= 105f) + { + NPC.ai[3] += 1f; + NPC.ai[2] = 0f; + NPC.target = 255; + NPC.rotation = calCloneBroRotation; + if (NPC.ai[3] >= 3f) + { + NPC.ai[1] = 0f; + NPC.ai[3] = 0f; + return; + } + NPC.ai[1] = 1f; + } + } + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -237,7 +552,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/NPCs/CalClone/Catastrophe.cs b/NPCs/CalClone/Catastrophe.cs index dcae21a2da..a11b491bf1 100644 --- a/NPCs/CalClone/Catastrophe.cs +++ b/NPCs/CalClone/Catastrophe.cs @@ -4,12 +4,14 @@ using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Placeables.Furniture.Trophies; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using System; using Terraria; +using Terraria.Audio; using Terraria.GameContent; using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; @@ -41,11 +43,13 @@ namespace CalamityMod.NPCs.CalClone } } + public static int BallDamage = 22; // 88 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 45; // 90 NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -53,9 +57,8 @@ namespace CalamityMod.NPCs.CalClone if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; - NPC.defense = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 15 : 10; - NPC.DR_NERD((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.225f : 0.15f); - NPC.LifeMaxNERB(9200, 11025, 80000); + NPC.defense = 10; + NPC.LifeMaxNERB(8500, 10000, 80000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; @@ -103,7 +106,315 @@ namespace CalamityMod.NPCs.CalClone public override void AI() { - CalamitasCloneAI.VanillaCatastropheAI(NPC, Mod); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + + if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) + { + if (NPC.alpha < 255) + { + NPC.velocity *= 0.9f; + + NPC.alpha += 2; + if (NPC.alpha > 255) + NPC.alpha = 255; + + int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - NPC.alpha) / 255f)); + for (int i = 0; i < dustAmount; i++) + { + int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); + Main.dust[dust].noGravity = true; + Main.dust[dust].fadeIn = 1f; + } + } + else + NPC.active = false; + + return; + } + + // Percent life remaining + float lifeRatio = NPC.life / (float)NPC.lifeMax; + + CalamityGlobalNPC.catastrophe = NPC.whoAmI; + + // Emit light + Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 1f, 0f, 0f); + + 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) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + float enrageScale = 0f; + if (Main.IsItDay()) + { + NPC.Calamity().CurrentlyEnraged = true; + enrageScale += 2f; + } + + float calCloneBroPlayerXDist = NPC.position.X + (NPC.width / 2) - player.position.X - (player.width / 2); + float calCloneBroPlayerYDist = NPC.position.Y + NPC.height - 59f - player.position.Y - (player.height / 2); + float calCloneBroRotation = (float)Math.Atan2(calCloneBroPlayerYDist, calCloneBroPlayerXDist) + MathHelper.PiOver2; + if (calCloneBroRotation < 0f) + calCloneBroRotation += MathHelper.TwoPi; + else if (calCloneBroRotation > MathHelper.TwoPi) + calCloneBroRotation -= MathHelper.TwoPi; + + float calCloneBroRotationSpeed = 0.15f; + if (NPC.rotation < calCloneBroRotation) + { + if ((calCloneBroRotation - NPC.rotation) > MathHelper.Pi) + NPC.rotation -= calCloneBroRotationSpeed; + else + NPC.rotation += calCloneBroRotationSpeed; + } + else if (NPC.rotation > calCloneBroRotation) + { + if ((NPC.rotation - calCloneBroRotation) > MathHelper.Pi) + NPC.rotation += calCloneBroRotationSpeed; + else + NPC.rotation -= calCloneBroRotationSpeed; + } + + if (NPC.rotation > calCloneBroRotation - calCloneBroRotationSpeed && NPC.rotation < calCloneBroRotation + calCloneBroRotationSpeed) + NPC.rotation = calCloneBroRotation; + if (NPC.rotation < 0f) + NPC.rotation += MathHelper.TwoPi; + else if (NPC.rotation > MathHelper.TwoPi) + NPC.rotation -= MathHelper.TwoPi; + if (NPC.rotation > calCloneBroRotation - calCloneBroRotationSpeed && NPC.rotation < calCloneBroRotation + calCloneBroRotationSpeed) + NPC.rotation = calCloneBroRotation; + + if (!player.active || player.dead) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + if (!player.active || player.dead) + { + if (NPC.velocity.Y > 3f) + NPC.velocity.Y = 3f; + NPC.velocity.Y -= 0.1f; + if (NPC.velocity.Y < -12f) + NPC.velocity.Y = -12f; + + if (NPC.timeLeft > 60) + NPC.timeLeft = 60; + + if (NPC.ai[1] != 0f) + { + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.netUpdate = true; + } + + return; + } + } + + if (NPC.ai[1] == 0f) + { + float calCloneBroProjAttackMaxSpeed = 4.5f; + float calCloneBroProjAttackAccel = 0.2f; + calCloneBroProjAttackMaxSpeed += 2f * enrageScale; + calCloneBroProjAttackAccel += 0.1f * enrageScale; + + if (CalamityWorld.LegendaryMode) + { + calCloneBroProjAttackMaxSpeed *= 1.15f; + calCloneBroProjAttackAccel *= 1.15f; + } + + int calCloneBroProjAttackDirection = 1; + if (NPC.Center.X < player.Center.X) + calCloneBroProjAttackDirection = -1; + + Vector2 calCloneBroProjLocation = NPC.Center; + float calCloneBroProjTargetX = player.Center.X + (calCloneBroProjAttackDirection * 180) - calCloneBroProjLocation.X; + float calCloneBroProjTargetY = player.Center.Y - calCloneBroProjLocation.Y; + float calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); + + if (expertMode) + { + if (calCloneBroProjTargetDist > 300f) + calCloneBroProjAttackMaxSpeed += 0.5f; + if (calCloneBroProjTargetDist > 400f) + calCloneBroProjAttackMaxSpeed += 0.5f; + if (calCloneBroProjTargetDist > 500f) + calCloneBroProjAttackMaxSpeed += 0.55f; + if (calCloneBroProjTargetDist > 600f) + calCloneBroProjAttackMaxSpeed += 0.55f; + if (calCloneBroProjTargetDist > 700f) + calCloneBroProjAttackMaxSpeed += 0.6f; + if (calCloneBroProjTargetDist > 800f) + calCloneBroProjAttackMaxSpeed += 0.6f; + } + + calCloneBroProjTargetDist = calCloneBroProjAttackMaxSpeed / calCloneBroProjTargetDist; + calCloneBroProjTargetX *= calCloneBroProjTargetDist; + calCloneBroProjTargetY *= calCloneBroProjTargetDist; + + if (NPC.velocity.X < calCloneBroProjTargetX) + { + NPC.velocity.X += calCloneBroProjAttackAccel; + if (NPC.velocity.X < 0f && calCloneBroProjTargetX > 0f) + NPC.velocity.X += calCloneBroProjAttackAccel; + } + else if (NPC.velocity.X > calCloneBroProjTargetX) + { + NPC.velocity.X -= calCloneBroProjAttackAccel; + if (NPC.velocity.X > 0f && calCloneBroProjTargetX < 0f) + NPC.velocity.X -= calCloneBroProjAttackAccel; + } + if (NPC.velocity.Y < calCloneBroProjTargetY) + { + NPC.velocity.Y += calCloneBroProjAttackAccel; + if (NPC.velocity.Y < 0f && calCloneBroProjTargetY > 0f) + NPC.velocity.Y += calCloneBroProjAttackAccel; + } + else if (NPC.velocity.Y > calCloneBroProjTargetY) + { + NPC.velocity.Y -= calCloneBroProjAttackAccel; + if (NPC.velocity.Y > 0f && calCloneBroProjTargetY < 0f) + NPC.velocity.Y -= calCloneBroProjAttackAccel; + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= (180f - (death ? 90f * (1f - lifeRatio) : 0f))) + { + NPC.ai[1] = 1f; + NPC.ai[2] = 0f; + NPC.target = 255; + NPC.netUpdate = true; + } + + bool fireDelay = NPC.ai[2] > 120f || lifeRatio < 0.9f; + if (Collision.CanHit(NPC.position, NPC.width, NPC.height, player.position, player.width, player.height) && fireDelay) + { + NPC.localAI[2] += 1f; + if (NPC.localAI[2] > 36f) + { + NPC.localAI[2] = 0f; + SoundEngine.PlaySound(SoundID.Item34, NPC.Center); + } + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.localAI[1] += 1f; + if (revenge) + NPC.localAI[1] += 0.5f; + + if (NPC.localAI[1] > 50f) + { + NPC.localAI[1] = 0f; + float calCloneBroProjSpeed = death ? 14f : 12f; + calCloneBroProjSpeed += 3f * enrageScale; + int type = ModContent.ProjectileType(); + calCloneBroProjLocation = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); + calCloneBroProjTargetX = player.position.X + (player.width / 2) - calCloneBroProjLocation.X; + calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; + calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); + calCloneBroProjTargetDist = calCloneBroProjSpeed / calCloneBroProjTargetDist; + calCloneBroProjTargetX *= calCloneBroProjTargetDist; + calCloneBroProjTargetY *= calCloneBroProjTargetDist; + calCloneBroProjTargetY += NPC.velocity.Y * 0.5f; + calCloneBroProjTargetX += NPC.velocity.X * 0.5f; + calCloneBroProjLocation.X -= calCloneBroProjTargetX; + calCloneBroProjLocation.Y -= calCloneBroProjTargetY; + Projectile.NewProjectile(NPC.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, BallDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + } + else + { + if (NPC.ai[1] == 1f) + { + SoundEngine.PlaySound(SoundID.Roar, NPC.Center); + NPC.rotation = calCloneBroRotation; + + float calCloneBroChargeSpeed = (NPC.AnyNPCs(ModContent.NPCType()) ? 12f : 16f) + (death ? 4f * (1f - lifeRatio) : 0f); + calCloneBroChargeSpeed += 4f * enrageScale; + if (expertMode) + calCloneBroChargeSpeed += 2f; + if (revenge) + calCloneBroChargeSpeed += 2f; + if (CalamityWorld.LegendaryMode) + calCloneBroChargeSpeed *= 1.25f; + + Vector2 calCloneBroChargeCenter = new Vector2(NPC.position.X + NPC.width * 0.5f, NPC.position.Y + NPC.height * 0.5f); + float calCloneBroChargeTargetXDist = player.position.X + (player.width / 2) - calCloneBroChargeCenter.X; + float calCloneBroChargeTargetYDist = player.position.Y + (player.height / 2) - calCloneBroChargeCenter.Y; + float calCloneBroChargeTargetDistance = (float)Math.Sqrt(calCloneBroChargeTargetXDist * calCloneBroChargeTargetXDist + calCloneBroChargeTargetYDist * calCloneBroChargeTargetYDist); + calCloneBroChargeTargetDistance = calCloneBroChargeSpeed / calCloneBroChargeTargetDistance; + NPC.velocity.X = calCloneBroChargeTargetXDist * calCloneBroChargeTargetDistance; + NPC.velocity.Y = calCloneBroChargeTargetYDist * calCloneBroChargeTargetDistance; + NPC.ai[1] = 2f; + + if (Main.zenithWorld) + { + SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, NPC.Center); + + int type = ModContent.ProjectileType(); + + int totalProjectiles = death ? 10 : revenge ? 8 : expertMode ? 6 : 4; + float radians = MathHelper.TwoPi / totalProjectiles; + float velocity = 5f; + Vector2 spinningPoint = new Vector2(0f, -velocity); + float projectileVelocityToPass = velocity * 3f; + for (int k = 0; k < totalProjectiles; k++) + { + Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, CalamitasClone.DartDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + } + + for (int i = 0; i < 6; i++) + Dust.NewDust(NPC.position + NPC.velocity, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f); + } + return; + } + + if (NPC.ai[1] == 2f) + { + NPC.ai[2] += 1f + (death ? 0.5f * (1f - lifeRatio) : 0f); + if (expertMode) + NPC.ai[2] += 0.25f; + if (revenge) + NPC.ai[2] += 0.25f; + + if (NPC.ai[2] >= 60f) //50 + { + NPC.velocity.X *= 0.93f; + NPC.velocity.Y *= 0.93f; + + if (NPC.velocity.X > -0.1 && NPC.velocity.X < 0.1) + NPC.velocity.X = 0f; + if (NPC.velocity.Y > -0.1 && NPC.velocity.Y < 0.1) + NPC.velocity.Y = 0f; + } + else + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) - MathHelper.PiOver2; + + if (NPC.ai[2] >= 90f) //80 + { + NPC.ai[3] += 1f; + NPC.ai[2] = 0f; + NPC.rotation = calCloneBroRotation; + if (NPC.ai[3] >= 4f) + { + NPC.ai[1] = 0f; + NPC.ai[3] = 0f; + return; + } + NPC.ai[1] = 1f; + } + } + } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -231,7 +542,7 @@ namespace CalamityMod.NPCs.CalClone public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/NPCs/CalClone/SoulSeeker.cs b/NPCs/CalClone/SoulSeeker.cs index d6a78285ce..8c72841b5b 100644 --- a/NPCs/CalClone/SoulSeeker.cs +++ b/NPCs/CalClone/SoulSeeker.cs @@ -40,9 +40,8 @@ namespace CalamityMod.NPCs.CalClone NPC.height = 40; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.defense = 10; - NPC.DR_NERD(0.1f); NPC.lifeMax = CalamityWorld.death ? 1500 : 2500; if (BossRushEvent.BossRushActive) { @@ -53,10 +52,6 @@ namespace CalamityMod.NPCs.CalClone NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -119,8 +114,7 @@ namespace CalamityMod.NPCs.CalClone Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 1f, parent.target, 1f, 0f, projectileSpeed * 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, CalamitasClone.DartDamage, 1f, parent.target, 1f, 0f, projectileSpeed * 2f); } timer = 0; } diff --git a/NPCs/CalamityAIs/CalamityBossAIs/AquaticScourgeAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/AquaticScourgeAI.cs deleted file mode 100644 index a8f6e79f8c..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/AquaticScourgeAI.cs +++ /dev/null @@ -1,628 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.SulphurousSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class AquaticScourgeAI - { - public static void VanillaAquaticScourgeAI(NPC npc, Mod mod, bool head) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - bool getFuckedAI = Main.zenithWorld; - - if (head) - CalamityGlobalNPC.aquaticScourge = npc.whoAmI; - - // Adjust hostility and stats - bool nonHostile = calamityGlobalNPC.newAI[0] == 0f; - if (npc.justHit || npc.life <= npc.lifeMax * 0.999 || bossRush || Main.getGoodWorld) - { - if (nonHostile) - { - // Kiss my motherfucking ass you piece of shit game - npc.timeLeft *= 20; - npc.npcSlots = 16f; - CalamityGlobalNPC.BossKillTimes.TryGetValue(npc.type, out int revKillTime); - calamityGlobalNPC.KillTime = revKillTime; - calamityGlobalNPC.newAI[0] = 1f; - nonHostile = false; - npc.boss = head; - npc.chaseable = true; - npc.netUpdate = true; - } - } - else - npc.damage = 0; - - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; - - // Phases - bool phase2 = lifeRatio < 0.75f; - bool phase3 = lifeRatio < 0.5f; - bool phase4 = lifeRatio < 0.25f; - - // Set worm variable - if (npc.ai[2] > 0f) - npc.realLife = (int)npc.ai[2]; - - if (!head) - { - if (npc.life > Main.npc[(int)npc.ai[1]].life) - npc.life = Main.npc[(int)npc.ai[1]].life; - } - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - bool notOcean = player.position.Y < 300f || - player.position.Y > Main.worldSurface * 16.0 || - (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); - - // Check for the flipped Abyss - if (Main.remixWorld) - { - notOcean = player.position.Y < Main.UnderworldLayer * 0.8f || player.position.Y > Main.UnderworldLayer || - (player.position.X > 7680f && player.position.X < (Main.maxTilesX * 16 - 7680)); - } - - // Enrage - if (head) - { - if (notOcean && !player.Calamity().ZoneSulphur && !bossRush) - { - if (npc.localAI[2] > 0f) - npc.localAI[2] -= 1f; - } - else - npc.localAI[2] = CalamityGlobalNPC.biomeEnrageTimerMax; - } - - bool biomeEnraged = npc.localAI[2] <= 0f || bossRush; - - float enrageScale = bossRush ? 1f : 0f; - if (biomeEnraged) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - - // Circular movement - float colorFadeTimeAfterSpiral = 90f; - float spiralGateValue = 480f; - bool doSpiral = false; - if (head && calamityGlobalNPC.newAI[0] == 1f && calamityGlobalNPC.newAI[2] == 1f && (revenge || getFuckedAI)) - { - doSpiral = calamityGlobalNPC.newAI[1] == 0f && calamityGlobalNPC.newAI[3] >= spiralGateValue; - if (Vector2.Distance(npc.Center, player.Center) < (getFuckedAI ? 1600f : 1000f) || doSpiral) - calamityGlobalNPC.newAI[3] += 1f; - - if (doSpiral) - { - npc.localAI[3] = colorFadeTimeAfterSpiral; - - // Vomit acid mist - float acidMistBarfDivisor = getFuckedAI ? 2f : ((float)Math.Floor(bossRush ? 4f : death ? 5f : 6f) * (phase3 ? 1.5f : 1f)); - if (calamityGlobalNPC.newAI[3] % acidMistBarfDivisor == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float mistVelocity = death ? 10f : 8f; - Vector2 projectileVelocity = (npc.Center + npc.velocity * 10f - npc.Center).SafeNormalize(Vector2.UnitY); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity * 5f, projectileVelocity * mistVelocity, type, damage, 0f, Main.myPlayer); - Main.projectile[proj].tileCollide = false; - Main.projectile[proj].timeLeft = getFuckedAI ? 240 : 600; - } - } - - // Vomit circular spreads of acid clouds while in phase 3 - float toxicCloudBarfDivisor = bossRush ? 20f : death ? 30f : 40f; - if (calamityGlobalNPC.newAI[3] % toxicCloudBarfDivisor == 0f && phase3) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int totalProjectiles = (phase4 ? 6 : 9) + (getFuckedAI ? Main.rand.Next(-2, 3) : (int)((calamityGlobalNPC.newAI[3] - spiralGateValue) / toxicCloudBarfDivisor) * (phase4 ? 2 : 3)); - float radians = MathHelper.TwoPi / totalProjectiles; - float cloudVelocity = 1f + enrageScale; - Vector2 spinningPoint = new Vector2(0f, -cloudVelocity); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer); - } - } - } - - // Velocity boost - if (calamityGlobalNPC.newAI[3] == spiralGateValue) - { - npc.velocity = npc.velocity.SafeNormalize(Vector2.UnitY); - npc.velocity *= 24f; - } - - // Spin velocity - float velocity = (float)(Math.PI * 2D) / 120f; - // In GFB, contracts the radius as the fight progresses - if (getFuckedAI) - velocity *= phase3 ? 1.5f : phase2 ? 1.25f : 1f; - npc.velocity = npc.velocity.RotatedBy(-(double)velocity * npc.localAI[1]); - // Speed up even more in GFB for more radius - if (getFuckedAI && npc.velocity.Length() <= 32f) - npc.velocity *= 1.1f; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; - - // Reset and charge at target - // Don't reset in GFB - if (!getFuckedAI && calamityGlobalNPC.newAI[3] >= spiralGateValue + 120f) - { - calamityGlobalNPC.newAI[3] = 0f; - npc.TargetClosest(); - } - } - else - { - if (!Collision.CanHit(npc.Center, 1, 1, player.position, player.width, player.height) && calamityGlobalNPC.newAI[3] > 300f) - calamityGlobalNPC.newAI[3] -= 2f; - - if (npc.localAI[3] > 0f) - npc.localAI[3] -= 1f; - - npc.localAI[1] = npc.Center.X - player.Center.X < 0 ? 1f : -1f; - } - } - - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = doSpiral || getFuckedAI; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - - if (head) - { - // Spawn segments - if (calamityGlobalNPC.newAI[2] == 0f && npc.ai[0] == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int maxLength = getFuckedAI ? 24 : death ? 80 : revenge ? 40 : expertMode ? 35 : 30; - int Previous = npc.whoAmI; - for (int segments = 0; segments < maxLength; segments++) - { - int lol; - if (segments >= 0 && segments < maxLength - 1) - { - if (segments % 2 == 0) - lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI); - else - lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI); - } - else - lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI); - - Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].ai[2] = npc.whoAmI; - Main.npc[lol].ai[1] = Previous; - Main.npc[Previous].ai[0] = lol; - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol); - Previous = lol; - } - } - - calamityGlobalNPC.newAI[2] = 1f; - } - - // Big barf attack - if (calamityGlobalNPC.newAI[0] == 1f && (!doSpiral && phase2) || (getFuckedAI && !phase3)) - { - npc.localAI[0] += 1f; - if (npc.localAI[0] >= (revenge ? 360f : 420f)) - { - if (Vector2.Distance(player.Center, npc.Center) > 320f) - { - npc.localAI[0] = 0f; - npc.netUpdate = true; - SoundEngine.PlaySound(SoundID.NPCDeath13, npc.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int totalProjectiles = bossRush ? 10 : expertMode ? 8 : 6; - if (phase3) - totalProjectiles *= 2; - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 velocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - velocity = velocity.SafeNormalize(Vector2.UnitY); - velocity *= Main.rand.Next(phase3 ? 300 : 100, 401) * 0.01f; - - float maximumVelocityMult = death ? 0.75f : 0.5f; - if (expertMode) - velocity *= 1f + (maximumVelocityMult * (0.5f - lifeRatio)); - - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + velocity.SafeNormalize(Vector2.UnitY) * 5f, velocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - } - } - - // Fire teeth depending on body type - else - { - if (calamityGlobalNPC.newAI[0] == 1f && (!phase3 || phase4)) - { - npc.localAI[0] += 1f; - float shootProjectile = 300; - float timer = npc.ai[0] + 15f; - float divisor = timer + shootProjectile; - - if (npc.type == ModContent.NPCType()) - { - if (npc.localAI[0] % divisor == 0f && (npc.ai[0] % 3f == 0f || getFuckedAI || !death)) - { - npc.TargetClosest(); - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - SoundEngine.PlaySound(SoundID.Item17, npc.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float toothVelocity = death ? 9f : 8f; - Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float accelerate = phase4 ? 1f : 0f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity * 5f, projectileVelocity * toothVelocity, type, damage, 0f, Main.myPlayer, accelerate, 0f); - } - - npc.netUpdate = true; - } - } - } - } - } - - // Kill body and tail - if (!head) - { - bool shouldDespawn = true; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == ModContent.NPCType()) - { - shouldDespawn = false; - break; - } - } - if (!shouldDespawn) - { - if (npc.ai[1] <= 0f) - shouldDespawn = true; - else if (Main.npc[(int)npc.ai[1]].life <= 0) - shouldDespawn = true; - } - if (shouldDespawn) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.checkDead(); - npc.active = false; - } - } - else - { - if (npc.life > Main.npc[(int)npc.ai[0]].life) - npc.life = Main.npc[(int)npc.ai[0]].life; - } - - float maxDistance = calamityGlobalNPC.newAI[0] == 1f ? 12800f : 6400f; - if (player.dead || Vector2.Distance(npc.Center, player.Center) > maxDistance || (nonHostile && biomeEnraged)) - { - calamityGlobalNPC.newAI[1] = 1f; - npc.TargetClosest(false); - npc.velocity.Y += 2f; - - if (npc.position.Y > Main.worldSurface * 16D) - npc.velocity.Y += 2f; - - if (npc.position.Y > Main.worldSurface * 16D) - { - for (int a = 0; a < Main.npc.Length; a++) - { - int type = Main.npc[a].type; - if (type == ModContent.NPCType() || type == ModContent.NPCType() || type == ModContent.NPCType() || type == ModContent.NPCType()) - Main.npc[a].active = false; - } - } - } - else - calamityGlobalNPC.newAI[1] = 0f; - - // Change direction - if (npc.velocity.X < 0f) - npc.spriteDirection = -1; - else if (npc.velocity.X > 0f) - npc.spriteDirection = 1; - - // Alpha changes - if (head || Main.npc[(int)npc.ai[1]].alpha < 128) - { - npc.alpha -= 42; - if (npc.alpha < 0) - npc.alpha = 0; - } - - Vector2 scourgePosition = npc.Center; - Vector2 predictionVector = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.player[npc.target].velocity * 20f : Vector2.Zero; - float scourgeTargetX = player.Center.X + predictionVector.X; - float scourgeTargetY = player.Center.Y + predictionVector.Y; - - // Velocity and movement - float scourgeMaxSpeed = 5f; - float scourgeAcceleration = 0.08f; - if (calamityGlobalNPC.newAI[0] == 1f) - { - scourgeMaxSpeed = revenge ? 14.4f : 12f; - scourgeAcceleration = revenge ? 0.18f : 0.15f; - if (expertMode) - { - scourgeMaxSpeed += 2.4f * (1f - lifeRatio); - scourgeAcceleration += 0.03f * (1f - lifeRatio); - } - scourgeMaxSpeed += 3f * enrageScale; - scourgeAcceleration += 0.06f * enrageScale; - if (death || getFuckedAI) - { - scourgeMaxSpeed += 5f; - scourgeAcceleration -= getFuckedAI ? 0f : 0.03f; - scourgeMaxSpeed += Vector2.Distance(player.Center, npc.Center) * 0.001f; - scourgeAcceleration += Vector2.Distance(player.Center, npc.Center) * 0.000045f; - } - - // Increase acceleration after spiral attack - if (npc.localAI[3] > 0f) - { - float accelerationMultiplier = MathHelper.Lerp(1f, 2f, npc.localAI[3] / colorFadeTimeAfterSpiral); - scourgeAcceleration *= accelerationMultiplier; - } - - if (Main.getGoodWorld) - { - scourgeMaxSpeed *= 1.15f; - scourgeAcceleration *= 1.15f; - } - } - - if (head && !doSpiral) - { - if (calamityGlobalNPC.newAI[0] != 1f) - { - scourgeTargetY += 400; - if (Math.Abs(npc.Center.X - player.Center.X) < 500f) - { - if (npc.velocity.X > 0f) - scourgeTargetX = player.Center.X + 600f; - else - scourgeTargetX = player.Center.X - 600f; - } - } - - float scourgeHigherSpeed = scourgeMaxSpeed * 1.3f; - float scourgeLowerSpeed = scourgeMaxSpeed * 0.7f; - float scourgeSpeed = npc.velocity.Length(); - if (scourgeSpeed > 0f) - { - if (scourgeSpeed > scourgeHigherSpeed) - { - npc.velocity = npc.velocity.SafeNormalize(Vector2.UnitY); - npc.velocity *= scourgeHigherSpeed; - } - else if (scourgeSpeed < scourgeLowerSpeed) - { - npc.velocity = npc.velocity.SafeNormalize(Vector2.UnitY); - npc.velocity *= scourgeLowerSpeed; - } - } - } - - scourgeTargetX = (int)(scourgeTargetX / 16f) * 16; - scourgeTargetY = (int)(scourgeTargetY / 16f) * 16; - scourgePosition.X = (int)(scourgePosition.X / 16f) * 16; - scourgePosition.Y = (int)(scourgePosition.Y / 16f) * 16; - scourgeTargetX -= scourgePosition.X; - scourgeTargetY -= scourgePosition.Y; - float scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY); - - if (!head) - { - if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) - { - try - { - scourgePosition = npc.Center; - scourgeTargetX = Main.npc[(int)npc.ai[1]].Center.X - scourgePosition.X; - scourgeTargetY = Main.npc[(int)npc.ai[1]].Center.Y - scourgePosition.Y; - } - catch - { - } - - npc.rotation = (float)Math.Atan2(scourgeTargetY, scourgeTargetX) + MathHelper.PiOver2; - scourgeTargetDist = (float)Math.Sqrt(scourgeTargetX * scourgeTargetX + scourgeTargetY * scourgeTargetY); - int scourgeWidth = npc.width; - scourgeTargetDist = (scourgeTargetDist - scourgeWidth) / scourgeTargetDist; - scourgeTargetX *= scourgeTargetDist; - scourgeTargetY *= scourgeTargetDist; - npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + scourgeTargetX; - npc.position.Y = npc.position.Y + scourgeTargetY; - - if (scourgeTargetX < 0f) - npc.spriteDirection = -1; - else if (scourgeTargetX > 0f) - npc.spriteDirection = 1; - } - } - else if (!doSpiral) - { - float scourgeAbsoluteTargetX = Math.Abs(scourgeTargetX); - float scourgeAbsoluteTargetY = Math.Abs(scourgeTargetY); - float scourgeTimeToReachTarget = scourgeMaxSpeed / scourgeTargetDist; - scourgeTargetX *= scourgeTimeToReachTarget; - scourgeTargetY *= scourgeTimeToReachTarget; - - if ((npc.velocity.X > 0f && scourgeTargetX > 0f) || (npc.velocity.X < 0f && scourgeTargetX < 0f) || (npc.velocity.Y > 0f && scourgeTargetY > 0f) || (npc.velocity.Y < 0f && scourgeTargetY < 0f)) - { - if (npc.velocity.X < scourgeTargetX) - { - npc.velocity.X += scourgeAcceleration; - } - else - { - if (npc.velocity.X > scourgeTargetX) - npc.velocity.X -= scourgeAcceleration; - } - - if (npc.velocity.Y < scourgeTargetY) - { - npc.velocity.Y += scourgeAcceleration; - } - else - { - if (npc.velocity.Y > scourgeTargetY) - npc.velocity.Y -= scourgeAcceleration; - } - - if (Math.Abs(scourgeTargetY) < scourgeMaxSpeed * 0.2 && ((npc.velocity.X > 0f && scourgeTargetX < 0f) || (npc.velocity.X < 0f && scourgeTargetX > 0f))) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += scourgeAcceleration * 2f; - else - npc.velocity.Y -= scourgeAcceleration * 2f; - } - - if (Math.Abs(scourgeTargetX) < scourgeMaxSpeed * 0.2 && ((npc.velocity.Y > 0f && scourgeTargetY < 0f) || (npc.velocity.Y < 0f && scourgeTargetY > 0f))) - { - if (npc.velocity.X > 0f) - npc.velocity.X += scourgeAcceleration * 2f; - else - npc.velocity.X -= scourgeAcceleration * 2f; - } - } - else - { - if (scourgeAbsoluteTargetX > scourgeAbsoluteTargetY) - { - if (npc.velocity.X < scourgeTargetX) - npc.velocity.X += scourgeAcceleration * 1.1f; - else if (npc.velocity.X > scourgeTargetX) - npc.velocity.X -= scourgeAcceleration * 1.1f; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < scourgeMaxSpeed * 0.5) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += scourgeAcceleration; - else - npc.velocity.Y -= scourgeAcceleration; - } - } - else - { - if (npc.velocity.Y < scourgeTargetY) - npc.velocity.Y += scourgeAcceleration * 1.1f; - else if (npc.velocity.Y > scourgeTargetY) - npc.velocity.Y -= scourgeAcceleration * 1.1f; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < scourgeMaxSpeed * 0.5) - { - if (npc.velocity.X > 0f) - npc.velocity.X += scourgeAcceleration; - else - npc.velocity.X -= scourgeAcceleration; - } - } - } - - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; - } - - // Calculate contact damage based on velocity - if (!nonHostile) - { - float minimalContactDamageVelocity = scourgeMaxSpeed * 0.25f; - float minimalDamageVelocity = scourgeMaxSpeed * 0.5f; - if (head) - { - if (npc.velocity.Length() <= minimalContactDamageVelocity) - { - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((npc.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp((float)Math.Round(npc.defDamage * 0.5), npc.defDamage, velocityDamageScalar); - } - } - else - { - float bodyAndTailVelocity = (npc.position - npc.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - npc.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp(0f, npc.defDamage, velocityDamageScalar); - } - } - } - } - } -} diff --git a/NPCs/CalamityAIs/CalamityBossAIs/AstrumAureusAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/AstrumAureusAI.cs deleted file mode 100644 index e7e3f546bb..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/AstrumAureusAI.cs +++ /dev/null @@ -1,969 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.SulphurousSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class AstrumAureusAI - { - public static void VanillaAstrumAureusAI(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - CalamityGlobalNPC.astrumAureus = npc.whoAmI; - - // Variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; - - // Phases - bool phase2 = lifeRatio < (revenge ? 0.85f : expertMode ? 0.8f : 0.75f); - bool phase3 = lifeRatio < (revenge ? 0.7f : expertMode ? 0.6f : 0.5f); - bool phase4 = lifeRatio < (revenge ? 0.5f : 0.4f) && expertMode; - bool phase5 = lifeRatio < 0.3f && revenge; - - // 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) - npc.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - // Don't fire projectiles and don't increment phase timers for 4 seconds after the teleport phase to avoid cheap bullshit - float noProjectileOrPhaseIncrementTime = 240f; - - bool dontAttack = npc.localAI[3] > 0f; - if (dontAttack) - { - npc.localAI[3] -= 1f; - if (npc.Distance(player.Center) < 240f) - npc.localAI[3] -= death ? 4f : expertMode ? 2f : 1f; - } - - float enrageScale = bossRush ? 1f : 0f; - if ((Main.IsItDay() && !player.Calamity().ZoneAstral) || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - - float astralFlameBarrageTimerIncrement = 1f; - if (expertMode) - astralFlameBarrageTimerIncrement += death ? (float)Math.Round(3f * (1f - lifeRatio)) : (float)Math.Round(2f * (1f - lifeRatio)); - - float walkingVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 6f : 5f; - walkingVelocity += 3f * enrageScale; - if (phase5) - walkingVelocity += 2f; - if (expertMode) - walkingVelocity += 1.5f * (1f - lifeRatio); - if (revenge) - walkingVelocity += Math.Abs(npc.Center.X - player.Center.X) * 0.0025f; - if (Main.getGoodWorld) - walkingVelocity *= 1.15f; - - float walkingProjectileVelocity = walkingVelocity * 0.8f; - - // Direction - npc.spriteDirection = (npc.direction > 0) ? 1 : -1; - - // Used to reduce Aureus' fall speed - bool reduceFallSpeed = npc.velocity.Y > 0f && Collision.SolidCollision(npc.position + Vector2.UnitY * 1.1f * npc.velocity.Y, npc.width, npc.height) && npc.ai[0] == 4f; - - // Despawn - bool despawnDistance = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; - if (!player.active || player.dead || despawnDistance) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead || despawnDistance) - { - npc.noTileCollide = true; - - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; - npc.velocity.Y += 0.1f; - if (npc.velocity.Y > 12f) - npc.velocity.Y = 12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - if (npc.ai[0] != 0f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.localAI[2] = 0f; - npc.localAI[3] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - npc.netUpdate = true; - } - return; - } - } - else if (npc.timeLeft < 1800) - npc.timeLeft = 1800; - - bool geldonPhase1 = lifeRatio > 0.6f && lifeRatio <= 0.7f; - bool geldonPhase2 = lifeRatio <= 0.1f; - if (Main.zenithWorld && (geldonPhase1 || geldonPhase2)) - { - AstrumAureus.AstrumAureus astrumAureus = npc.ModNPC(); - astrumAureus.slimeProjCounter++; - if (astrumAureus.slimeProjCounter % 180 == 0) - { - SoundEngine.PlaySound(SoundID.Item33, npc.Center); // Intentionally keeping the old laser sound in GFB - - if (astrumAureus.slimePhase == 1) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6; - float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = 10f; - Vector2 spinningPoint = new Vector2(0f, -velocity); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 1f); - } - } - astrumAureus.slimePhase = 0; - } - else - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float aureusLaserSpeed = 7f; - float aureusLaserTargetX = player.Center.X - npc.Center.X; - float aureusLaserTargetY = player.Center.Y - npc.Center.Y; - float aureusLaserTargetDist = (float)Math.Sqrt(aureusLaserTargetX * aureusLaserTargetX + aureusLaserTargetY * aureusLaserTargetY); - aureusLaserTargetDist = aureusLaserSpeed / aureusLaserTargetDist; - aureusLaserTargetX *= aureusLaserTargetDist; - aureusLaserTargetY *= aureusLaserTargetDist; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, aureusLaserTargetX, aureusLaserTargetY, type, damage, 0f, Main.myPlayer); - for (int i = 0; i < 4; i++) - { - Vector2 offset = new Vector2(Main.rand.Next(-6, 7), Main.rand.Next(-6, 7)); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, aureusLaserTargetX + offset.X, aureusLaserTargetY + offset.Y, type, damage, 0f, Main.myPlayer); - } - } - astrumAureus.slimePhase = 1; - } - } - RevengeanceAndDeathAI.BuffedMimicAI(npc, mod); - npc.noGravity = false; - npc.noTileCollide = false; - return; - } - else - { - npc.noGravity = true; - } - - // Emit light when not Idle - if (npc.ai[0] != 1f) - Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1.3f, 0.5f, 0f); - - // Fire projectiles while walking, teleporting, or falling - if (npc.ai[0] == 2f || npc.ai[0] >= 5f) - { - if (!dontAttack) - npc.localAI[0] += npc.ai[0] == 2f ? 1f : astralFlameBarrageTimerIncrement; - - float astralFlameBarrageGateValue = phase4 ? 30f : 60f; - if (npc.localAI[0] >= astralFlameBarrageGateValue) - { - // Fire astral flames while teleporting - if (npc.ai[0] >= 5f && npc.ai[0] != 7) - { - npc.localAI[0] = 0f; - SoundEngine.PlaySound(AstrumAureus.AstrumAureus.FlameCrystalSound, npc.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float velocity = death ? (8f + npc.localAI[2] * 0.025f) : 7f; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float spreadLimit = (phase4 ? 100f : 50f) + enrageScale * 50f; - float randomSpread = (Main.rand.NextFloat() - 0.5f) * spreadLimit; - Vector2 spawnVector = new Vector2(npc.Center.X, npc.Center.Y - 80f * npc.scale); - Vector2 destination = new Vector2(spawnVector.X + randomSpread, spawnVector.Y - 100f * npc.scale); - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, Vector2.Normalize(destination - spawnVector) * velocity, type, damage, 0f, Main.myPlayer); - } - } - } - - float laserBarrageGateValue = phase5 ? 160f : phase3 ? 120f : phase2 ? 80f : 60f; - if (npc.localAI[0] >= laserBarrageGateValue) - { - // Fire astral lasers while walking - if (npc.ai[0] == 2f) - { - npc.localAI[0] = 0f; - - SoundEngine.PlaySound(AstrumAureus.AstrumAureus.LaserSound, npc.Center); - - if (calamityGlobalNPC.newAI[2] == 0f) - { - calamityGlobalNPC.newAI[2] = 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int maxProjectiles = !phase2 ? (bossRush ? 5 : 3) : (bossRush ? 7 : 5); - int spread = !phase2 ? (bossRush ? 11 : 8) : (bossRush ? 12 : 10); - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 projectileVelocity = Vector2.Normalize(player.Center - npc.Center) * walkingProjectileVelocity; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < maxProjectiles; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); - } - - if (phase3) - { - float flameVelocity = walkingProjectileVelocity; - maxProjectiles = 2; - spread = 45; - - type = ModContent.ProjectileType(); - damage = npc.GetProjectileDamage(type); - projectileVelocity = Vector2.Normalize(player.Center - npc.Center) * flameVelocity; - rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < maxProjectiles; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer); - } - } - } - } - else - { - calamityGlobalNPC.newAI[2] = 0f; - - 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 type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int centralLaser = maxProjectiles / 2; - int[] lasersToNotFire = new int[6] { centralLaser - 3, centralLaser - 2, centralLaser - 1, centralLaser + 1, centralLaser + 2, centralLaser + 3 }; - Vector2 projectileVelocity = Vector2.Normalize(player.Center - npc.Center) * walkingProjectileVelocity; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < maxProjectiles; i++) - { - if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3] && i != lasersToNotFire[4] && i != lasersToNotFire[5]) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, walkingProjectileVelocity * 2f); - } - } - } - } - } - } - } - else - npc.localAI[0] = 0f; - - // Start up - if (npc.ai[0] == 0f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.ai[0] = 1f; - npc.netUpdate = true; - CustomGravity(); - } - - // Idle - else if (npc.ai[0] == 1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Slow down - npc.velocity.X *= 0.8f; - - // Stay vulnerable for 3 seconds - npc.ai[1] += 1f; - if (npc.Distance(player.Center) < 240f) - npc.ai[1] += death ? 4f : expertMode ? 2f : 1f; - - if (npc.ai[1] >= 180f || bossRush) - { - // Set AI to random state and reset other AI arrays - npc.TargetClosest(); - switch (Main.rand.Next(phase3 ? 3 : 2)) - { - case 0: - npc.ai[0] = 2f; - break; - - case 1: - npc.ai[0] = 3f; - break; - - case 2: - npc.ai[0] = 5f; - break; - - default: - break; - } - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - // Stop colliding with tiles if entering walking phase - npc.noTileCollide = npc.ai[0] == 2f; - - npc.netUpdate = true; - } - else - CustomGravity(); - } - - // Walk - else if (npc.ai[0] == 2f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Set walking direction - if (Math.Abs(npc.Center.X - player.Center.X) < 200f * npc.scale) - { - npc.velocity.X *= 0.8f; - if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) - npc.velocity.X = 0f; - } - else - { - float playerLocation = npc.Center.X - player.Center.X; - npc.direction = playerLocation < 0 ? 1 : -1; - - if (npc.direction > 0) - npc.velocity.X = (npc.velocity.X * 20f + walkingVelocity) / 21f; - if (npc.direction < 0) - npc.velocity.X = (npc.velocity.X * 20f - walkingVelocity) / 21f; - } - - if (Collision.CanHit(npc.position, npc.width, npc.height, player.Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height) && player.position.Y <= npc.position.Y + npc.height && !npc.collideX) - { - CustomGravity(); - npc.noTileCollide = false; - } - else - { - npc.noTileCollide = true; - - // Walk through tiles if colliding with tiles and player is out of reach - int aureusHitboxWidth = 80; - int aureusHitboxHeight = 20; - Vector2 aureusHitboxTileCollideSize = new Vector2(npc.Center.X - (aureusHitboxWidth / 2), npc.position.Y + npc.height - aureusHitboxHeight); - - bool nearPlayerWalkingThroughTiles = false; - if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width && npc.position.Y + npc.height < player.position.Y + player.height - 16f) - nearPlayerWalkingThroughTiles = true; - - if (nearPlayerWalkingThroughTiles) - { - npc.velocity.Y += 0.5f; - } - else if (Collision.SolidCollision(aureusHitboxTileCollideSize, aureusHitboxWidth, aureusHitboxHeight)) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y = 0f; - - if (npc.velocity.Y > -0.2) - npc.velocity.Y -= 0.025f; - else - npc.velocity.Y -= 0.2f; - - if (npc.velocity.Y < -4f) - npc.velocity.Y = -4f; - } - else - { - if (npc.velocity.Y < 0f) - npc.velocity.Y = 0f; - - if (npc.velocity.Y < 0.1) - npc.velocity.Y += 0.025f; - else - npc.velocity.Y += 0.5f; - } - } - - // Walk for a maximum of 6 seconds - if (!dontAttack) - { - npc.ai[1] += 1f; - if (npc.Distance(player.Center) < 240f) - npc.ai[1] += death ? 4f : expertMode ? 2f : 1f; - } - - if (npc.ai[1] >= ((bossRush ? 270f : 360f) - (death ? 90f * (1f - lifeRatio) : 0f))) - { - // Collide with tiles again - npc.noTileCollide = false; - - // Set AI to next phase (Jump) and reset other AI - npc.TargetClosest(); - npc.ai[0] = exhausted ? 1f : 3f; - npc.ai[1] = 0f; - npc.ai[2] += 1f; - npc.netUpdate = true; - } - - // Limit downward velocity - if (npc.velocity.Y > 10f) - npc.velocity.Y = 10f; - } - - // Jump - else if (npc.ai[0] == 3f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.noTileCollide = false; - - if (npc.velocity.Y == 0f) - { - // Slow down - npc.velocity.X *= 0.8f; - - // Half second delay before jumping - if (!dontAttack) - npc.ai[1] += 1f; - - if (npc.ai[1] >= 30f) - { - npc.ai[1] = -20f; - } - else if (npc.ai[1] == -1f) - { - // Set damage - npc.damage = npc.defDamage; - - // Set jump velocity, reset and set AI to next phase (Stomp) - float distanceFromPlayerOnXAxis = npc.Center.X - player.Center.X; - npc.direction = distanceFromPlayerOnXAxis < 0 ? 1 : -1; - calamityGlobalNPC.newAI[3] = npc.direction; - - // The limit for how much Aureus can multiply its jump velocity - float speedMultLimit = 1f; - - // Maxes out when the player is a full 2000 pixels away from or above Aureus - float multiplier = 1f / 2000f; - - // Increase Aureus jump velocity X if it's far enough away from the player - float distanceAwayFromTarget = Math.Abs(distanceFromPlayerOnXAxis); - float distanceGateValue = 400f; - bool increaseJumpVelocityX = distanceAwayFromTarget > distanceGateValue && expertMode; - if (increaseJumpVelocityX) - { - calamityGlobalNPC.newAI[0] = (distanceAwayFromTarget - distanceGateValue) * multiplier; - if (calamityGlobalNPC.newAI[0] > speedMultLimit) - calamityGlobalNPC.newAI[0] = speedMultLimit; - } - - // Increase Aureus jump velocity Y if it's far enough above the player - float distanceBelowTarget = npc.position.Y - (player.position.Y + 80f); - bool increaseJumpVelocityY = distanceBelowTarget > 0f && revenge; - if (increaseJumpVelocityY) - { - calamityGlobalNPC.newAI[1] = distanceBelowTarget * multiplier; - if (calamityGlobalNPC.newAI[1] > speedMultLimit) - calamityGlobalNPC.newAI[1] = speedMultLimit; - } - - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 27f : 20f; - velocity += 6f * enrageScale; - if (expertMode) - velocity += death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); - if (Main.getGoodWorld) - velocity *= 1.15f; - - npc.velocity = (new Vector2(player.Center.X, player.Center.Y - 500f) - npc.Center).SafeNormalize(Vector2.Zero) * velocity; - npc.velocity *= new Vector2(calamityGlobalNPC.newAI[0] + 1f, calamityGlobalNPC.newAI[1] + 1f); - - npc.noTileCollide = true; - - npc.ai[0] = 4f; - npc.ai[1] = 0f; - - SoundEngine.PlaySound(AstrumAureus.AstrumAureus.JumpSound, npc.Center); - - npc.netUpdate = true; - } - } - - // Don't run custom gravity when starting a jump - if (npc.ai[0] != 4f) - CustomGravity(); - } - - // Stomp - else if (npc.ai[0] == 4f) - { - if (npc.velocity.Y == 0f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Play stomp sound. Gotta specify the filepath to avoid confusion between the namespace and npc - SoundStyle soundToPlay = Main.zenithWorld ? NPCs.ExoMechs.Ares.AresGaussNuke.NukeExplosionSound : NPCs.AstrumAureus.AstrumAureus.StompSound; - SoundEngine.PlaySound(soundToPlay, npc.Center); - - if (Main.zenithWorld) - { - float screenShakePower = 16 * Utils.GetLerpValue(1300f, 0f, npc.Distance(Main.LocalPlayer.Center), true); - if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) - Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower; - } - - // Stomp and jump again, if stomped twice then reset and set AI to next phase (Teleport or Idle) - npc.TargetClosest(); - npc.localAI[1] += 1f; - float maxStompAmt = phase5 ? 5f : phase3 ? 2f : 3f; - if (npc.localAI[1] >= maxStompAmt) - { - npc.ai[0] = exhausted ? 1f : (phase3 ? 5f : 2f); - npc.localAI[1] = 0f; - npc.ai[2] += 1f; - npc.ai[3] = 0f; - npc.noTileCollide = false; - npc.netUpdate = true; - } - else - { - float playerLocation = npc.Center.X - player.Center.X; - npc.direction = playerLocation < 0 ? 1 : -1; - npc.ai[0] = 3f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - - // Spawn dust for visual effect - for (int i = (int)npc.position.X - 20; i < (int)npc.position.X + npc.width + 40; i += 20) - { - for (int j = 0; j < 4; j++) - { - int stompDust = Dust.NewDust(new Vector2(npc.position.X - 20f, npc.position.Y + npc.height), npc.width + 20, 4, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); - Main.dust[stompDust].velocity *= 0.2f; - } - } - - // Fire lasers or flames on stomp - SoundEngine.PlaySound(AstrumAureus.AstrumAureus.LaserSound, npc.Center); - - if (Main.zenithWorld) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int totalProjectiles = bossRush ? 14 : death ? 12 : revenge ? 10 : expertMode ? 8 : 6; - float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = 10f; - Vector2 spinningPoint = new Vector2(0f, -velocity); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 1f); - } - } - } - else if (calamityGlobalNPC.newAI[2] == 0f && phase2) - { - calamityGlobalNPC.newAI[2] = 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float flameVelocity = 6f; - int maxProjectiles = bossRush ? 4 : death ? 3 : 2; - int spread = bossRush ? 36 : death ? 28 : 20; - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 spawnVector = new Vector2(npc.Center.X, npc.Center.Y - 80f * npc.scale); - Vector2 destination = new Vector2(spawnVector.X, spawnVector.Y + 100f * npc.scale); - Vector2 projectileVelocity = Vector2.Normalize(destination - spawnVector) * flameVelocity; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < maxProjectiles; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector + Vector2.Normalize(perturbedSpeed) * 100f, perturbedSpeed, type, damage, 0f, Main.myPlayer); - } - } - } - else - { - calamityGlobalNPC.newAI[2] = 0f; - - 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 type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int[] lasersToNotFire = new int[4] { 1, 3, maxProjectiles - 2, maxProjectiles - 4 }; - Vector2 projectileVelocity = Vector2.Normalize(player.Center - npc.Center) * laserVelocity; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < maxProjectiles; i++) - { - if (i != lasersToNotFire[0] && i != lasersToNotFire[1] && i != lasersToNotFire[2] && i != lasersToNotFire[3]) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(maxProjectiles - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, laserVelocity * 2f); - } - } - } - } - } - else - { - // Set damage - npc.damage = npc.defDamage; - - // Set velocities while falling, this happens before the stomp - // Fall through - if (!player.dead) - { - if ((player.position.Y > npc.Bottom.Y && npc.velocity.Y > 0f) || (player.position.Y < npc.Bottom.Y && npc.velocity.Y < 0f)) - npc.noTileCollide = true; - else if ((npc.velocity.Y > 0f && npc.Bottom.Y > Main.player[npc.target].Top.Y) || (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].Center, 1, 1) && !Collision.SolidCollision(npc.position, npc.width, npc.height))) - npc.noTileCollide = false; - } - - if (npc.position.X < player.position.X && npc.position.X + npc.width > player.position.X + player.width) - { - // Make sure Aureus falls quickly when directly on top of or below the player - if (npc.ai[3] < 30f) - npc.ai[3] = 30f; - - npc.velocity.X *= 0.8f; - - if (npc.Bottom.Y < player.position.Y) - { - // Make sure Aureus falls rather quickly - if (npc.velocity.Y < -3f) - npc.velocity.Y = -3f; - - float fallSpeed = 1.2f; - fallSpeed += 0.36f * enrageScale; - if (expertMode) - fallSpeed += death ? 0.36f * (1f - lifeRatio) : 0.24f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - fallSpeed += 0.5f; - - if (calamityGlobalNPC.newAI[1] > 0f) - fallSpeed *= calamityGlobalNPC.newAI[1] + 1f; - - npc.velocity.Y += fallSpeed; - } - } - else - { - // Push Aureus towards the player on the X axis if he's not directly on top of or below the player - float velocityXChange = 0.2f + Math.Abs(npc.Center.X - player.Center.X) * 0.0001f; - velocityXChange += 0.1f * enrageScale; - - if (calamityGlobalNPC.newAI[0] > 0f) - velocityXChange *= calamityGlobalNPC.newAI[0] + 1f; - - if (npc.direction < 0) - npc.velocity.X -= velocityXChange; - else if (npc.direction > 0) - npc.velocity.X += velocityXChange; - - float velocityXCap = 12f; - velocityXCap += 3.6f * enrageScale; - if (expertMode) - velocityXCap += death ? 3.6f * (1f - lifeRatio) : 2.4f * (1f - lifeRatio); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - velocityXCap += 5f; - - if (calamityGlobalNPC.newAI[0] > 0f) - velocityXCap *= calamityGlobalNPC.newAI[0] + 1f; - - float playerLocation = npc.Center.X - player.Center.X; - int directionRelativeToTarget = playerLocation < 0 ? 1 : -1; - bool slowDown = directionRelativeToTarget != calamityGlobalNPC.newAI[3]; - - if (slowDown) - velocityXCap *= 0.333f; - - if (npc.velocity.X < -velocityXCap) - npc.velocity.X = -velocityXCap; - if (npc.velocity.X > velocityXCap) - npc.velocity.X = velocityXCap; - } - - // Don't start falling quickly until half a second has passed - npc.ai[3] += 1f; - if (npc.ai[3] > 30f) - CustomGravity(); - } - } - - // Teleport - else if (npc.ai[0] == 5f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Slow down - npc.velocity.X *= 0.8f; - - // Start teleport - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[1] += 1f; - if (death) - npc.localAI[2] += 1.25f; - - if (phase4) - { - npc.localAI[1] += 1f; - if (death) - npc.localAI[2] += 1.25f; - } - - if (npc.localAI[1] >= (bossRush ? 60f : death ? 180f : 240f)) - { - // Reset localAI and find a teleport destination - npc.TargetClosest(); - npc.localAI[1] = 0f; - - Vector2 vectorAimedAheadOfTarget = Main.player[npc.target].Center + new Vector2((float)Math.Round(Main.player[npc.target].velocity.X), 0f).SafeNormalize(Vector2.Zero) * 1000f; - Point point4 = vectorAimedAheadOfTarget.ToTileCoordinates(); - int teleportTries = 0; - while (teleportTries < 100) - { - teleportTries++; - int teleportTileX = Main.rand.Next(point4.X - 5, point4.X + 6); - int teleportTileY = Main.rand.Next(point4.Y - 5, point4.Y); - - if (!Main.tile[teleportTileX, teleportTileY].HasUnactuatedTile) - { - npc.ai[1] = teleportTileX * 16 + 8; - npc.ai[3] = teleportTileY * 16 + 16; - break; - } - } - - // Default teleport if the above conditions aren't met in 100 iterations - if (teleportTries >= 100) - { - Vector2 bottom = Main.player[Player.FindClosest(npc.position, npc.width, npc.height)].Bottom; - npc.ai[1] = bottom.X; - npc.ai[3] = bottom.Y; - } - - // Set AI to next phase (Mid-teleport) - npc.ai[0] = 6f; - npc.netUpdate = true; - } - } - - CustomGravity(); - } - - // Mid-teleport - else if (npc.ai[0] == 6f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (death) - npc.localAI[2] += 1.25f; - - if (phase4) - { - if (death) - npc.localAI[2] += 1.25f; - } - - // Turn invisible - npc.alpha += 10; - if (npc.alpha >= 255) - { - // Set position to teleport destination - npc.Bottom = new Vector2(npc.ai[1], npc.ai[3]); - - // Reset alpha and set AI to next phase (End of teleport) - npc.alpha = 255; - npc.ai[0] = 7f; - npc.localAI[2] = 0f; - npc.netUpdate = true; - } - - // Play sound for cool effect - if (npc.soundDelay == 0) - { - npc.soundDelay = 15; - SoundEngine.PlaySound(AstrumAureus.AstrumAureus.TeleportSound, npc.Center); - } - - // Emit dust to make the teleport pretty - for (int i = 0; i < 10; i++) - { - int teleportDust = Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType(), npc.velocity.X, npc.velocity.Y, 255, default, 2f); - Main.dust[teleportDust].noGravity = true; - Main.dust[teleportDust].velocity *= 0.5f; - } - - CustomGravity(); - } - - // End of teleport - else if (npc.ai[0] == 7f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Turn visible - npc.alpha -= 10; - if (npc.alpha <= 0) - { - // Spawn Aureus Spawns - bool spawnFlag = expertMode; - if (NPC.CountNPCS(ModContent.NPCType()) >= 2) - spawnFlag = false; - - if (spawnFlag && Main.netMode != NetmodeID.MultiplayerClient) - { - int aureusSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)(npc.Center.Y - 25f * npc.scale), ModContent.NPCType()); - Main.npc[aureusSpawn].velocity.Y = -10f; - Main.npc[aureusSpawn].netUpdate = true; - if (revenge) - { - aureusSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)(npc.Center.Y - 25f * npc.scale), ModContent.NPCType()); - Main.npc[aureusSpawn].velocity.Y = -15f; - Main.npc[aureusSpawn].netUpdate = true; - } - - if (death) - { - int damageAmt = npc.lifeMax / 50; - npc.life -= damageAmt; - if (npc.life < 1) - npc.life = 1; - - npc.DamageEffect(damageAmt); - } - } - - // Reset alpha and set AI to next phase (Idle) - npc.alpha = 0; - npc.ai[0] = exhausted ? 1f : 2f; - npc.ai[1] = 0f; - npc.ai[2] += 1f; - npc.localAI[3] = noProjectileOrPhaseIncrementTime; - - // Stop colliding with tiles if entering walking phase - npc.noTileCollide = npc.ai[0] == 2f; - - npc.netUpdate = true; - } - - // Play sound at teleport destination for cool effect - if (npc.soundDelay == 0) - { - npc.soundDelay = 15; - SoundEngine.PlaySound(SoundID.Item109, npc.Center); - } - - // Emit dust to make the teleport pretty - for (int i = 0; i < 10; i++) - { - int teleportDust = Dust.NewDust(npc.position, npc.width, npc.height, ModContent.DustType(), npc.velocity.X, npc.velocity.Y, 255, default, 2f); - Main.dust[teleportDust].noGravity = true; - Main.dust[teleportDust].velocity *= 0.5f; - } - - CustomGravity(); - } - - void CustomGravity() - { - float gravity = 0.36f + 0.12f * enrageScale; - float maxFallSpeed = reduceFallSpeed ? 12f : 12f + 4f * enrageScale; - - if (calamityGlobalNPC.newAI[1] > 0f && !reduceFallSpeed) - maxFallSpeed *= calamityGlobalNPC.newAI[1] + 1f; - - if (Main.getGoodWorld && !reduceFallSpeed) - { - gravity *= 1.15f; - maxFallSpeed *= 1.15f; - } - - npc.velocity.Y += gravity; - if (npc.velocity.Y > maxFallSpeed) - npc.velocity.Y = maxFallSpeed; - } - } - } -} diff --git a/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs deleted file mode 100644 index c7bc0300cc..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/AstrumDeusAI.cs +++ /dev/null @@ -1,915 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.SulphurousSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Packets; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class AstrumDeusAI - { - public static void VanillaAstrumDeusAI(NPC npc, Mod mod, bool head) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - // Difficulty variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - float enrageScale = bossRush ? 0.5f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1.5f; - } - - // Deus cannot hit for 3 seconds or while invulnerable - bool doNotDealDamage = calamityGlobalNPC.newAI[1] < 180f || npc.dontTakeDamage; - if (doNotDealDamage) - npc.damage = 0; - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - bool increaseSpeed = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles; - bool increaseSpeedMore = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; - - // Despawn safety, make sure to target another player if the current player target is too far away - if (increaseSpeedMore && head) - npc.TargetClosest(); - - // Inflict Extreme Gravity to nearby players - if (revenge) - { - if (!Main.dedServ) - { - if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < CalamityGlobalNPC.CatchUpDistance350Tiles) - Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); - } - } - - // Life - float lifeRatio = npc.life / (float)npc.lifeMax; - - // Phases based on life percentage - bool halfHealth = lifeRatio < 0.5f; - bool doubleWormPhase = calamityGlobalNPC.newAI[0] != 0f; - bool startFlightPhase = lifeRatio < 0.8f || death || doubleWormPhase; - bool phase2 = lifeRatio < 0.5f && doubleWormPhase && expertMode; - bool phase3 = lifeRatio < 0.2f && doubleWormPhase && expertMode; - bool splittingMines = lifeRatio < 0.7f; - bool movingMines = lifeRatio < 0.3f && doubleWormPhase && expertMode; - bool deathModeEnragePhase_Head = calamityGlobalNPC.newAI[0] == 3f; - bool deathModeEnragePhase_BodyAndTail = false; - - // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing - float resistanceTime = doubleWormPhase ? 300f : 600f; - - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < resistanceTime; - - // Flight timer - float aiSwitchTimer = doubleWormPhase ? (Main.getGoodWorld ? 600f : 1200f) : (Main.getGoodWorld ? 900f : 1800f); - - calamityGlobalNPC.newAI[3] += 1f; - if (calamityGlobalNPC.newAI[3] >= aiSwitchTimer) - calamityGlobalNPC.newAI[3] = 0f; - // Sound effect for swapping between attack behaviors in phase 2 - if (doubleWormPhase && calamityGlobalNPC.newAI[3] % aiSwitchTimer == 0f && !(deathModeEnragePhase_Head || deathModeEnragePhase_BodyAndTail)) - SoundEngine.PlaySound(AstrumDeusHead.SplitSound with { Pitch = -0.2f, Volume = 0.9f }, player.Center); - - // Phase for flying at the player - bool flyAtTarget = calamityGlobalNPC.newAI[3] >= (aiSwitchTimer * 0.5f) && startFlightPhase; - - // Length of worms - int phase1Length = death ? 80 : revenge ? 70 : expertMode ? 60 : 50; - int phase2Length = death ? 40 : revenge ? 35 : expertMode ? 30 : 25; - int gfbLength = death ? 8 : revenge ? 7 : expertMode ? 6 : 5; - int maxLength = Main.zenithWorld && doubleWormPhase ? gfbLength : doubleWormPhase ? phase2Length : phase1Length; - - // Become gradually more pissed as more worms are killed - int gfbMaxWormCount = 10; - int gfbWormCount = 0; - if (CalamityWorld.LegendaryMode && revenge) - gfbWormCount = NPC.CountNPCS(ModContent.NPCType()); - if (gfbWormCount > gfbMaxWormCount) - gfbWormCount = gfbMaxWormCount; - if (gfbWormCount > 0) - enrageScale += (gfbMaxWormCount - gfbWormCount) * 0.111f; - - // Split into two worms - if (head) - { - float splitAnimationTime = 180f; - bool oneWormAlive = NPC.CountNPCS(ModContent.NPCType()) < 2; - bool deathModeFinalWormEnrage = death && doubleWormPhase && oneWormAlive && calamityGlobalNPC.newAI[1] >= resistanceTime; - if (deathModeFinalWormEnrage) - { - if (calamityGlobalNPC.newAI[0] != 3f) - { - SoundEngine.PlaySound(AstrumDeusHead.SplitSound, player.Center); - calamityGlobalNPC.newAI[0] = 3f; - npc.defense = 12; - calamityGlobalNPC.DR = 0.075f; - - // Despawns the other deus worm segments - int bodyID = ModContent.NPCType(); - int tailID = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC wormseg = Main.npc[i]; - if (!wormseg.active) - continue; - - if ((wormseg.type == bodyID || wormseg.type == tailID) && Main.npc[(int)wormseg.ai[2]].Calamity().newAI[0] != 3f) - { - wormseg.life = 0; - wormseg.active = false; - } - } - } - - calamityGlobalNPC.newAI[2] += 10f; - if (calamityGlobalNPC.newAI[2] > 162f) - calamityGlobalNPC.newAI[2] = 162f; - - npc.Opacity = MathHelper.Clamp(1f - (calamityGlobalNPC.newAI[2] / splitAnimationTime), 0f, 1f); - } - - bool despawnRemainingWorm = doubleWormPhase && oneWormAlive && !death; - if ((halfHealth && calamityGlobalNPC.newAI[0] == 0f) || despawnRemainingWorm) - { - npc.dontTakeDamage = true; - - calamityGlobalNPC.newAI[2] += despawnRemainingWorm ? 10f : 1f; - npc.Opacity = MathHelper.Clamp(1f - (calamityGlobalNPC.newAI[2] / splitAnimationTime), 0f, 1f); - - bool despawning = calamityGlobalNPC.newAI[2] == splitAnimationTime; - - // - // CODE TWEAKED BY: OZZATRON - // September 20th, 2020 - // reason: fixing Astrum Deus death mode NPC cap bug - // - - // Despawn the unsplit Astrum Deus and spawn two half-size Astrum Deus worms. - if (despawning) - { - // If this is already a split worm (newAI[0] != 0f) then don't do anything. At all. - if (doubleWormPhase) - return; - - // Mark all existing body and tail segments as inactive. This instantly frees up their NPC slots for the freshly spawned worms. - int bodyID = ModContent.NPCType(); - int tailID = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC wormseg = Main.npc[i]; - if (!wormseg.active) - continue; - if (wormseg.type == bodyID || wormseg.type == tailID) - { - wormseg.life = 0; - wormseg.active = false; - } - } - - // The unsplit Astrum Deus worm head will die next frame. - npc.life = 0; - - // Do not spawn worms client side. The server handles this. - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int wormamt = Main.zenithWorld ? 5 : 1; - for (int i = 0; i < wormamt; i++) - { - // Now that the original worm doesn't exist, startCount can be zero. - // int startCount = npc.whoAmI + phase1Length + 1; - int startIndexHeadOne = 1; - int headOneID = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, npc.type, startIndexHeadOne); - Main.npc[headOneID].Calamity().newAI[0] = 1f; - Main.npc[headOneID].velocity = Vector2.Normalize(player.Center - Main.npc[headOneID].Center) * 16f; - Main.npc[headOneID].timeLeft *= 20; - Main.npc[headOneID].ForceNetUpdate(); - - // On server, immediately send the correct extra AI of this head to clients. - if (Main.dedServ) - { - SyncCalamityNPCAIArrayPacket.Send(Main.npc[headOneID]); - } - - // Make sure the second split worm is also contiguous. - int startIndexHeadTwo = startIndexHeadOne + phase2Length + 1; - int headTwoID = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, npc.type, startIndexHeadTwo); - Main.npc[headTwoID].Calamity().newAI[0] = 2f; - Main.npc[headTwoID].Calamity().newAI[3] = Main.getGoodWorld ? 300f : 600f; - Main.npc[headTwoID].velocity = Vector2.Normalize(player.Center - Main.npc[headTwoID].Center) * 16f; - Main.npc[headTwoID].timeLeft *= 20; - Main.npc[headTwoID].ForceNetUpdate(); - - // On server, immediately send the correct extra AI of this head to clients. - if (Main.dedServ) - { - SyncCalamityNPCAIArrayPacket.Send(Main.npc[headTwoID]); - } - } - - SoundEngine.PlaySound(AstrumDeusHead.SplitSound, player.Center); - } - return; - } - } - - if (Main.zenithWorld && calamityGlobalNPC.newAI[1] < 10f) // desync the deuses - { - float pushForce = 0.25f; - for (int k = 0; k < Main.maxNPCs; k++) - { - NPC otherDeus = Main.npc[k]; - // Short circuits to make the loop as fast as possible - if (!otherDeus.active || k == npc.whoAmI) - continue; - - // If the other projectile is indeed the same owned by the same player and they're too close, nudge them away. - bool sameProjType = otherDeus.type == npc.type; - float taxicabDist = Vector2.Distance(npc.Center, otherDeus.Center); - float distancegate = 320f; - if (sameProjType && taxicabDist < distancegate) - { - if (npc.position.X < otherDeus.position.X) - npc.velocity.X -= pushForce; - else - npc.velocity.X += pushForce; - - if (npc.position.Y < otherDeus.position.Y) - npc.velocity.Y -= pushForce; - else - npc.velocity.Y += pushForce; - } - } - } - } - - // Copy dontTakeDamage and Opacity from head - else - { - npc.dontTakeDamage = Main.npc[(int)npc.ai[2]].dontTakeDamage; - npc.Opacity = Main.npc[(int)npc.ai[2]].Opacity; - deathModeEnragePhase_BodyAndTail = Main.npc[(int)npc.ai[2]].Calamity().newAI[0] == 3f; - - if (deathModeEnragePhase_BodyAndTail) - { - npc.defense = 25; - calamityGlobalNPC.DR = 0.15f; - } - } - - // Set worm variable - if (npc.ai[2] > 0f) - npc.realLife = (int)npc.ai[2]; - - // Alpha effects - if ((head || Main.npc[(int)npc.ai[1]].alpha < 128) && !npc.dontTakeDamage) - { - // Alpha changes - npc.alpha -= 42; - if (npc.alpha < 0) - npc.alpha = 0; - } - - // Check if other segments are still alive, if not, die - if (!head) - { - bool shouldDespawn = true; - int headType = ModContent.NPCType(); - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].type != headType || !Main.npc[i].active) - continue; - shouldDespawn = false; - break; - } - if (shouldDespawn) - { - if (Main.npc.IndexInRange((int)npc.ai[1]) && Main.npc[(int)npc.ai[1]].active && Main.npc[(int)npc.ai[1]].life > 0) - shouldDespawn = false; - } - if (shouldDespawn) - { - npc.life = 0; - npc.HitEffect(0, 10.0); - npc.checkDead(); - npc.active = false; - npc.ForceNetUpdate(false); - } - } - - // Direction - if (npc.velocity.X < 0f) - npc.spriteDirection = -1; - else if (npc.velocity.X > 0f) - npc.spriteDirection = 1; - - // Head code - if (head) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (npc.ai[0] == 0f) - { - int Previous = npc.whoAmI; - int bodyType = ModContent.NPCType(); - int tailType = ModContent.NPCType(); - for (int segments = 0; segments < maxLength; segments++) - { - int lol; - if (segments >= 0 && segments < maxLength - 1) - lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, bodyType, npc.whoAmI); - else - lol = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, tailType, npc.whoAmI); - - if (segments % 2 == 0) - Main.npc[lol].localAI[3] = 1f; - - Main.npc[lol].realLife = npc.whoAmI; - Main.npc[lol].Calamity().newAI[0] = Main.npc[Previous].Calamity().newAI[0]; - Main.npc[lol].Calamity().newAI[3] = Main.npc[Previous].Calamity().newAI[3]; - - if (Main.dedServ) - { - SyncCalamityNPCAIArrayPacket.Send(Main.npc[lol]); - } - - Main.npc[lol].ai[3] = segments + 1; - Main.npc[lol].ai[2] = npc.whoAmI; - Main.npc[lol].ai[1] = Previous; - Main.npc[Previous].ai[0] = lol; - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, lol); - Previous = lol; - } - } - } - - if (npc.life > Main.npc[(int)npc.ai[0]].life) - npc.life = Main.npc[(int)npc.ai[0]].life; - } - else - { - if (npc.life > Main.npc[(int)npc.ai[1]].life) - npc.life = Main.npc[(int)npc.ai[1]].life; - } - - bool hasJustSpawned = calamityGlobalNPC.newAI[1] < resistanceTime * 0.4f && !doubleWormPhase; // Speed boost for the first 4 seconds after spawning - float segmentVelocity = hasJustSpawned ? 25f : deathModeEnragePhase_Head ? 19f : death ? 17.5f : 16f; - - float segmentVelocityBoost = 5f * (1f - lifeRatio); - segmentVelocity += segmentVelocityBoost; - segmentVelocity += 4f * enrageScale; - - if (revenge) - { - float revMultiplier = 1.1f; - segmentVelocity *= revMultiplier; - } - - if (head) - { - int headTilePositionX = (int)(npc.position.X / 16f) - 1; - int headTileWidthPosX = (int)((npc.position.X + npc.width) / 16f) + 2; - int headTilePositionY = (int)(npc.position.Y / 16f) - 1; - int headTileWidthPosY = (int)((npc.position.Y + npc.height) / 16f) + 2; - - if (headTilePositionX < 0) - headTilePositionX = 0; - if (headTileWidthPosX > Main.maxTilesX) - headTileWidthPosX = Main.maxTilesX; - if (headTilePositionY < 0) - headTilePositionY = 0; - if (headTileWidthPosY > Main.maxTilesY) - headTileWidthPosY = Main.maxTilesY; - - // Fly or not - bool shouldFly = flyAtTarget; - if (!shouldFly) - { - for (int k = headTilePositionX; k < headTileWidthPosX; k++) - { - for (int l = headTilePositionY; l < headTileWidthPosY; l++) - { - if (Main.tile[k, l] != null && ((Main.tile[k, l].HasUnactuatedTile && (Main.tileSolid[Main.tile[k, l].TileType] || (Main.tileSolidTop[Main.tile[k, l].TileType] && Main.tile[k, l].TileFrameY == 0))) || Main.tile[k, l].LiquidAmount > 64)) - { - Vector2 vector2; - vector2.X = k * 16f; - vector2.Y = l * 16f; - if (npc.position.X + npc.width > vector2.X && npc.position.X < vector2.X + 16f && npc.position.Y + npc.height > vector2.Y && npc.position.Y < vector2.Y + 16f) - { - shouldFly = true; - break; - } - } - } - } - } - - // Start flying if target is not within a certain distance - if (!shouldFly) - { - npc.localAI[1] = 1f; - - Rectangle rectangle = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - int noFlyZone = 200; - int heightReduction = death ? 130 : (int)(130f * (1f - lifeRatio)); - int height = 400 - heightReduction; - bool outsideNoFlyZone = true; - - if (npc.position.Y > player.position.Y) - { - for (int m = 0; m < Main.maxPlayers; m++) - { - if (Main.player[m].active) - { - Rectangle rectangle2 = new Rectangle((int)Main.player[m].position.X - noFlyZone, (int)Main.player[m].position.Y - noFlyZone, noFlyZone * 2, height); - if (rectangle.Intersects(rectangle2)) - { - outsideNoFlyZone = false; - break; - } - } - } - - if (outsideNoFlyZone) - shouldFly = true; - } - } - else - npc.localAI[1] = 0f; - - // Despawn - if (player.dead) - { - shouldFly = false; - float velocity = 2f; - npc.velocity.Y -= velocity; - if ((double)npc.position.Y < Main.topWorld + 16f) - { - segmentVelocity *= 2f; - npc.velocity.Y -= velocity; - } - - int headType = ModContent.NPCType(); - int bodyType = ModContent.NPCType(); - int tailType = ModContent.NPCType(); - if ((double)npc.position.Y < Main.topWorld + 16f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].type == headType || Main.npc[i].type == bodyType || Main.npc[i].type == tailType) - { - Main.npc[i].active = false; - Main.npc[i].ForceNetUpdate(false); - } - } - } - } - - // Speed and movement - float speedBoost = death ? (0.1f * (1f - lifeRatio)) : (0.13f * (1f - lifeRatio)); - float turnSpeedBoost = death ? (0.18f * (1f - lifeRatio)) : (0.2f * (1f - lifeRatio)); - float speed = (hasJustSpawned ? 0.26f : deathModeEnragePhase_Head ? 0.2f : death ? 0.18f : 0.13f) + speedBoost; - float turnSpeed = (hasJustSpawned ? 0.3f : deathModeEnragePhase_Head ? 0.27f : death ? 0.25f : 0.2f) + turnSpeedBoost; - speed += 0.05f * enrageScale; - turnSpeed += 0.08f * enrageScale; - - if (flyAtTarget) - { - float speedMultiplier = deathModeEnragePhase_Head ? 1.25f : doubleWormPhase ? (phase3 ? 1.25f : phase2 ? 1.2f : 1.15f) : 1f; - speed *= speedMultiplier; - } - - if (revenge) - { - float revMultiplier = 1.1f; - speed *= revMultiplier; - turnSpeed *= revMultiplier; - } - - speed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; - turnSpeed *= increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; - - if (Main.getGoodWorld) - { - speed *= 1.15f; - turnSpeed *= 1.15f; - } - - Vector2 deusCenter = npc.Center; - float deusTargetX = player.Center.X; - float deusTargetY = player.Center.Y; - deusTargetX = (int)(deusTargetX / 16f) * 16; - deusTargetY = (int)(deusTargetY / 16f) * 16; - deusCenter.X = (int)(deusCenter.X / 16f) * 16; - deusCenter.Y = (int)(deusCenter.Y / 16f) * 16; - deusTargetX -= deusCenter.X; - deusTargetY -= deusCenter.Y; - - if (!shouldFly) - { - npc.velocity.Y += 0.15f; - if (npc.velocity.Y > segmentVelocity) - npc.velocity.Y = segmentVelocity; - - // This bool exists to stop the strange wiggle behavior when worms are falling down - bool slowXVelocity = Math.Abs(npc.velocity.X) > speed; - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < segmentVelocity * 0.4) - { - if (npc.velocity.X < 0f) - npc.velocity.X -= speed * 1.1f; - else - npc.velocity.X += speed * 1.1f; - } - else if (npc.velocity.Y == segmentVelocity) - { - if (slowXVelocity) - { - if (npc.velocity.X < deusTargetX) - npc.velocity.X += speed; - else if (npc.velocity.X > deusTargetX) - npc.velocity.X -= speed; - } - else - npc.velocity.X = 0f; - } - else if (npc.velocity.Y > 4f) - { - if (slowXVelocity) - { - if (npc.velocity.X < 0f) - npc.velocity.X += speed * 0.9f; - else - npc.velocity.X -= speed * 0.9f; - } - else - npc.velocity.X = 0f; - } - } - else - { - float deusTargetDist = (float)Math.Sqrt(deusTargetX * deusTargetX + deusTargetY * deusTargetY); - float deusAbsoluteTargetX = Math.Abs(deusTargetX); - float deusAbsoluteTargetY = Math.Abs(deusTargetY); - float deusTimeToReachTarget = segmentVelocity / deusTargetDist; - deusTargetX *= deusTimeToReachTarget; - deusTargetY *= deusTimeToReachTarget; - - bool speedUpWhileFlying = false; - if (flyAtTarget) - { - if (((npc.velocity.X > 0f && deusTargetX < 0f) || (npc.velocity.X < 0f && deusTargetX > 0f) || (npc.velocity.Y > 0f && deusTargetY < 0f) || (npc.velocity.Y < 0f && deusTargetY > 0f)) && Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) > speed / 2f && deusTargetDist < 400f) - { - speedUpWhileFlying = true; - - if (Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y) < segmentVelocity) - npc.velocity *= 1.1f; - } - - if (npc.position.Y > player.position.Y) - { - speedUpWhileFlying = true; - - if (Math.Abs(npc.velocity.X) < segmentVelocity / 2f) - { - if (npc.velocity.X == 0f) - npc.velocity.X -= npc.direction; - - npc.velocity.X *= 1.1f; - } - else if (npc.velocity.Y > -segmentVelocity) - npc.velocity.Y -= speed; - } - } - - if (!speedUpWhileFlying) - { - if (!flyAtTarget) - { - if (((npc.velocity.X > 0f && deusTargetX > 0f) || (npc.velocity.X < 0f && deusTargetX < 0f)) && ((npc.velocity.Y > 0f && deusTargetY > 0f) || (npc.velocity.Y < 0f && deusTargetY < 0f))) - { - if (npc.velocity.X < deusTargetX) - npc.velocity.X += turnSpeed; - else if (npc.velocity.X > deusTargetX) - npc.velocity.X -= turnSpeed; - - if (npc.velocity.Y < deusTargetY) - npc.velocity.Y += turnSpeed; - else if (npc.velocity.Y > deusTargetY) - npc.velocity.Y -= turnSpeed; - } - } - - if ((npc.velocity.X > 0f && deusTargetX > 0f) || (npc.velocity.X < 0f && deusTargetX < 0f) || (npc.velocity.Y > 0f && deusTargetY > 0f) || (npc.velocity.Y < 0f && deusTargetY < 0f)) - { - if (npc.velocity.X < deusTargetX) - npc.velocity.X += speed; - else if (npc.velocity.X > deusTargetX) - npc.velocity.X -= speed; - - if (npc.velocity.Y < deusTargetY) - npc.velocity.Y += speed; - else if (npc.velocity.Y > deusTargetY) - npc.velocity.Y -= speed; - - if (Math.Abs(deusTargetY) < segmentVelocity * 0.2 && ((npc.velocity.X > 0f && deusTargetX < 0f) || (npc.velocity.X < 0f && deusTargetX > 0f))) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += speed * 2f; - else - npc.velocity.Y -= speed * 2f; - } - - if (Math.Abs(deusTargetX) < segmentVelocity * 0.2 && ((npc.velocity.Y > 0f && deusTargetY < 0f) || (npc.velocity.Y < 0f && deusTargetY > 0f))) - { - if (npc.velocity.X > 0f) - npc.velocity.X += speed * 2f; - else - npc.velocity.X -= speed * 2f; - } - } - else if (deusAbsoluteTargetX > deusAbsoluteTargetY) - { - if (npc.velocity.X < deusTargetX) - npc.velocity.X += speed * 1.1f; - else if (npc.velocity.X > deusTargetX) - npc.velocity.X -= speed * 1.1f; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < segmentVelocity * 0.5) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y += speed; - else - npc.velocity.Y -= speed; - } - } - else - { - if (npc.velocity.Y < deusTargetY) - npc.velocity.Y += speed * 1.1f; - else if (npc.velocity.Y > deusTargetY) - npc.velocity.Y -= speed * 1.1f; - - if ((Math.Abs(npc.velocity.X) + Math.Abs(npc.velocity.Y)) < segmentVelocity * 0.5) - { - if (npc.velocity.X > 0f) - npc.velocity.X += speed; - else - npc.velocity.X -= speed; - } - } - } - } - - if (shouldFly) - { - if (npc.localAI[0] != 1f) - npc.ForceNetUpdate(false); - - npc.localAI[0] = 1f; - } - else - { - if (npc.localAI[0] != 0f) - npc.ForceNetUpdate(false); - - npc.localAI[0] = 0f; - } - - if (((npc.velocity.X > 0f && npc.oldVelocity.X < 0f) || (npc.velocity.X < 0f && npc.oldVelocity.X > 0f) || (npc.velocity.Y > 0f && npc.oldVelocity.Y < 0f) || (npc.velocity.Y < 0f && npc.oldVelocity.Y > 0f)) && !npc.justHit) - npc.ForceNetUpdate(false); - - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) + MathHelper.PiOver2; - } - - // Only the main worm body and tail use this code - else - { - // Shoot lasers - if (npc.type == ModContent.NPCType()) - { - npc.localAI[0] += 1f; - - int shootTime = (doubleWormPhase && expertMode) ? 2 : 1; - float shootProjectile = (doubleWormPhase && expertMode) ? 200 : 400; - float timer = npc.ai[0] + 15f; - float divisor = timer + shootProjectile; - bool canFireProjectiles = npc.Opacity >= 1f; - bool shootGodRays = phase2 || deathModeEnragePhase_BodyAndTail; - - if (canFireProjectiles) - { - if (!flyAtTarget || deathModeEnragePhase_BodyAndTail) - { - float laserDivisor = (phase2 && !deathModeEnragePhase_BodyAndTail) ? 4f : 2f; - if (npc.localAI[0] % divisor == 0f && npc.ai[0] % laserDivisor == 0f) - { - npc.TargetClosest(); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (deathModeEnragePhase_BodyAndTail) - { - Vector2 velocity = Vector2.Zero; - if (movingMines) - { - Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - randomMineMovement.Normalize(); - randomMineMovement *= Main.rand.Next(90, 121) * 0.01f; - velocity = randomMineMovement; - } - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); - } - } - - if (Vector2.Distance(player.Center, npc.Center) > 80f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float deusLaserSpeed = (death ? 16f : revenge ? 14f : 13f) + enrageScale * 4f; - - Vector2 deusLaserCenter = npc.Center; - float deusLaserTargetX = player.Center.X - deusLaserCenter.X; - float deusLaserTargetY = player.Center.Y - deusLaserCenter.Y; - float deusLaserTargetDist = (float)Math.Sqrt(deusLaserTargetX * deusLaserTargetX + deusLaserTargetY * deusLaserTargetY); - deusLaserTargetDist = deusLaserSpeed / deusLaserTargetDist; - deusLaserTargetX *= deusLaserTargetDist; - deusLaserTargetY *= deusLaserTargetDist; - deusLaserCenter.X += deusLaserTargetX * 5f; - deusLaserCenter.Y += deusLaserTargetY * 5f; - - Vector2 shootDirection = new Vector2(deusLaserTargetX, deusLaserTargetY).SafeNormalize(Vector2.UnitY); - Vector2 laserVelocity = shootDirection * deusLaserSpeed; - - int type = shootGodRays ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - if (shootGodRays) - { - SoundEngine.PlaySound(AstrumDeusHead.GodRaySound, npc.Center); - // Waving beams need to start offset so they cross each other neatly. - float waveSideOffset = Main.rand.NextFloat(9f, 14f); - Vector2 perp = shootDirection.RotatedBy(-MathHelper.PiOver2) * waveSideOffset; - - for (int i = -1; i <= 1; i += 2) - { - Vector2 laserStartPos = deusLaserCenter + i * perp + Main.rand.NextVector2CircularEdge(6f, 6f); - Projectile godRay = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), laserStartPos, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); - - // Tell this Phased God Ray exactly which way it should be waving. - godRay.localAI[1] = i * 0.5f; - } - } - else - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, npc.Center); - Projectile.NewProjectile(npc.GetSource_FromAI(), deusLaserCenter, laserVelocity, type, damage, 0f, Main.myPlayer, player.Center.X, player.Center.Y); - } - } - } - } - } - else - { - if (npc.localAI[0] % divisor == 0f && npc.ai[0] % 2f == 0f) - { - Vector2 velocity = Vector2.Zero; - if (movingMines) - { - Vector2 randomMineMovement = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); - randomMineMovement.Normalize(); - randomMineMovement *= Main.rand.Next(30, 121) * 0.01f; - velocity = randomMineMovement; - } - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float split = (splittingMines && npc.ai[0] % 3f == 0f) ? 1f : 0f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity, type, damage, 0f, Main.myPlayer, split, 0f); - } - } - } - } - - // Follow the head - Vector2 segmentCenter = npc.Center; - float segmentTargetX = player.Center.X; - float segmentTargetY = player.Center.Y; - segmentTargetX = (int)(segmentTargetX / 16f) * 16; - segmentTargetY = (int)(segmentTargetY / 16f) * 16; - segmentCenter.X = (int)(segmentCenter.X / 16f) * 16; - segmentCenter.Y = (int)(segmentCenter.Y / 16f) * 16; - segmentTargetX -= segmentCenter.X; - segmentTargetY -= segmentCenter.Y; - - if (npc.ai[1] > 0f && npc.ai[1] < Main.npc.Length) - { - try - { - segmentCenter = npc.Center; - segmentTargetX = Main.npc[(int)npc.ai[1]].Center.X - segmentCenter.X; - segmentTargetY = Main.npc[(int)npc.ai[1]].Center.Y - segmentCenter.Y; - } - catch - { - } - - npc.rotation = (float)Math.Atan2(segmentTargetY, segmentTargetX) + MathHelper.PiOver2; - float segmentTargetDist = (float)Math.Sqrt(segmentTargetX * segmentTargetX + segmentTargetY * segmentTargetY); - int segmentWidth = npc.width; - segmentTargetDist = (segmentTargetDist - segmentWidth) / segmentTargetDist; - segmentTargetX *= segmentTargetDist; - segmentTargetY *= segmentTargetDist; - npc.velocity = Vector2.Zero; - npc.position.X = npc.position.X + segmentTargetX; - npc.position.Y = npc.position.Y + segmentTargetY; - - if (segmentTargetX < 0f) - npc.spriteDirection = -1; - else if (segmentTargetX > 0f) - npc.spriteDirection = 1; - } - } - - // Play spawn sound on Deus on the first frame because otherwise the sound wouldn't play properly in multiplayer - if (calamityGlobalNPC.newAI[1] == 0f && !doubleWormPhase) - { - SoundEngine.PlaySound(AstrumDeusHead.SpawnSound, npc.Center); - calamityGlobalNPC.newAI[1] = 1f; - } - - // 5 seconds of resistance in phase 2, 10 seconds in phase 1, to prevent spawn killing - if (calamityGlobalNPC.newAI[1] < resistanceTime && ((npc.position - npc.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 1f)) - calamityGlobalNPC.newAI[1] += 1f; - - // Calculate contact damage based on velocity - if (!doNotDealDamage) - { - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (head) - { - if (npc.velocity.Length() <= minimalContactDamageVelocity) - { - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((npc.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp((float)Math.Round(npc.defDamage * 0.5), npc.defDamage, velocityDamageScalar); - } - } - else - { - float bodyAndTailVelocity = (npc.position - npc.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - npc.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp(0f, npc.defDamage, velocityDamageScalar); - } - } - } - } - } -} diff --git a/NPCs/CalamityAIs/CalamityBossAIs/BrimstoneElementalAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/BrimstoneElementalAI.cs deleted file mode 100644 index 2134f154b2..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/BrimstoneElementalAI.cs +++ /dev/null @@ -1,734 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class BrimstoneElementalAI - { - public static void VanillaBrimstoneElementalAI(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - BrimstoneElemental.BrimstoneElemental brimmy = npc.ModNPC(); - - // Used for Brimling AI states - CalamityGlobalNPC.brimstoneElemental = npc.whoAmI; - - // Emit light - Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), 1.2f, 0f, 0f); - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - bool despawnDistance = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; - - if (!player.active || player.dead || despawnDistance) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead || despawnDistance) - { - npc.rotation = npc.velocity.X * 0.04f; - - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - npc.velocity.Y -= 0.1f; - if (npc.velocity.Y < -12f) - npc.velocity.Y = -12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - if (npc.ai[0] != 0f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.localAI[0] = 0f; - npc.localAI[1] = 0f; - npc.netUpdate = true; - } - return; - } - } - else if (npc.timeLeft < 1800) - npc.timeLeft = 1800; - - CalamityPlayer modPlayer = player.Calamity(); - - // Reset defense - npc.defense = npc.defDefense; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = npc.ai[0] == 4f; - - // Percent life remaining - 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 phase2 = lifeRatio < 0.5f && revenge; - bool phase3 = lifeRatio < 0.33f; - - // Enrage - if ((!player.ZoneUnderworldHeight || !modPlayer.ZoneCalamity) && !bossRush) - { - if (calamityGlobalNPC.newAI[3] > 0f) - calamityGlobalNPC.newAI[3] -= 1f; - } - else - calamityGlobalNPC.newAI[3] = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = calamityGlobalNPC.newAI[3] <= 0f || bossRush; - - float enrageScale = bossRush ? 0.5f : 0f; - if (biomeEnraged && (!player.ZoneUnderworldHeight || bossRush)) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 0.5f; - } - if (biomeEnraged && (!modPlayer.ZoneCalamity || bossRush)) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - - npc.Calamity().DR = npc.ai[0] == 4f ? 0.6f : 0.2f; - - // Emit dust - int dustAmt = (npc.ai[0] == 2f) ? 2 : 1; - int size = (npc.ai[0] == 2f) ? 50 : 35; - if (npc.ai[0] != 1f) - { - for (int i = 0; i < 2; i++) - { - if (Main.rand.Next(3) < dustAmt) - { - int dust = Dust.NewDust(npc.Center - new Vector2(size), size * 2, size * 2, DustID.LifeDrain, npc.velocity.X * 0.5f, npc.velocity.Y * 0.5f, 90, default, 1.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0.2f; - Main.dust[dust].fadeIn = 1f; - } - } - } - - // Distance from destination where Brimmy stops moving - float movementDistanceGateValue = 100f; - - // How fast Brimmy moves to the destination - float baseVelocity = (death ? 6f : revenge ? 5.5f : expertMode ? 5f : 4.5f) * (npc.ai[0] == 5f ? 0.05f : npc.ai[0] == 3f ? 1.5f : 1f); - baseVelocity += 3f * enrageScale; - if (expertMode) - baseVelocity += death ? 3f * (1f - lifeRatio) : 2f * (1f - lifeRatio); - - float baseAcceleration = (death ? 0.12f : 0.1f) * (npc.ai[0] == 5f ? 0.5f : npc.ai[0] == 3f ? 1.5f : 1f); - baseAcceleration += 0.06f * enrageScale; - if (expertMode) - baseAcceleration += 0.03f * (1f - lifeRatio); - - // This is where Brimmy should be - Vector2 destination = npc.ai[0] != 3f ? player.Center : new Vector2(player.Center.X, player.Center.Y - 300f); - - // How far Brimmy is from where she's supposed to be - Vector2 distanceFromDestination = destination - npc.Center; - - // Movement - if (npc.ai[0] != 4f) - CalamityUtils.SmoothMovement(npc, movementDistanceGateValue, distanceFromDestination, baseVelocity, baseAcceleration, true); - - // Rotation and direction - if (npc.ai[0] <= 2f || npc.ai[0] == 5f) - { - npc.rotation = npc.velocity.X * 0.04f; - if (npc.ai[0] != 5 || (npc.ai[1] < 180f && npc.ai[0] == 5f)) - { - float playerLocation = npc.Center.X - player.Center.X; - npc.direction = playerLocation < 0f ? 1 : -1; - npc.spriteDirection = npc.direction; - } - } - - if (Main.zenithWorld) // in gfb, Brimmy channels the power of the other elementals. - { - int newMode; - if (lifeRatio <= 0.8f && lifeRatio > 0.6f) - { - newMode = 1; // Sand - } - else if (lifeRatio <= 0.6f && lifeRatio > 0.4f) - { - newMode = 2; // Rare Sand - } - else if (lifeRatio <= 0.4f && lifeRatio > 0.2f) - { - newMode = 3; // Cloud - } - else if (lifeRatio <= 0.2f) - { - newMode = 4; // Water - } - else - { - newMode = 0; // Brimstone, default - } - if (newMode != brimmy.currentMode) - { - SoundEngine.PlaySound(SoundID.Item29, npc.Center); - } - brimmy.currentMode = newMode; - } - - if (npc.ai[0] == -1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int phase; - int random = phase2 ? 6 : 5; - do phase = Main.rand.Next(random); - while (phase == npc.ai[1] || (phase == 0 && phase3 && revenge) || phase == 1 || phase == 2 || (phase == 4 && npc.localAI[3] != 0f)); - - npc.ai[0] = phase; - npc.ai[1] = 0f; - - // Cocoon phase cooldown - if (npc.localAI[3] > 0f) - npc.localAI[3] -= 1f; - else if (phase == 4) - { - npc.localAI[3] = 3f; - SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.HideInShellSound, player.Center); - } - - // Prevent netUpdate from being blocked by the spam counter. - // A phase switch sync is a critical operation that must be synced. - npc.ForceNetUpdate(false); - } - } - - // Pick a location to teleport to - else if (npc.ai[0] == 0f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.chaseable = true; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[1] += 1f; - if (npc.Distance(player.Center) < 160f) - npc.localAI[1] += death ? 4f : expertMode ? 2f : 1f; - - if (npc.localAI[1] >= (bossRush ? 90f : death ? 120f : 180f)) - { - npc.TargetClosest(); - npc.localAI[1] = 0f; - int timer = 0; - int playerPosX; - int playerPosY; - while (true) - { - timer++; - playerPosX = (int)player.Center.X / 16; - playerPosY = (int)player.Center.Y / 16; - - int min = 12; - int max = 16; - - if (Main.rand.NextBool()) - playerPosX += Main.rand.Next(min, max); - else - playerPosX -= Main.rand.Next(min, max); - - if (Main.rand.NextBool()) - playerPosY += Main.rand.Next(min, max); - else - playerPosY -= Main.rand.Next(min, max); - - if (!WorldGen.SolidTile(playerPosX, playerPosY)) - break; - - if (timer > 100) - return; - } - npc.ai[0] = 1f; - npc.ai[1] = playerPosX; - npc.ai[2] = playerPosY; - npc.netUpdate = true; - } - } - } - - // Teleport to location - else if (npc.ai[0] == 1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.chaseable = true; - Vector2 position = new Vector2(npc.ai[1] * 16f - (npc.width / 2), npc.ai[2] * 16f - (npc.height / 2)); - for (int m = 0; m < 5; m++) - { - int dust = Dust.NewDust(position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, 2f); - Main.dust[dust].noGravity = true; - Main.dust[dust].fadeIn = 1f; - } - npc.alpha += bossRush ? 8 : death ? 5 : revenge ? 4 : expertMode ? 3 : 2; - if (npc.alpha >= 255) - { - int spawnType = brimmy.currentMode == 3 ? NPCID.AngryNimbus : ModContent.NPCType(); - int enemyCount = brimmy.currentMode == 3 ? 3 : 1; // 3 angry nimbi if cloud, otherwise 1 brimling - if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(spawnType) < (death ? 1 : 2) && revenge && brimmy.currentMode != 2) // dont spawn anything if gfb rare sand - { - for (int i = 0; i < enemyCount; i++) - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, spawnType); - } - SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.TeleportSound, npc.Center); - npc.alpha = 255; - npc.position = position; - for (int n = 0; n < 15; n++) - { - int warpDust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, 3f); - Main.dust[warpDust].noGravity = true; - } - npc.ai[0] = 2f; - npc.netUpdate = true; - } - } - - // Either teleport again or go to next AI state - else if (npc.ai[0] == 2f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.alpha >= 255) - { - if (Main.zenithWorld) - { - SoundEngine.PlaySound(SoundID.Item68, npc.Center); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 pos = npc.Center; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), pos, new Vector2(0, 1), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), pos, new Vector2(0, -1), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), pos, new Vector2(1, 0), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), pos, new Vector2(-1, 0), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - } - if (brimmy.currentMode >= 1 && brimmy.currentMode <= 3) - { - int tornadoType = brimmy.currentMode == 3 ? ModContent.ProjectileType() : ProjectileID.SandnadoHostileMark; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), pos, Vector2.Zero, tornadoType, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - if (brimmy.currentMode == 2) - { - int healAmt = npc.lifeMax / 25; - if (healAmt > 0) - { - npc.life += healAmt; - npc.HealEffect(healAmt, true); - npc.netUpdate = true; - } - } - } - } - - npc.alpha -= 50; - if (npc.alpha <= 0) - { - npc.chaseable = true; - npc.ai[3] += 1f; - npc.alpha = 0; - if (npc.ai[3] >= 2f || phase2 || Main.getGoodWorld) - { - npc.ai[0] = -1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - else - { - npc.ai[0] = 0f; - } - npc.netUpdate = true; - } - } - - // Float above target and fire projectiles - else if (npc.ai[0] == 3f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.chaseable = true; - npc.rotation = npc.velocity.X * 0.04f; - - float playerLocation = npc.Center.X - player.Center.X; - npc.direction = playerLocation < 0f ? 1 : -1; - npc.spriteDirection = npc.direction; - - npc.ai[1] += 1f; - float divisor = expertMode ? (death ? 80f : revenge ? 45f : 50f) - (float)Math.Ceiling(10f * (1f - lifeRatio)) : 50f; - divisor -= 3f * enrageScale; - float divisor2 = divisor * 2f; - - if (npc.ai[1] % divisor == divisor - 1f) - { - float velocity = (death ? 7f : revenge ? 6f : 5f) + (2f * enrageScale) + (expertMode ? 3f * (1f - lifeRatio) : 0f); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - if (brimmy.currentMode == 4) - { - type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundID.Item30, player.Center); - } - else - { - SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.HellfireballSound, player.Center); - } - Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 5f, projectileVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); - Main.projectile[proj].timeLeft = 240; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - Main.projectile[proj].extraUpdates += 1; - } - - if (npc.ai[1] % divisor2 == divisor2 - 1f) - { - velocity = (death ? 5f : 4f) + 2f * enrageScale; - type = ModContent.ProjectileType(); - damage = npc.GetProjectileDamage(type); - if (brimmy.currentMode == 4) - { - type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundID.Item21, player.Center); - } - else - { - SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.DartSound, player.Center); - } - projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; - int numProj = death ? 8 : 4; - int spread = death ? 90 : 45; - if (Main.getGoodWorld) - { - numProj *= 3; - spread *= 2; - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float rotation = MathHelper.ToRadians(spread); - float projectileVelocityToPass = velocity * 3f; - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - Main.projectile[proj2].extraUpdates += 1; - } - } - } - } - - if (npc.ai[1] >= divisor * (death ? 5f : 10f)) - { - npc.TargetClosest(); - npc.ai[0] = -1f; - npc.ai[1] = 3f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - } - - // Cocoon bullet hell - else if (npc.ai[0] == 4f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.defense = npc.defDefense * 4; - - npc.chaseable = false; - npc.localAI[0] += 1f; - if (Main.getGoodWorld) - npc.localAI[0] += 2f; - if (expertMode) - npc.localAI[0] += 1f - lifeRatio; - npc.localAI[0] += enrageScale; - - if (npc.localAI[0] >= 120f) - { - npc.localAI[0] = 0f; - - float projectileSpeed = death ? 9f : revenge ? 8f : 6f; - projectileSpeed += 2f * enrageScale; - - Vector2 projectileVelocity = player.Center - npc.Center; - - float radialOffset = 0.2f; - float diameter = 80f; - - projectileVelocity = projectileVelocity.SafeNormalize(Vector2.UnitY) * projectileSpeed; - - Vector2 velocity = projectileVelocity; - velocity = velocity.SafeNormalize(Vector2.UnitY); - velocity *= diameter; - - int totalProjectiles = 6; - float offsetAngle = (float)Math.PI * radialOffset; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int j = 0; j < totalProjectiles; j++) - { - float radians = j - (totalProjectiles - 1f) / 2f; - Vector2 offset = velocity.RotatedBy(offsetAngle * radians); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, projectileVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); - Main.projectile[proj].timeLeft = 300; - Main.projectile[proj].tileCollide = false; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - Main.projectile[proj].extraUpdates += 1; - } - } - - totalProjectiles = 12; - float radians2 = MathHelper.TwoPi / totalProjectiles; - type = ModContent.ProjectileType(); - damage = npc.GetProjectileDamage(type); - if (brimmy.currentMode == 4) - { - type = ModContent.ProjectileType(); - SoundEngine.PlaySound(SoundID.Item26, player.Center); - } - else - { - SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.ShellFireSound, player.Center); - } - double angleA = radians2 * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(projectileSpeed * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = npc.localAI[2] % 2f == 0f ? new Vector2(0f, -projectileSpeed) : new Vector2(-velocityX, -projectileSpeed); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float projectileVelocityToPass = projectileSpeed * 3f; - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - Main.projectile[proj].extraUpdates += 1; - } - - if (death) - { - spinningPoint = npc.localAI[2] % 2f == 0f ? new Vector2(-velocityX, -projectileSpeed) : new Vector2(0f, -projectileSpeed); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 vector255 = spinningPoint.RotatedBy(radians2 * k); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + vector255.SafeNormalize(Vector2.UnitY) * 5f, vector255 * 0.75f, type, damage, 0f, Main.myPlayer, 1f, 0f, projectileVelocityToPass); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - Main.projectile[proj].extraUpdates += 1; - } - } - } - - npc.localAI[2] += 1f; - } - - npc.velocity *= 0.95f; - npc.rotation = npc.velocity.X * 0.04f; - float playerLocation = npc.Center.X - player.Center.X; - npc.direction = playerLocation < 0f ? 1 : -1; - npc.spriteDirection = npc.direction; - - npc.ai[1] += 1f; - if (npc.ai[1] >= (death ? 240f : 300f)) - { - npc.TargetClosest(); - npc.ai[0] = -1f; - npc.ai[1] = 4f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.localAI[0] = 0f; - npc.netUpdate = true; - } - } - - // Laser beam attack - else if (npc.ai[0] == 5f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.chaseable = true; - - npc.defense = npc.defDefense * 2; - - Vector2 source = new Vector2(npc.Center.X + (npc.spriteDirection > 0 ? 34f : -34f), npc.Center.Y - 74f); - Vector2 aimAt = player.Center + player.velocity * 20f; - float aimResponsiveness = bossRush ? 0.05f : (npc.ai[2] == 1f || death) ? 0.1f : 0.25f; - - Vector2 aimVector = (aimAt - source).SafeNormalize(Vector2.UnitY); - if (aimVector.HasNaNs()) - aimVector = -Vector2.UnitY; - aimVector = (Vector2.Lerp(aimVector, npc.velocity.SafeNormalize(Vector2.UnitY), aimResponsiveness)).SafeNormalize(Vector2.UnitY); - aimVector *= 6f; - - Vector2 laserVelocity = aimVector.SafeNormalize(Vector2.UnitY); - if (laserVelocity.HasNaNs()) - laserVelocity = -Vector2.UnitY; - - calamityGlobalNPC.newAI[1] = laserVelocity.X; - calamityGlobalNPC.newAI[2] = laserVelocity.Y; - - // Rev = 190 + 165 = 355 - // Death = 165 - - npc.ai[1] += 1f; - if (npc.ai[1] >= 240f) - { - npc.TargetClosest(); - npc.ai[2] += 1f; - npc.localAI[0] = 0f; - npc.localAI[1] = 0f; - if (npc.ai[2] >= (death ? 1f : 2f)) - { - npc.ai[0] = -1f; - npc.ai[1] = 5f; - npc.ai[2] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - else - { - npc.ai[1] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - } - } - else if (npc.ai[1] >= 180f) - { - npc.velocity *= 0.95f; - if (npc.ai[1] == 180f) - { - SoundEngine.PlaySound(SoundID.Item68, source); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 laserVelocity2 = new Vector2(npc.localAI[0], npc.localAI[1]); - laserVelocity2 = laserVelocity2.SafeNormalize(Vector2.UnitY); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - - Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - if (Main.getGoodWorld) - Projectile.NewProjectile(npc.GetSource_FromAI(), source, -laserVelocity2, type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - - if (Main.zenithWorld) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(-laserVelocity2.X, laserVelocity2.Y), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(laserVelocity2.X, -laserVelocity2.Y), type, damage, 0f, Main.myPlayer, 0f, npc.whoAmI); - } - } - } - } - else - { - float playSoundTimer = 30f; - if (npc.ai[1] < 150f) - { - switch ((int)npc.ai[2]) - { - case 0: - npc.ai[1] += 0.5f; - break; - case 1: - npc.ai[1] += 1f; - playSoundTimer = 40f; - break; - } - if (death) - { - npc.ai[1] += 0.5f; - playSoundTimer += 10f; - } - } - - if (npc.ai[1] % playSoundTimer == 0f) - SoundEngine.PlaySound(SoundID.Item20, npc.Center); - - if (npc.ai[1] < 150f && calamityGlobalNPC.newAI[0] == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), source, laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); - if (Main.getGoodWorld) - Projectile.NewProjectile(npc.GetSource_FromAI(), source, -laserVelocity, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); - - if (Main.zenithWorld) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(-laserVelocity.X, laserVelocity.Y), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), source, new Vector2(laserVelocity.X, -laserVelocity.Y), ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, npc.whoAmI); - } - } - - calamityGlobalNPC.newAI[0] = 1f; - } - else - { - if (npc.ai[1] == 150f) - { - npc.localAI[0] = laserVelocity.X; - npc.localAI[1] = laserVelocity.Y; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - if (Main.getGoodWorld) - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, -npc.localAI[0], -npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - - if (Main.zenithWorld) - { - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, -npc.localAI[0], npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - Projectile.NewProjectile(npc.GetSource_FromAI(), source.X, source.Y, npc.localAI[0], -npc.localAI[1], ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 1f, npc.whoAmI); - } - } - } - } - } - } - } - } -} diff --git a/NPCs/CalamityAIs/CalamityBossAIs/BumblebirbAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/BumblebirbAI.cs deleted file mode 100644 index 15d826ab41..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/BumblebirbAI.cs +++ /dev/null @@ -1,1077 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.SulphurousSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class BumblebirbAI - { - public static void VanillaBumblebirbAI(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - // 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; - - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = npc.ai[0] == 3f || npc.ai[0] == 3.1f || npc.ai[0] == 3.2f; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - - // If target is outside the jungle for more than 5 seconds, enrage - if (!player.ZoneJungle) - { - if (npc.localAI[1] < CalamityGlobalNPC.biomeEnrageTimerMax) - npc.localAI[1] += 1f; - } - else - npc.localAI[1] = 0f; - - // If dragonfolly is off screen, enrage for the next couple attacks - if (Vector2.Distance(player.Center, npc.Center) > 1200f) - npc.localAI[2] = 2f; - - // Enrage scale - float enrageScale = death ? 1.5f : 1f; - if (npc.localAI[1] >= CalamityGlobalNPC.biomeEnrageTimerMax || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - - if (npc.localAI[2] > 0f || bossRush) - enrageScale += 1f; - - if (Main.getGoodWorld) - enrageScale += 0.5f; - - if (enrageScale > 3f) - enrageScale = 3f; - - // Despawn - if (!player.active || player.dead || Vector2.Distance(player.Center, npc.Center) > 5600f) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - - if (!player.active || player.dead || Vector2.Distance(player.Center, npc.Center) > 5600f) - { - npc.rotation = (npc.rotation * rotationMult + npc.velocity.X * rotationAmt) / 10f; - - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - npc.velocity.Y -= 0.2f; - if (npc.velocity.Y < -12f) - npc.velocity.Y = -12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - if (npc.ai[0] != 0f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - npc.ForceNetUpdate(false); - } - - return; - } - } - else if (npc.timeLeft < 1800) - npc.timeLeft = 1800; - - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; - - // Phases - bool phase2 = lifeRatio < (revenge ? 0.75f : 0.5f); - bool phase3 = lifeRatio < (death ? 0.4f : revenge ? 0.25f : 0.1f) && expertMode; - - float birbSpawnPhaseTimer = 180f; - float newPhaseTimer = 180f; - 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); - - int reducedSetDamage = (int)Math.Round(npc.defDamage * 0.5); - - if (phaseSwitchPhase) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else if (npc.velocity.X > 0f) - npc.direction = 1; - - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * rotationMult + npc.velocity.X * rotationAmt) / 10f; - - if (phase3) - { - calamityGlobalNPC.newAI[1] += 1f; - - // Sound - if (calamityGlobalNPC.newAI[1] == newPhaseTimer - 60f) - { - float squawkpitch = Main.zenithWorld ? 1.3f : 0.25f; - SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.Center); - - if (Main.zenithWorld) - { - int spacing = 20; - int amt = 5; - SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, npc.Center - Vector2.UnitY * 300f); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int i = 0; i < amt; i++) - { - Vector2 fireFrom = new Vector2(npc.Center.X + (spacing * i) - (spacing * amt / 2), npc.Center.Y - 900f); - Vector2 ai0 = npc.Center - fireFrom; - float ai = Main.rand.Next(100); - Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), npc.defDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); - } - } - } - } - - if (calamityGlobalNPC.newAI[1] >= newPhaseTimer) - { - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 1f; - calamityGlobalNPC.newAI[3] = 1f; - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.SyncExtraAI(); - npc.ForceNetUpdate(false); - } - } - else - { - calamityGlobalNPC.newAI[0] += 1f; - - // Sound - if (calamityGlobalNPC.newAI[0] == newPhaseTimer - 60f) - { - float squawkpitch = Main.zenithWorld ? 1.3f : 0.25f; - SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.Center); - - if (Main.zenithWorld) - { - int spacing = 20; - int amt = 3; - SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, npc.Center - Vector2.UnitY * 300f); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int i = 0; i < amt; i++) - { - Vector2 fireFrom = new Vector2(npc.Center.X + (spacing * i) - (spacing * amt / 2), npc.Center.Y - 900f); - Vector2 ai0 = npc.Center - fireFrom; - float ai = Main.rand.Next(100); - Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), npc.defDamage, 0f, Main.myPlayer, ai0.ToRotation(), ai); - } - } - } - } - - if (calamityGlobalNPC.newAI[0] >= newPhaseTimer) - { - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.newAI[2] = 1f; - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.SyncExtraAI(); - npc.ForceNetUpdate(false); - } - } - - Vector2 follyTargetDirection = player.Center - npc.Center; - float follyTargetDistance = 4f + follyTargetDirection.Length() / 100f; - float follyVelocityMult = 25f; - follyTargetDirection.Normalize(); - follyTargetDirection *= follyTargetDistance; - npc.velocity = (npc.velocity * (follyVelocityMult - 1f) + follyTargetDirection) / follyVelocityMult; - return; - } - - // Max spawn amount - int maxBirbs = (CalamityWorld.LegendaryMode && revenge) ? 12 : revenge ? 3 : 2; - - // Variable for charging - float chargeDistance = 600f; - if (phase2) - chargeDistance -= 50f; - if (phase3) - chargeDistance -= 50f; - chargeDistance -= (enrageScale - 1f) * 100f; - - // Phase switch - if (npc.ai[0] == 0f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.Center.X < player.Center.X - 2f) - npc.direction = 1; - if (npc.Center.X > player.Center.X + 2f) - npc.direction = -1; - - // Direction and rotation - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * rotationMult + npc.velocity.X * rotationAmt * 1.25f) / 10f; - - // Fly to target if target is too far away, otherwise get close to target and then slow down - Vector2 follyFlyTargetDirection = player.Center - npc.Center; - follyFlyTargetDirection.Y -= 200f; - if (follyFlyTargetDirection.Length() > 2800f) - { - npc.TargetClosest(); - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - else if (follyFlyTargetDirection.Length() > 240f) - { - float follyFlySpeed = 12f + (enrageScale - 1f) * 6f; - float follyFlyVelocityMult = 30f; - follyFlyTargetDirection.Normalize(); - follyFlyTargetDirection *= follyFlySpeed; - npc.velocity = (npc.velocity * (follyFlyVelocityMult - 1f) + follyFlyTargetDirection) / follyFlyVelocityMult; - } - else if (npc.velocity.Length() > 2f) - npc.velocity *= 0.95f; - else if (npc.velocity.Length() < 1f) - npc.velocity *= 1.05f; - - // Phase switch - npc.ai[1] += 1f; - if (npc.ai[1] >= 30f) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - while (npc.ai[0] == 0f) - { - if (phase2) - npc.localAI[0] += 1f; - - if (npc.localAI[0] >= (phase3 ? 7 : 9)) - { - npc.TargetClosest(); - npc.ai[0] = 5f; - npc.localAI[0] = 0f; - - // Decrease the feather variable, feathers can be used again if it's at 0 - if (npc.ai[3] > 0f) - npc.ai[3] -= 1f; - - // Decrease enraged attacks by 1 - if (npc.localAI[2] > 0f) - npc.localAI[2] -= 1f; - - // Decrease amount of attacks until able to spawn small birbs again - if (npc.localAI[3] > 0f) - npc.localAI[3] -= 1f; - } - else - { - int follyAttackPicker = phase2 ? Main.rand.Next(2) + 1 : Main.rand.Next(3); - if (phase3) - follyAttackPicker = 1; - - float featherVelocity = 2f + (enrageScale - 1f); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - - if (follyAttackPicker == 0 && npc.localAI[3] == 0f) - { - npc.TargetClosest(); - npc.ai[0] = 2f; - - // Decrease the feather variable, feathers can be used again if it's at 0 - if (npc.ai[3] > 0f) - npc.ai[3] -= 1f; - - // Decrease enraged attacks by 1 - if (npc.localAI[2] > 0f) - npc.localAI[2] -= 1f; - - // Birb will do at least 1 different attack before entering this phase again - npc.localAI[3] = 1f; - } - else if (follyAttackPicker == 1) - { - npc.TargetClosest(); - npc.ai[0] = 3f; - - // Decrease enraged attacks by 1 - if (npc.localAI[2] > 0f) - npc.localAI[2] -= 1f; - - // Decrease amount of attacks until able to use other attacks again - if (npc.localAI[3] > 0f) - npc.localAI[3] -= 1f; - - if (phase2 && npc.ai[3] == 0f) - { - npc.ai[3] = 3f; - SoundEngine.PlaySound(SoundID.Item102, player.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int totalProjectiles = 40; - float radians = MathHelper.TwoPi / totalProjectiles; - int distance = 800; - bool spawnRight = player.velocity.X > 0f; - for (int i = 0; i < totalProjectiles; i++) - { - if (Main.getGoodWorld) - { - if (i >= (int)(totalProjectiles * 0.125) && i <= (int)(totalProjectiles * 0.375)) - { - Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; - Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - if (i >= (int)(totalProjectiles * 0.625) && i <= (int)(totalProjectiles * 0.875)) - { - Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; - Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - } - else - { - if (spawnRight) - { - if (i >= (int)(totalProjectiles * 0.125) && i <= (int)(totalProjectiles * 0.375)) - { - Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; - Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - } - else - { - if (i >= (int)(totalProjectiles * 0.625) && i <= (int)(totalProjectiles * 0.875)) - { - Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; - Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - } - } - else - { - // Decrease the feather variable, feathers can be used again if it's at 0 - if (npc.ai[3] > 0f) - npc.ai[3] -= 1f; - } - } - else if (NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && npc.localAI[3] == 0f) - { - npc.TargetClosest(); - npc.ai[0] = 4f; - - // Birb will do at least 2 different attacks before entering this phase again - npc.localAI[3] = 2f; - - // Decrease enraged attacks by 1 - if (npc.localAI[2] > 0f) - npc.localAI[2] -= 1f; - - if (npc.ai[3] == 0f) - { - npc.ai[3] = 3f; - SoundEngine.PlaySound(SoundID.Item102, player.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int totalProjectiles = phase2 ? 40 : 48; - - if (Main.getGoodWorld) - totalProjectiles *= 2; - - float radians = MathHelper.TwoPi / totalProjectiles; - int distance = phase2 ? 1200 : 1320; - - if (Main.getGoodWorld) - distance *= 2; - - bool spawnRight = player.velocity.X > 0f; - for (int i = 0; i < totalProjectiles; i++) - { - if (spawnRight) - { - if (i >= totalProjectiles / 2) - break; - - Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; - Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - else - { - if (i >= totalProjectiles / 2) - { - Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -featherVelocity).RotatedBy(radians * i)) * distance; - Vector2 velocity = Vector2.Normalize(player.Center - spawnVector) * featherVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - } - else - { - // Decrease the feather variable, feathers can be used again if it's at 0 - if (npc.ai[3] > 0f) - npc.ai[3] -= 1f; - } - } - } - } - - npc.ForceNetUpdate(false); - npc.SyncExtraAI(); - } - } - - // Fly to target - else if (npc.ai[0] == 1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else if (npc.velocity.X > 0f) - npc.direction = 1; - - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * rotationMult + npc.velocity.X * rotationAmt) / 10f; - - Vector2 follyTargetDirection = player.Center - npc.Center; - if (follyTargetDirection.Length() < 800f) - { - npc.TargetClosest(); - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - npc.ForceNetUpdate(false); - npc.SyncExtraAI(); - } - - float velocity = 14f + (enrageScale - 1f) * 4f; - float follyTargetDistance = velocity + follyTargetDirection.Length() / 100f; - float follyVelocityMult = 25f; - follyTargetDirection.Normalize(); - follyTargetDirection *= follyTargetDistance; - npc.velocity = (npc.velocity * (follyVelocityMult - 1f) + follyTargetDirection) / follyVelocityMult; - } - - // Fly towards target quickly - else if (npc.ai[0] == 2f) - { - // Set reduced damage - npc.damage = reducedSetDamage; - - if (npc.target < 0 || !player.active || player.dead) - { - npc.TargetClosest(); - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - npc.ForceNetUpdate(false); - npc.SyncExtraAI(); - } - - if (player.Center.X - 10f < npc.Center.X) - npc.direction = -1; - else if (player.Center.X + 10f > npc.Center.X) - npc.direction = 1; - - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * rotationMult * 0.5f + npc.velocity.X * rotationAmt * 1.25f) / 5f; - - Vector2 follyQuickFlyTargetDirection = player.Center - npc.Center; - follyQuickFlyTargetDirection.Y -= 20f; - npc.ai[2] += 0.0222222228f; - if (expertMode) - npc.ai[2] += 0.0166666675f; - - float velocity = 8f + (enrageScale - 1f) * 2f; - float follyQuickFlySpeed = velocity + npc.ai[2] + follyQuickFlyTargetDirection.Length() / 120f; - if (CalamityWorld.LegendaryMode && revenge) - follyQuickFlySpeed *= 2f; - - float follyQuickFlyVelMult = 20f; - follyQuickFlyTargetDirection.Normalize(); - follyQuickFlyTargetDirection *= follyQuickFlySpeed; - npc.velocity = (npc.velocity * (follyQuickFlyVelMult - 1f) + follyQuickFlyTargetDirection) / follyQuickFlyVelMult; - - npc.ai[1] += 1f; - if (npc.ai[1] >= ((CalamityWorld.LegendaryMode && revenge) ? 90f : 180f)) - { - npc.TargetClosest(); - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - npc.ForceNetUpdate(false); - npc.SyncExtraAI(); - } - } - - // Line up charge - else if (npc.ai[0] == 3f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else - npc.direction = 1; - - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * rotationMult * 0.5f + npc.velocity.X * rotationAmt * 0.85f) / 5f; - - Vector2 follyLineUpTargetDirection = player.Center - npc.Center; - follyLineUpTargetDirection.Y -= 12f; - if (npc.Center.X > player.Center.X) - follyLineUpTargetDirection.X += chargeDistance; - else - follyLineUpTargetDirection.X -= chargeDistance; - - float verticalDistanceGateValue = (phase3 ? 100f : 20f) + (enrageScale - 1f) * 20f; - if (Math.Abs(npc.Center.X - player.Center.X) > chargeDistance - 50f && Math.Abs(npc.Center.Y - player.Center.Y) < verticalDistanceGateValue) - { - npc.ai[0] = 3.1f; - npc.ai[1] = 0f; - - npc.ForceNetUpdate(false); - npc.SyncExtraAI(); - } - - npc.ai[1] += 0.0333333351f; - float velocity = 16f + (enrageScale - 1f) * 4f; - float follyLineUpSpeed = velocity + npc.ai[1]; - float follyLineUpVelMult = 4f; - follyLineUpTargetDirection.Normalize(); - follyLineUpTargetDirection *= follyLineUpSpeed; - npc.velocity = (npc.velocity * (follyLineUpVelMult - 1f) + follyLineUpTargetDirection) / follyLineUpVelMult; - } - - // Prepare to charge - else if (npc.ai[0] == 3.1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.rotation = (npc.rotation * rotationMult * 0.5f + npc.velocity.X * rotationAmt * 0.85f) / 5f; - - Vector2 follyChargePrepareTargetDirection = player.Center - npc.Center; - follyChargePrepareTargetDirection.Y -= 12f; - float follyChargePrepareSpeed = 28f + (enrageScale - 1f) * 4f; - float follyChargePrepareVelMult = 8f; - follyChargePrepareTargetDirection.Normalize(); - follyChargePrepareTargetDirection *= follyChargePrepareSpeed; - npc.velocity = (npc.velocity * (follyChargePrepareVelMult - 1f) + follyChargePrepareTargetDirection) / follyChargePrepareVelMult; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else - npc.direction = 1; - - npc.spriteDirection = npc.direction; - - npc.ai[1] += 1f; - if (npc.ai[1] > 10f) - { - // Set damage - npc.damage = npc.defDamage; - - npc.velocity = follyChargePrepareTargetDirection; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else - npc.direction = 1; - - npc.ai[0] = 3.2f; - npc.ai[1] = npc.direction; - - npc.ForceNetUpdate(false); - npc.SyncExtraAI(); - } - } - - // Charge - else if (npc.ai[0] == 3.2f) - { - // Set damage - npc.damage = npc.defDamage; - - npc.ai[2] += 0.0333333351f; - float velocity = 28f + (enrageScale - 1f) * 4f; - npc.velocity.X = (velocity + npc.ai[2]) * npc.ai[1]; - - if ((npc.ai[1] > 0f && npc.Center.X > player.Center.X + (chargeDistance - 140f)) || (npc.ai[1] < 0f && npc.Center.X < player.Center.X - (chargeDistance - 140f))) - { - if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.TargetClosest(); - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ForceNetUpdate(false); - } - else if (Math.Abs(npc.Center.X - player.Center.X) > chargeDistance + 200f) - { - npc.TargetClosest(); - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ForceNetUpdate(false); - } - } - - npc.rotation = (npc.rotation * rotationMult * 0.5f + npc.velocity.X * rotationAmt * 0.85f) / 5f; - } - - // Birb spawn - else if (npc.ai[0] == 4f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.ai[1] == 0f) - { - Vector2 destination2 = player.Center + new Vector2(0f, -200f); - Vector2 desiredVelocity2 = npc.SafeDirectionTo(destination2, -Vector2.UnitY) * 18f; - npc.SimpleFlyMovement(desiredVelocity2, 1.5f); - - if (npc.velocity.X < 0f) - npc.direction = -1; - else - npc.direction = 1; - - npc.spriteDirection = npc.direction; - - npc.ai[2] += 1f; - if (npc.Distance(player.Center) < 600f || npc.ai[2] >= 180f) - { - npc.ai[1] = 1f; - npc.ForceNetUpdate(false); - } - } - else - { - if (npc.ai[1] < 90f) - npc.velocity *= 0.95f; - else - npc.velocity *= 0.98f; - - if (npc.ai[1] == 90f) - { - if (npc.velocity.Y > 0f) - npc.velocity.Y /= 3f; - - npc.velocity.Y -= 3f; - } - - // Sound - if (npc.ai[1] == birbSpawnPhaseTimer - 60f) - { - float squawkpitch = Main.zenithWorld ? 1.3f : 0.25f; - SoundEngine.PlaySound(SoundID.DD2_BetsyScream with { Pitch = squawkpitch }, npc.Center); - - if (Main.zenithWorld) - { - int spacing = 30; - int amt = 3; - SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, npc.Center - Vector2.UnitY * 300f); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int i = 0; i < amt; i++) - { - Vector2 fireFrom = new Vector2(npc.Center.X + (spacing * i) - (spacing * amt / 2), npc.Center.Y - 900f); - Vector2 ai0 = npc.Center - fireFrom; - float ai = Main.rand.Next(100); - Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), npc.damage, 0f, Main.myPlayer, ai0.ToRotation(), ai); - } - } - } - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - bool gfbSpawnFlag = CalamityWorld.LegendaryMode && revenge && (npc.ai[1] == 145f || npc.ai[1] == 150f || npc.ai[1] == 160f || npc.ai[1] == 165f); - bool spawnFlag = NPC.CountNPCS(ModContent.NPCType()) < maxBirbs && (npc.ai[1] == 140f || (revenge && npc.ai[1] == 155f) || npc.ai[1] == 170f || gfbSpawnFlag); - if (spawnFlag) - { - Vector2 follySpawnCenter = npc.Center + (MathHelper.TwoPi * Main.rand.NextFloat()).ToRotationVector2() * new Vector2(2f, 1f) * 50f * (0.6f + Main.rand.NextFloat() * 0.4f); - if (Vector2.Distance(follySpawnCenter, player.Center) > 150f) - NPC.NewNPC(npc.GetSource_FromAI(), (int)follySpawnCenter.X, (int)follySpawnCenter.Y, ModContent.NPCType(), npc.whoAmI); - - npc.ForceNetUpdate(false); - } - } - - npc.ai[1] += 1f; - } - - if (npc.ai[1] >= birbSpawnPhaseTimer) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.TargetClosest(); - npc.ForceNetUpdate(false); - } - } - - // Spit homing aura sphere - else if (npc.ai[0] == 5f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - npc.velocity *= 0.98f; - npc.rotation = (npc.rotation * rotationMult + npc.velocity.X * rotationAmt) / 10f; - - // Play sound - float aiGateValue = 120f; - if (npc.ai[1] == aiGateValue - 30f) - { - SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, npc.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 follySpawnCenter = npc.rotation.ToRotationVector2() * (Vector2.UnitX * npc.direction) * (npc.width + 20) / 2f + npc.Center; - float ai0 = (phase3 ? 2f : 0f) + (enrageScale - 1f); - if (ai0 > 3f) - ai0 = 3f; - - Projectile.NewProjectile(npc.GetSource_FromAI(), follySpawnCenter.X, follySpawnCenter.Y, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, ai0, npc.target + 1); - npc.ForceNetUpdate(false); - } - - if (Main.zenithWorld) - { - int spacing = 30; - int amt = 3; - SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, npc.Center - Vector2.UnitY * 300f); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int i = 0; i < amt; i++) - { - Vector2 fireFrom = new Vector2(npc.Center.X + (spacing * i) - (spacing * amt / 2), npc.Center.Y - 900f); - Vector2 ai0 = npc.Center - fireFrom; - float ai = Main.rand.Next(100); - Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), npc.damage, 0f, Main.myPlayer, ai0.ToRotation(), ai); - } - } - } - } - - npc.ai[1] += 1f; - if (npc.ai[1] >= aiGateValue) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ForceNetUpdate(false); - } - } - } - - public static void VanillaBumblebirb2AI(NPC npc, Mod mod, bool bossMinion) - { - Player player = Main.player[npc.target]; - - float rotationMult = 4f; - float rotationAmt = 0.04f; - - if (Vector2.Distance(player.Center, npc.Center) > 5600f) - { - if (npc.timeLeft > 5) - npc.timeLeft = 5; - } - - npc.rotation = (npc.rotation * rotationMult + npc.velocity.X * rotationAmt * 1.25f) / 10f; - - if (npc.ai[0] == 0f || npc.ai[0] == 1f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type) - { - Vector2 otherSwarmerDirection = Main.npc[i].Center - npc.Center; - if (otherSwarmerDirection.Length() < (npc.width + npc.height)) - { - otherSwarmerDirection.Normalize(); - otherSwarmerDirection *= -0.1f; - npc.velocity += otherSwarmerDirection; - NPC nPC6 = Main.npc[i]; - nPC6.velocity -= otherSwarmerDirection; - } - } - } - } - - if (npc.target < 0 || Main.player[npc.target].dead || !Main.player[npc.target].active) - { - npc.TargetClosest(true); - Vector2 swarmerTargetDist = Main.player[npc.target].Center - npc.Center; - if (Main.player[npc.target].dead || swarmerTargetDist.Length() > (bossMinion ? 5600f : 2800f)) - npc.ai[0] = -1f; - } - else - { - Vector2 swarmerCatchUpTargetDist = Main.player[npc.target].Center - npc.Center; - if (npc.ai[0] > 1f && swarmerCatchUpTargetDist.Length() > 3600f) - npc.ai[0] = 1f; - } - - if (npc.ai[0] == -1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - Vector2 swarmerDespawnVelMult = new Vector2(0f, -8f); - npc.velocity = (npc.velocity * 21f + swarmerDespawnVelMult) / 10f; - return; - } - - if (npc.ai[0] == 0f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.TargetClosest(true); - npc.spriteDirection = npc.direction; - - Vector2 swarmerIdleTargetDist = Main.player[npc.target].Center - npc.Center; - if (swarmerIdleTargetDist.Length() > 2800f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - else if (swarmerIdleTargetDist.Length() > 400f) - { - float swarmerIdleSpeed = (bossMinion ? 9f : 7f) + swarmerIdleTargetDist.Length() / 100f + npc.ai[1] / 15f; - swarmerIdleTargetDist.Normalize(); - swarmerIdleTargetDist *= swarmerIdleSpeed; - npc.velocity = (npc.velocity * 29f + swarmerIdleTargetDist) / 30f; - if (Main.getGoodWorld && !Main.zenithWorld) - npc.velocity *= 1.15f; - } - else if (npc.velocity.Length() > 2f) - npc.velocity *= 0.95f; - else if (npc.velocity.Length() < 1f) - npc.velocity *= 1.05f; - - npc.ai[1] += 1f; - if (npc.ai[1] >= (bossMinion ? 90f : 105f)) - { - npc.ai[1] = 0f; - npc.ai[0] = 2f; - } - } - else - { - if (npc.ai[0] == 1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.target < 0 || !Main.player[npc.target].active || Main.player[npc.target].dead) - npc.TargetClosest(true); - - if (npc.velocity.X < 0f) - npc.direction = -1; - else if (npc.velocity.X > 0f) - npc.direction = 1; - - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * rotationMult + npc.velocity.X * rotationAmt) / 10f; - - Vector2 swarmerChargeTargetDist = Main.player[npc.target].Center - npc.Center; - if (swarmerChargeTargetDist.Length() < 800f && !Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - } - - npc.ai[2] += 0.0166666675f; - float swarmerChargeSpeed = (bossMinion ? 12f : 9f) + npc.ai[2] + swarmerChargeTargetDist.Length() / 150f; - float swarmerChargeVelMult = 25f; - swarmerChargeTargetDist.Normalize(); - swarmerChargeTargetDist *= swarmerChargeSpeed; - npc.velocity = (npc.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; - if (Main.getGoodWorld && !Main.zenithWorld) - npc.velocity *= 1.15f; - - npc.ForceNetUpdate(); - - return; - } - - if (npc.ai[0] == 2f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else if (npc.velocity.X > 0f) - npc.direction = 1; - - npc.spriteDirection = npc.direction; - npc.rotation = (npc.rotation * rotationMult * 0.75f + npc.velocity.X * rotationAmt * 1.25f) / 8f; - - Vector2 swarmerDecelerateTargetDist = Main.player[npc.target].Center - npc.Center; - swarmerDecelerateTargetDist.Y -= 8f; - float swarmerDecelerateSpeed = bossMinion ? 18f : 14f; - float swarmerDecelerateVelMult = 8f; - swarmerDecelerateTargetDist.Normalize(); - swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; - npc.velocity = (npc.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; - if (Main.getGoodWorld && !Main.zenithWorld) - npc.velocity *= 1.15f; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else - npc.direction = 1; - - npc.spriteDirection = npc.direction; - - npc.ai[1] += 1f; - if (npc.ai[1] > 10f) - { - // Set damage - npc.damage = npc.defDamage; - - npc.velocity = swarmerDecelerateTargetDist; - if (Main.getGoodWorld && !Main.zenithWorld) - npc.velocity *= 1.15f; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else - npc.direction = 1; - - npc.ai[0] = 2.1f; - npc.ai[1] = 0f; - } - } - else if (npc.ai[0] == 2.1f) - { - // Set damage - npc.damage = npc.defDamage; - - if (npc.velocity.X < 0f) - npc.direction = -1; - else if (npc.velocity.X > 0f) - npc.direction = 1; - - npc.spriteDirection = npc.direction; - - npc.velocity *= 1.01f; - - npc.ai[1] += 1f; - if (npc.ai[1] > 30f) - { - if (!Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - return; - } - - if (npc.ai[1] > 60f) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - } - } - } - } - } -} diff --git a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs deleted file mode 100644 index 7dfb5557da..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/CalamitasCloneAI.cs +++ /dev/null @@ -1,1405 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.CalClone; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using ReLogic.Utilities; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class CalamitasCloneAI - { - public static void VanillaCalamitasCloneAI(NPC npc, Mod mod, SlotId warn) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - // Emit light - 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; - - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; - - // Phases - bool phase2 = lifeRatio < 0.7f || death; - bool phase3 = lifeRatio < 0.35f; - bool phase4 = lifeRatio <= 0.1f && death; - - // Don't take damage during bullet hells - npc.dontTakeDamage = calamityGlobalNPC.newAI[2] > 0f; - - // Variable for live brothers - bool brotherAlive = false; - - // For seekers - CalamityGlobalNPC.calamitas = npc.whoAmI; - - // Seeker ring - if (calamityGlobalNPC.newAI[1] == 0f && phase3 && expertMode) - { - SoundEngine.PlaySound(SoundID.Item72, npc.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int seekerAmt = death ? 10 : 5; - int seekerSpread = 360 / seekerAmt; - int seekerDistance = death ? 180 : 150; - for (int i = 0; i < seekerAmt; i++) - { - int spawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * seekerSpread) * seekerDistance)), (int)(npc.Center.Y + (Math.Cos(i * seekerSpread) * seekerDistance)), ModContent.NPCType(), npc.whoAmI, 0, 0, 0, -1); - Main.npc[spawn].ai[0] = i * seekerSpread; - } - } - - string key = "Mods.CalamityMod.Status.Boss.CalamitasBossText3"; - Color messageColor = Color.Orange; - CalamityUtils.DisplayLocalizedText(key, messageColor); - - calamityGlobalNPC.newAI[1] = 1f; - } - - // CIT 14SEP2024: Fixed bug where her phases would get offset by dealing a large amount of damage in a single hit to take her into a new phase. - // newAI[0] now starts at 1 and has 0.3 subtracted from it for each phase, instead of it storing her current health when she enters a new phase. - - // Do bullet hell or spawn brothers - if (calamityGlobalNPC.newAI[0] == 0f && npc.life > 0) - calamityGlobalNPC.newAI[0] = 1f; - - // Bullet hells at 70% and 10%, brothers at 40% - if (npc.life > 0) - { - int calClonePhaseThreshold = (int)(npc.lifeMax * 0.3); - if (((npc.life + calClonePhaseThreshold) / (float)npc.lifeMax) < calamityGlobalNPC.newAI[0]) - { - calamityGlobalNPC.newAI[0] -= 0.3f; - if (calamityGlobalNPC.newAI[0] <= 0.1f) - { - SoundEngine.PlaySound(SoundID.Item109, npc.Center); - calamityGlobalNPC.newAI[2] = 2f; - - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - calamityGlobalNPC.newAI[3] = 0f; - - SpawnDust(); - } - else if (calamityGlobalNPC.newAI[0] <= 0.4f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.position.Y + npc.height, ModContent.NPCType(), npc.whoAmI); - } - - string key = "Mods.CalamityMod.Status.Boss.CalamitasBossText2"; - Color messageColor = Color.Orange; - CalamityUtils.DisplayLocalizedText(key, messageColor); - - SpawnDust(); - } - else - { - SoundEngine.PlaySound(SoundID.Item109, npc.Center); - calamityGlobalNPC.newAI[2] = 1f; - - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - calamityGlobalNPC.newAI[3] = 0f; - - SpawnDust(); - } - } - } - - // Immunity if brothers are alive - if (CalamityGlobalNPC.cataclysm != -1) - { - if (Main.npc[CalamityGlobalNPC.cataclysm].active) - brotherAlive = true; - } - if (CalamityGlobalNPC.catastrophe != -1) - { - if (Main.npc[CalamityGlobalNPC.catastrophe].active) - brotherAlive = true; - } - - if (brotherAlive) - npc.dontTakeDamage = true; - - void SpawnDust() - { - int dustAmt = 50; - int random = 3; - - for (int j = 0; j < 10; j++) - { - random += j; - int dustAmtSpawned = 0; - int scale = random * 6; - float dustPositionX = npc.Center.X - (scale / 2); - float dustPositionY = npc.Center.Y - (scale / 2); - while (dustAmtSpawned < dustAmt) - { - float dustVelocityX = Main.rand.Next(-random, random); - float dustVelocityY = Main.rand.Next(-random, random); - float dustVelocityScalar = random * 2f; - float dustVelocity = (float)Math.Sqrt(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY); - dustVelocity = dustVelocityScalar / dustVelocity; - dustVelocityX *= dustVelocity; - dustVelocityY *= dustVelocity; - int dust = Dust.NewDust(new Vector2(dustPositionX, dustPositionY), scale, scale, (int)CalamityDusts.Brimstone, 0f, 0f, 100, default, 2f); - Main.dust[dust].noGravity = true; - Main.dust[dust].position.X = npc.Center.X; - Main.dust[dust].position.Y = npc.Center.Y; - Main.dust[dust].position.X += Main.rand.Next(-10, 11); - Main.dust[dust].position.Y += Main.rand.Next(-10, 11); - Main.dust[dust].velocity.X = dustVelocityX; - Main.dust[dust].velocity.Y = dustVelocityY; - dustAmtSpawned++; - } - } - } - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - // Target variable - Player player = Main.player[npc.target]; - - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - - // Rotation - Vector2 npcCenter = new Vector2(npc.Center.X, npc.position.Y + npc.height - 59f); - Vector2 lookAt = new Vector2(player.position.X - (player.width / 2), player.position.Y - (player.height / 2)); - Vector2 rotationVector = npcCenter - lookAt; - - // Boss Rush predictive charge rotation - if (npc.ai[1] == 4f && phase4 && bossRush) - { - // Velocity - float chargeVelocity = 30f; - chargeVelocity += 5f * enrageScale; - lookAt += Main.player[npc.target].velocity * 20f; - rotationVector = Vector2.Normalize(npcCenter - lookAt) * chargeVelocity; - } - - float rotation = (float)Math.Atan2(rotationVector.Y, rotationVector.X) + MathHelper.PiOver2; - if (rotation < 0f) - rotation += MathHelper.TwoPi; - else if (rotation > MathHelper.TwoPi) - rotation -= MathHelper.TwoPi; - - float rotationAmt = 0.1f; - if (npc.rotation < rotation) - { - if ((rotation - npc.rotation) > MathHelper.Pi) - npc.rotation -= rotationAmt; - else - npc.rotation += rotationAmt; - } - else if (npc.rotation > rotation) - { - if ((npc.rotation - rotation) > MathHelper.Pi) - npc.rotation += rotationAmt; - else - npc.rotation -= rotationAmt; - } - - if (npc.rotation > rotation - rotationAmt && npc.rotation < rotation + rotationAmt) - npc.rotation = rotation; - if (npc.rotation < 0f) - npc.rotation += MathHelper.TwoPi; - else if (npc.rotation > MathHelper.TwoPi) - npc.rotation -= MathHelper.TwoPi; - if (npc.rotation > rotation - rotationAmt && npc.rotation < rotation + rotationAmt) - npc.rotation = rotation; - - // Despawn - if (!player.active || player.dead) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead) - { - if (SoundEngine.TryGetActiveSound(warn, out var warningSound) && warningSound.IsPlaying) - warningSound.Stop(); - - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - npc.velocity.Y -= 0.1f; - if (npc.velocity.Y < -12f) - npc.velocity.Y = -12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - if (npc.ai[1] != 0f) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - npc.alpha = 0; - npc.netUpdate = true; - } - return; - } - } - else if (npc.timeLeft < 1800) - npc.timeLeft = 1800; - - // Distance from destination where Cal Clone stops moving - float movementDistanceGateValue = 100f; - - // How fast Cal Clone moves to the destination - float baseVelocity = (expertMode ? 10f : 8.5f) * (npc.ai[1] == 4f ? 1.4f : 1f); - float baseAcceleration = (expertMode ? 0.18f : 0.155f) * (npc.ai[1] == 4f ? 1.4f : 1f); - baseVelocity += 4f * enrageScale; - baseAcceleration += 0.1f * enrageScale; - if (revenge) - { - baseVelocity += 1.5f * (1f - lifeRatio); - baseAcceleration += 0.03f * (1f - lifeRatio); - } - if (death) - { - baseVelocity += 1.5f * (1f - lifeRatio); - baseAcceleration += 0.03f * (1f - lifeRatio); - } - if (Main.getGoodWorld) - { - baseVelocity *= 1.15f; - baseAcceleration *= 1.15f; - } - - // What side Cal Clone should be on, relative to the target - int xPos = 1; - if (npc.Center.X < player.Center.X) - xPos = -1; - - // How far Cal Clone should be from the target - float averageDistance = 500f; - float chargeDistance = phase4 ? 300f : 400f; - - // This is where Cal Clone should be - Vector2 destination = (calamityGlobalNPC.newAI[2] > 0f || npc.ai[1] == 0f) ? new Vector2(player.Center.X, player.Center.Y - averageDistance) : - npc.ai[1] == 1f ? new Vector2(player.Center.X + averageDistance * xPos, player.Center.Y) : - new Vector2(player.Center.X + chargeDistance * xPos, player.Center.Y); - - // Add some random distance to the destination after certain attacks - if (npc.localAI[0] == 1f) - { - npc.localAI[0] = 0f; - npc.localAI[2] = Main.rand.Next(-50, 51); - npc.localAI[3] = Main.rand.Next(-300, 301); - npc.netUpdate = true; - } - - // Add a bit of randomness to the destination - if (death) - { - destination.X += npc.ai[1] == 0f ? npc.localAI[3] : npc.localAI[2]; - destination.Y += npc.ai[1] == 0f ? npc.localAI[2] : npc.localAI[3]; - } - - // How far Cal Clone is from where she's supposed to be - Vector2 distanceFromDestination = destination - npc.Center; - - // Movement - if (npc.ai[1] == 0f || npc.ai[1] == 1f || npc.ai[1] == 4f || calamityGlobalNPC.newAI[2] > 0f) - CalamityUtils.SmoothMovement(npc, movementDistanceGateValue, distanceFromDestination, baseVelocity, baseAcceleration, true); - - // Bullet hell phase - if (calamityGlobalNPC.newAI[2] > 0f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (calamityGlobalNPC.newAI[3] < 900f) - { - calamityGlobalNPC.newAI[3] += 1f; - npc.dontTakeDamage = true; - npc.alpha = 255; - - float rotX = player.Center.X - npc.Center.X; - float rotY = player.Center.Y - npc.Center.Y; - npc.rotation = (float)Math.Atan2(rotY, rotX) - MathHelper.PiOver2; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (calamityGlobalNPC.newAI[2] == 2f) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - if (Main.zenithWorld) - type = ModContent.ProjectileType(); - - float gigaBlastFrequency = (Main.getGoodWorld ? 120f : expertMode ? 180f : 240f) - enrageScale * 15f; - float projSpeed = bossRush ? 6.25f : 5f; - if (calamityGlobalNPC.newAI[3] <= 300f) - { - if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); - } - else if (calamityGlobalNPC.newAI[3] <= 600f && calamityGlobalNPC.newAI[3] > 300f) - { - if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from right - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -projSpeed, 0f, type, damage, 0f, Main.myPlayer); - } - else if (calamityGlobalNPC.newAI[3] > 600f) - { - if (calamityGlobalNPC.newAI[3] % gigaBlastFrequency == 0f) // Blasts from top - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer); - } - } - } - - npc.ai[0] += 1f; - float hellblastGateValue = (expertMode ? 12f : 16f) - enrageScale; - if (npc.ai[0] >= hellblastGateValue) - { - npc.ai[0] = 0f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float projSpeed = bossRush ? 4.5f : 4f; - if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) - { - float distance = Main.rand.NextBool() ? -1000f : 1000f; - float velocity = distance == -1000f ? projSpeed : -projSpeed; - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - - if (calamityGlobalNPC.newAI[3] < 300f) // Blasts from above - { - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - else if (calamityGlobalNPC.newAI[3] < 600f) // Blasts from left and right - { - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 0.5f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 0.5f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - else // Blasts from above, left, and right - { - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed - 1f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 1f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 1f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - } - } - - if (calamityGlobalNPC.newAI[3] == 900f - 360f) - warn = SoundEngine.PlaySound(CalamitasClone.BulletHellWarning, player.Center); - if (calamityGlobalNPC.newAI[3] > 900f - 360f) - { - if (SoundEngine.TryGetActiveSound(warn, out var warningSound) && warningSound.IsPlaying) - warningSound.Position = player.Center; - } - } - else - { - npc.ai[0] = 0f; - npc.ai[3] = 0f; - npc.localAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - SoundEngine.PlaySound(CalamitasClone.BulletHellEnd, player.Center); - - // Prevent bullshit charge hits when second bullet hell ends. - if (phase4) - { - npc.ai[1] = 4f; - npc.ai[2] = -105f; - npc.TargetClosest(); - } - else - { - if (death) - { - int AIState = Main.rand.Next(3); - switch (AIState) - { - case 0: - npc.ai[1] = 0f; - npc.ai[2] = 0f; - break; - case 1: - npc.ai[1] = 1f; - npc.ai[2] = 0f; - break; - case 2: - npc.ai[1] = 4f; - npc.ai[2] = -105f; - npc.TargetClosest(); - break; - } - } - else - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - if (death) - npc.localAI[0] = 1f; - } - - npc.netUpdate = true; - - for (int x = 0; x < Main.maxProjectiles; x++) - { - Projectile projectile = Main.projectile[x]; - if (projectile.active) - { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) - { - if (projectile.timeLeft > 60) - projectile.timeLeft = 60; - } - else if (projectile.type == ModContent.ProjectileType()) - { - projectile.ai[2] = 1f; - - if (projectile.timeLeft > 60) - projectile.timeLeft = 60; - } - } - } - } - - return; - } - else if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) - { - if (calamityGlobalNPC.newAI[3] < 900f) - calamityGlobalNPC.newAI[3] += 1f; - else - calamityGlobalNPC.newAI[3] = 0f; - - npc.ai[0] += 1f; - float hellblastGateValue = 30f - enrageScale; - if (npc.ai[0] >= hellblastGateValue) - { - npc.ai[0] = 0f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - float projSpeed = bossRush ? 5f : 4f; - if (calamityGlobalNPC.newAI[3] % (hellblastGateValue * 6f) == 0f) - { - float distance = Main.rand.NextBool() ? -1000f : 1000f; - float velocity = distance == -1000f ? projSpeed : -projSpeed; - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - - if (calamityGlobalNPC.newAI[3] < 300f) // Blasts from above - { - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - else if (calamityGlobalNPC.newAI[3] < 600f) // Blasts from left and right - { - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 0.5f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 0.5f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - else // Blasts from above, left, and right - { - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, projSpeed - 1f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -(projSpeed - 1f), 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - Projectile.NewProjectile(npc.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), projSpeed - 1f, 0f, type, damage, 0f, Main.myPlayer, 2f, 0f); - } - } - } - } - - npc.alpha = npc.dontTakeDamage ? 255 : 0; - - // Float above target and fire hellfireballs - if (npc.ai[1] == 0f) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.ai[2] += 1f; - float phaseTimer = 400f - (death ? 120f * (1f - lifeRatio) : 0f); - if (npc.ai[2] >= phaseTimer || phase4) - { - if (death && !phase4 && Main.rand.NextBool() && !brotherAlive) - npc.ai[1] = 4f; - else - npc.ai[1] = 1f; - - npc.ai[2] = 0f; - if (death) - npc.localAI[0] = 1f; - - npc.netUpdate = true; - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[1] += 1f; - if (!brotherAlive) - { - if (expertMode) - npc.localAI[1] += death ? 2f * (1f - lifeRatio) : 1f - lifeRatio; - if (revenge) - npc.localAI[1] += 0.5f; - } - - if (npc.localAI[1] >= (brotherAlive ? 180f : 120f)) - { - npc.localAI[1] = 0f; - SoundEngine.PlaySound(BrimstoneElemental.BrimstoneElemental.HellfireballSound, npc.Center); - - float projectileVelocity = expertMode ? 14f : 12.5f; - projectileVelocity += 3f * enrageScale; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - bool shootPredictiveShot = CalamityWorld.LegendaryMode && CalamityWorld.revenge && Main.rand.NextBool(); - Vector2 predictionVector = shootPredictiveShot ? player.velocity * 20f : Vector2.Zero; - Vector2 fireballVelocity = Vector2.Normalize(player.Center + predictionVector - npc.Center) * projectileVelocity; - Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); - Main.projectile[proj].netUpdate = true; - } - } - } - - // Float to the side of the target and fire - else if (npc.ai[1] == 1f) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[1] += 1f; - if (!brotherAlive) - { - if (revenge) - npc.localAI[1] += 0.5f; - if (expertMode) - npc.localAI[1] += 0.5f; - } - - if (npc.localAI[1] >= (brotherAlive ? 75f : 50f) && Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - npc.localAI[1] = 0f; - - float projectileVelocity = expertMode ? 12.5f : 11f; - projectileVelocity += 3f * enrageScale; - int type = brotherAlive ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 fireballVelocity = Vector2.Normalize(player.Center - npc.Center) * projectileVelocity; - Vector2 offset = Vector2.Normalize(fireballVelocity) * 40f; - - if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) - { - type = ModContent.ProjectileType(); - damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y); - } - else - { - float ai0 = type == ModContent.ProjectileType() ? 1f : player.position.X; - float ai1 = type == ModContent.ProjectileType() ? 0f : player.position.Y; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + offset, fireballVelocity, type, damage, 0f, Main.myPlayer, ai0, ai1); - } - } - } - - npc.ai[2] += 1f; - float phaseTimer = 240f - (death ? 60f * (1f - lifeRatio) : 0f); - if (npc.ai[2] >= phaseTimer || phase4) - { - if (death && !phase4 && Main.rand.NextBool() && !brotherAlive) - npc.ai[1] = 0f; - else - npc.ai[1] = !brotherAlive && phase2 && revenge ? 4f : 0f; - - npc.ai[2] = 0f; - if (death) - npc.localAI[0] = 1f; - - npc.netUpdate = true; - } - } - else if (npc.ai[1] == 2f) - { - // Set damage - npc.damage = npc.defDamage; - SoundEngine.PlaySound(CalamitasClone.ChargeSound, npc.Center); - npc.rotation = rotation; - - float chargeVelocity = phase4 ? 30f : death ? 28f : 25f; - chargeVelocity += 5f * enrageScale; - - Vector2 vector = Vector2.Normalize(player.Center + (phase4 && bossRush ? player.velocity * 20f : Vector2.Zero) - npc.Center); - npc.velocity = vector * chargeVelocity; - - npc.ai[1] = 3f; - npc.netUpdate = true; - } - else if (npc.ai[1] == 3f) - { - // Set damage - npc.damage = npc.defDamage; - - npc.ai[2] += 1f; - - float chargeTime = phase4 ? 35f : death ? 40f : 45f; - if (npc.ai[2] >= chargeTime) - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.velocity *= 0.9f; - if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) - npc.velocity.X = 0f; - if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1) - npc.velocity.Y = 0f; - } - else - { - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2; - - // Leave behind slow hellblasts in Death Mode - if (Main.netMode != NetmodeID.MultiplayerClient && death && phase3 && npc.ai[2] % (phase4 ? 6f : 10f) == 0f) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 fireballVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(0.02f, 0.02f) : npc.velocity * 0.01f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, fireballVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); - } - } - - if (npc.ai[2] >= chargeTime + 10f) - { - if (!phase4) - npc.ai[3] += 1f; - - npc.ai[2] = 0f; - - npc.rotation = rotation; - npc.netUpdate = true; - - if (npc.ai[3] >= 2f) - { - npc.TargetClosest(); - npc.ai[1] = 0f; - npc.ai[3] = 0f; - return; - } - - npc.ai[1] = 4f; - } - } - else - { - // Avoid cheap bullshit - npc.damage = 0; - - npc.ai[2] += 1f; - if (npc.ai[2] >= (phase4 ? 15f : 30f)) - { - npc.ai[1] = 2f; - npc.ai[2] = 0f; - if (death) - npc.localAI[0] = 1f; - - npc.netUpdate = true; - } - } - } - - public static void VanillaCataclysmAI(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) - { - if (npc.alpha < 255) - { - npc.velocity *= 0.9f; - - npc.alpha += 2; - if (npc.alpha > 255) - npc.alpha = 255; - - int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - npc.alpha) / 255f)); - for (int i = 0; i < dustAmount; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); - Main.dust[dust].noGravity = true; - Main.dust[dust].fadeIn = 1f; - } - } - else - npc.active = false; - - npc.active = false; - return; - } - - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; - - CalamityGlobalNPC.cataclysm = npc.whoAmI; - - // 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; - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - - float calCloneBroPlayerXDist = npc.position.X + (npc.width / 2) - player.position.X - (player.width / 2); - float calCloneBroPlayerYDist = npc.position.Y + npc.height - 59f - player.position.Y - (player.height / 2); - float calCloneBroRotation = (float)Math.Atan2(calCloneBroPlayerYDist, calCloneBroPlayerXDist) + MathHelper.PiOver2; - if (calCloneBroRotation < 0f) - calCloneBroRotation += MathHelper.TwoPi; - else if (calCloneBroRotation > MathHelper.TwoPi) - calCloneBroRotation -= MathHelper.TwoPi; - - float calCloneBroRotationSpeed = 0.15f; - if (npc.rotation < calCloneBroRotation) - { - if ((calCloneBroRotation - npc.rotation) > MathHelper.Pi) - npc.rotation -= calCloneBroRotationSpeed; - else - npc.rotation += calCloneBroRotationSpeed; - } - else if (npc.rotation > calCloneBroRotation) - { - if ((npc.rotation - calCloneBroRotation) > MathHelper.Pi) - npc.rotation += calCloneBroRotationSpeed; - else - npc.rotation -= calCloneBroRotationSpeed; - } - - if (npc.rotation > calCloneBroRotation - calCloneBroRotationSpeed && npc.rotation < calCloneBroRotation + calCloneBroRotationSpeed) - npc.rotation = calCloneBroRotation; - if (npc.rotation < 0f) - npc.rotation += MathHelper.TwoPi; - else if (npc.rotation > MathHelper.TwoPi) - npc.rotation -= MathHelper.TwoPi; - if (npc.rotation > calCloneBroRotation - calCloneBroRotationSpeed && npc.rotation < calCloneBroRotation + calCloneBroRotationSpeed) - npc.rotation = calCloneBroRotation; - - if (!player.active || player.dead) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead) - { - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - npc.velocity.Y -= 0.1f; - if (npc.velocity.Y < -12f) - npc.velocity.Y = -12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - if (npc.ai[1] != 0f) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - - return; - } - } - - if (npc.ai[1] == 0f) - { - // Avoid cheap bullshit - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - - float calCloneBroProjAttackMaxSpeed = 5f; - float calCloneBroProjAttackAccel = 0.1f; - calCloneBroProjAttackMaxSpeed += 2f * enrageScale; - calCloneBroProjAttackAccel += 0.06f * enrageScale; - - if (Main.getGoodWorld) - { - calCloneBroProjAttackMaxSpeed *= 1.15f; - calCloneBroProjAttackAccel *= 1.15f; - } - - int calCloneBroProjAttackDirection = 1; - if (npc.position.X + (npc.width / 2) < player.position.X + player.width) - calCloneBroProjAttackDirection = -1; - - Vector2 calCloneBroProjLocation = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float calCloneBroProjTargetX = player.position.X + (player.width / 2) + (calCloneBroProjAttackDirection * 180) - calCloneBroProjLocation.X; - float calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; - float calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); - - if (expertMode) - { - if (calCloneBroProjTargetDist > 300f) - calCloneBroProjAttackMaxSpeed += 0.5f; - if (calCloneBroProjTargetDist > 400f) - calCloneBroProjAttackMaxSpeed += 0.5f; - if (calCloneBroProjTargetDist > 500f) - calCloneBroProjAttackMaxSpeed += 0.55f; - if (calCloneBroProjTargetDist > 600f) - calCloneBroProjAttackMaxSpeed += 0.55f; - if (calCloneBroProjTargetDist > 700f) - calCloneBroProjAttackMaxSpeed += 0.6f; - if (calCloneBroProjTargetDist > 800f) - calCloneBroProjAttackMaxSpeed += 0.6f; - } - - calCloneBroProjTargetDist = calCloneBroProjAttackMaxSpeed / calCloneBroProjTargetDist; - calCloneBroProjTargetX *= calCloneBroProjTargetDist; - calCloneBroProjTargetY *= calCloneBroProjTargetDist; - - if (npc.velocity.X < calCloneBroProjTargetX) - { - npc.velocity.X += calCloneBroProjAttackAccel; - if (npc.velocity.X < 0f && calCloneBroProjTargetX > 0f) - npc.velocity.X += calCloneBroProjAttackAccel; - } - else if (npc.velocity.X > calCloneBroProjTargetX) - { - npc.velocity.X -= calCloneBroProjAttackAccel; - if (npc.velocity.X > 0f && calCloneBroProjTargetX < 0f) - npc.velocity.X -= calCloneBroProjAttackAccel; - } - if (npc.velocity.Y < calCloneBroProjTargetY) - { - npc.velocity.Y += calCloneBroProjAttackAccel; - if (npc.velocity.Y < 0f && calCloneBroProjTargetY > 0f) - npc.velocity.Y += calCloneBroProjAttackAccel; - } - else if (npc.velocity.Y > calCloneBroProjTargetY) - { - npc.velocity.Y -= calCloneBroProjAttackAccel; - if (npc.velocity.Y > 0f && calCloneBroProjTargetY < 0f) - npc.velocity.Y -= calCloneBroProjAttackAccel; - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= (240f - (death ? 120f * (1f - lifeRatio) : 0f))) - { - npc.ai[1] = 1f; - npc.ai[2] = 0f; - npc.target = 255; - npc.netUpdate = true; - } - - bool fireDelay = npc.ai[2] > 120f || npc.life < npc.lifeMax * 0.9; - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && fireDelay) - { - if (npc.localAI[2] == 0f) - SoundEngine.PlaySound(Cataclysm.FlamethrowerStart, npc.Center); - - npc.localAI[2] += 1f; - if (npc.localAI[2] > 30f) - { - npc.localAI[2] = 1f; - SoundEngine.PlaySound(Cataclysm.FlamethrowerLoop, npc.Center); - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[1] += 3f; - if (revenge) - npc.localAI[1] += 1f; - - if (npc.localAI[1] > 12f) - { - npc.localAI[1] = 0f; - float calCloneBroProjSpeed = NPC.AnyNPCs(ModContent.NPCType()) ? 4f : 6f; - calCloneBroProjSpeed += enrageScale; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - calCloneBroProjLocation = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - calCloneBroProjTargetX = player.position.X + (player.width / 2) - calCloneBroProjLocation.X; - calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; - calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); - calCloneBroProjTargetDist = calCloneBroProjSpeed / calCloneBroProjTargetDist; - calCloneBroProjTargetX *= calCloneBroProjTargetDist; - calCloneBroProjTargetY *= calCloneBroProjTargetDist; - calCloneBroProjTargetY += npc.velocity.Y * 0.5f; - calCloneBroProjTargetX += npc.velocity.X * 0.5f; - calCloneBroProjLocation.X -= calCloneBroProjTargetX; - calCloneBroProjLocation.Y -= calCloneBroProjTargetY; - Projectile.NewProjectile(npc.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - else - { - if (npc.ai[1] == 1f) - { - // Set damage - npc.damage = npc.defDamage; - - SoundEngine.PlaySound(SoundID.Roar, npc.Center); - npc.rotation = calCloneBroRotation; - - float calCloneBroChargeSpeed = 14f + (death ? 4f * (1f - lifeRatio) : 0f); - calCloneBroChargeSpeed += 3f * enrageScale; - if (expertMode) - calCloneBroChargeSpeed += 2f; - if (revenge) - calCloneBroChargeSpeed += 2f; - if (Main.getGoodWorld) - calCloneBroChargeSpeed *= 1.25f; - - Vector2 calCloneBroChargeCenter = npc.Center; - float calCloneBroChargeTargetXDist = player.Center.X - calCloneBroChargeCenter.X; - float calCloneBroChargeTargetYDist = player.Center.Y - calCloneBroChargeCenter.Y; - float calCloneBroChargeTargetDistance = (float)Math.Sqrt(calCloneBroChargeTargetXDist * calCloneBroChargeTargetXDist + calCloneBroChargeTargetYDist * calCloneBroChargeTargetYDist); - calCloneBroChargeTargetDistance = calCloneBroChargeSpeed / calCloneBroChargeTargetDistance; - npc.velocity.X = calCloneBroChargeTargetXDist * calCloneBroChargeTargetDistance; - npc.velocity.Y = calCloneBroChargeTargetYDist * calCloneBroChargeTargetDistance; - npc.ai[1] = 2f; - - if (Main.zenithWorld) - { - SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, npc.Center); - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(ModContent.ProjectileType()); - if (bossRush) - damage /= 2; - - int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 8 : expertMode ? 6 : 4; - float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = 5f; - Vector2 spinningPoint = new Vector2(0f, -velocity); - float projectileVelocityToPass = velocity * 3f; - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); - } - - for (int i = 0; i < 6; i++) - Dust.NewDust(npc.position + npc.velocity, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f); - } - return; - } - - if (npc.ai[1] == 2f) - { - // Set damage - npc.damage = npc.defDamage; - - npc.ai[2] += 1f + (death ? 0.5f * (1f - lifeRatio) : 0f); - if (expertMode) - npc.ai[2] += 0.25f; - if (revenge) - npc.ai[2] += 0.25f; - - if (npc.ai[2] >= 75f) - { - // Avoid cheap bullshit - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - - npc.velocity.X *= 0.93f; - npc.velocity.Y *= 0.93f; - - if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) - npc.velocity.X = 0f; - if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1) - npc.velocity.Y = 0f; - } - else - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2; - - if (npc.ai[2] >= 105f) - { - npc.ai[3] += 1f; - npc.ai[2] = 0f; - npc.target = 255; - npc.rotation = calCloneBroRotation; - if (npc.ai[3] >= 3f) - { - npc.ai[1] = 0f; - npc.ai[3] = 0f; - return; - } - npc.ai[1] = 1f; - } - } - } - } - - public static void VanillaCatastropheAI(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - if (CalamityGlobalNPC.calamitas < 0 || !Main.npc[CalamityGlobalNPC.calamitas].active) - { - if (npc.alpha < 255) - { - npc.velocity *= 0.9f; - - npc.alpha += 2; - if (npc.alpha > 255) - npc.alpha = 255; - - int dustAmount = (int)Math.Round(MathHelper.Lerp(1f, 5f, (255 - npc.alpha) / 255f)); - for (int i = 0; i < dustAmount; i++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.LifeDrain, 0f, -1f, 90, default, Main.rand.NextFloat(0.5f, 2f)); - Main.dust[dust].noGravity = true; - Main.dust[dust].fadeIn = 1f; - } - } - else - npc.active = false; - - return; - } - - // Percent life remaining - float lifeRatio = npc.life / (float)npc.lifeMax; - - CalamityGlobalNPC.catastrophe = npc.whoAmI; - - // 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; - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - - float calCloneBroPlayerXDist = npc.position.X + (npc.width / 2) - player.position.X - (player.width / 2); - float calCloneBroPlayerYDist = npc.position.Y + npc.height - 59f - player.position.Y - (player.height / 2); - float calCloneBroRotation = (float)Math.Atan2(calCloneBroPlayerYDist, calCloneBroPlayerXDist) + MathHelper.PiOver2; - if (calCloneBroRotation < 0f) - calCloneBroRotation += MathHelper.TwoPi; - else if (calCloneBroRotation > MathHelper.TwoPi) - calCloneBroRotation -= MathHelper.TwoPi; - - float calCloneBroRotationSpeed = 0.15f; - if (npc.rotation < calCloneBroRotation) - { - if ((calCloneBroRotation - npc.rotation) > MathHelper.Pi) - npc.rotation -= calCloneBroRotationSpeed; - else - npc.rotation += calCloneBroRotationSpeed; - } - else if (npc.rotation > calCloneBroRotation) - { - if ((npc.rotation - calCloneBroRotation) > MathHelper.Pi) - npc.rotation += calCloneBroRotationSpeed; - else - npc.rotation -= calCloneBroRotationSpeed; - } - - if (npc.rotation > calCloneBroRotation - calCloneBroRotationSpeed && npc.rotation < calCloneBroRotation + calCloneBroRotationSpeed) - npc.rotation = calCloneBroRotation; - if (npc.rotation < 0f) - npc.rotation += MathHelper.TwoPi; - else if (npc.rotation > MathHelper.TwoPi) - npc.rotation -= MathHelper.TwoPi; - if (npc.rotation > calCloneBroRotation - calCloneBroRotationSpeed && npc.rotation < calCloneBroRotation + calCloneBroRotationSpeed) - npc.rotation = calCloneBroRotation; - - if (!player.active || player.dead) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead) - { - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - npc.velocity.Y -= 0.1f; - if (npc.velocity.Y < -12f) - npc.velocity.Y = -12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - if (npc.ai[1] != 0f) - { - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.netUpdate = true; - } - - return; - } - } - - if (npc.ai[1] == 0f) - { - // Avoid cheap bullshit - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - - float calCloneBroProjAttackMaxSpeed = 4.5f; - float calCloneBroProjAttackAccel = 0.2f; - calCloneBroProjAttackMaxSpeed += 2f * enrageScale; - calCloneBroProjAttackAccel += 0.1f * enrageScale; - - if (Main.getGoodWorld) - { - calCloneBroProjAttackMaxSpeed *= 1.15f; - calCloneBroProjAttackAccel *= 1.15f; - } - - int calCloneBroProjAttackDirection = 1; - if (npc.Center.X < player.Center.X) - calCloneBroProjAttackDirection = -1; - - Vector2 calCloneBroProjLocation = npc.Center; - float calCloneBroProjTargetX = player.Center.X + (calCloneBroProjAttackDirection * 180) - calCloneBroProjLocation.X; - float calCloneBroProjTargetY = player.Center.Y - calCloneBroProjLocation.Y; - float calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); - - if (expertMode) - { - if (calCloneBroProjTargetDist > 300f) - calCloneBroProjAttackMaxSpeed += 0.5f; - if (calCloneBroProjTargetDist > 400f) - calCloneBroProjAttackMaxSpeed += 0.5f; - if (calCloneBroProjTargetDist > 500f) - calCloneBroProjAttackMaxSpeed += 0.55f; - if (calCloneBroProjTargetDist > 600f) - calCloneBroProjAttackMaxSpeed += 0.55f; - if (calCloneBroProjTargetDist > 700f) - calCloneBroProjAttackMaxSpeed += 0.6f; - if (calCloneBroProjTargetDist > 800f) - calCloneBroProjAttackMaxSpeed += 0.6f; - } - - calCloneBroProjTargetDist = calCloneBroProjAttackMaxSpeed / calCloneBroProjTargetDist; - calCloneBroProjTargetX *= calCloneBroProjTargetDist; - calCloneBroProjTargetY *= calCloneBroProjTargetDist; - - if (npc.velocity.X < calCloneBroProjTargetX) - { - npc.velocity.X += calCloneBroProjAttackAccel; - if (npc.velocity.X < 0f && calCloneBroProjTargetX > 0f) - npc.velocity.X += calCloneBroProjAttackAccel; - } - else if (npc.velocity.X > calCloneBroProjTargetX) - { - npc.velocity.X -= calCloneBroProjAttackAccel; - if (npc.velocity.X > 0f && calCloneBroProjTargetX < 0f) - npc.velocity.X -= calCloneBroProjAttackAccel; - } - if (npc.velocity.Y < calCloneBroProjTargetY) - { - npc.velocity.Y += calCloneBroProjAttackAccel; - if (npc.velocity.Y < 0f && calCloneBroProjTargetY > 0f) - npc.velocity.Y += calCloneBroProjAttackAccel; - } - else if (npc.velocity.Y > calCloneBroProjTargetY) - { - npc.velocity.Y -= calCloneBroProjAttackAccel; - if (npc.velocity.Y > 0f && calCloneBroProjTargetY < 0f) - npc.velocity.Y -= calCloneBroProjAttackAccel; - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= (180f - (death ? 90f * (1f - lifeRatio) : 0f))) - { - npc.ai[1] = 1f; - npc.ai[2] = 0f; - npc.target = 255; - npc.netUpdate = true; - } - - bool fireDelay = npc.ai[2] > 120f || lifeRatio < 0.9f; - if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) && fireDelay) - { - npc.localAI[2] += 1f; - if (npc.localAI[2] > 36f) - { - npc.localAI[2] = 0f; - SoundEngine.PlaySound(SoundID.Item34, npc.Center); - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.localAI[1] += 1f; - if (revenge) - npc.localAI[1] += 0.5f; - - if (npc.localAI[1] > 50f) - { - npc.localAI[1] = 0f; - float calCloneBroProjSpeed = death ? 14f : 12f; - calCloneBroProjSpeed += 3f * enrageScale; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - calCloneBroProjLocation = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - calCloneBroProjTargetX = player.position.X + (player.width / 2) - calCloneBroProjLocation.X; - calCloneBroProjTargetY = player.position.Y + (player.height / 2) - calCloneBroProjLocation.Y; - calCloneBroProjTargetDist = (float)Math.Sqrt(calCloneBroProjTargetX * calCloneBroProjTargetX + calCloneBroProjTargetY * calCloneBroProjTargetY); - calCloneBroProjTargetDist = calCloneBroProjSpeed / calCloneBroProjTargetDist; - calCloneBroProjTargetX *= calCloneBroProjTargetDist; - calCloneBroProjTargetY *= calCloneBroProjTargetDist; - calCloneBroProjTargetY += npc.velocity.Y * 0.5f; - calCloneBroProjTargetX += npc.velocity.X * 0.5f; - calCloneBroProjLocation.X -= calCloneBroProjTargetX; - calCloneBroProjLocation.Y -= calCloneBroProjTargetY; - Projectile.NewProjectile(npc.GetSource_FromAI(), calCloneBroProjLocation.X, calCloneBroProjLocation.Y, calCloneBroProjTargetX, calCloneBroProjTargetY, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - } - } - else - { - if (npc.ai[1] == 1f) - { - // Set damage - npc.damage = npc.defDamage; - - SoundEngine.PlaySound(SoundID.Roar, npc.Center); - npc.rotation = calCloneBroRotation; - - float calCloneBroChargeSpeed = (NPC.AnyNPCs(ModContent.NPCType()) ? 12f : 16f) + (death ? 4f * (1f - lifeRatio) : 0f); - calCloneBroChargeSpeed += 4f * enrageScale; - if (expertMode) - calCloneBroChargeSpeed += 2f; - if (revenge) - calCloneBroChargeSpeed += 2f; - if (Main.getGoodWorld) - calCloneBroChargeSpeed *= 1.25f; - - Vector2 calCloneBroChargeCenter = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height * 0.5f); - float calCloneBroChargeTargetXDist = player.position.X + (player.width / 2) - calCloneBroChargeCenter.X; - float calCloneBroChargeTargetYDist = player.position.Y + (player.height / 2) - calCloneBroChargeCenter.Y; - float calCloneBroChargeTargetDistance = (float)Math.Sqrt(calCloneBroChargeTargetXDist * calCloneBroChargeTargetXDist + calCloneBroChargeTargetYDist * calCloneBroChargeTargetYDist); - calCloneBroChargeTargetDistance = calCloneBroChargeSpeed / calCloneBroChargeTargetDistance; - npc.velocity.X = calCloneBroChargeTargetXDist * calCloneBroChargeTargetDistance; - npc.velocity.Y = calCloneBroChargeTargetYDist * calCloneBroChargeTargetDistance; - npc.ai[1] = 2f; - - if (Main.zenithWorld) - { - SoundEngine.PlaySound(SupremeCalamitas.SupremeCalamitas.BrimstoneShotSound, npc.Center); - - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(ModContent.ProjectileType()); - if (bossRush) - damage /= 2; - - int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 8 : expertMode ? 6 : 4; - float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = 5f; - Vector2 spinningPoint = new Vector2(0f, -velocity); - float projectileVelocityToPass = velocity * 3f; - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); - } - - for (int i = 0; i < 6; i++) - Dust.NewDust(npc.position + npc.velocity, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, 0f); - } - return; - } - - if (npc.ai[1] == 2f) - { - // Set damage - npc.damage = npc.defDamage; - - npc.ai[2] += 1f + (death ? 0.5f * (1f - lifeRatio) : 0f); - if (expertMode) - npc.ai[2] += 0.25f; - if (revenge) - npc.ai[2] += 0.25f; - - if (npc.ai[2] >= 60f) //50 - { - // Avoid cheap bullshit - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - - npc.velocity.X *= 0.93f; - npc.velocity.Y *= 0.93f; - - if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) - npc.velocity.X = 0f; - if (npc.velocity.Y > -0.1 && npc.velocity.Y < 0.1) - npc.velocity.Y = 0f; - } - else - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X) - MathHelper.PiOver2; - - if (npc.ai[2] >= 90f) //80 - { - npc.ai[3] += 1f; - npc.ai[2] = 0f; - npc.rotation = calCloneBroRotation; - if (npc.ai[3] >= 4f) - { - npc.ai[1] = 0f; - npc.ai[3] = 0f; - return; - } - npc.ai[1] = 1f; - } - } - } - } - } -} diff --git a/NPCs/CalamityAIs/CalamityBossAIs/CeaselessVoidAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/CeaselessVoidAI.cs deleted file mode 100644 index 7fc43d201c..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/CeaselessVoidAI.cs +++ /dev/null @@ -1,619 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.SulphurousSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class CeaselessVoidAI - { - public static void VanillaCeaselessVoidAI(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - CalamityGlobalNPC.voidBoss = npc.whoAmI; - - // Percent life remaining - 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; - - // Phases - bool phase2 = lifeRatio <= 0.7; - bool phase3 = lifeRatio <= 0.4; - bool phase4 = lifeRatio <= 0.1; - bool theBigSucc = npc.life / (double)npc.lifeMax <= 0.1; - bool succSoHardThatYouDie = npc.life / (double)npc.lifeMax <= 0.005; - - // Spawn Dark Energies - int darkEnergyAmt = death ? 6 : revenge ? 5 : expertMode ? 4 : 3; - if (phase2) - darkEnergyAmt += 1; - if (phase3) - darkEnergyAmt += 1; - if (phase4) - darkEnergyAmt += 1; - - if (Main.getGoodWorld) - darkEnergyAmt *= 2; - - // Spawn a few Dark Energies as soon as the fight starts - int spacing = 360 / darkEnergyAmt; - int distance2 = 10; - if (npc.ai[2] == 0f) - { - npc.ai[2] = 1f; - for (int i = 0; i < darkEnergyAmt; i++) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); - } - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 0.5f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1.5f, 0f, 0f); - } - - // If there are any Dark Energies alive, change AI and don't take damage - bool anyDarkEnergies = NPC.AnyNPCs(ModContent.NPCType()); - bool movingDuringSuccPhase = npc.ai[3] == 0f; - npc.dontTakeDamage = anyDarkEnergies || theBigSucc || movingDuringSuccPhase; - - // Get a target - if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) - npc.TargetClosest(); - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - - Player player = Main.player[npc.target]; - - // Speed enrage - bool moveVeryFast = Vector2.Distance(npc.Center, player.Center) > 960f || (!player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0); - - // Despawn - if (!player.active || player.dead || Vector2.Distance(player.Center, npc.Center) > 5600f) - { - npc.TargetClosest(false); - player = Main.player[npc.target]; - if (!player.active || player.dead || Vector2.Distance(player.Center, npc.Center) > 5600f) - { - if (npc.velocity.Y > 3f) - npc.velocity.Y = 3f; - npc.velocity.Y -= 0.1f; - if (npc.velocity.Y < -12f) - npc.velocity.Y = -12f; - - if (npc.timeLeft > 60) - npc.timeLeft = 60; - - return; - } - } - 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; - - // Set AI variable to be used by Dark Energies - npc.ai[1] = tileEnrageMult; - - // Increase projectile fire rate based on number of nearby active tiles - float projectileFireRateMultiplier = MathHelper.Lerp(0.5f, 1.5f, 1f - ((tileEnrageMult - 1f) / 0.5f)); - - // Decides whether Ceaseless moves closer to its target or not - float distanceRequiredToMove = (Main.getGoodWorld || !anyDarkEnergies) ? 320f : bossRush ? 600f : death ? 520f : revenge ? 480f : expertMode ? 440f : 400f; - bool move = Vector2.Distance(npc.Center, player.Center) > distanceRequiredToMove || !Collision.CanHit(npc.Center, 1, 1, player.Center, 1, 1); - - // Succ attack - if (!anyDarkEnergies) - { - // This is here because it's used in multiple places - float suckDistance = (CalamityWorld.LegendaryMode && revenge) ? 2400f : bossRush ? 1920f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; - - // Move closer to the target before trying to succ - if (movingDuringSuccPhase) - { - // Avoid cheap bullshit - npc.damage = 0; - - if (move) - Movement(true); - else - npc.ai[3] = 1f; - } - else - { - // Set damage - npc.damage = npc.defDamage; - - // Use this to generate more and more dust in final phase - float finalPhaseDustRatio = 1f; - if (succSoHardThatYouDie) - { - finalPhaseDustRatio = 5f; - } - else if (theBigSucc) - { - float amount = (10f - (float)(npc.life / (double)npc.lifeMax) * 100f) / 10f; - finalPhaseDustRatio += MathHelper.Lerp(0f, 2f, amount); - } - - // Slow down - if (npc.velocity.Length() > 0.5f) - npc.velocity *= 0.8f; - else - npc.velocity = Vector2.Zero; - - // Move towards target again if they get outside the succ radius - float moveCloserGateValue = suckDistance * 0.8f; - if (Vector2.Distance(npc.Center, player.Center) > moveCloserGateValue) - npc.ai[3] = 0f; - - // Ceaseless Void sucks in dark energy in different patterns - // This attack also sucks in all players that are within reach of the succ - int dustRings = 3; - for (int h = 0; h < dustRings; h++) - { - float distanceDivisor = h + 1f; - float dustDistance = suckDistance / distanceDivisor; - int numDust = (int)(0.1f * MathHelper.TwoPi * dustDistance); - float angleIncrement = MathHelper.TwoPi / numDust; - Vector2 dustOffset = new Vector2(dustDistance, 0f); - dustOffset = dustOffset.RotatedByRandom(MathHelper.TwoPi); - - int var = (int)(dustDistance / finalPhaseDustRatio); - float dustVelocity = 24f / distanceDivisor * finalPhaseDustRatio; - for (int i = 0; i < numDust; i++) - { - if (Main.rand.NextBool(var)) - { - dustOffset = dustOffset.RotatedBy(angleIncrement); - int dust = Dust.NewDust(npc.Center, 1, 1, ModContent.DustType()); - Main.dust[dust].position = npc.Center + dustOffset; - Main.dust[dust].fadeIn = 1f; - Main.dust[dust].velocity = Vector2.Normalize(npc.Center - Main.dust[dust].position) * dustVelocity; - Main.dust[dust].scale = 3f - h; - } - } - } - - float succPower = 0.125f + finalPhaseDustRatio * 0.125f; - for (int i = 0; i < Main.maxPlayers; i++) - { - float distance = Vector2.Distance(Main.player[i].Center, npc.Center); - if (distance < suckDistance && Main.player[i].grappling[0] == -1) - { - if (Collision.CanHit(npc.Center, 1, 1, Main.player[i].Center, 1, 1)) - { - float distanceRatio = distance / suckDistance; - float multiplier = 1f - distanceRatio; - - if (Main.player[i].Center.X < npc.Center.X) - Main.player[i].velocity.X += succPower * multiplier; - else - Main.player[i].velocity.X -= succPower * multiplier; - } - } - } - - // Slowly die in final phase and then implode - // This phase lasts 20 seconds - if (theBigSucc && calamityGlobalNPC.newAI[1] % 60f == 0f) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int damageAmt = npc.lifeMax / 200; - npc.life -= damageAmt; - npc.DamageEffect(damageAmt); - } - - if (npc.life <= ((npc.lifeMax / 200) * 5) && !npc.ModNPC().playedbuildsound) - { - SoundEngine.PlaySound(CeaselessVoid.CeaselessVoid.BuildupSound, npc.Center); - npc.ModNPC().playedbuildsound = true; - } - - if (npc.life <= 0) - { - npc.life = 0; - npc.HitEffect(); - npc.checkDead(); - } - - npc.netUpdate = true; - } - - // Beam Portals - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (calamityGlobalNPC.newAI[1] == 0f) - { - int numBeamPortals = bossRush ? 4 : revenge ? 3 : 2; - float degrees = 360 / numBeamPortals; - float beamPortalDistance = bossRush ? 360f : death ? 400f : revenge ? 420f : expertMode ? 440f : 480f; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - for (int i = 0; i < numBeamPortals; i++) - { - float ai1 = i * degrees; - Projectile.NewProjectile(npc.GetSource_FromAI(), player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, damage, 0f, Main.myPlayer, ai1, 0f); - } - } - } - - // Use this timer to lessen Dark Energy projectile rate of fire while Beam Portals are active - float beamPortalTimeLeft = 600f; - bool summonLessDarkEnergies = false; - if (calamityGlobalNPC.newAI[1] < beamPortalTimeLeft) - { - calamityGlobalNPC.newAI[1] += 1f; - summonLessDarkEnergies = true; - } - else if (theBigSucc) - calamityGlobalNPC.newAI[1] += 1f; - - // Suck in Dark Energy projectiles from far away - calamityGlobalNPC.newAI[3] += 1f; - float darkEnergySpiralGateValue = (summonLessDarkEnergies ? 24f : 12f) * projectileFireRateMultiplier; - if (calamityGlobalNPC.newAI[3] >= darkEnergySpiralGateValue) - { - calamityGlobalNPC.newAI[3] = 0f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - bool normalSpread = npc.localAI[0] % 2f == 0f; - float speed = 0.5f; - int totalProjectiles = 4; - float radians = MathHelper.TwoPi / totalProjectiles; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(speed * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalSpread ? new Vector2(0f, -speed) : new Vector2(-velocityX, -speed); - float radialOffset = MathHelper.ToRadians(npc.localAI[1]); - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 spawnVector = npc.Center + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; - Vector2 velocity = Vector2.Normalize(npc.Center - spawnVector) * speed; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - } - - npc.localAI[1] += 10f; - } - - // Summon some extra projectiles in Expert Mode - if (phase2 && expertMode) - { - npc.localAI[2] += 1f; - if (npc.localAI[2] >= 60f * projectileFireRateMultiplier) - { - npc.localAI[2] = 0f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - bool normalSpread = npc.localAI[0] % 2f != 0f; - float speed = 2f; - int totalProjectiles = 2; - float radians = MathHelper.TwoPi / totalProjectiles; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(speed * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalSpread ? new Vector2(0f, -speed) : new Vector2(-velocityX, -speed); - float radialOffset = MathHelper.ToRadians(npc.localAI[1] * 0.25f); - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 spawnVector = npc.Center + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; - Vector2 velocity = Vector2.Normalize(npc.Center - spawnVector) * speed; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - - // Summon some extra projectiles in Revengeance Mode - if (phase4 && revenge) - { - npc.localAI[3] += 1f; - if (npc.localAI[3] >= 90f * projectileFireRateMultiplier) - { - npc.localAI[3] = 0f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - bool normalSpread = npc.localAI[0] % 2f == 0f; - float speed = 4f; - int totalProjectiles = 2; - float radians = MathHelper.TwoPi / totalProjectiles; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(speed * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalSpread ? new Vector2(0f, -speed) : new Vector2(-velocityX, -speed); - float radialOffset = MathHelper.ToRadians(npc.localAI[1] * 0.25f); - for (int i = 0; i < totalProjectiles; i++) - { - Vector2 spawnVector = npc.Center + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; - Vector2 velocity = Vector2.Normalize(npc.Center - spawnVector) * speed; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnVector, velocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - } - } - else - { - // Avoid cheap bullshit - npc.damage = 0; - - if (move) - { - Movement(false); - } - else - { - // Slow down - if (npc.velocity.Length() > 0.5f) - npc.velocity *= 0.8f; - else - npc.velocity = Vector2.Zero; - } - - // Count up all Dark Energy HP values - int totalDarkEnergyHP = 0; - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC darkEnergy = Main.npc[i]; - if (darkEnergy.active && darkEnergy.type == ModContent.NPCType()) - totalDarkEnergyHP += darkEnergy.life; - } - - // Destroy all Dark Energies if their total HP is below 20% - int darkEnergyMaxHP = bossRush ? 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); - - int totalDarkEnergiesSpawned = darkEnergyAmt * 3 + 2; - int totalDarkEnergyMaxHP = darkEnergyMaxHP * totalDarkEnergiesSpawned; - int succPhaseGateValue = (int)(totalDarkEnergyMaxHP * 0.2); - if (totalDarkEnergyHP < succPhaseGateValue) - { - SoundEngine.PlaySound(SoundID.NPCDeath44, npc.Center); - - // Kill all Dark Energies - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC darkEnergy = Main.npc[i]; - if (darkEnergy.active && darkEnergy.type == ModContent.NPCType()) - { - darkEnergy.HitEffect(); - darkEnergy.active = false; - darkEnergy.netUpdate = true; - } - } - - // Generate a dust explosion - int dustAmt = 30; - int random = 3; - for (int j = 0; j < 10; j++) - { - random += j * 2; - int dustAmtSpawned = 0; - int scale = random * 13; - float dustPositionX = npc.Center.X - (scale / 2); - float dustPositionY = npc.Center.Y - (scale / 2); - while (dustAmtSpawned < dustAmt) - { - float dustVelocityX = Main.rand.Next(-random, random); - float dustVelocityY = Main.rand.Next(-random, random); - float dustVelocityScalar = random * 2f; - float dustVelocity = (float)Math.Sqrt(dustVelocityX * dustVelocityX + dustVelocityY * dustVelocityY); - dustVelocity = dustVelocityScalar / dustVelocity; - dustVelocityX *= dustVelocity; - dustVelocityY *= dustVelocity; - int dust = Dust.NewDust(new Vector2(dustPositionX, dustPositionY), scale, scale, (int)CalamityDusts.PurpleCosmilite, 0f, 0f, 100, default, 5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].position.X = npc.Center.X; - Main.dust[dust].position.Y = npc.Center.Y; - Main.dust[dust].position.X += Main.rand.Next(-10, 11); - Main.dust[dust].position.Y += Main.rand.Next(-10, 11); - Main.dust[dust].velocity.X = dustVelocityX; - Main.dust[dust].velocity.Y = dustVelocityY; - dustAmtSpawned++; - } - } - } - } - - // 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; - - // Increase speed dramatically in succ phase - if (succ) - { - velocity *= 2f; - acceleration *= 2f; - } - - if (Main.getGoodWorld) - { - velocity *= 1.15f; - acceleration *= 1.15f; - } - - Vector2 destination = player.Center; - - // Move between 8 different positions around the player, in order - float maxDistance = 320f; - Vector2 moveToOffset = succ ? Vector2.Zero : Main.getGoodWorld ? new Vector2(0f, -maxDistance) : Vector2.Zero; - if (!succ && Main.getGoodWorld) - { - // Move to a new location every few seconds - calamityGlobalNPC.newAI[2] += 1f; - float newPositionGateValue = bossRush ? 120f : death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; - if (calamityGlobalNPC.newAI[2] > newPositionGateValue) - { - calamityGlobalNPC.newAI[2] = 0f; - - npc.ai[0] += 1f; - if (npc.ai[0] > 7f) - npc.ai[0] = 0f; - } - - switch ((int)npc.ai[0]) - { - case 0: - break; - case 1: - moveToOffset.X = -maxDistance; - break; - case 2: - moveToOffset.X = -maxDistance; - moveToOffset.Y = 0f; - break; - case 3: - moveToOffset.X = -maxDistance; - moveToOffset.Y = maxDistance; - break; - case 4: - moveToOffset.Y = maxDistance; - break; - case 5: - moveToOffset.X = maxDistance; - moveToOffset.Y = maxDistance; - break; - case 6: - moveToOffset.X = maxDistance; - moveToOffset.Y = 0f; - break; - case 7: - moveToOffset.X = maxDistance; - break; - } - } - - destination += moveToOffset; - - // How far Ceaseless Void is from where it's supposed to be - Vector2 distanceFromDestination = destination - npc.Center; - - // Movement - if (npc.Distance(destination) > maxDistance || succ || !Main.getGoodWorld) - CalamityUtils.SmoothMovement(npc, 0f, distanceFromDestination, velocity, acceleration, true); - } - - // Spawn more Dark Energies as the fight progresses - if (calamityGlobalNPC.newAI[0] == 0f && npc.life > 0) - calamityGlobalNPC.newAI[0] = npc.lifeMax; - - if (npc.life > 0) - { - int healthGateValue = (int)(npc.lifeMax * 0.3); - if ((npc.life + healthGateValue) < calamityGlobalNPC.newAI[0]) - { - npc.TargetClosest(); - calamityGlobalNPC.newAI[0] = npc.life; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - calamityGlobalNPC.newAI[3] = 0f; - npc.ai[3] = 0f; - npc.localAI[0] += 1f; - npc.localAI[1] = 0f; - npc.localAI[2] = 0f; - npc.localAI[3] = 0f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (phase4) - { - for (int i = 0; i < darkEnergyAmt; i++) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 4f, 0f, 0f); - } - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 3f, 0f, 0f); - } - else if (phase3) - { - for (int i = 0; i < darkEnergyAmt; i++) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1.5f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 3f, 0f, 0f); - } - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 0.5f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 2f, 0f, 0f); - } - else - { - for (int i = 0; i < darkEnergyAmt; i++) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 0f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 1f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(npc.Center.Y + (Math.Cos(i * spacing) * distance2)), ModContent.NPCType(), npc.whoAmI, i * spacing, 2f, 0f, 0f); - } - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 1.5f, 0f, 0f); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + (Math.Sin(0) * distance2)), (int)(npc.Center.Y + (Math.Cos(0) * distance2)), ModContent.NPCType(), npc.whoAmI, 0f, 2.5f, 0f, 0f); - } - } - - // Despawn potentially hazardous projectiles when entering a new phase - for (int i = 0; i < Main.maxProjectiles; i++) - { - Projectile projectile = Main.projectile[i]; - if (projectile.active) - { - if (projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType() || - projectile.type == ModContent.ProjectileType() || projectile.type == ModContent.ProjectileType()) - { - if (projectile.timeLeft > 30) - projectile.timeLeft = 30; - } - } - } - } - } - } - } -} diff --git a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs b/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs deleted file mode 100644 index 281d6b94ab..0000000000 --- a/NPCs/CalamityAIs/CalamityBossAIs/OldDukeAI.cs +++ /dev/null @@ -1,1702 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; -using CalamityMod.Dusts; -using CalamityMod.Events; -using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; -using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; -using CalamityMod.NPCs.SulphurousSea; -using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Particles; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; -using CalamityMod.Systems; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.CalamityAIs.CalamityBossAIs -{ - public static class OldDukeAI - { - public static void VanillaOldDukeAI(NPC npc, Mod mod) - { - CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - OldDuke.OldDuke modNPC = npc.ModNPC(); - - npc.Calamity().canBreakPlayerDefense = true; - - // Percent life remaining - 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; - - float exhaustionGateValue = 360f; - if (Main.getGoodWorld) - exhaustionGateValue *= 0.5f; - - float numberOfAttacksBeforeExhaustion = 12f; - float exhaustionIncreasePerAttack = exhaustionGateValue * (1f / numberOfAttacksBeforeExhaustion); - bool exhausted = calamityGlobalNPC.newAI[1] == 1f; - bool phase2 = lifeRatio <= (death ? OldDuke.OldDuke.LifePercentagePhase2_Death : revenge ? OldDuke.OldDuke.LifePercentagePhase2_Revenge : OldDuke.OldDuke.LifePercentagePhase2_Normal); - bool phase3 = lifeRatio <= (death ? OldDuke.OldDuke.LifePercentagePhase3_Death : (revenge ? OldDuke.OldDuke.LifePercentagePhase3_Revenge : OldDuke.OldDuke.LifePercentagePhase3_Expert)) && expertMode; - bool phase2AI = npc.ai[0] > 4f; - bool phase3AI = npc.ai[0] > 9f; - - int phase = (npc.ModNPC as OldDuke.OldDuke).Phase; - - bool charging = npc.ai[3] < 10f; - float pie = (float)Math.PI; - - if (calamityGlobalNPC.newAI[0] >= exhaustionGateValue) - calamityGlobalNPC.newAI[1] = 1f; - - float alphaScale = (255 - npc.alpha) / 255f; - float redLight = (phase3AI ? 0.4f : phase2AI ? 0.64f : 0.88f) * alphaScale; - float greenLight = (phase3AI ? 1.2f : phase2AI ? 0.8f : 0.4f) * alphaScale; - Lighting.AddLight((int)((npc.position.X + (npc.width / 2)) / 16f), (int)((npc.position.Y + (npc.height / 2)) / 16f), redLight, greenLight, 0f); - - if (CalamityServerConfig.Instance.BossesStopWeather) - CalamityWorld.StopRain(); - else if (!Main.raining && !BossRushEvent.BossRushActive) - CalamityWorld.StartRain(); - - // Adjust stats - int setDamage = npc.defDamage; - calamityGlobalNPC.DR = exhausted ? 0f : 0.5f; - npc.defense = exhausted ? 0 : npc.defDefense; - if (phase3AI) - { - setDamage = (int)Math.Round(setDamage * 1.2); - npc.defense = exhausted ? 0 : npc.defDefense - 40; - } - else if (phase2AI) - { - setDamage = (int)Math.Round(setDamage * 1.1); - npc.defense = exhausted ? 0 : npc.defDefense - 20; - } - - int idlePhaseTimer = expertMode ? 55 : 60; - float idlePhaseAcceleration = expertMode ? 0.75f : 0.7f; - float idlePhaseVelocity = expertMode ? 14f : 13f; - if (phase3AI) - { - idlePhaseAcceleration = expertMode ? 0.6f : 0.55f; - idlePhaseVelocity = expertMode ? 12f : 11f; - } - else if (phase2AI & charging) - { - idlePhaseAcceleration = expertMode ? 0.8f : 0.75f; - idlePhaseVelocity = expertMode ? 15f : 14f; - } - - int chargeTime = expertMode ? 34 : 36; - float chargeVelocity = expertMode ? 20f : 19f; - if (phase3AI) - { - chargeTime = expertMode ? 28 : 30; - chargeVelocity = expertMode ? 26f : 25f; - } - else if (charging & phase2AI) - { - chargeTime = expertMode ? 31 : 33; - chargeVelocity = expertMode ? 24f : 23f; - } - - if (bossRush) - { - idlePhaseTimer = 35; - idlePhaseAcceleration *= 1.25f; - idlePhaseVelocity *= 1.2f; - chargeTime -= 3; - chargeVelocity *= 1.25f; - } - else if (death) - { - idlePhaseTimer = 51; - idlePhaseAcceleration *= 1.05f; - idlePhaseVelocity *= 1.05f; - chargeTime -= 2; - chargeVelocity *= 1.1f; - } - else if (revenge) - { - idlePhaseTimer = 53; - idlePhaseAcceleration *= 1.025f; - idlePhaseVelocity *= 1.025f; - chargeTime -= 1; - chargeVelocity *= 1.05f; - } - - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge) - chargeVelocity *= 1.25f; - - if (exhausted) - idlePhaseVelocity *= 0.25f; - - // Variables - int maxToothBallBelches = bossRush ? 5 : death ? 4 : 3; - int toothBallBelchPhaseDivisor = bossRush ? 24 : 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 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; - int attackTimer = 120; - int phaseTransitionTimer = 180; - int teleportPauseTimer = 30; - int toothBallSpinPhaseDivisor = bossRush ? 27 : death ? 32 : 45; - int toothBallSpinTimer = maxToothBallBelches * toothBallSpinPhaseDivisor; - float spinTime = toothBallSpinTimer / 2f; - float toothBallSpinToothBallVelocity = bossRush ? 14f : death ? 9.5f : 9f; - float spinAttackSpeed = Main.zenithWorld ? 44f : 22f; - float spinSpeed = MathHelper.TwoPi / spinTime; - - Player player = Main.player[npc.target]; - - // Get target - if (npc.target < 0 || npc.target == Main.maxPlayers || player.dead || !player.active) - { - npc.TargetClosest(); - player = Main.player[npc.target]; - npc.netUpdate = true; - } - - // Despawn safety, make sure to target another player if the current player target is too far away - if (Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) - npc.TargetClosest(); - - // Despawn - if (player.dead || Vector2.Distance(player.Center, npc.Center) > 8800f) - { - npc.TargetClosest(); - - npc.velocity.Y -= 0.4f; - - if (npc.timeLeft > 10) - npc.timeLeft = 10; - - if (npc.timeLeft == 1) - { - AcidRainEvent.AccumulatedKillPoints = 0; - AcidRainEvent.HasTriedToSummonOldDuke = false; - AcidRainEvent.UpdateInvasion(false); - npc.timeLeft = 0; - } - - if (npc.ai[0] > 4f) - npc.ai[0] = 5f; - else - npc.ai[0] = 0f; - - npc.ai[2] = 0f; - } - - if (exhausted) - { - npc.Calamity().canBreakPlayerDefense = false; - - // Play exhausted sound - if (calamityGlobalNPC.newAI[0] % 60f == 0f && Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < 2800f) - SoundEngine.PlaySound(OldDuke.OldDuke.HuffSound with { Volume = OldDuke.OldDuke.HuffSound.Volume * 1.25f }, Main.LocalPlayer.Center); - - if (Main.zenithWorld) - { - float screenShakePower = 10 * Utils.GetLerpValue(800f, 0f, npc.Distance(Main.LocalPlayer.Center), true); - if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) - Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower; - - if (calamityGlobalNPC.newAI[0] == exhaustionGateValue) - SoundEngine.PlaySound(SoundID.NPCDeath64 with { Pitch = SoundID.NPCDeath64.Pitch - 0.9f, Volume = SoundID.NPCDeath64.Volume + 0.4f }, player.Center); // fart - - if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[0] % 5f == 0f) - { - Vector2 dist = player.Center - npc.Center; - dist.Normalize(); - dist *= 3; - dist.X += Main.rand.NextFloat(-0.5f, 0.5f); - dist.Y += Main.rand.NextFloat(-0.5f, 0.5f); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, -dist, type, damage, 0, Main.myPlayer); - } - } - - calamityGlobalNPC.newAI[0] -= bossRush ? 1.5f : 1f; - if (calamityGlobalNPC.newAI[0] <= 0f) - { - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - } - } - - // Enrage variable - bool enrage = !bossRush && - (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 && - (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))); - } - - // Enrage - if (enrage) - { - if (npc.localAI[1] > 0f) - npc.localAI[1] -= 1f; - } - else - npc.localAI[1] = CalamityGlobalNPC.biomeEnrageTimerMax; - - bool biomeEnraged = npc.localAI[1] <= 0f; - - npc.Calamity().CurrentlyEnraged = biomeEnraged || bossRush; - - // 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.CurrentlyIncreasingDefenseOrDR = npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f; - - // Enrage - if (biomeEnraged) - { - toothBallBelchPhaseTimer = 60; - toothBallBelchPhaseDivisor = 20; - toothBallBelchPhaseAcceleration = 1f; - toothBallBelchPhaseVelocity = 15f; - goreVelocityX = 12f; - goreVelocityY = 16f; - sharkronVelocity = 20f; - idlePhaseTimer = 20; - idlePhaseAcceleration = 1.2f; - idlePhaseVelocity = 20f; - chargeTime = 25; - chargeVelocity += 8f; - toothBallSpinPhaseDivisor = 24; - toothBallSpinToothBallVelocity = 15f; - setDamage *= 2; - npc.defense = npc.defDefense * 3; - } - - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge) - chargeTime *= 2; - - // Set variables for spawn effects - if (npc.localAI[0] == 0f) - { - npc.alpha = 255; - - npc.velocity.Y = -12f; - npc.velocity.X = Main.rand.NextFloat(-2f, 2f); - - npc.localAI[0] = 1f; - npc.rotation = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - npc.ai[0] = -1f; - npc.netUpdate = true; - } - } - - // Rotation - float rateOfRotation = 0.04f; - if (npc.ai[0] == 1f || npc.ai[0] == 6f || npc.ai[0] == 7f || npc.ai[0] == 14f) - rateOfRotation = 0f; - if (npc.ai[0] == 3f || npc.ai[0] == 4f) - rateOfRotation = 0.01f; - if (npc.ai[0] == 8f || npc.ai[0] == 13f) - rateOfRotation = 0.05f; - - Vector2 rotationVector = player.Center - npc.Center; - if (calamityGlobalNPC.newAI[1] != 1f && !player.dead) - { - // Rotate to show direction of predictive charge - if (npc.ai[0] == 0f && !phase2) - { - if (npc.ai[3] < 6f) - { - rateOfRotation = 0.1f; - rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - npc.Center) * chargeVelocity; - } - } - else if (npc.ai[0] == 5f && !phase3) - { - if (npc.ai[3] < 4f) - { - rateOfRotation = 0.1f; - rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - npc.Center) * chargeVelocity; - } - } - else if (npc.ai[0] == 10f) - { - if (npc.ai[3] < 8f && npc.ai[3] != 1f && npc.ai[3] != 4f) - { - rateOfRotation = 0.1f; - rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - npc.Center) * chargeVelocity; - } - } - } - - float dukeRotationSpeed = (float)Math.Atan2(rotationVector.Y, rotationVector.X); - if (npc.spriteDirection == 1) - dukeRotationSpeed += pie; - if (dukeRotationSpeed < 0f) - dukeRotationSpeed += MathHelper.TwoPi; - if (dukeRotationSpeed > MathHelper.TwoPi) - dukeRotationSpeed -= MathHelper.TwoPi; - if (npc.ai[0] == -1f || npc.ai[0] == 3f || npc.ai[0] == 4f) - dukeRotationSpeed = 0f; - if (npc.ai[0] == 8f || npc.ai[0] == 13f) - dukeRotationSpeed = pie * 0.1666666667f * npc.spriteDirection; - - if (npc.rotation < dukeRotationSpeed) - { - if (dukeRotationSpeed - npc.rotation > pie) - npc.rotation -= rateOfRotation; - else - npc.rotation += rateOfRotation; - } - if (npc.rotation > dukeRotationSpeed) - { - if (npc.rotation - dukeRotationSpeed > pie) - npc.rotation += rateOfRotation; - else - npc.rotation -= rateOfRotation; - } - - if ((npc.ai[0] != 8f && npc.ai[0] != 13f) || npc.spriteDirection == 1) - { - if (npc.rotation > dukeRotationSpeed - rateOfRotation && npc.rotation < dukeRotationSpeed + rateOfRotation) - npc.rotation = dukeRotationSpeed; - if (npc.rotation < 0f) - npc.rotation += MathHelper.TwoPi; - if (npc.rotation > MathHelper.TwoPi) - npc.rotation -= MathHelper.TwoPi; - if (npc.rotation > dukeRotationSpeed - rateOfRotation && npc.rotation < dukeRotationSpeed + rateOfRotation) - npc.rotation = dukeRotationSpeed; - } - - // Alpha adjustments - if (npc.ai[0] != -1f && (npc.ai[0] < 9f || npc.ai[0] > 12f)) - { - if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - npc.alpha += 15; - else - npc.alpha -= 15; - - if (npc.alpha < 0) - npc.alpha = 0; - if (npc.alpha > 150) - npc.alpha = 150; - } - - // Spawn effects - if (npc.ai[0] == -1f) - { - npc.alpha = (int)MathHelper.Lerp(npc.alpha, 0, 0.2f); - - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - if (npc.Calamity().newAI[3] == 0f) - npc.velocity *= 0.98f; - - // Direction - int dukeFaceDirection = Math.Sign(player.Center.X - npc.Center.X); - if (dukeFaceDirection != 0) - { - npc.direction = dukeFaceDirection; - npc.spriteDirection = -npc.direction; - } - - // Alpha - if (npc.ai[2] > 20f) - { - npc.velocity *= 0.9f; - - npc.alpha -= 5; - if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - npc.alpha += 15; - if (npc.alpha < 0) - npc.alpha = 0; - if (npc.alpha > 150) - npc.alpha = 150; - } - - if (npc.ai[2] == 75) - { - modNPC.RoarSoundSlot = SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.Center); - - CalamityUtils.AddScreenshakeAt(npc.Center, 14); - SoundEngine.PlaySound(SoundID.DD2_BetsyFlameBreath.WithPitchOffset(-0.5f), npc.Center); - SoundEngine.PlaySound(OldDuke.OldDuke.DashSoundP3, npc.Center); - } - - if (npc.ai[2] >= 75f) - { - float sd = player.Center.X > npc.Center.X ? -1f : 1f; - - (npc.ModNPC as OldDuke.OldDuke).shake = 2f; - npc.rotation = MathHelper.Lerp(MathHelper.WrapAngle(npc.rotation), MathHelper.ToRadians(sd == 1f ? 75f : -75f), 0.2f); - - if (npc.ai[2] % 5f == 1f) - { - Vector2 mouthCenter = npc.Center + new Vector2(-80 * sd, 0).RotatedBy(npc.rotation); - - float factor = (npc.ai[2] - 75f) / 50f; - - float a = MathHelper.Lerp(1f, 0f, factor); - - GeneralParticleHandler.SpawnParticle(new CustomPulse(mouthCenter, Vector2.Zero, new Color(55, 55, 55).MultiplyRGBA(new Color(a, a, a, a)), "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.05f, 0.08f + (0.15f * factor), 10)); - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= 125f) - { - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.netUpdate = true; - } - } - - // Phase 1 - else if (npc.ai[0] == 0f && !player.dead) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - if (npc.ai[1] == 0f) - npc.ai[1] = 500 * Math.Sign((npc.Center - player.Center).X); - - Vector2 phase1IdleSpeed = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -300f) - npc.Center - npc.velocity) * idlePhaseVelocity; - npc.SimpleFlyMovement(phase1IdleSpeed, idlePhaseAcceleration); - - // Rotation and direction - int dukeLookAt = Math.Sign(player.Center.X - npc.Center.X); - if (dukeLookAt != 0) - { - if (npc.ai[2] == 0f && dukeLookAt != npc.direction) - npc.rotation += pie; - - npc.direction = dukeLookAt; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - // Phase switch - if (calamityGlobalNPC.newAI[1] != 1f || (phase2 && !phase2AI)) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || (phase2 && !phase2AI)) - { - int oldDukeAttackPicker = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - oldDukeAttackPicker = 1; - break; - case 6: - npc.ai[3] = 1f; - oldDukeAttackPicker = 2; - break; - case 7: - npc.ai[3] = 0f; - oldDukeAttackPicker = 3; - break; - } - - if (phase2) - oldDukeAttackPicker = 4; - - // Set velocity for charge - if (oldDukeAttackPicker == 1) - { - npc.ai[0] = 1f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - // Velocity - Vector2 distanceVector = player.Center + player.velocity * 20f - npc.Center; - npc.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - DoChargeBurst(npc, 0); - - // Direction - if (dukeLookAt != 0) - { - npc.direction = dukeLookAt; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - } - - // Tooth Balls - else if (oldDukeAttackPicker == 2) - { - npc.ai[0] = 2f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - // Call sharks from the sides of the screen - else if (oldDukeAttackPicker == 3) - { - npc.ai[0] = 3f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - // Go to phase 2 - else if (oldDukeAttackPicker == 4) - { - npc.ai[0] = 4f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - npc.netUpdate = true; - } - } - } - - // Charge - else if (npc.ai[0] == 1f) - { - // Set damage - npc.damage = setDamage; - - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge && npc.ai[2] % 10f == 0f) - { - // Rotation and direction - int dir = Math.Sign(player.Center.X - npc.Center.X); - if (dir != 0) - { - if (npc.ai[2] == 0f && dir != npc.direction) - npc.rotation += pie; - - npc.direction = dir; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - Vector2 distanceVector = player.Center + player.velocity * 20f - npc.Center; - npc.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - // Direction - if (dir != 0) - { - npc.direction = dir; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - } - else - { - // Accelerate - npc.velocity *= 1.01f; - } - - // Spawn dust - Vector2 vel = npc.velocity; - vel.Normalize(); - vel *= 55f; - - DoChargeVisual(npc, phase); - - GeneralParticleHandler.SpawnParticle(new SparkParticle(npc.Center + vel + vel.RotatedBy(MathHelper.ToRadians(90)), vel / 7f, false, 20, 0.75f, new Color(155, 155, 155, 55), true)); - GeneralParticleHandler.SpawnParticle(new SparkParticle(npc.Center + vel + vel.RotatedBy(MathHelper.ToRadians(-90)), vel / 7f, false, 20, 0.75f, new Color(155, 155, 155, 55), true)); - - npc.ai[2] += 1f; - if (npc.ai[2] >= chargeTime) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Tooth Ball belch - else if (npc.ai[0] == 2f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - if (npc.ai[1] == 0f) - npc.ai[1] = 500 * Math.Sign((npc.Center - player.Center).X); - - Vector2 toothBallBelchPhaseSpeed = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -300f) - npc.Center - npc.velocity) * toothBallBelchPhaseVelocity; - npc.SimpleFlyMovement(toothBallBelchPhaseSpeed, toothBallBelchPhaseAcceleration); - - // Play sounds and spawn Tooth Balls - if (npc.ai[2] == 0f) - modNPC.RoarSoundSlot = SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.Center); - - if (npc.ai[2] % toothBallBelchPhaseDivisor == 0f) - { - if (npc.ai[2] != 0f) - SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.Center); - - Vector2 toothBallDirection = Vector2.Normalize(player.Center - npc.Center) * (npc.width + 20) / 2f + npc.Center; - Vector2 toothBallVelocity = Vector2.Normalize(Main.player[npc.target].Center - npc.Center) * toothBallFinalVelocity; - Vector2 toothBallSpawnPos = new Vector2(toothBallDirection.X, toothBallDirection.Y + 45f); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int toothBall = NPC.NewNPC(npc.GetSource_FromAI(), (int)toothBallSpawnPos.X, (int)toothBallSpawnPos.Y, ModContent.NPCType(), 0, toothBallVelocity.X, toothBallVelocity.Y); - Main.npc[toothBall].velocity = Vector2.Normalize(toothBallVelocity) * npc.velocity.Length(); - Main.npc[toothBall].netUpdate = true; - } - - for (int i = 0; i < 50; i++) - { - int dustID; - switch (Main.rand.Next(6)) - { - case 0: - case 1: - case 2: - case 3: - dustID = (int)CalamityDusts.SulphurousSeaAcid; - break; - default: - dustID = DustID.Blood; - break; - } - - // Choose a random speed and angle to belch out the vomit - float dustSpeed = Main.rand.NextFloat(3.0f, 12.0f); - float angleRandom = 0.06f; - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(toothBallVelocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - // Pick a size for the vomit particles - float scale = Main.rand.NextFloat(1f, 2f); - - // Actually spawn the vomit - int idx = Dust.NewDust(toothBallSpawnPos, 40, 40, dustID, dustVel.X, dustVel.Y, 0, default, scale); - Main.dust[idx].noGravity = true; - } - } - - // Direction - int toothBallLookAt = Math.Sign(player.Center.X - npc.Center.X); - if (toothBallLookAt != 0) - { - npc.direction = toothBallLookAt; - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - npc.spriteDirection = -npc.direction; - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= toothBallBelchPhaseTimer) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Call sharks from the sides of the screen - else if (npc.ai[0] == 3f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - // Play sound and spawn sharks - if (npc.ai[2] == attackTimer - 30) - SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.Center); - - if (npc.ai[2] >= attackTimer - 90) - { - if (npc.ai[2] % 18f == 0f) - { - calamityGlobalNPC.newAI[2] += 100f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + 900f), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - 900f), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - - if (Main.getGoodWorld) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + 1800f), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - 1800f), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - } - } - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= attackTimer) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - calamityGlobalNPC.newAI[2] = 0f; - npc.ai[0] = 0f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Transition to phase 2 and call sharks from below - else if (npc.ai[0] == 4f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - // Sound - if (npc.ai[2] == phaseTransitionTimer - 60) - modNPC.RoarSoundSlot = SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.Center); - - if (npc.ai[2] >= phaseTransitionTimer - 60) - { - if (npc.ai[2] % 18f == 0f) - { - calamityGlobalNPC.newAI[2] += 150f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(npc.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(npc.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); - - if (Main.getGoodWorld) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(npc.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(npc.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); - } - } - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= phaseTransitionTimer) - { - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Phase 2 - else if (npc.ai[0] == 5f && !player.dead) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - if (npc.ai[1] == 0f) - npc.ai[1] = 500 * Math.Sign((npc.Center - player.Center).X); - - Vector2 dukePhase2IdleSpeed = Vector2.Normalize(player.Center + new Vector2(npc.ai[1], -300f) - npc.Center - npc.velocity) * idlePhaseVelocity; - npc.SimpleFlyMovement(dukePhase2IdleSpeed, idlePhaseAcceleration); - - // Direction and rotation - int phase2FaceDirection = Math.Sign(player.Center.X - npc.Center.X); - if (phase2FaceDirection != 0) - { - if (npc.ai[2] == 0f && phase2FaceDirection != npc.direction) - npc.rotation += pie; - - npc.direction = phase2FaceDirection; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - // Phase switch - if (calamityGlobalNPC.newAI[1] != 1f || (phase3 && !phase3AI)) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer || (phase3 && !phase3AI)) - { - int phase2AttackPicker = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 1: - case 2: - case 3: - phase2AttackPicker = 1; - break; - case 4: - npc.ai[3] = 1f; - phase2AttackPicker = 2; - break; - case 5: - npc.ai[3] = 0f; - phase2AttackPicker = 3; - break; - } - - if (phase3) - phase2AttackPicker = 4; - - // Set velocity for charge - if (phase2AttackPicker == 1) - { - npc.ai[0] = 6f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - // Velocity and rotation - Vector2 distanceVector = player.Center + player.velocity * 20f - npc.Center; - npc.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - // Direction - if (phase2FaceDirection != 0) - { - npc.direction = phase2FaceDirection; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - DoChargeBurst(npc, 1); - } - - // Set velocity for spin - else if (phase2AttackPicker == 2) - { - // Velocity and rotation - npc.velocity = Vector2.Normalize(player.Center - npc.Center) * spinAttackSpeed; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - // Direction - if (phase2FaceDirection != 0) - { - npc.direction = phase2FaceDirection; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - npc.ai[0] = 7f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - else if (phase2AttackPicker == 3) - { - npc.ai[0] = 8f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - // Go to next phase - else if (phase2AttackPicker == 4) - { - npc.ai[0] = 9f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - npc.netUpdate = true; - } - } - } - - // Charge - else if (npc.ai[0] == 6f) - { - // Set damage - npc.damage = setDamage; - - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge && npc.ai[2] % 8f == 0f) - { - // Rotation and direction - int dir = Math.Sign(player.Center.X - npc.Center.X); - if (dir != 0) - { - if (npc.ai[2] == 0f && dir != npc.direction) - npc.rotation += pie; - - npc.direction = dir; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - Vector2 distanceVector = player.Center + player.velocity * 20f - npc.Center; - npc.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - // Direction - if (dir != 0) - { - npc.direction = dir; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - } - else - { - // Accelerate - npc.velocity *= 1.01f; - } - - DoChargeVisual(npc, phase); - - npc.ai[2] += 1f; - if (npc.ai[2] >= chargeTime) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Tooth Ball and Vortex spin - else if (npc.ai[0] == 7f) - { - // Set damage - npc.damage = 0; - - // Play sounds and spawn Tooth Balls and a Vortex - if (npc.ai[2] == 0f) - { - modNPC.RoarSoundSlot = SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.Center); - - SoundEngine.PlaySound(OldDuke.OldDuke.VortexSpawnSound, npc.Center); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 vortexSpawn = npc.Center + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; - if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); - } - - if (npc.ai[2] % toothBallSpinPhaseDivisor == 0f) - { - if (npc.ai[2] != 0f) - SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.Center); - - Vector2 phase2ToothBallDirection = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + npc.Center; - Vector2 toothBallVelocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * toothBallSpinToothBallVelocity; - Vector2 toothBallSpawnPos = new Vector2(phase2ToothBallDirection.X, phase2ToothBallDirection.Y + 45f); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int toothBall = NPC.NewNPC(npc.GetSource_FromAI(), (int)toothBallSpawnPos.X, (int)toothBallSpawnPos.Y, ModContent.NPCType(), 0, toothBallVelocity.X, toothBallVelocity.Y); - Main.npc[toothBall].target = npc.target; - Main.npc[toothBall].velocity = Vector2.Normalize(toothBallVelocity) * toothBallSpinToothBallVelocity * 0.5f; - Main.npc[toothBall].netUpdate = true; - Main.npc[toothBall].ai[3] = 30f; - } - - for (int i = 0; i < 50; i++) - { - int dustID; - switch (Main.rand.Next(6)) - { - case 0: - case 1: - case 2: - case 3: - dustID = (int)CalamityDusts.SulphurousSeaAcid; - break; - default: - dustID = DustID.Blood; - break; - } - - // Choose a random speed and angle to belch out the vomit - float dustSpeed = Main.rand.NextFloat(3.0f, 12.0f); - float angleRandom = 0.06f; - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(toothBallVelocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - // Pick a size for the vomit particles - float scale = Main.rand.NextFloat(1f, 2f); - - // Actually spawn the vomit - int idx = Dust.NewDust(toothBallSpawnPos, 40, 40, dustID, dustVel.X, dustVel.Y, 0, default, scale); - Main.dust[idx].noGravity = true; - } - } - - // Velocity and rotation - npc.velocity = npc.velocity.RotatedBy(-(double)spinSpeed * (float)npc.direction); - npc.rotation -= spinSpeed * npc.direction; - - npc.ai[2] += 1f; - if (npc.ai[2] >= toothBallSpinTimer) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Vomit a huge amount of gore into the sky and call sharks from the sides of the screen - else if (npc.ai[0] == 8f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - // Play sound - if (npc.ai[2] == attackTimer - 30) - { - SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 phase2GoreDirection = npc.rotation.ToRotationVector2() * (Vector2.UnitX * npc.direction) * (npc.width + 20) / 2f + npc.Center; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int totalGore = Main.getGoodWorld ? 40 : 20; - for (int i = 0; i < totalGore; i++) - { - float velocityX = npc.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - - if (Main.getGoodWorld) - { - velocityX *= Main.rand.NextFloat() + 0.5f; - velocityY *= Main.rand.NextFloat() + 0.5f; - } - - Projectile.NewProjectile(npc.GetSource_FromAI(), phase2GoreDirection.X, phase2GoreDirection.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - } - - if (npc.ai[2] >= attackTimer - 90) - { - if (npc.ai[2] % 18f == 0f) - { - calamityGlobalNPC.newAI[2] += 100f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float x = 900f - calamityGlobalNPC.newAI[2]; - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + x), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - x), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - } - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= attackTimer) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - calamityGlobalNPC.newAI[2] = 0f; - npc.ai[0] = 5f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Transition to phase 3 and summon sharks from above - else if (npc.ai[0] == 9f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - // Sound - if (npc.ai[2] == phaseTransitionTimer - 60) - modNPC.RoarSoundSlot = SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.Center); - - if (npc.ai[2] >= phaseTransitionTimer - 60) - { - if (npc.ai[2] % 18f == 0f) - { - calamityGlobalNPC.newAI[2] += 200f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(npc.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, sharkronVelocity, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(npc.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, sharkronVelocity, 255); - - if (Main.getGoodWorld) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(npc.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(npc.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); - } - } - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= phaseTransitionTimer) - { - calamityGlobalNPC.newAI[0] = 0f; - calamityGlobalNPC.newAI[1] = 0f; - calamityGlobalNPC.newAI[2] = 0f; - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Phase 3 - else if (npc.ai[0] == 10f && !player.dead) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Alpha - npc.alpha -= 25; - if (npc.alpha < 0) - npc.alpha = 0; - - // Movement location - if (npc.ai[1] == 0f) - npc.ai[1] = 500 * Math.Sign((npc.Center - player.Center).X); - - Vector2 desiredVelocity = Vector2.Normalize(player.Center + new Vector2(-npc.ai[1], -300f) - npc.Center - npc.velocity) * idlePhaseVelocity; - npc.SimpleFlyMovement(desiredVelocity, idlePhaseAcceleration); - - // Rotation and direction - int phase3FaceDirection = Math.Sign(player.Center.X - npc.Center.X); - if (phase3FaceDirection != 0) - { - if (npc.ai[2] == 0f && phase3FaceDirection != npc.direction) - { - npc.rotation += pie; - for (int l = 0; l < npc.oldPos.Length; l++) - npc.oldPos[l] = Vector2.Zero; - } - - npc.direction = phase3FaceDirection; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - // Phase switch - if (calamityGlobalNPC.newAI[1] != 1f) - { - npc.ai[2] += 1f; - if (npc.ai[2] >= idlePhaseTimer) - { - int phase3AttackPicker = 0; - switch ((int)npc.ai[3]) - { - case 0: - case 2: - case 3: - case 5: - case 6: - case 7: - phase3AttackPicker = 1; - break; - case 1: - case 8: - phase3AttackPicker = 2; - break; - case 4: - npc.ai[3] = 1f; - phase3AttackPicker = 3; - break; - case 9: - npc.ai[3] = 6f; - phase3AttackPicker = 4; - break; - } - - // Set velocity for charge - if (phase3AttackPicker == 1) - { - npc.ai[0] = 11f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - // Velocity and rotation - Vector2 distanceVector = player.Center + player.velocity * 20f - npc.Center; - npc.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - // Direction - if (phase3FaceDirection != 0) - { - npc.direction = phase3FaceDirection; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - DoChargeBurst(npc, 2); - } - - // Pause - else if (phase3AttackPicker == 2) - { - npc.ai[0] = 12f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - else if (phase3AttackPicker == 3) - { - npc.ai[0] = 13f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - // Set velocity for spin - else if (phase3AttackPicker == 4) - { - // Velocity and rotation - npc.velocity = Vector2.Normalize(player.Center - npc.Center) * spinAttackSpeed; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - // Direction - if (phase3FaceDirection != 0) - { - npc.direction = phase3FaceDirection; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - npc.ai[0] = 14f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - } - - npc.netUpdate = true; - } - } - } - - // Charge - else if (npc.ai[0] == 11f) - { - // Set damage - npc.damage = setDamage; - - // The dumbest thing to ever exist - if (CalamityWorld.LegendaryMode && revenge && npc.ai[2] % 6f == 0f) - { - // Rotation and direction - int dir = Math.Sign(player.Center.X - npc.Center.X); - if (dir != 0) - { - if (npc.ai[2] == 0f && dir != npc.direction) - npc.rotation += pie; - - npc.direction = dir; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - - Vector2 distanceVector = player.Center + player.velocity * 20f - npc.Center; - npc.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; - npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); - - // Direction - if (dir != 0) - { - npc.direction = dir; - - if (npc.spriteDirection == 1) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - } - else - { - // Accelerate - npc.velocity *= 1.01f; - } - - DoChargeVisual(npc, phase); - - npc.ai[2] += 1f; - if (npc.ai[2] >= chargeTime) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.ai[3] += 2f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Pause before teleport - else if (npc.ai[0] == 12f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Alpha - if (npc.alpha < 255 && npc.ai[2] >= teleportPauseTimer - 15f) - { - npc.alpha += 17; - if (npc.alpha > 255) - npc.alpha = 255; - } - - // Velocity - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - // Play sound - if (npc.ai[2] == teleportPauseTimer / 2) - modNPC.RoarSoundSlot = SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == teleportPauseTimer - 1f) - { - // Teleport location - if (npc.ai[1] == 0f) - npc.ai[1] = 600 * Math.Sign((npc.Center - player.Center).X); - - // Rotation and direction - Vector2 center = player.Center + new Vector2(npc.ai[1], -300f); - Vector2 npcCenter = npc.Center = center; - int phase3TeleportFaceDirection = Math.Sign(player.Center.X - npcCenter.X); - if (phase3TeleportFaceDirection != 0) - { - if (npc.ai[2] == 0f && phase3TeleportFaceDirection != npc.direction) - { - npc.rotation += pie; - for (int n = 0; n < npc.oldPos.Length; n++) - npc.oldPos[n] = Vector2.Zero; - } - - npc.direction = phase3TeleportFaceDirection; - - if (npc.spriteDirection != -npc.direction) - npc.rotation += pie; - - npc.spriteDirection = -npc.direction; - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= teleportPauseTimer) - { - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - - npc.ai[3] += 2f; - if (npc.ai[3] >= 9f) - npc.ai[3] = 0f; - - npc.netUpdate = true; - } - } - - // Vomit a huge amount of gore into the sky and call sharks from the sides of the screen - else if (npc.ai[0] == 13f) - { - // Avoid cheap bullshit - npc.damage = 0; - - // Velocity - npc.velocity *= 0.98f; - npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); - - // Play sound - if (npc.ai[2] == attackTimer - 30) - { - SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 phase3GoreDirection = npc.rotation.ToRotationVector2() * (Vector2.UnitX * npc.direction) * (npc.width + 20) / 2f + npc.Center; - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - int totalGore = Main.getGoodWorld ? 40 : 20; - for (int i = 0; i < totalGore; i++) - { - float velocityX = npc.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); - - if (Main.getGoodWorld) - { - velocityX *= Main.rand.NextFloat() + 0.5f; - velocityY *= Main.rand.NextFloat() + 0.5f; - } - - Projectile.NewProjectile(npc.GetSource_FromAI(), phase3GoreDirection.X, phase3GoreDirection.Y, velocityX, -velocityY, type, damage, 0f, Main.myPlayer, 0f, 0f); - } - } - } - - if (npc.ai[2] >= attackTimer - 90) - { - if (npc.ai[2] % 18f == 0f) - { - calamityGlobalNPC.newAI[2] += 150f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float x = 900f - calamityGlobalNPC.newAI[2]; - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + x), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - x), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - - if (Main.getGoodWorld) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X + x), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X - x), (int)(npc.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, npc.whoAmI, 0f, 255); - } - } - } - } - - npc.ai[2] += 1f; - if (npc.ai[2] >= attackTimer) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - calamityGlobalNPC.newAI[2] = 0f; - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - // Tooth Ball and Vortex spin - else if (npc.ai[0] == 14f) - { - // Set damage - npc.damage = 0; - - // Play sounds and spawn Tooth Balls and a Vortex - if (npc.ai[2] == 0f) - { - modNPC.RoarSoundSlot = SoundEngine.PlaySound(OldDuke.OldDuke.RoarSound, npc.Center); - - SoundEngine.PlaySound(OldDuke.OldDuke.VortexSpawnSound, npc.Center); - int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - Vector2 vortexSpawn = npc.Center + npc.velocity.RotatedBy(MathHelper.PiOver2 * -npc.direction) * spinTime / MathHelper.TwoPi; - if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, damage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); - } - - if (npc.ai[2] % toothBallSpinPhaseDivisor == 0f) - { - if (npc.ai[2] != 0f) - SoundEngine.PlaySound(OldDuke.OldDuke.VomitSound, npc.Center); - - Vector2 phase3ToothBallDirection = Vector2.Normalize(npc.velocity) * (npc.width + 20) / 2f + npc.Center; - Vector2 toothBallVelocity = Vector2.Normalize(npc.velocity).RotatedBy(MathHelper.PiOver2 * npc.direction) * toothBallSpinToothBallVelocity; - Vector2 toothBallSpawnPos = new Vector2(phase3ToothBallDirection.X, phase3ToothBallDirection.Y + 45f); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int toothBall = NPC.NewNPC(npc.GetSource_FromAI(), (int)toothBallSpawnPos.X, (int)toothBallSpawnPos.Y, ModContent.NPCType(), 0, toothBallVelocity.X, toothBallVelocity.Y); - Main.npc[toothBall].target = npc.target; - Main.npc[toothBall].velocity = Vector2.Normalize(toothBallVelocity) * toothBallSpinToothBallVelocity * 0.5f; - Main.npc[toothBall].netUpdate = true; - Main.npc[toothBall].ai[3] = 60f; - } - - for (int i = 0; i < 50; i++) - { - int dustID; - switch (Main.rand.Next(6)) - { - case 0: - case 1: - case 2: - case 3: - dustID = (int)CalamityDusts.SulphurousSeaAcid; - break; - default: - dustID = DustID.Blood; - break; - } - - // Choose a random speed and angle to belch out the vomit - float dustSpeed = Main.rand.NextFloat(3.0f, 12.0f); - float angleRandom = 0.06f; - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(toothBallVelocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - // Pick a size for the vomit particles - float scale = Main.rand.NextFloat(1f, 2f); - - // Actually spawn the vomit - int idx = Dust.NewDust(toothBallSpawnPos, 40, 40, dustID, dustVel.X, dustVel.Y, 0, default, scale); - Main.dust[idx].noGravity = true; - } - } - - // Velocity and rotation - npc.velocity = npc.velocity.RotatedBy(-(double)spinSpeed * npc.direction); - npc.rotation -= spinSpeed * npc.direction; - - npc.ai[2] += 1f; - if (npc.ai[2] >= toothBallSpinTimer) - { - calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; - npc.ai[0] = 10f; - npc.ai[1] = 0f; - npc.ai[2] = 0f; - npc.TargetClosest(); - npc.netUpdate = true; - } - } - - if (SoundEngine.TryGetActiveSound(modNPC.RoarSoundSlot, out var roarSound) && roarSound.IsPlaying) - roarSound.Position = npc.Center; - } - - static Color FireGreen = new Color(155, 255, 55); - - static void DoChargeBurst(NPC npc, int phase) - { - SoundEngine.PlaySound(phase > 1 ? OldDuke.OldDuke.DashSoundP3 : OldDuke.OldDuke.DashSound, npc.Center); - - if (phase > 1) - { - for (int i = 0; i < 30; i++) - { - float fl = Main.rand.NextFloat(-60f, 60f); - GeneralParticleHandler.SpawnParticle(new SparkParticle(npc.Center + (Vector2.Zero.DirectionTo(npc.velocity) * 20f) + new Vector2(0f, fl).RotatedBy(Vector2.Zero.AngleTo(npc.velocity)), (-npc.velocity * Main.rand.NextFloat(2f)).RotatedBy(MathHelper.ToRadians(fl)), false, 25, Main.rand.NextFloat(0.3f, 1.2f), FireGreen)); - } - - CalamityUtils.AddScreenshakeAt(npc.Center, 10f, 3000f); - - SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, npc.Center); - SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, npc.Center); - GeneralParticleHandler.SpawnParticle(new CustomPulse(npc.Center, -npc.velocity / 3f, FireGreen, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1.2f), Vector2.Zero.AngleTo(npc.velocity) + (Main.rand.NextBool() ? 0 : -MathHelper.Pi), 0.05f, 0.2f, 20)); - GeneralParticleHandler.SpawnParticle(new CustomPulse(npc.Center, -npc.velocity / 2f, FireGreen, "CalamityMod/Particles/FlameExplosion", new Vector2(0.4f, 1.2f), Vector2.Zero.AngleTo(npc.velocity) + (Main.rand.NextBool() ? 0 : -MathHelper.Pi), 0.1f, 0.4f, 20)); - } - } - - static void DoChargeVisual(NPC npc, int phase) - { - float progress = npc.ai[2]; - - int chargeTime = 36; - - Color col = Color.Lerp(phase > 0 ? FireGreen : new Color(100, 100, 100, 55), new Color(55, 55, 55, 55), progress / chargeTime); - - if (phase > 1) - { - if (Math.Floor(VisualTimerSystem.GlobalVisualTimer % 6f) < 1f) - GeneralParticleHandler.SpawnParticle(new CustomPulse(npc.Center, npc.velocity / 3f, col, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1f), Vector2.Zero.AngleTo(npc.velocity) + (Main.rand.NextBool() ? 0 : -MathHelper.Pi), 0.04f, 0.1f, 20)); - - (npc.ModNPC as OldDuke.OldDuke).NuclearOverlayVisual = 1f; - } - - if (Main.rand.NextBool()) - GeneralParticleHandler.SpawnParticle(new CustomSpark(npc.Center - (npc.velocity * 2f), npc.velocity / 2f, "CalamityMod/Particles/ForwardSmear", false, 10, Main.rand.NextFloat(0.3f, 0.5f), col, new Vector2(1f, Main.rand.NextFloat(1.45f, 1.6f)), fadeIn: true, extraRotation: MathHelper.ToRadians(180f))); - } - } -} diff --git a/NPCs/CalamityDrawParameterNPC.cs b/NPCs/CalamityDrawParameterNPC.cs index f872738810..40c5bf6185 100644 --- a/NPCs/CalamityDrawParameterNPC.cs +++ b/NPCs/CalamityDrawParameterNPC.cs @@ -45,8 +45,8 @@ namespace CalamityMod.NPCs #region Load / Unload public override void Load() { - DrawingMiracleBlight = new bool[Main.maxNPCs]; - DrawingPolarity = new bool[Main.maxNPCs]; + DrawingMiracleBlight = new bool[Main.maxNPCs + 1]; + DrawingPolarity = new bool[Main.maxNPCs + 1]; } public override void Unload() diff --git a/NPCs/CalamityGlobalNPC.cs b/NPCs/CalamityGlobalNPC.cs index cf6ca20151..569944cd14 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; @@ -203,8 +204,6 @@ namespace CalamityMod.NPCs public float velocityPriorToPhaseSwap = 0f; public const float velocityPriorToPhaseSwapIncrement = 0.1f; - public bool ShouldFallThroughPlatforms; - /// Allows hostile NPCs to deal defense damage to the player, used mostly for hard-hitting bosses. public bool canBreakPlayerDefense = false; @@ -237,20 +236,6 @@ namespace CalamityMod.NPCs private const double EnemyHPMultiplier = 1.25; /// Constant multiplier used to decrease the health and/or damage of pre-Hardmode Desert enemies. private const double DesertEnemyStatMultiplier = 0.75; - /// - /// Constant multiplier used to decrease vanilla boss health in Master Mode.
- /// When combined with the universal health multiplier, results in 27.5% more health than Expert Mode. - ///
- public const double MasterModeBossHPMultiplier = 0.85; - - /// Constant multiplier used to decrease enemy health in Master Mode. - public const double MasterModeEnemyHPMultiplier = 0.75; - /// Constant multiplier used to decrease enemy damage in Master Mode. - public const double MasterModeEnemyDamageMultiplier = 0.9; - /// Constant multiplier used to decrease enemy knockback resistance. - public const float ExpertModeEnemyKnockbackMultiplier = 0.05f; - /// - public const float MasterModeEnemyKnockbackMultiplier = 0.1f; /// Constant multiplier used for decreasing the health and damage of mechanical bosses if the Early Hardmode Progression Rework config is enabled. public const double EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic = 0.8; @@ -311,7 +296,6 @@ namespace CalamityMod.NPCs public bool temporalSadness = false; public bool eutrophication = false; public bool webbed = false; - public bool slowed = false; public bool electrified = false; public bool pearlAura = false; /// @@ -571,8 +555,6 @@ namespace CalamityMod.NPCs myClone.velocityPriorToPhaseSwap = velocityPriorToPhaseSwap; - myClone.ShouldFallThroughPlatforms = ShouldFallThroughPlatforms; - myClone.canBreakPlayerDefense = canBreakPlayerDefense; myClone.miscDefenseLoss = miscDefenseLoss; @@ -608,7 +590,6 @@ namespace CalamityMod.NPCs myClone.temporalSadness = temporalSadness; myClone.eutrophication = eutrophication; myClone.webbed = webbed; - myClone.slowed = slowed; myClone.electrified = electrified; myClone.pearlAura = pearlAura; myClone.pearlAuraCounter = pearlAuraCounter; @@ -931,12 +912,6 @@ namespace CalamityMod.NPCs damage = projectileCount * 4; } } - - // Parasitic Scepter debuff stacking - if (irradiated) - { - - } #endregion // Debuff vulnerabilities and resistances. @@ -1080,115 +1055,29 @@ namespace CalamityMod.NPCs { #region Setup Vanilla DR Values DRValues = new SortedDictionary { - { NPCID.AngryBonesBig, 0.2f }, - { NPCID.AngryBonesBigHelmet, 0.2f }, - { NPCID.AngryBonesBigMuscle, 0.2f }, - { NPCID.AnomuraFungus, 0.1f }, - { NPCID.Antlion, 0.1f }, - { NPCID.Arapaima, 0.1f }, - { NPCID.ArmoredSkeleton, 0.15f }, - { NPCID.ArmoredViking, 0.1f }, - { NPCID.BigMimicCorruption, 0.3f }, - { NPCID.BigMimicCrimson, 0.3f }, - { NPCID.BigMimicHallow, 0.3f }, - { NPCID.BigMimicJungle, 0.3f }, - { NPCID.BlueArmoredBones, 0.2f }, - { NPCID.BlueArmoredBonesMace, 0.2f }, - { NPCID.BlueArmoredBonesNoPants, 0.2f }, - { NPCID.BlueArmoredBonesSword, 0.2f }, - { NPCID.BoneLee, 0.2f }, - { NPCID.Crab, 0.05f }, - { NPCID.Crawdad, 0.2f }, - { NPCID.Crawdad2, 0.2f }, { NPCID.CultistBoss, 0.15f }, - { NPCID.Deerclops, 0.05f }, - { NPCID.DD2Betsy, 0.1f }, - { NPCID.DD2OgreT2, 0.1f }, - { NPCID.DD2OgreT3, 0.15f }, - { NPCID.DeadlySphere, 0.4f }, - { NPCID.DiabolistRed, 0.2f }, - { NPCID.DiabolistWhite, 0.2f }, { NPCID.DukeFishron, 0.15f }, { NPCID.DungeonGuardian, 0.9f }, - { NPCID.DungeonSpirit, 0.2f }, - { NPCID.ElfCopter, 0.15f }, - { NPCID.Everscream, 0.1f }, - { NPCID.FlyingAntlion, 0.05f }, - { NPCID.GiantCursedSkull, 0.2f }, - { NPCID.GiantShelly, 0.2f }, - { NPCID.GiantShelly2, 0.2f }, - { NPCID.GiantTortoise, 0.35f }, - { NPCID.Golem, 0.25f }, - { NPCID.GolemFistLeft, 0.25f }, - { NPCID.GolemFistRight, 0.25f }, - { NPCID.GolemHead, 0.25f }, - { NPCID.GolemHeadFree, 0.25f }, - { NPCID.GraniteFlyer, 0.1f }, - { NPCID.GraniteGolem, 0.15f }, - { NPCID.GreekSkeleton, 0.1f }, - { NPCID.HellArmoredBones, 0.2f }, - { NPCID.HellArmoredBonesMace, 0.2f }, - { NPCID.HellArmoredBonesSpikeShield, 0.2f }, - { NPCID.HellArmoredBonesSword, 0.2f }, - { NPCID.IceGolem, 0.1f }, - { NPCID.IceQueen, 0.1f }, - { NPCID.IceTortoise, 0.35f }, - { NPCID.HeadlessHorseman, 0.05f }, - { NPCID.MartianDrone, 0.2f }, - { NPCID.MartianSaucer, 0.2f }, - { NPCID.MartianSaucerCannon, 0.2f }, - { NPCID.MartianSaucerCore, 0.2f }, - { NPCID.MartianSaucerTurret, 0.2f }, - { NPCID.MartianTurret, 0.2f }, - { NPCID.MartianWalker, 0.35f }, - { NPCID.Mimic, 0.3f }, + { NPCID.Golem, 0.15f }, + { NPCID.GolemFistLeft, 0.15f }, + { NPCID.GolemFistRight, 0.15f }, + { NPCID.GolemHead, 0.15f }, + { NPCID.GolemHeadFree, 0.15f }, { NPCID.MoonLordCore, 0.15f }, { NPCID.MoonLordHand, 0.15f }, { NPCID.MoonLordHead, 0.15f }, - { NPCID.Mothron, 0.2f }, - { NPCID.MothronEgg, 0.5f }, - { NPCID.MourningWood, 0.1f }, - { NPCID.Necromancer, 0.2f }, - { NPCID.NecromancerArmored, 0.2f }, - { NPCID.Paladin, 0.45f }, - { NPCID.PirateCaptain, 0.05f }, - { NPCID.PirateShipCannon, 0.15f }, { NPCID.Plantera, 0.15f }, - { NPCID.PlanterasTentacle, 0.1f }, { NPCID.HallowBoss, 0.15f }, - { NPCID.PossessedArmor, 0.25f }, - { NPCID.PresentMimic, 0.3f }, { NPCID.PrimeCannon, 0.2f }, { NPCID.PrimeLaser, 0.2f }, { NPCID.PrimeSaw, 0.2f }, { NPCID.PrimeVice, 0.2f }, - { NPCID.Probe, 0.2f }, - { NPCID.Pumpking, 0.1f }, - { NPCID.QueenBee, 0.05f }, - { NPCID.RaggedCaster, 0.2f }, - { NPCID.RaggedCasterOpenCoat, 0.2f }, { NPCID.Retinazer, 0.2f }, - { NPCID.RustyArmoredBonesAxe, 0.2f }, - { NPCID.RustyArmoredBonesFlail, 0.2f }, - { NPCID.RustyArmoredBonesSword, 0.2f }, - { NPCID.RustyArmoredBonesSwordNoArmor, 0.2f }, - { NPCID.SandElemental, 0.1f }, - { NPCID.SantaNK1, 0.35f }, - { NPCID.SeaSnail, 0.05f }, - { NPCID.SkeletonArcher, 0.1f }, - { NPCID.SkeletonCommando, 0.2f }, - { NPCID.SkeletonSniper, 0.2f }, - { NPCID.SkeletronHand, 0.05f }, - { NPCID.SkeletronHead, 0.05f }, { NPCID.SkeletronPrime, 0.2f }, { NPCID.Spazmatism, 0.2f }, - { NPCID.TacticalSkeleton, 0.2f }, { NPCID.TheDestroyer, 0.1f }, { NPCID.TheDestroyerBody, 0.2f }, { NPCID.TheDestroyerTail, 0.35f }, - { NPCID.TheHungry, 0.1f }, - { NPCID.UndeadViking, 0.1f }, - { NPCID.WalkingAntlion, 0.1f }, { NPCID.WallofFlesh, 0.15f }, }; #endregion @@ -1226,7 +1115,7 @@ namespace CalamityMod.NPCs { NPCID.Creeper, 1800 }, // 0:30 (30 seconds, length of Creepers phase) { NPCID.Deerclops, 5400 }, // 1:30 (90 seconds) { NPCID.QueenBee, 7200 }, // 2:00 (120 seconds) - { NPCID.SkeletronHead, 9000 }, // 2:30 (150 seconds) + { NPCID.SkeletronHead, 7200 }, // 2:00 (120 seconds) { NPCID.WallofFlesh, 7200 }, // 2:00 (120 seconds) { NPCID.WallofFleshEye, 7200 }, { NPCID.QueenSlimeBoss, 7200 }, // 2:00 (120 seconds) @@ -1237,10 +1126,10 @@ namespace CalamityMod.NPCs { NPCID.TheDestroyerTail, 10800 }, { NPCID.SkeletronPrime, 10800 }, // 3:00 (180 seconds) { NPCID.Plantera, 10800 }, // 3:00 (180 seconds) - { NPCID.HallowBoss, 10800 }, // 3:00 (180 seconds) { NPCID.Golem, 9000 }, // 2:30 (150 seconds) { NPCID.GolemHead, 3600 }, // 1:00 (60 seconds) { NPCID.DukeFishron, 9000 }, // 2:30 (150 seconds) + { NPCID.HallowBoss, 10800 }, // 3:00 (180 seconds) { NPCID.CultistBoss, 9000 }, // 2:30 (150 seconds) { NPCID.MoonLordCore, 14400 }, // 4:00 (240 seconds) { NPCID.MoonLordHand, 7200 }, // 2:00 (120 seconds) @@ -1266,7 +1155,7 @@ namespace CalamityMod.NPCs { NPCType(), 9000 }, { NPCType(), 9000 }, { NPCType(), 10800 }, // 3:00 (180 seconds) - { NPCType(), 14400 }, // 4:00 (240 seconds) + { NPCType(), 10800 }, // 3:00 (180 seconds) { NPCType(), 10800 }, // 3:00 (180 seconds) { NPCType(), 10800 }, { NPCType(), 10800 }, // 3:00 (180 seconds) @@ -1275,8 +1164,8 @@ namespace CalamityMod.NPCs { NPCType(), 7200 }, { NPCType(), 10800 }, // 3:00 (180 seconds) { NPCType(), 10800 }, // 3:00 (180 seconds) - { NPCType(), 5400 }, // 1:30 (90 seconds) - { NPCType(), 7200 }, // 2:00 (120 seconds) + { NPCType(), 7200 }, // 2:00 (120 seconds) + { NPCType(), 7200 }, // 2:00 (120 seconds) { NPCType(), 14400 }, // 4:00 (240 seconds) { NPCType(), 10800 }, // 3:00 (180 seconds) { NPCType(), 1200 }, // 0:20 (20 seconds) @@ -1289,7 +1178,7 @@ namespace CalamityMod.NPCs { NPCType(), 14400 }, // 4:00 (240 seconds) { NPCType(), 14400 }, // DoG Phase 1 is 1:30, DoG Phase 2 is 2:30 { NPCType(), 14400 }, - { NPCType(), 14700 }, // 4:05 (245 seconds) -- he spends 5 seconds invincible where you can't do anything + { NPCType(), 14400 }, // 4:00 (240 seconds) { NPCType(), 21600 }, // 6:00 (360 seconds) { NPCType(), 21600 }, { NPCType(), 21600 }, // 6:00 (360 seconds) @@ -1317,8 +1206,6 @@ namespace CalamityMod.NPCs public override void SetDefaults(NPC npc) { - ShouldFallThroughPlatforms = false; - for (int i = 0; i < maxPlayerImmunities; i++) dashImmunityTime[i] = 0; @@ -1354,8 +1241,6 @@ namespace CalamityMod.NPCs if (BossRushEvent.BossRushActive) BossRushStatChanges(npc, Mod); - BossValueChanges(npc); - if (CalamityWorld.revenge) RevDeathStatChanges(npc, Mod); @@ -1424,12 +1309,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: @@ -1437,7 +1322,7 @@ namespace CalamityMod.NPCs break; case NPCID.Plantera: - npc.lifeMax = 80000; + npc.lifeMax = 72000; break; case NPCID.PlanterasTentacle: @@ -1492,16 +1377,6 @@ namespace CalamityMod.NPCs } #endregion - #region Boss Value Changes - private void BossValueChanges(NPC npc) - { - if (BossValueDict.TryGet(npc.type, out var value)) - { - npc.value = value; - } - } - #endregion - #region Revengeance and Death Mode Stat Changes private void RevDeathStatChanges(NPC npc, Mod mod) { @@ -1538,12 +1413,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) { @@ -1562,7 +1439,7 @@ namespace CalamityMod.NPCs else if (DestroyerIDList.Includes(npc.type)) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.25); - npc.scale *= Main.zenithWorld ? 2f : CalamityWorld.death ? 1.4f : 1.2f; + npc.scale *= Main.zenithWorld ? 2f : 1.2f; npc.npcSlots = 10f; } else if (npc.type == NPCID.Probe) @@ -1570,19 +1447,19 @@ namespace CalamityMod.NPCs if (CalamityWorld.death) npc.lifeMax = (int)Math.Round(npc.lifeMax * 2D); - npc.scale *= Main.zenithWorld ? 2f : CalamityWorld.death ? 1.4f : 1.2f; + npc.scale *= Main.zenithWorld ? 2f : 1.2f; } - else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) + else if (npc.type == NPCID.SkeletronPrime) { - // HP boosted in Death Mode due to having two heads (piercing can make them die faster than normal here since they share an HP bar) - npc.lifeMax = (int)Math.Round(npc.lifeMax * (CalamityWorld.death ? 1.7 : 1.2)); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 12f; } else if (npc.type <= NPCID.PrimeLaser && npc.type >= NPCID.PrimeCannon) { - npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.55); + npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.65); + npc.scale = 1.15f; } - else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism || npc.type == NPCType()) + else if (npc.type == NPCID.Retinazer || npc.type == NPCID.Spazmatism) { npc.lifeMax = (int)Math.Round(npc.lifeMax * 1.2); npc.npcSlots = 10f; @@ -1662,11 +1539,11 @@ namespace CalamityMod.NPCs else if (npc.type == NPCID.KingSlime) { if (CalamityWorld.death) - npc.scale = Main.getGoodWorld ? 6f : 2.5f; + npc.scale = CalamityWorld.LegendaryMode ? 6f : 2.5f; else - npc.scale = Main.getGoodWorld ? 3f : 1.5f; + npc.scale = CalamityWorld.LegendaryMode ? 3f : 1.5f; - npc.lifeMax = (int)Math.Round(npc.lifeMax * (Main.getGoodWorld ? 1.8 : 1.5)); + npc.lifeMax = (int)Math.Round(npc.lifeMax * (CalamityWorld.LegendaryMode ? 1.8 : 1.5)); } else if ((npc.type == NPCID.Wraith || npc.type == NPCID.Mimic || npc.type == NPCID.Reaper || npc.type == NPCID.PresentMimic || npc.type == NPCID.SandElemental || npc.type == NPCID.Ghost) && CalamityWorld.LegendaryMode) { @@ -2385,13 +2262,6 @@ namespace CalamityMod.NPCs { EditGlobalCoinDrops(npc); - // Put this first so that any boss damage value modifications aren't reset - bool vanillaNPC = npc.type < NPCID.Count; - if (vanillaNPC && NPCStats.EnemyStats.ContactDamageValues.ContainsKey(npc.type)) - { - npc.GetNPCDamage(); - npc.defDamage = npc.damage; - } if ((npc.boss && npc.type != NPCID.MartianSaucerCore) || BossHPScalingList.Includes(npc.type)) { double HPBoost = CalamityServerConfig.Instance.BossHealthBoost * 0.01; @@ -2404,43 +2274,14 @@ namespace CalamityMod.NPCs case NPCID.EyeofCthulhu: case NPCID.BrainofCthulhu: case NPCID.QueenBee: - case NPCID.Crawdad: - case NPCID.Crawdad2: - case NPCID.ManEater: - case NPCID.AngryTrapper: - case NPCID.Snatcher: - case NPCID.SpikeBall: - case NPCID.DesertBeast: - case NPCID.BoneLee: case NPCID.Paladin: case NPCID.BigMimicCorruption: case NPCID.BigMimicCrimson: case NPCID.BigMimicHallow: - case NPCID.DiggerHead: - case NPCID.SeekerHead: - case NPCID.DuneSplicerHead: - case NPCID.SolarCrawltipedeHead: - case NPCID.Mimic: - case NPCID.SandShark: - case NPCID.SandsharkCorrupt: - case NPCID.SandsharkCrimson: - case NPCID.SandsharkHallow: - case NPCID.Butcher: - case NPCID.DeadlySphere: case NPCID.Mothron: - case NPCID.Reaper: - case NPCID.Psycho: - case NPCID.PresentMimic: - case NPCID.Yeti: - case NPCID.NebulaBeast: - case NPCID.SolarCorite: - case NPCID.StardustWormHead: case NPCID.EaterofWorldsHead: case NPCID.SkeletronHead: - case NPCID.SkeletronHand: case NPCID.WallofFlesh: - case NPCID.TheHungry: - case NPCID.TheHungryII: case NPCID.Spazmatism: case NPCID.Retinazer: case NPCID.TheDestroyer: @@ -2455,19 +2296,13 @@ namespace CalamityMod.NPCs case NPCID.GolemFistLeft: case NPCID.GolemFistRight: case NPCID.CultistDragonHead: - case NPCID.AncientCultistSquidhead: - case NPCID.AncientLight: case NPCID.DD2OgreT2: case NPCID.DD2OgreT3: case NPCID.DD2Betsy: case NPCID.PumpkingBlade: case NPCID.SantaNK1: case NPCID.DukeFishron: - case NPCID.RockGolem: - case NPCID.BloodEelHead: case NPCID.BloodNautilus: - case NPCID.GoblinShark: - case NPCID.ZombieMerman: case NPCID.HallowBoss: case NPCID.QueenSlimeBoss: case NPCID.Deerclops: @@ -2476,10 +2311,6 @@ namespace CalamityMod.NPCs // Enemies that should have coldDamage set to true case NPCID.IceMimic: - canBreakPlayerDefense = true; - npc.coldDamage = true; - break; - case NPCID.IceBat: case NPCID.IceTortoise: npc.coldDamage = true; @@ -2498,11 +2329,6 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.25); break; - case NPCID.ChatteringTeethBomb: - npc.damage = 100; - canBreakPlayerDefense = true; - break; - case NPCID.LarvaeAntlion: npc.lifeMax = 15; break; @@ -2538,8 +2364,6 @@ namespace CalamityMod.NPCs npc.lifeMax = (int)Math.Round(npc.lifeMax * 0.5); npc.damage = (int)Math.Round(npc.damage * DesertEnemyStatMultiplier); npc.defDamage = npc.damage; - // Tomb Crawler Head has 0 defense so there is no need to reduce it - canBreakPlayerDefense = true; break; case NPCID.TombCrawlerBody: @@ -2556,7 +2380,6 @@ namespace CalamityMod.NPCs case NPCID.Sharkron2: npc.width = npc.height = 36; npc.chaseable = false; - canBreakPlayerDefense = true; break; // Fix drawing issues with Golem's Free Head @@ -2585,9 +2408,10 @@ namespace CalamityMod.NPCs npc.dontTakeDamage = true; break; - // Make Fishron and Anahita Bubbles immune to damage in Death Mode + // Make Fishron and Anahita Bubbles have actual health in Death Mode case NPCID.DetonatingBubble: - npc.dontTakeDamage = CalamityWorld.death; + if (CalamityWorld.death) + npc.lifeMax = 300; break; default: @@ -2599,7 +2423,7 @@ namespace CalamityMod.NPCs { if (!NPC.downedMechBossAny) { - if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) + if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2609,7 +2433,7 @@ namespace CalamityMod.NPCs } else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) { - if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) + if (DestroyerIDList.Includes(npc.type) || npc.type == NPCID.Probe || SkeletronPrimeIDList.Includes(npc.type) || npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) { double multiplier = Main.expertMode ? EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert : EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Classic; npc.lifeMax = (int)Math.Round(npc.lifeMax * multiplier); @@ -2677,575 +2501,6 @@ namespace CalamityMod.NPCs npc.defDamage = npc.damage; } } - - // Nerf KB resist in Expert and Master using this roundabout method - if (Main.expertMode) - AdjustExpertModeStatScaling(npc); - - // Adjust a ton of enemy stats - switch (npc.type) - { - case NPCID.AngryBones: - case NPCID.AngryBonesBig: - case NPCID.AngryBonesBigHelmet: - case NPCID.AngryBonesBigMuscle: - case NPCID.BigBoned: - case NPCID.ShortBones: - case NPCID.AnomuraFungus: - case NPCID.Antlion: - case NPCID.WalkingAntlion: - case NPCID.GiantWalkingAntlion: - case NPCID.LarvaeAntlion: - case NPCID.FlyingAntlion: - case NPCID.GiantFlyingAntlion: - case NPCID.BabySlime: - case NPCID.BlackSlime: - case NPCID.BlazingWheel: - case NPCID.BloodCrawler: - case NPCID.BloodCrawlerWall: - case NPCID.BlueJellyfish: - case NPCID.GreenJellyfish: - case NPCID.PinkJellyfish: - case NPCID.BloodJelly: - case NPCID.FungoFish: - case NPCID.BlueSlime: - case NPCID.BoneSerpentBody: - case NPCID.BoneSerpentHead: - case NPCID.BoneSerpentTail: - case NPCID.CaveBat: - case NPCID.CochinealBeetle: - case NPCID.Crab: - case NPCID.Crawdad: - case NPCID.Crawdad2: - case NPCID.Crimera: - case NPCID.BigCrimera: - case NPCID.LittleCrimera: - case NPCID.CursedSkull: - case NPCID.CyanBeetle: - case NPCID.Demon: - case NPCID.DemonEye: - case NPCID.CataractEye: - case NPCID.CataractEye2: - case NPCID.DemonEye2: - case NPCID.DemonEyeOwl: - case NPCID.DemonEyeSpaceship: - case NPCID.DialatedEye: - case NPCID.DialatedEye2: - case NPCID.GreenEye: - case NPCID.GreenEye2: - case NPCID.PurpleEye: - case NPCID.PurpleEye2: - case NPCID.SleepyEye: - case NPCID.SleepyEye2: - case NPCID.DevourerBody: - case NPCID.DevourerHead: - case NPCID.DevourerTail: - case NPCID.DoctorBones: - case NPCID.DungeonSlime: - case NPCID.EaterofSouls: - case NPCID.BigEater: - case NPCID.LittleEater: - case NPCID.FaceMonster: - case NPCID.ArmedZombieEskimo: - case NPCID.ZombieEskimo: - case NPCID.FungiBulb: - case NPCID.Ghost: - case NPCID.GiantShelly: - case NPCID.GiantShelly2: - case NPCID.GiantWormBody: - case NPCID.GiantWormHead: - case NPCID.GiantWormTail: - case NPCID.Gnome: - case NPCID.GoblinScout: - case NPCID.GraniteFlyer: - case NPCID.GraniteGolem: - case NPCID.GreenSlime: - case NPCID.Harpy: - case NPCID.Hellbat: - case NPCID.GreekSkeleton: - case NPCID.Hornet: - case NPCID.HornetFatty: - case NPCID.HornetHoney: - case NPCID.HornetLeafy: - case NPCID.HornetSpikey: - case NPCID.HornetStingy: - case NPCID.BigHornetFatty: - case NPCID.BigHornetHoney: - case NPCID.BigHornetLeafy: - case NPCID.BigHornetSpikey: - case NPCID.BigHornetStingy: - case NPCID.BigMossHornet: - case NPCID.GiantMossHornet: - case NPCID.LittleHornetFatty: - case NPCID.LittleHornetHoney: - case NPCID.LittleHornetLeafy: - case NPCID.LittleHornetSpikey: - case NPCID.LittleHornetStingy: - case NPCID.LittleMossHornet: - case NPCID.MossHornet: - case NPCID.TinyMossHornet: - case NPCID.IceBat: - case NPCID.IceSlime: - case NPCID.JungleBat: - case NPCID.JungleSlime: - case NPCID.LacBeetle: - case NPCID.LavaSlime: - case NPCID.MaggotZombie: - case NPCID.ManEater: - case NPCID.MeteorHead: - case NPCID.MotherSlime: - case NPCID.MushiLadybug: - case NPCID.Nymph: - case NPCID.Pinky: - case NPCID.Piranha: - case NPCID.PurpleSlime: - case NPCID.Raven: - case NPCID.RedSlime: - case NPCID.Salamander: - case NPCID.Salamander2: - case NPCID.Salamander3: - case NPCID.Salamander4: - case NPCID.Salamander5: - case NPCID.Salamander6: - case NPCID.Salamander7: - case NPCID.Salamander8: - case NPCID.Salamander9: - case NPCID.SandSlime: - case NPCID.SeaSnail: - case NPCID.Shark: - case NPCID.ShimmerSlime: - case NPCID.Skeleton: - case NPCID.SkeletonAlien: - case NPCID.SkeletonAstonaut: - case NPCID.SkeletonTopHat: - case NPCID.ArmoredSkeleton: - case NPCID.BigHeadacheSkeleton: - case NPCID.BigMisassembledSkeleton: - case NPCID.BigPantlessSkeleton: - case NPCID.BigSkeleton: - case NPCID.BoneThrowingSkeleton: - case NPCID.BoneThrowingSkeleton2: - case NPCID.BoneThrowingSkeleton3: - case NPCID.BoneThrowingSkeleton4: - case NPCID.HeadacheSkeleton: - case NPCID.HeavySkeleton: - case NPCID.MisassembledSkeleton: - case NPCID.PantlessSkeleton: - case NPCID.SmallMisassembledSkeleton: - case NPCID.SmallHeadacheSkeleton: - case NPCID.SmallSkeleton: - case NPCID.SmallPantlessSkeleton: - case NPCID.SporeSkeleton: - case NPCID.TacticalSkeleton: - case NPCID.SkeletonSniper: - case NPCID.SkeletonCommando: - case NPCID.DarkCaster: - case NPCID.FireImp: - case NPCID.Snatcher: - case NPCID.SnowFlinx: - case NPCID.SpikeBall: - case NPCID.SpikedIceSlime: - case NPCID.SpikedJungleSlime: - case NPCID.SporeBat: - case NPCID.ZombieMushroom: - case NPCID.ZombieMushroomHat: - case NPCID.Squid: - case NPCID.Tim: - case NPCID.TombCrawlerBody: - case NPCID.TombCrawlerHead: - case NPCID.TombCrawlerTail: - case NPCID.UndeadMiner: - case NPCID.UndeadViking: - case NPCID.VoodooDemon: - case NPCID.Vulture: - case NPCID.WallCreeper: - case NPCID.WallCreeperWall: - case NPCID.YellowSlime: - case NPCID.Zombie: - case NPCID.ZombieDoctor: - case NPCID.ZombieElf: - case NPCID.ZombieElfBeard: - case NPCID.ZombieElfGirl: - case NPCID.ZombieMerman: - case NPCID.ZombiePixie: - case NPCID.ZombieRaincoat: - case NPCID.ZombieSuperman: - case NPCID.ZombieSweater: - case NPCID.ZombieXmas: - case NPCID.ArmedTorchZombie: - case NPCID.ArmedZombie: - case NPCID.ArmedZombieCenx: - case NPCID.ArmedZombiePincussion: - case NPCID.ArmedZombieSlimed: - case NPCID.ArmedZombieSwamp: - case NPCID.ArmedZombieTwiggy: - case NPCID.BaldZombie: - case NPCID.BigBaldZombie: - case NPCID.BigFemaleZombie: - case NPCID.BigPincushionZombie: - case NPCID.BigRainZombie: - case NPCID.BigSlimedZombie: - case NPCID.BigSwampZombie: - case NPCID.BigTwiggyZombie: - case NPCID.BigZombie: - case NPCID.BloodZombie: - case NPCID.FemaleZombie: - case NPCID.PincushionZombie: - case NPCID.SlimedZombie: - case NPCID.SmallBaldZombie: - case NPCID.SmallFemaleZombie: - case NPCID.SmallPincushionZombie: - case NPCID.SmallRainZombie: - case NPCID.SmallSlimedZombie: - case NPCID.SmallSwampZombie: - case NPCID.SmallTwiggyZombie: - case NPCID.SmallZombie: - case NPCID.SwampZombie: - case NPCID.TorchZombie: - case NPCID.TwiggyZombie: - case NPCID.AnglerFish: - case NPCID.AngryTrapper: - case NPCID.Arapaima: - case NPCID.ArmoredViking: - case NPCID.DesertBeast: - case NPCID.BlackRecluse: - case NPCID.BlackRecluseWall: - case NPCID.BloodFeeder: - case NPCID.Mummy: - case NPCID.BloodMummy: - case NPCID.DarkMummy: - case NPCID.LightMummy: - case NPCID.BlueArmoredBones: - case NPCID.BlueArmoredBonesMace: - case NPCID.BlueArmoredBonesNoPants: - case NPCID.BlueArmoredBonesSword: - case NPCID.BoneLee: - case NPCID.ChaosElemental: - case NPCID.Clinger: - case NPCID.BigMimicCorruption: - case NPCID.BigMimicCrimson: - case NPCID.BigMimicHallow: - case NPCID.BigMimicJungle: - case NPCID.CorruptSlime: - case NPCID.Corruptor: - case NPCID.Crimslime: - case NPCID.BigCrimslime: - case NPCID.LittleCrimslime: - case NPCID.CrimsonAxe: - case NPCID.CultistArcherBlue: - case NPCID.CultistArcherWhite: - case NPCID.CultistDevote: - case NPCID.CursedHammer: - case NPCID.Derpling: - case NPCID.Herpling: - case NPCID.DesertDjinn: - case NPCID.DiabolistRed: - case NPCID.DiabolistWhite: - case NPCID.DiggerBody: - case NPCID.DiggerHead: - case NPCID.DiggerTail: - case NPCID.DesertGhoul: - case NPCID.DesertGhoulCorruption: - case NPCID.DesertGhoulCrimson: - case NPCID.DesertGhoulHallow: - case NPCID.DuneSplicerBody: - case NPCID.DuneSplicerHead: - case NPCID.DuneSplicerTail: - case NPCID.DungeonSpirit: - case NPCID.EnchantedSword: - case NPCID.FloatyGross: - case NPCID.FlyingSnake: - case NPCID.Gastropod: - case NPCID.GiantBat: - case NPCID.GiantCursedSkull: - case NPCID.GiantFlyingFox: - case NPCID.GiantFungiBulb: - case NPCID.GiantTortoise: - case NPCID.IceTortoise: - case NPCID.HellArmoredBones: - case NPCID.HellArmoredBonesMace: - case NPCID.HellArmoredBonesSpikeShield: - case NPCID.HellArmoredBonesSword: - case NPCID.HoppinJack: - case NPCID.IceElemental: - case NPCID.Mimic: - case NPCID.IceMimic: - case NPCID.PresentMimic: - case NPCID.IchorSticker: - case NPCID.IcyMerman: - case NPCID.IlluminantBat: - case NPCID.IlluminantSlime: - case NPCID.JungleCreeper: - case NPCID.JungleCreeperWall: - case NPCID.DesertLamiaDark: - case NPCID.DesertLamiaLight: - case NPCID.Lavabat: - case NPCID.Lihzahrd: - case NPCID.LihzahrdCrawler: - case NPCID.Medusa: - case NPCID.Moth: - case NPCID.Necromancer: - case NPCID.NecromancerArmored: - case NPCID.Paladin: - case NPCID.PigronCorruption: - case NPCID.PigronCrimson: - case NPCID.PigronHallow: - case NPCID.Pixie: - case NPCID.PossessedArmor: - case NPCID.RaggedCaster: - case NPCID.RaggedCasterOpenCoat: - case NPCID.RedDevil: - case NPCID.RockGolem: - case NPCID.RuneWizard: - case NPCID.RustyArmoredBonesAxe: - case NPCID.RustyArmoredBonesFlail: - case NPCID.RustyArmoredBonesSword: - case NPCID.RustyArmoredBonesSwordNoArmor: - case NPCID.DesertScorpionWalk: - case NPCID.DesertScorpionWall: - case NPCID.SkeletonArcher: - case NPCID.Slimeling: - case NPCID.Slimer: - case NPCID.Slimer2: - case NPCID.ToxicSludge: - case NPCID.Unicorn: - case NPCID.WanderingEye: - case NPCID.Werewolf: - case NPCID.Wolf: - case NPCID.SeekerBody: - case NPCID.SeekerHead: - case NPCID.SeekerTail: - case NPCID.Wraith: - case NPCID.WyvernBody: - case NPCID.WyvernBody2: - case NPCID.WyvernBody3: - case NPCID.WyvernHead: - case NPCID.WyvernLegs: - case NPCID.WyvernTail: - case NPCID.BloodEelBody: - case NPCID.BloodEelHead: - case NPCID.BloodEelTail: - case NPCID.BloodSquid: - case NPCID.ChatteringTeethBomb: - case NPCID.Clown: - case NPCID.CorruptBunny: - case NPCID.CorruptGoldfish: - case NPCID.CorruptPenguin: - case NPCID.Drippler: - case NPCID.GoblinShark: - case NPCID.TheGroom: - case NPCID.TheBride: - case NPCID.CrimsonBunny: - case NPCID.CrimsonGoldfish: - case NPCID.CrimsonPenguin: - case NPCID.EyeballFlyingFish: - case NPCID.Dandelion: - case NPCID.AngryNimbus: - case NPCID.FlyingFish: - case NPCID.IceGolem: - case NPCID.RainbowSlime: - case NPCID.UmbrellaSlime: - case NPCID.Tumbleweed: - case NPCID.SandShark: - case NPCID.SandsharkCorrupt: - case NPCID.SandsharkCrimson: - case NPCID.SandsharkHallow: - case NPCID.SandElemental: - case NPCID.BloodNautilus: - case NPCID.GoblinArcher: - case NPCID.GoblinPeon: - case NPCID.GoblinSorcerer: - case NPCID.GoblinSummoner: - case NPCID.GoblinThief: - case NPCID.GoblinWarrior: - case NPCID.MisterStabby: - case NPCID.SnowBalla: - case NPCID.SnowmanGangsta: - case NPCID.Parrot: - case NPCID.PirateCaptain: - case NPCID.PirateCorsair: - case NPCID.PirateCrossbower: - case NPCID.PirateDeadeye: - case NPCID.PirateDeckhand: - case NPCID.PirateGhost: - case NPCID.PirateShipCannon: - case NPCID.MothronSpawn: - case NPCID.Mothron: - case NPCID.Butcher: - case NPCID.CreatureFromTheDeep: - case NPCID.DeadlySphere: - case NPCID.DrManFly: - case NPCID.Eyezor: - case NPCID.Frankenstein: - case NPCID.Fritz: - case NPCID.Nailhead: - case NPCID.Psycho: - case NPCID.Reaper: - case NPCID.ThePossessed: - case NPCID.SwampThing: - case NPCID.Vampire: - case NPCID.VampireBat: - case NPCID.BrainScrambler: - case NPCID.GigaZapper: - case NPCID.MartianWalker: - case NPCID.GrayGrunt: - case NPCID.MartianDrone: - case NPCID.MartianEngineer: - case NPCID.MartianOfficer: - case NPCID.RayGunner: - case NPCID.Scutlix: - case NPCID.ScutlixRider: - case NPCID.MartianTurret: - case NPCID.HeadlessHorseman: - case NPCID.Hellhound: - case NPCID.Splinterling: - case NPCID.Poltergeist: - case NPCID.Scarecrow1: - case NPCID.Scarecrow2: - case NPCID.Scarecrow3: - case NPCID.Scarecrow4: - case NPCID.Scarecrow5: - case NPCID.Scarecrow6: - case NPCID.Scarecrow7: - case NPCID.Scarecrow8: - case NPCID.Scarecrow9: - case NPCID.Scarecrow10: - case NPCID.ElfArcher: - case NPCID.ElfCopter: - case NPCID.Flocko: - case NPCID.GingerbreadMan: - case NPCID.Krampus: - case NPCID.Nutcracker: - case NPCID.NutcrackerSpinning: - case NPCID.Yeti: - case NPCID.NebulaBeast: - case NPCID.NebulaBrain: - case NPCID.NebulaHeadcrab: - case NPCID.NebulaSoldier: - case NPCID.SolarCorite: - case NPCID.SolarCrawltipedeBody: - case NPCID.SolarCrawltipedeHead: - case NPCID.SolarCrawltipedeTail: - case NPCID.SolarDrakomire: - case NPCID.SolarDrakomireRider: - case NPCID.SolarSolenian: - case NPCID.SolarSpearman: - case NPCID.SolarSroller: - case NPCID.StardustCellBig: - case NPCID.StardustCellSmall: - case NPCID.StardustJellyfishBig: - case NPCID.StardustWormBody: - case NPCID.StardustWormHead: - case NPCID.StardustWormTail: - case NPCID.StardustSoldier: - case NPCID.StardustSpiderBig: - case NPCID.StardustSpiderSmall: - case NPCID.VortexHornet: - case NPCID.VortexHornetQueen: - case NPCID.VortexLarva: - case NPCID.VortexRifleman: - case NPCID.VortexSoldier: - case NPCID.DD2DarkMageT1: - case NPCID.DD2DarkMageT3: - case NPCID.DD2OgreT2: - case NPCID.DD2OgreT3: - case NPCID.MartianSaucerCore: - case NPCID.MartianSaucerCannon: - case NPCID.MartianSaucerTurret: - case NPCID.DD2SkeletonT1: - case NPCID.DD2SkeletonT3: - case NPCID.DD2DrakinT2: - case NPCID.DD2DrakinT3: - case NPCID.DD2GoblinBomberT1: - case NPCID.DD2GoblinBomberT2: - case NPCID.DD2GoblinBomberT3: - case NPCID.DD2GoblinT1: - case NPCID.DD2GoblinT2: - case NPCID.DD2GoblinT3: - case NPCID.DD2JavelinstT1: - case NPCID.DD2JavelinstT2: - case NPCID.DD2JavelinstT3: - case NPCID.DD2KoboldFlyerT2: - case NPCID.DD2KoboldFlyerT3: - case NPCID.DD2KoboldWalkerT2: - case NPCID.DD2KoboldWalkerT3: - case NPCID.DD2LightningBugT3: - case NPCID.DD2WitherBeastT2: - case NPCID.DD2WitherBeastT3: - case NPCID.DD2WyvernT1: - case NPCID.DD2WyvernT2: - case NPCID.DD2WyvernT3: - case NPCID.SlimeSpiked: - - // Buff enemy HP by 25% - npc.lifeMax = (int)Math.Round(npc.lifeMax * EnemyHPMultiplier); - - // Nerf a shitload of Master Mode enemies - // HP is nerfed by 25% (this nerf is higher due to the player not dealing any more damage in Master) - // Damage is nerfed by 15% (this nerf is lower due to the player having 100% effective defense in Master) - if (Main.masterMode) - { - AdjustMasterModeStatScaling(npc); - npc.defDamage = npc.damage; - } - - break; - - case NPCID.AncientCultistSquidhead: - // This guy only gets Master Mode nerfs - // HP is nerfed by 25% (this nerf is higher due to the player not dealing any more damage in Master) - // Damage is nerfed by 15% (this nerf is lower due to the player having 100% effective defense in Master) - if (Main.masterMode) - { - AdjustMasterModeStatScaling(npc); - npc.defDamage = npc.damage; - } - break; - - case NPCID.KingSlime: - case NPCID.EyeofCthulhu: - case NPCID.EaterofWorldsHead: - case NPCID.EaterofWorldsBody: - case NPCID.EaterofWorldsTail: - case NPCID.BrainofCthulhu: - case NPCID.Creeper: - case NPCID.QueenBee: - case NPCID.SkeletronHead: - case NPCID.SkeletronHand: - case NPCID.Deerclops: - case NPCID.WallofFlesh: - case NPCID.WallofFleshEye: - case NPCID.QueenSlimeBoss: - case NPCID.Retinazer: - case NPCID.Spazmatism: - case NPCID.TheDestroyer: - case NPCID.TheDestroyerBody: - case NPCID.TheDestroyerTail: - case NPCID.SkeletronPrime: - case NPCID.PrimeCannon: - case NPCID.PrimeLaser: - case NPCID.PrimeSaw: - case NPCID.PrimeVice: - case NPCID.Plantera: - case NPCID.PlanterasTentacle: - case NPCID.Golem: - case NPCID.GolemHead: - case NPCID.GolemHeadFree: - case NPCID.GolemFistLeft: - case NPCID.GolemFistRight: - case NPCID.HallowBoss: - case NPCID.DukeFishron: - case NPCID.CultistBoss: - case NPCID.MoonLordCore: - case NPCID.MoonLordFreeEye: - case NPCID.MoonLordHand: - case NPCID.MoonLordHead: - - if (Main.masterMode) - AdjustMasterModeStatScaling(npc, true); - - break; - } } #endregion @@ -3455,10 +2710,13 @@ namespace CalamityMod.NPCs ApplyDR(npc, ref modifiers); // Damage reduction on spawn for certain worm bosses. - if (EaterOfWorldsIDList.Includes(npc.type) && newAI[1] < EaterOfWorldsAI.DRIncreaseTime) - modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(BossRushEvent.BossRushActive ? 0.6f : 0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / EaterOfWorldsAI.DRIncreaseTime, 0f, 1f))); - if (DestroyerIDList.Includes(npc.type) && newAI[1] < DestroyerAI.DRIncreaseTime) - modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / DestroyerAI.DRIncreaseTime, 0f, 1f))); + if (CalamityWorld.revenge) + { + if (EaterOfWorldsIDList.Includes(npc.type) && newAI[1] < EaterOfWorldsAI.DRIncreaseTime) + modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / EaterOfWorldsAI.DRIncreaseTime, 0f, 1f))); + if (DestroyerIDList.Includes(npc.type) && newAI[1] < DestroyerAI.DRIncreaseTime) + modifiers.FinalDamage *= 1f - (float)Math.Sqrt(MathHelper.Lerp(0f, 0.99f, MathHelper.Clamp(1f - newAI[1] / DestroyerAI.DRIncreaseTime, 0f, 1f))); + } if (AstrumDeusIDList.Includes(npc.type)) { float drTime = newAI[0] != 0f ? 300f : 600f; @@ -3597,18 +2855,12 @@ namespace CalamityMod.NPCs #region Boss Head Slot public override void BossHeadSlot(NPC npc, ref int index) { - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) + if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) { - if (npc.type == NPCID.SkeletronPrime && (CalamityWorld.death || BossRushEvent.BossRushActive)) - index = ExtraTextureRefs.BossHeadIndex_ChadPrime; - - if (npc.type == NPCID.DukeFishron && (CalamityWorld.death || BossRushEvent.BossRushActive)) - { - float lifeRatio = npc.life / (float)npc.lifeMax; - float mapIconVanishValue = CalamityWorld.death ? 0.3f : 0.4f; - if (lifeRatio < mapIconVanishValue || (lifeRatio > 0.9f && (CalamityWorld.death || BossRushEvent.BossRushActive))) - index = -1; - } + float lifeRatio = npc.life / (float)npc.lifeMax; + float mapIconVanishValue = 0.3f; + if (lifeRatio < mapIconVanishValue || lifeRatio > 0.9f) + index = -1; } } #endregion @@ -3617,7 +2869,7 @@ namespace CalamityMod.NPCs public override bool PreAI(NPC npc) { // Change Spaz and Ret weaknesses and resistances when phase 2 starts. - if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer || npc.type == NPCType()) + if (npc.type == NPCID.Spazmatism || npc.type == NPCID.Retinazer) { if (npc.ai[0] >= 2f) { @@ -3647,9 +2899,6 @@ namespace CalamityMod.NPCs { if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < BossZenDistance) Main.LocalPlayer.AddBuff(BuffType(), 2); - - if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && npc.type == NPCType() && Vector2.Distance(Main.LocalPlayer.Center, npc.Center) < BossZenDistance) - Main.LocalPlayer.AddBuff(BuffType(), 2); } if (npc.type != NPCType()) @@ -3695,10 +2944,6 @@ namespace CalamityMod.NPCs if (npc.type == NPCID.BloodNautilus) return DreadnautilusAI.BuffedDreadnautilusAI(npc, Mod); - // More telegraphs - if (npc.type == NPCID.SpikedIceSlime || npc.type == NPCID.SpikedJungleSlime || npc.type == NPCID.SlimeSpiked) - return SlimeAI.BuffedSlimeAI(npc, Mod); - // Decrease the projectile velocities of several fighter enemies and make them better to fight in general // Also limit the amount of times Vortex Larvae and Hornets can evolve if (npc.type == NPCID.IceGolem || npc.type == NPCID.Eyezor || npc.type == NPCID.VortexRifleman || @@ -3796,73 +3041,6 @@ namespace CalamityMod.NPCs return DukeFishronAI.BuffedDetonatingBubbleAI(npc, Mod); } - // Expert+ Hive Mind Vile Spits - if (npc.type == NPCID.VileSpitEaterOfWorlds) - { - if (Main.expertMode || BossRushEvent.BossRushActive) - { - if (npc.ai[1] >= 69f) - { - if (npc.target == Main.maxPlayers) - { - npc.TargetClosest(); - - float velocity = Main.getGoodWorld ? 12f : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 10.5f : 9f; - if (npc.ai[1] == 70f) - velocity *= 0.4f; - - npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; - } - - if (Main.getGoodWorld && !npc.dontTakeDamage) - { - if ((double)(npc.Center.Y / 16f) < Main.worldSurface) - npc.dontTakeDamage = true; - } - - npc.damage = npc.GetAttackDamage_ScaledByStrength(32f); - - npc.ai[0] += 1f; - if (npc.ai[0] > 3f) - npc.ai[0] = 3f; - - if (npc.ai[0] == 2f) - { - npc.position += npc.velocity; - SoundEngine.PlaySound(SoundID.NPCDeath9, npc.Center); - for (int i = 0; i < 20; i++) - { - int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f) + npc.netOffset, npc.width, npc.height, DustID.CorruptGibs, 0f, 0f, 100, default, 1.8f); - Main.dust[dust].velocity *= 1.3f; - Main.dust[dust].velocity += npc.velocity; - Main.dust[dust].noGravity = true; - } - } - - if (Collision.SolidCollision(npc.position, npc.width, npc.height)) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - npc.StrikeInstantKill(); - } - - npc.EncourageDespawn(100); - - npc.position += npc.netOffset; - for (int i = 0; i < 2; i++) - { - int dust = Dust.NewDust(new Vector2(npc.position.X, npc.position.Y + 2f), npc.width, npc.height, DustID.CorruptGibs, npc.velocity.X * 0.1f, npc.velocity.Y * 0.1f, 80, default, 1.3f); - Main.dust[dust].velocity *= 0.3f; - Main.dust[dust].noGravity = true; - } - - npc.rotation += 0.4f * npc.direction; - npc.position -= npc.netOffset; - - return false; - } - } - } - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { switch (npc.type) @@ -4029,6 +3207,8 @@ namespace CalamityMod.NPCs case NPCID.ToxicSludge: case NPCID.IceSlime: case NPCID.Crimslime: + case NPCID.SpikedIceSlime: + case NPCID.SpikedJungleSlime: case NPCID.UmbrellaSlime: case NPCID.RainbowSlime: case NPCID.SlimeMasked: @@ -4038,6 +3218,7 @@ namespace CalamityMod.NPCs case NPCID.SlimeRibbonGreen: case NPCID.SlimeRibbonRed: case NPCID.SandSlime: + case NPCID.SlimeSpiked: case NPCID.GoldenSlime: case NPCID.ShimmerSlime: return SlimeAI.BuffedSlimeAI(npc, Mod); @@ -5509,9 +4690,6 @@ namespace CalamityMod.NPCs velocitySlownessFactor += baseSlownessFactor; } - if (slowed) - velocitySlownessFactor += 0.05f; - if (galvanicCorrosion) { float baseSlownessFactor = 0.05f; @@ -5641,7 +4819,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); @@ -5649,21 +4827,6 @@ namespace CalamityMod.NPCs switch (npc.type) { - case NPCID.VileSpitEaterOfWorlds: - case NPCID.VileSpit: - - target.AddBuff(BuffType(), 180); - if (Main.rand.NextBool(10)) - target.AddBuff(BuffID.Weak, 3600); - else if (Main.rand.NextBool(5)) - target.AddBuff(BuffID.Weak, 720); - else if (Main.rand.NextBool(2)) - target.AddBuff(BuffID.Weak, 120); - else - target.AddBuff(BuffID.Weak, 60); - - break; - case NPCID.DevourerHead: case NPCID.FaceMonster: target.AddBuff(BuffID.Weak, 180); @@ -5723,60 +4886,17 @@ namespace CalamityMod.NPCs target.AddBuff(BuffType(), 120); break; - case NPCID.EyeofCthulhu: - if (npc.ai[0] > 2f) - target.AddBuff(BuffID.Bleeding, 180); - break; - - case NPCID.WallofFlesh: - target.AddBuff(BuffID.Bleeding, 300); - break; - - case NPCID.Spazmatism: - if (npc.ai[0] != 1f && npc.ai[0] != 2f && npc.ai[0] != 0f) - target.AddBuff(BuffType(), 180); - break; - - case NPCID.SkeletronPrime: - if (npc.ai[1] == 1f || npc.ai[1] == 2f) - target.AddBuff(BuffType(), 180); - break; - - case NPCID.PrimeSaw: - target.AddBuff(BuffType(), 120); - break; - - case NPCID.Plantera: - if (npc.life < npc.lifeMax / 2) - target.AddBuff(BuffID.Poisoned, 360); - break; - - case NPCID.PlanterasTentacle: - target.AddBuff(BuffID.Poisoned, 180); - break; - case NPCID.Golem: - target.AddBuff(BuffType(), 480); + if (CalamityWorld.revenge) + target.AddBuff(BuffType(), 480); break; case NPCID.GolemHead: case NPCID.GolemHeadFree: case NPCID.GolemFistRight: case NPCID.GolemFistLeft: - target.AddBuff(BuffType(), 240); - break; - - case NPCID.DukeFishron: - target.AddBuff(BuffType(), 180); - break; - - case NPCID.AncientLight: - target.AddBuff(BuffType(), 120); - break; - - case NPCID.HallowBoss: - if (NPC.ShouldEmpressBeEnraged()) - target.AddBuff(BuffType(), 360); + if (CalamityWorld.revenge) + target.AddBuff(BuffType(), 240); break; case NPCID.BloodNautilus: @@ -5921,14 +5041,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 @@ -6100,13 +5227,13 @@ namespace CalamityMod.NPCs if (GrenadeResistIDList.Includes(projectile.type)) { // Eater of Worlds has a vanilla resist in Expert+, this gives it to him in Normal mode - // Note that Calamity reduces the vanilla resist from 80% to 60% + // Note that Calamity reduces the vanilla resist from 80% to 66% bool hasResist = EaterOfWorldsIDList.Includes(npc.type) && !Main.expertMode; // Add a resist for BoC's creepers and Prehardmode worm bosses if (npc.type == NPCID.Creeper || DesertScourgeIDList.Includes(npc.type) || PerforatorWormIDList.Includes(npc.type)) hasResist = true; if (hasResist) - modifiers.SourceDamage *= 0.4f; + modifiers.SourceDamage *= 0.33f; } if (modPlayer.camper && !player.StandingStill()) @@ -6172,7 +5299,6 @@ namespace CalamityMod.NPCs #endregion - #region Summon Tag //doze 03-15-2025: A full refactor of the summon tag system to make it easier to use and more flexible. Ping me with any questions. private void EditSummonTagDamage(Projectile proj, NPC npc, ref NPC.HitModifiers modifiers) @@ -6260,26 +5386,6 @@ namespace CalamityMod.NPCs #region Check Dead public override bool CheckDead(NPC npc) { - if (npc.type == NPCID.SkeletronPrime) - { - if (CalamityWorld.death || BossRushEvent.BossRushActive) - { - // Kill the other head if he's still alive when this head dies - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == NPCType() && nPC.life > 0) - { - nPC.life = 0; - nPC.HitEffect(); - nPC.checkDead(); - nPC.active = false; - nPC.netUpdate = true; - } - } - } - } - if (npc.lifeMax > 1000 && npc.type != NPCID.DungeonSpirit && npc.type != NPCType() && npc.type != NPCType() && @@ -6344,7 +5450,7 @@ namespace CalamityMod.NPCs { if (Main.netMode != NetmodeID.MultiplayerClient) { - int slimeAmt = Main.getGoodWorld ? Main.rand.Next(6) + 10 : Main.rand.Next(2) + 2; // 2 to 3 extra + int slimeAmt = CalamityWorld.LegendaryMode ? Main.rand.Next(6) + 10 : Main.rand.Next(2) + 2; // 2 to 3 extra for (int s = 0; s < slimeAmt; s++) { int slime = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)(npc.position.Y + npc.height), NPCID.BlueSlime, 0, 0f, 0f, 0f, 0f, 255); @@ -6352,8 +5458,8 @@ namespace CalamityMod.NPCs npc2.SetDefaults(NPCID.BabySlime); npc2.velocity.X = npc.velocity.X * 2f; npc2.velocity.Y = npc.velocity.Y; - npc2.velocity.X += Main.rand.Next(-20, 20) * (Main.getGoodWorld ? 0.5f : 0.1f) + s * npc.direction * (Main.getGoodWorld ? 0.5f : 0.3f); - npc2.velocity.Y -= Main.rand.Next(0, 10) * (Main.getGoodWorld ? 0.5f : 0.1f) + s; + npc2.velocity.X += Main.rand.Next(-20, 20) * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f) + s * npc.direction * (CalamityWorld.LegendaryMode ? 0.5f : 0.3f); + npc2.velocity.Y -= Main.rand.Next(0, 10) * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f) + s; npc2.ai[0] = -1000 * Main.rand.Next(3); if (Main.dedServ && slime < Main.maxNPCs) @@ -6366,7 +5472,7 @@ namespace CalamityMod.NPCs case NPCID.CursedHammer: case NPCID.EnchantedSword: case NPCID.CrimsonAxe: - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.justHit = false; break; @@ -6377,13 +5483,13 @@ namespace CalamityMod.NPCs case NPCID.IceTortoise: case NPCID.BlackRecluse: case NPCID.BlackRecluseWall: - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.justHit = false; break; case NPCID.Paladin: - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.justHit = false; break; @@ -6391,7 +5497,7 @@ namespace CalamityMod.NPCs if (npc.type == NPCType()) { - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.justHit = false; } } @@ -6643,6 +5749,12 @@ namespace CalamityMod.NPCs maxSpawns = (int)(maxSpawns * 10f); } + if (CalamityWorld.death && player.ZoneGraveyard) + { + spawnRate = (int)(spawnRate * 0.6); + maxSpawns = (int)(maxSpawns * 1.5f); + } + if (NPC.LunarApocalypseIsUp) { if ((player.ZoneTowerNebula && NPC.ShieldStrengthTowerNebula == 0) || (player.ZoneTowerStardust && NPC.ShieldStrengthTowerStardust == 0) || @@ -6913,6 +6025,15 @@ namespace CalamityMod.NPCs } } + // Increased Maggot Zombie,the Groom, and the Bride spawn rates in a Graveyard + if (spawnInfo.Player.ZoneGraveyard) + { + pool[NPCID.MaggotZombie] = SpawnCondition.OverworldNightMonster.Chance * 0.2f; + pool[NPCID.TheGroom] = SpawnCondition.OverworldNightMonster.Chance * 0.035f; + pool[NPCID.TheBride] = SpawnCondition.OverworldNightMonster.Chance * 0.035f; + + } + // Disable vanilla spawns while in the Brimstone Crag if (calamityBiomeZone) { @@ -7007,11 +6128,6 @@ namespace CalamityMod.NPCs // If the doll is active, Voodoo Demons cannot spawn (via modded means). if (voodooDemonDollActive) pool.Remove(NPCID.VoodooDemon); - // Otherwise, if it's pre-Hardmode, provide a modded spawn entry that makes them much more common. - else if (!Main.hardMode && spawnInfo.Player.ZoneUnderworldHeight && !calamityBiomeZone) - { - pool[NPCID.VoodooDemon] = SpawnCondition.Underworld.Chance * 0.15f; - } } #endregion @@ -7071,11 +6187,11 @@ namespace CalamityMod.NPCs #region Drawing public override void FindFrame(NPC npc, int frameHeight) { - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) + /*if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) + if (npc.type == NPCID.SkeletronPrime) npc.frameCounter = 0D; - } + }*/ // Increment the bestiary worm timer when hovering over the NPC or having their entry open. Pauses otherwise if (npc.IsABestiaryIconDummy) { @@ -7281,21 +6397,6 @@ namespace CalamityMod.NPCs Dust.NewDustDirect(npc.position, npc.width, npc.height, DustID.Electric, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), 0, default, 0.35f); } } - if (slowed) - { - if (Main.rand.Next(5) < 4) - { - int dust = Dust.NewDust(npc.position - new Vector2(2f, 2f), npc.width + 4, npc.height + 4, DustID.SpookyWood, npc.velocity.X * 0.4f, npc.velocity.Y * 0.4f, 225, default, 3f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 1.1f; - Main.dust[dust].velocity.Y += 0.25f; - if (Main.rand.NextBool()) - { - Main.dust[dust].noGravity = false; - Main.dust[dust].scale *= 0.5f; - } - } - } if (webbed) { if (Main.rand.Next(5) < 4) @@ -7368,7 +6469,7 @@ namespace CalamityMod.NPCs if (npc.IsABestiaryIconDummy) return null; - if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode && CalamityWorld.revenge)) + if (Main.LocalPlayer.Calamity().trippy || (npc.type == NPCID.KingSlime && CalamityWorld.LegendaryMode)) return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Main.DiscoR); if (npc.type == NPCID.KingSlime && CalamityWorld.death) @@ -7529,8 +6630,6 @@ namespace CalamityMod.NPCs currentDebuffs.Add(TextureAssets.Buff[BuffID.Confused].Value); if (npc.ichor) currentDebuffs.Add(TextureAssets.Buff[BuffID.Ichor].Value); - if (slowed) - currentDebuffs.Add(TextureAssets.Buff[BuffID.Slow].Value); if (webbed) currentDebuffs.Add(TextureAssets.Buff[BuffID.Webbed].Value); if (npc.midas) @@ -7624,11 +6723,46 @@ namespace CalamityMod.NPCs if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { - if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType() || DestroyerIDList.Includes(npc.type)) + if (DestroyerIDList.Includes(npc.type)) shouldDrawBool = false; + + // Allows correct frames to draw in Rev+ phases + // GFB can rot for all I care + if (npc.type == NPCID.SkeletronPrime && !NPC.IsMechQueenUp) + { + int frameHeight = TextureAssets.Npc[npc.type].Value.Height / Main.npcFrameCount[npc.type]; + if (npc.ai[1] == 0f || npc.ai[1] == 4f) + { + newAI[2] += 1f; + if (newAI[2] >= 12f) + { + newAI[2] = 0f; + newAI[3] += frameHeight; + + if (newAI[3] / frameHeight >= 2f) + newAI[3] = 0f; + } + } + + // Spinning probe spawn or fly over phase + else if (npc.ai[1] == 5f || npc.ai[1] == 6f) + { + newAI[2] = 0f; + newAI[3] = frameHeight; + } + + // Spinning phase + else + { + newAI[2] = 0f; + newAI[3] = frameHeight * 2; + } + + npc.frame.Y = (int)newAI[3]; + } } - if (npc.type == NPCID.Corruptor || npc.type == NPCID.BloodSquid || npc.type == NPCID.Probe || (npc.type == NPCID.HornetHoney && npc.ai[3] == 1f)) + if (npc.type == NPCID.Corruptor || npc.type == NPCID.BloodSquid || (npc.type == NPCID.HornetHoney && npc.ai[3] == 1f)) { Texture2D texture = TextureAssets.Npc[npc.type].Value; @@ -7827,7 +6961,6 @@ namespace CalamityMod.NPCs public override void PostDraw(NPC npc, SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - bool masterMode = Main.masterMode || BossRushEvent.BossRushActive; bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; @@ -7983,10 +7116,8 @@ namespace CalamityMod.NPCs } else if (npc.type == NPCID.TheDestroyerBody && revenge) { - float shootProjectileTime = death ? (phase5 ? 120f : phase4 ? 150f : 180f) : 450f; - float bodySegmentTime = npc.ai[0] * (death ? 20f : 30f); - float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; - float telegraphGateValue = shootProjectileGateValue - DestroyerAI.LaserTelegraphTime; + float shootProjectileTime = death ? (phase5 ? 180f : phase4 ? 270f : 360f) : 450f; + float telegraphGateValue = shootProjectileTime - DestroyerAI.LaserTelegraphTime; if (newAI[0] > telegraphGateValue) { switch (destroyerLaserColor) @@ -8030,124 +7161,24 @@ namespace CalamityMod.NPCs } // Laser telegraph - else if (npc.type == NPCID.Probe && CalamityClientConfig.Instance.EnableVanillaTextureEdits) + 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; - Texture2D glowTexture = ExtraTextureRefs.ProbeGlowmask.Value; + 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; - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; + Vector2 drawPosition = npc.Center - screenPos + Vector2.UnitX.RotatedBy(npc.rotation) * (npc.width * 0.45f * npc.spriteDirection) + Vector2.UnitY * npc.gfxOffY; float colorScale = MathHelper.Clamp((npc.localAI[0] - eyeTelegraphGateValue) / DestroyerAI.ProbeLaserTelegraphTime, 0f, 1f); - Color drawColor2 = Color.Lerp(new Color(150, 0, 0, 192), new Color(255, 100, 150, 192), colorScale); - for (int i = 0; i < 2; i++) - { - spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, - drawColor2, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); - } + Color drawColor2 = new Color(255, 100, 150, 192) * colorScale; + spriteBatch.SetBlendState(BlendState.Additive); + spriteBatch.Draw(glowTexture, drawPosition, npc.frame, drawColor2, npc.rotation, halfSize, npc.scale * 1.1f, SpriteEffects.None, 0f); + spriteBatch.SetBlendState(BlendState.AlphaBlend); } if (revenge) { - // Create additional afterimages in the cardinal directions in Rev+ - if (npc.type == NPCID.BrainofCthulhu) - { - float secondAfterimageSetHealthValue = (int)(npc.lifeMax * 0.8f); - if (npc.life < secondAfterimageSetHealthValue) - { - int totalAfterimages = death ? 12 : 4; - for (int i = 0; i < totalAfterimages; i++) - { - Color currentColor = npc.GetAlpha(drawColor); - float opacityScale = 1f - MathHelper.Lerp(0.34f, 1f, npc.life / (float)secondAfterimageSetHealthValue); - float opacity = Main.getGoodWorld ? 0.7f : opacityScale; - - opacity = MathHelper.Clamp(opacity, 0f, 1f); - currentColor.R = (byte)((float)(int)currentColor.R * opacity); - currentColor.G = (byte)((float)(int)currentColor.G * opacity); - currentColor.B = (byte)((float)(int)currentColor.B * opacity); - currentColor.A = (byte)((float)(int)currentColor.A * opacity); - - Vector2 position = npc.position; - float distanceFromTargetX = Math.Abs(npc.Center.X - Main.LocalPlayer.Center.X); - float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.LocalPlayer.Center.Y); - if (i > 3) - { - currentColor *= 0.5f; - distanceFromTargetX *= 0.5f; - distanceFromTargetY *= 0.5f; - } - if (i > 7) - currentColor *= 0.5f; - - switch (i) - { - case 0: - case 4: - position.X = Main.LocalPlayer.Center.X - distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y; - break; - - case 1: - case 5: - position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY; - position.X = Main.LocalPlayer.Center.X; - break; - - case 2: - case 6: - position.X = Main.LocalPlayer.Center.X + distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y; - break; - - case 3: - case 7: - position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY; - position.X = Main.LocalPlayer.Center.X; - break; - - case 8: - position.X = Main.LocalPlayer.Center.X - distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY; - break; - - case 9: - position.X = Main.LocalPlayer.Center.X + distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY; - break; - - case 10: - position.X = Main.LocalPlayer.Center.X + distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY; - break; - - case 11: - position.X = Main.LocalPlayer.Center.X - distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY; - break; - - default: - break; - } - - position.X -= npc.width / 2; - position.Y -= npc.height / 2; - - Vector2 halfSize = npc.frame.Size() / 2; - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - int width = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Width(); - int height = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Height(); - spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); - } - } - } - // Telegraph for charge and blood shots - else if (npc.type == NPCID.Creeper) + if (npc.type == NPCID.Creeper) { if (NPC.crimsonBoss < 0) return; @@ -8164,14 +7195,14 @@ namespace CalamityMod.NPCs Color currentColor = npc.GetAlpha(drawColor); float opacity = (1f - Main.npc[NPC.crimsonBoss].life / (float)Main.npc[NPC.crimsonBoss].lifeMax) * 2f; opacity *= opacity; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) opacity = 1f; opacity = MathHelper.Clamp(opacity, 0f, 1f); - currentColor.R = (byte)((float)(int)currentColor.R * opacity); - currentColor.G = (byte)((float)(int)currentColor.G * opacity); - currentColor.B = (byte)((float)(int)currentColor.B * opacity); - currentColor.A = (byte)((float)(int)currentColor.A * opacity); + currentColor.R = (byte)(currentColor.R * opacity); + currentColor.G = (byte)(currentColor.G * opacity); + currentColor.B = (byte)(currentColor.B * opacity); + currentColor.A = (byte)(currentColor.A * opacity); int totalAfterimages = 4; for (int i = 0; i < totalAfterimages; i++) { @@ -8195,90 +7226,6 @@ namespace CalamityMod.NPCs int height = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Height(); spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); } - - float secondAfterimageSetHealthValue = (int)(Main.npc[NPC.crimsonBoss].lifeMax * 0.8f); - if (Main.npc[NPC.crimsonBoss].life < secondAfterimageSetHealthValue) - { - currentColor = npc.GetAlpha(drawColor); - float opacityScale = 1f - Main.npc[NPC.crimsonBoss].life / (float)secondAfterimageSetHealthValue; - opacity = Main.getGoodWorld ? 1f : opacityScale; - - opacity = MathHelper.Clamp(opacity, 0f, 1f); - currentColor.R = (byte)((float)(int)currentColor.R * opacity); - currentColor.G = (byte)((float)(int)currentColor.G * opacity); - currentColor.B = (byte)((float)(int)currentColor.B * opacity); - currentColor.A = (byte)((float)(int)currentColor.A * opacity); - totalAfterimages = death ? 12 : 4; - for (int i = 0; i < totalAfterimages; i++) - { - Vector2 position = npc.position; - float distanceFromTargetX = Math.Abs(npc.Center.X - Main.LocalPlayer.Center.X); - float distanceFromTargetY = Math.Abs(npc.Center.Y - Main.LocalPlayer.Center.Y); - if (i > 3) - { - currentColor *= 0.5f; - distanceFromTargetX *= 0.5f; - distanceFromTargetY *= 0.5f; - } - - switch (i) - { - case 0: - case 4: - position.X = Main.LocalPlayer.Center.X - distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y + distanceFromBrain.Y; - break; - - case 1: - case 5: - position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY; - position.X = Main.LocalPlayer.Center.X + distanceFromBrain.X; - break; - - case 2: - case 6: - position.X = Main.LocalPlayer.Center.X + distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y + distanceFromBrain.Y; - break; - - case 3: - case 7: - position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY; - position.X = Main.LocalPlayer.Center.X + distanceFromBrain.X; - break; - - case 8: - position.X = Main.LocalPlayer.Center.X - distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY; - break; - - case 9: - position.X = Main.LocalPlayer.Center.X + distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y - distanceFromTargetY; - break; - - case 10: - position.X = Main.LocalPlayer.Center.X + distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY; - break; - - case 11: - position.X = Main.LocalPlayer.Center.X - distanceFromTargetX; - position.Y = Main.LocalPlayer.Center.Y + distanceFromTargetY; - break; - - default: - break; - } - - position.X -= npc.width / 2; - position.Y -= npc.height / 2; - - int width = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Width(); - int height = TextureAssets.Npc[npc.type] is null ? 0 : TextureAssets.Npc[npc.type].Height(); - spriteBatch.Draw(TextureAssets.Npc[npc.type].Value, new Vector2(position.X - screenPos.X + (float)(npc.width / 2) - (float)width * npc.scale / 2f + halfSize.X * npc.scale, position.Y - screenPos.Y + (float)npc.height - (float)height * npc.scale / (float)Main.npcFrameCount[npc.type] + 4f + halfSize.Y * npc.scale + npc.gfxOffY), npc.frame, currentColor, npc.rotation, halfSize, npc.scale, spriteEffects, 0f); - } - } } float beginTelegraphGateValue = BrainOfCthulhuAI.TimeBeforeCreeperAttack - BrainOfCthulhuAI.CreeperTelegraphTime; @@ -8363,83 +7310,6 @@ namespace CalamityMod.NPCs } } - // His afterimages I can't get to work, so fuck it - else if (npc.type == NPCID.SkeletronPrime || npc.type == NPCType()) - { - Texture2D npcTexture = (death && npc.type == NPCID.SkeletronPrime) ? ExtraTextureRefs.ChadPrime.Value : TextureAssets.Npc[npc.type].Value; - int frameHeight = npcTexture.Height / Main.npcFrameCount[npc.type]; - - npc.frame.Y = (int)newAI[3]; - - // Mechdusa drawing - if (NPC.IsMechQueenUp) - { - if (npc.ai[1] == 0f || npc.ai[1] == 4f) - { - newAI[2] += 1f; - if (newAI[2] >= 12f) - { - newAI[2] = 0f; - newAI[3] += frameHeight; - if (newAI[3] / frameHeight >= 5) - newAI[3] = frameHeight * 3; - } - } - else - { - newAI[2] = 0f; - newAI[3] = frameHeight * 5; - } - } - - // Floating phase - else if (npc.ai[1] == 0f || npc.ai[1] == 4f) - { - newAI[2] += 1f; - if (newAI[2] >= 12f) - { - newAI[2] = 0f; - newAI[3] += frameHeight; - - if (newAI[3] / frameHeight >= 2f) - newAI[3] = 0f; - } - } - - // Spinning probe spawn or fly over phase - else if (npc.ai[1] == 5f || npc.ai[1] == 6f) - { - newAI[2] = 0f; - newAI[3] = frameHeight; - } - - // Spinning phase - else - { - newAI[2] = 0f; - newAI[3] = frameHeight * 2; - } - - npc.frame.Y = (int)newAI[3]; - - SpriteEffects spriteEffects = SpriteEffects.None; - if (npc.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - spriteBatch.Draw(npcTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, npc.GetAlpha(drawColor), npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - - Color eyesColor = new Color(200, 200, 200, 0); - if (death) - { - int alpha = 192; - eyesColor = npc.type == NPCType() ? new Color(150, 100, 255, alpha) : new Color(255, 255, 0, alpha); - Texture2D glowTexture = npc.type == NPCID.SkeletronPrime ? ExtraTextureRefs.ChadPrimeEyeGlowmask.Value : SkeletronPrime2.EyeTexture.Value; - spriteBatch.Draw(glowTexture, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - } - else - spriteBatch.Draw(TextureAssets.BoneEyes.Value, npc.Center - screenPos + new Vector2(0, npc.gfxOffY), npc.frame, eyesColor, npc.rotation, npc.frame.Size() / 2, npc.scale, spriteEffects, 0f); - } - else if (npc.type == NPCID.Plantera) { // Percent life remaining @@ -8798,7 +7668,7 @@ namespace CalamityMod.NPCs { return DownedBossSystem.downedGuardians; } - else if (type == NPCType()) + else if (type == NPCType()) { return DownedBossSystem.downedDragonfolly; } @@ -9536,37 +8406,6 @@ namespace CalamityMod.NPCs } #endregion - #region Adjust Difficulty Stat Scaling - // Adjust HP and damage in Master Mode - public static void AdjustMasterModeStatScaling(NPC npc, bool isABoss = false) - { - if (!Main.masterMode) - return; - - // Bosses and enemies have separate HP reduction multipliers - npc.lifeMax = (int)Math.Round(npc.lifeMax * (isABoss ? MasterModeBossHPMultiplier : MasterModeEnemyHPMultiplier)); - - // Bosses do not get their damage reduced - if (!isABoss) - npc.damage = (int)Math.Round(npc.damage * MasterModeEnemyDamageMultiplier); - } - - // Adjust only knockback resist in Expert Mode (this is also adjusted in Master Mode because Expert has to be enabled if Master is enabled) - public static void AdjustExpertModeStatScaling(NPC npc) - { - if (!Main.expertMode) - return; - - if (npc.knockBackResist <= 0f) - return; - - // Knockback resist is backasswards in this fucking game so we need to add to the knockBackResist variable here :^) - float knockBackResistMult = Main.masterMode ? MasterModeEnemyKnockbackMultiplier : ExpertModeEnemyKnockbackMultiplier; - float knockBackResistReduction = npc.knockBackResist * knockBackResistMult; - npc.knockBackResist += knockBackResistReduction; - } - #endregion - #region Bestiary public override void SetBestiary(NPC npc, BestiaryDatabase database, BestiaryEntry bestiaryEntry) { @@ -9739,34 +8578,5 @@ namespace CalamityMod.NPCs return result; } #endregion - - #region Type Name Changes - public override void ModifyTypeName(NPC npc, ref string typeName) - { - if (CalamityWorld.death || BossRushEvent.BossRushActive) - { - if (npc.type == NPCID.SkeletronPrime) - { - typeName = CalamityUtils.GetTextValue("NPCs.SkeletronOmega.DisplayName"); - } - if (npc.type == NPCID.PrimeSaw) - { - typeName = CalamityUtils.GetTextValue("NPCs.OmegaSaw.DisplayName"); - } - if (npc.type == NPCID.PrimeLaser) - { - typeName = CalamityUtils.GetTextValue("NPCs.OmegaLaser.DisplayName"); - } - if (npc.type == NPCID.PrimeVice) - { - typeName = CalamityUtils.GetTextValue("NPCs.AlphaVice.DisplayName"); - } - if (npc.type == NPCID.PrimeCannon) - { - typeName = CalamityUtils.GetTextValue("NPCs.AlphaCannon.DisplayName"); - } - } - } - #endregion } } diff --git a/NPCs/CalamityGlobalNPCLoot.cs b/NPCs/CalamityGlobalNPCLoot.cs index cb31ae999e..663b306e04 100644 --- a/NPCs/CalamityGlobalNPCLoot.cs +++ b/NPCs/CalamityGlobalNPCLoot.cs @@ -178,12 +178,6 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 3, 2)); break; - // Skeleton Merchant - // Punch Card @ 100% - case NPCID.SkeletonMerchant: - npcLoot.Add(ModContent.ItemType()); - break; - // Skeleton Archer // Magic Quiver @ 5% (2.5% in Vanilla) // Marrow @ 2.5% (0.5% in Vanilla) @@ -280,8 +274,16 @@ namespace CalamityMod.NPCs // Dreamer Ghoul // Trifold Map @ 1% Normal, 2% Expert+ + // Light Shard @ 10% case NPCID.DesertGhoulHallow: npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.TrifoldMap, 100, 50)); + npcLoot.ChangeDropRate(ItemID.LightShard, 1, 10); + break; + + // Crystal Thresher + // Light Shard @ 10% + case NPCID.SandsharkHallow: + npcLoot.ChangeDropRate(ItemID.LightShard, 1, 10); break; // Sand Elemental @@ -293,6 +295,15 @@ namespace CalamityMod.NPCs npcLoot.Add(ItemDropRule.NormalvsExpert(ModContent.ItemType(), 10, 6)); npcLoot.Add(ItemID.DungeonDesertKey, 10); break; + + // Tainted Ghoul, Vile Ghoul, Bone Biter, Flesh Reaver + // Dark Shard @ 10% + case NPCID.DesertGhoulCorruption: + case NPCID.DesertGhoulCrimson: + case NPCID.SandsharkCorrupt: + case NPCID.SandsharkCrimson: + npcLoot.ChangeDropRate(ItemID.DarkShard, 1, 10); + break; #endregion #region Ice @@ -684,11 +695,15 @@ namespace CalamityMod.NPCs #endregion #region Graveyard - // Alternate Blood Orb obtainment methods (10%) + // Alternate Blood Orb obtainment methods (20%) case NPCID.MaggotZombie: + postEoC.Add(ModContent.ItemType(), 5); + break; + + // 100%, 3-6 each case NPCID.TheBride: case NPCID.TheGroom: - postEoC.Add(ModContent.ItemType(), 10); + postEoC.Add(ModContent.ItemType(), 1, 3, 6); break; // Ghost Bracelet @ 5% (Dandy requests this drops at a "high chance" but inventory clutter is real so) @@ -1905,40 +1920,6 @@ namespace CalamityMod.NPCs if (BuffedDungeonEnemiesList.Includes(npc.type)) npcLoot.Add(ItemID.Ectoplasm, 5); #endregion - - // Blanket remove all specific food item drops that have changed obtainment methods in Calamity - // This is type-indiscriminate and will also most probably hit modded NPCs too - - // CIT 7NOV2024: Yeah it hits modded NPCs; in fact it removes GFB drops from Ravager and Deus - // Fixing this by making the code only run if the NPC is not a boss - if (!npc.boss) - { - int[] randomFoodItems = new int[] -{ - ItemID.ApplePie, - ItemID.BananaSplit, - ItemID.BBQRibs, - ItemID.Burger, - ItemID.MilkCarton, - ItemID.ChocolateChipCookie, - ItemID.CoffeeCup, - ItemID.CreamSoda, - ItemID.FriedEgg, - ItemID.Fries, - ItemID.Grapes, - ItemID.Hotdog, - ItemID.IceCream, - ItemID.Milkshake, - ItemID.Nachos, - ItemID.Pizza, - ItemID.PotatoChips, - ItemID.ShrimpPoBoy, - ItemID.Spaghetti, - ItemID.Steak -}; - foreach (int foodItemID in randomFoodItems) - npcLoot.RemoveWhere((rule) => rule is ItemDropWithConditionRule foodRule && foodRule.itemId == foodItemID); - } } #endregion @@ -2058,7 +2039,7 @@ namespace CalamityMod.NPCs break; case NPCID.WallofFlesh: - SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Painter, NPCID.WitchDoctor, NPCID.Stylist, NPCID.DyeTrader, NPCID.Demolitionist, NPCID.PartyGirl, NPCID.Clothier, NPCID.SkeletonMerchant, NPCID.BestiaryGirl }, Main.hardMode); + SetNewShopVariable(new int[] { NPCID.Merchant, NPCID.ArmsDealer, NPCID.Dryad, NPCID.Painter, NPCID.WitchDoctor, NPCID.Stylist, NPCID.DyeTrader, NPCID.Demolitionist, NPCID.PartyGirl, NPCID.Clothier, NPCID.SkeletonMerchant }, Main.hardMode); SetNewBossJustDowned(npc); if (!Main.hardMode && !BossRushEvent.BossRushActive) diff --git a/NPCs/CalamityGlobalTownNPC.cs b/NPCs/CalamityGlobalTownNPC.cs index 37104cfa0b..90e7304092 100644 --- a/NPCs/CalamityGlobalTownNPC.cs +++ b/NPCs/CalamityGlobalTownNPC.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using CalamityMod.Events; using CalamityMod.Items; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Ammo; using CalamityMod.Items.Armor; using CalamityMod.Items.Armor.Vanity; @@ -74,7 +75,6 @@ namespace CalamityMod.NPCs }; private static readonly string[] ArmsDealerNames = { - "Drifter", "Finchi", "Heniek", // <@!363404700445442050> (kazurgundu) "Fire", // <@!354362326947856384> (ultimatefirewaster) @@ -89,6 +89,7 @@ namespace CalamityMod.NPCs { "Joeseph Jostar", "Storm Havik", // <@!1013452363178197072> (fishnotduck) + "Magorfis Splunt the Greater Finklejim", // <@!147490809334333440> (eidolbyssus) }; private static readonly string[] CyborgNames = { @@ -99,7 +100,6 @@ namespace CalamityMod.NPCs { "Tavish DeGroot", // <@!442447226992721930> (magicoal) "Fimmy", // <@!407348617079160832> (darkmega5) - "Dorira", // <@!215269032360804352> (crimsoncb) "John Helldiver", // <@!614126424751603714> (exellent.) }; private static readonly string[] DryadNames = @@ -109,6 +109,7 @@ namespace CalamityMod.NPCs "Jasmine", // <@!430532867479699456> (phantasmagoria.) "Cybil", // <@!486507232666845185> (Captain Doofus#????) "Ruth", // <@!1001307586068492388> (briny_coffee) + "Kanna", // <@!730203712898859018> (cosmoredeathwish) }; private static readonly string[] DyeTraderNames = null; private static readonly string[] GoblinTinkererNames = @@ -187,10 +188,10 @@ namespace CalamityMod.NPCs "Captain J. Crackers", // <@!233232602994049024> (qyuuno) "Gol D. Roger", // <@!256228859110752257> (xtra3678) "Yarrim", // <@!290061123137306624> (borb9834) + "Hector Barbossa", // <@!615704209303797790> (thatrockisfullamagic) }; private static readonly string[] PrincessNames = { - "Catalyst", // <@!156672312425316352> (xaqult) "Nyapano", // <@!120976656826368003> (nyapano) "Jade", // <@!187395834625785869> (verymasterninja) "Nyavi Aceso", // <@!270260920888852480> (navigator.) @@ -203,6 +204,7 @@ namespace CalamityMod.NPCs private static readonly string[] SantaClausNames = { "Jank", // <@!339950757472239616> (jankle_) + "Aoi Kurashiki", // <@!358411687885537291> (nothinpurrsonal) }; private static readonly string[] SkeletonMerchantNames = { @@ -220,6 +222,7 @@ namespace CalamityMod.NPCs "Linn", // <@!277983612383526913> (duckycolors) "Eira", // <@!1166136068408623234> (taela_gemetha) "Kreutz", // <@!553445849149997056> (red_r_kreutz) + "Cathlyn", // <@!156672312425316352> (xaqult) }; private static readonly string[] StylistNames = { @@ -244,13 +247,15 @@ namespace CalamityMod.NPCs private static readonly string[] TravelingMerchantNames = { "Stan Pines", - "Slap Battles", // <@!923504188615450654> (gravityglider.) + "Intergaze", // <@!923504188615450654> (intergaze) "Borgus", // <@!539127427482255376> (therealmeepman) + "Postman Hiss", // <@!454638106122125312> (karinthefairy) }; private static readonly string[] TruffleNames = { "Aldrimil", // <@!413719640238194689> (Thorioum#2475) "Wonton", // <@!1198092982923043040> (imonthatgudkush) + "Mad Lad", // <@!215269032360804352> (crimsoncb) }; private static readonly string[] WitchDoctorNames = { @@ -269,6 +274,7 @@ namespace CalamityMod.NPCs "Chris Tallballs", // <@!770211589076418571> (vysterx) (previously: bewearium) "Syethas", // <@!325413275066171393> (cosmicstariight) "Nextdoor Psycho", // <@!173261518572486656> (nextdoorpsycho) + "Mike Cyclops", // <@!702327497475227741> (seichoseicho) }; private static readonly string[] ZoologistNames = { @@ -279,6 +285,19 @@ namespace CalamityMod.NPCs "Gwenhwyvar", // <@!291342874497515531> (diamondnife) "Daxie", // <@!465438861103988737> (daxie626) }; + // Town Slimes + private static readonly string[] ClumsySlimeNames = null; + private static readonly string[] CoolSlimeNames = null; + private static readonly string[] DivaSlimeNames = null; + private static readonly string[] ElderSlimeNames = null; + private static readonly string[] MysticSlimeNames = null; + private static readonly string[] NerdySlimeNames = + { + "Big Blungus", // <@!272759434282008577> (schmoov) + "Rimuru Tempest", // <@!806463201398358036> (c0d3_404) + }; + private static readonly string[] SquireSlimeNames = null; + private static readonly string[] SurlySlimeNames = null; // The following sets are for the 1.4 Town Pets: Town Dogs, Cats and Bunnies. // All three pet types come in numerous breeds. Each breed has its own name pool. @@ -341,6 +360,8 @@ namespace CalamityMod.NPCs { "Felix", // <@!183424826407518208> (lilac_vrt_olligoci) "Tardo", // <@!739343546867384391> (midnight295) + "Dali", // <@!460238880436781061> (darthlego) + "Kiba", // <@!852348657072340992> (jollydragonslayer) }; private static readonly string[] TownCatRussianBlueNames = null; private static readonly string[] TownCatSilverNames = @@ -358,6 +379,7 @@ namespace CalamityMod.NPCs private static readonly string[] TownBunnyNames = { "Poco", // <@!1192261996146593872> (tostitomuncher33) + "Puffer", // <@!181103507711983616> (piky) }; private static readonly string[] TownBunnyWhiteNames = null; private static readonly string[] TownBunnyAngoraNames = null; @@ -596,6 +618,32 @@ namespace CalamityMod.NPCs AddNewNames(nameList, ZoologistNames); break; + // Town Slimes + case NPCID.TownSlimePurple: // Clumsy Slime + AddNewNames(nameList, ClumsySlimeNames); + break; + case NPCID.TownSlimeGreen: // Cool Slime + AddNewNames(nameList, CoolSlimeNames); + break; + case NPCID.TownSlimeRainbow: // Diva Slime + AddNewNames(nameList, DivaSlimeNames); + break; + case NPCID.TownSlimeOld: // Elder Slime + AddNewNames(nameList, ElderSlimeNames); + break; + case NPCID.TownSlimeYellow: // Mystic Slime + AddNewNames(nameList, MysticSlimeNames); + break; + case NPCID.TownSlimeBlue: // Nerdy Slime + AddNewNames(nameList, NerdySlimeNames); + break; + case NPCID.TownSlimeCopper: // Squire Slime + AddNewNames(nameList, SquireSlimeNames); + break; + case NPCID.TownSlimeRed: // Surly Slime + AddNewNames(nameList, SurlySlimeNames); + break; + // This function doesn't work with Town Pets currently case NPCID.TownCat: AddNewNames(nameList, TownCatNames); @@ -1105,10 +1153,10 @@ namespace CalamityMod.NPCs bool happy = Main.LocalPlayer.currentShoppingSettings.PriceAdjustment <= 0.9; Condition hasFlareGunUpgrade = new(CalamityUtils.GetText("Condition.HasFlareGun"), () => (Main.LocalPlayer.HasItem(ItemType()) || Main.LocalPlayer.HasItem(ItemType())) && !Main.LocalPlayer.HasItem(ItemID.FlareGun)); + Condition bestiaryProgressLacewing = new(CalamityUtils.GetText("Condition.LacewingBestiary"), () => Main.GetBestiaryProgressReport().CompletionPercent >= 0.4f); Condition roguePlayer = CalamityConditions.PlayerHasRogueArmor; Condition wingedPlayer = CalamityConditions.PlayerHasWings; Condition revengeance = CalamityConditions.InRevengeanceMode; - Condition drunk = CalamityConditions.PlayerAlcoholPoisoned; Condition downedPolterghast = CalamityConditions.DownedPolterghast; Condition downedDoG = CalamityConditions.DownedDevourerOfGods; @@ -1118,10 +1166,7 @@ namespace CalamityMod.NPCs .AddWithCustomValue(ItemID.WormholePotion, Item.buyPrice(silver: 5), Condition.HappyEnoughToSellPylons); shop.Add(ItemID.Flare, hasFlareGunUpgrade) .Add(ItemID.BlueFlare, hasFlareGunUpgrade) - .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())) - .AddWithCustomValue(ItemID.Burger, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.Hotdog, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.CoffeeCup, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons); + .AddWithCustomValue(ItemID.AngelStatue, Item.buyPrice(gold: 5), Condition.NpcIsPresent(NPCType())); } if (type == NPCID.DyeTrader) @@ -1167,7 +1212,6 @@ namespace CalamityMod.NPCs shop.AddWithCustomValue(ItemID.JungleRose, Item.buyPrice(gold: 2)) .AddWithCustomValue(ItemID.NaturesGift, Item.buyPrice(gold: 10)) .Add(ItemType()) - .AddWithCustomValue(ItemID.Grapes, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) .Add(ItemType(), Condition.DownedSkeletron) .Add(ItemID.CorruptSeeds, Condition.CrimsonWorld, Condition.InGraveyard, Condition.PreHardmode) .Add(ItemID.CrimsonSeeds, Condition.CorruptWorld, Condition.InGraveyard, Condition.PreHardmode) // Vanilla sells these in Hardmode, we just make them available at all times @@ -1177,8 +1221,7 @@ namespace CalamityMod.NPCs if (type == NPCID.GoblinTinkerer) { shop.Add(ItemType()) - .Add(ItemID.Toolbox, Condition.NpcIsPresent(NPCID.Mechanic)) - .AddWithCustomValue(ItemID.Spaghetti, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron); + .Add(ItemID.Toolbox, Condition.NpcIsPresent(NPCID.Mechanic)); } if (type == NPCID.Mechanic) @@ -1207,7 +1250,11 @@ namespace CalamityMod.NPCs { shop.Add(ItemType(), Condition.NotRemixWorld) .Add(ItemID.PurpleSolution, Condition.InGraveyard, Condition.CrimsonWorld, Condition.NotRemixWorld) - .Add(ItemID.RedSolution, Condition.InGraveyard, Condition.CorruptWorld, Condition.NotRemixWorld); + .Add(ItemID.RedSolution, Condition.InGraveyard, Condition.CorruptWorld, Condition.NotRemixWorld) + .Add(ItemType()) + .Add(ItemType()) + .Add(ItemType()) + .Add(ItemType()); } if (type == NPCID.Wizard) @@ -1231,15 +1278,12 @@ namespace CalamityMod.NPCs .Add(ItemType()) .Add(ItemType()) .Add(ItemType()) - .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 10), Condition.DownedGolem) - .AddWithCustomValue(ItemID.FriedEgg, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons); + .AddWithCustomValue(ItemID.ButterflyDust, Item.buyPrice(gold: 10), Condition.DownedGolem); } if (type == NPCID.PartyGirl) { - shop.AddWithCustomValue(ItemID.GenderChangePotion, Item.buyPrice(silver: 25), Condition.HappyEnoughToSellPylons) - .AddWithCustomValue(ItemID.Pizza, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.DownedSkeletron) - .AddWithCustomValue(ItemID.CreamSoda, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons); + shop.AddWithCustomValue(ItemID.GenderChangePotion, Item.buyPrice(silver: 25), Condition.HappyEnoughToSellPylons); } if (type == NPCID.Princess) @@ -1267,14 +1311,10 @@ namespace CalamityMod.NPCs .AddWithCustomValue(ItemType(), Item.buyPrice(gold: 12)); } - if (type == NPCID.Golfer) - { - shop.AddWithCustomValue(ItemID.PotatoChips, Item.buyPrice(gold: 1), Condition.HappyEnoughToSellPylons); - } if (type == NPCID.BestiaryGirl) { - shop.AddWithCustomValue(ItemID.Steak, Item.buyPrice(gold: 5), Condition.HappyEnoughToSellPylons, Condition.Hardmode); + shop.AddWithCustomValue(ItemID.EmpressButterfly, Item.buyPrice(gold: 15), bestiaryProgressLacewing); } if (type == NPCID.Truffle) @@ -1282,6 +1322,29 @@ namespace CalamityMod.NPCs shop.Add(ItemType()); } } + + public override void ModifyActiveShop(NPC npc, string shopName, Item[] items) + { + // TODO: Uses a hardcoded string since dedicated names are currently hardcoded strings + // Will need to be changed if dedicated names are localized in the future + if (npc.type == NPCID.SkeletonMerchant && npc.GivenName == "Sans Undertale") + { + int index = 0; + for (int i = 0; i < Chest.maxItems; i++) + { + if (items[i] == null) + { + index = i; + break; + } + } + var punch = new Item(ItemType()) + { + shopCustomPrice = Item.buyPrice(gold: 10) + }; + items[index] = punch; + } + } #endregion } } diff --git a/NPCs/CalamityPierceResistance.cs b/NPCs/CalamityPierceResistance.cs index c69f0b3ad7..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 64336874e0..edbb95134b 100644 --- a/NPCs/CeaselessVoid/CeaselessVoid.cs +++ b/NPCs/CeaselessVoid/CeaselessVoid.cs @@ -12,13 +12,14 @@ using CalamityMod.Items.Potions; using CalamityMod.Items.TreasureBags; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; +using CalamityMod.Projectiles.Boss; using CalamityMod.Sounds; using CalamityMod.UI.VanillaBossBars; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using System; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -26,6 +27,8 @@ using Terraria.GameContent.Bestiary; using Terraria.GameContent.ItemDropRules; using Terraria.ID; using Terraria.ModLoader; +using static Terraria.ModLoader.ModContent; +using CalamityMod.UI; namespace CalamityMod.NPCs.CeaselessVoid { @@ -39,6 +42,8 @@ namespace CalamityMod.NPCs.CeaselessVoid public bool playedbuildsound = false; + public bool madeItToLocation = true; + public override void SetStaticDefaults() { Main.npcFrameCount[Type] = 6; @@ -52,34 +57,33 @@ namespace CalamityMod.NPCs.CeaselessVoid NPCID.Sets.MPAllowedEnemies[Type] = true; if (!Main.dedServ) { - GlowTexture = ModContent.Request(Texture + "Glow", AssetRequestMode.AsyncLoad); + GlowTexture = Request(Texture + "Glow", AssetRequestMode.AsyncLoad); } } + public static int BeamPortalDamage = 60; // 240 + public static int DarkEnergyProjectileDamage = 60; // 240 + public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 180; // 360 NPC.npcSlots = 36f; NPC.width = 100; NPC.height = 100; NPC.defense = 80; - CalamityGlobalNPC global = NPC.Calamity(); - global.DR = 0.5f; + NPC.Calamity().DR = 0.5f; NPC.LifeMaxNERB(65000, 78000, 72000); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; NPC.noGravity = true; NPC.noTileCollide = true; NPC.boss = true; - NPC.BossBar = ModContent.GetInstance(); + NPC.BossBar = GetInstance(); NPC.DeathSound = DeathSound; + NPC.Calamity().canBreakPlayerDefense = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -125,7 +129,539 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void AI() { - CeaselessVoidAI.VanillaCeaselessVoidAI(NPC, Mod); + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); + CalamityGlobalNPC.voidBoss = NPC.whoAmI; + + // Percent life remaining + double lifeRatio = NPC.life / (double)NPC.lifeMax; + + // Difficulty modes + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + + // Phases + bool phase2 = lifeRatio <= 0.7; + bool phase3 = lifeRatio <= 0.4; + bool phase4 = lifeRatio <= 0.1; + bool theBigSucc = NPC.life / (double)NPC.lifeMax <= 0.1; + bool succSoHardThatYouDie = NPC.life / (double)NPC.lifeMax <= 0.005; + + // Spawn Dark Energies + int darkEnergyAmt = death ? 6 : revenge ? 5 : expertMode ? 4 : 3; + if (phase2) + darkEnergyAmt += 1; + if (phase3) + darkEnergyAmt += 1; + if (phase4) + darkEnergyAmt += 1; + + if (CalamityWorld.LegendaryMode) + darkEnergyAmt *= 2; + + // Spawn a few Dark Energies as soon as the fight starts + int spacing = 360 / darkEnergyAmt; + int distance2 = 10; + if (NPC.ai[2] == 0f) + { + NPC.ai[2] = 1f; + for (int i = 0; i < darkEnergyAmt; i++) + { + for (int j = 0; j < 3; j++) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(NPC.Center.Y + (Math.Cos(i * spacing) * distance2)), NPCType(), NPC.whoAmI, i * spacing, j); + } + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 0.5f); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 1.5f); + } + + // If there are any Dark Energies alive, change AI and don't take damage + bool anyDarkEnergies = NPC.AnyNPCs(NPCType()); + bool movingDuringSuccPhase = NPC.ai[3] == 0f; + NPC.dontTakeDamage = anyDarkEnergies || theBigSucc || movingDuringSuccPhase; + + // Get a target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + NPC.TargetClosest(); + + // Despawn safety, make sure to target another player if the current player target is too far away + if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + NPC.TargetClosest(); + + Player player = Main.player[NPC.target]; + + // Speed enrage + bool moveVeryFast = Vector2.Distance(NPC.Center, player.Center) > 960f || (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0); + + // Despawn + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + { + NPC.TargetClosest(false); + player = Main.player[NPC.target]; + if (!player.active || player.dead || Vector2.Distance(player.Center, NPC.Center) > 5600f) + { + if (NPC.velocity.Y > 3f) + NPC.velocity.Y = 3f; + NPC.velocity.Y -= 0.1f; + if (NPC.velocity.Y < -12f) + NPC.velocity.Y = -12f; + + if (NPC.timeLeft > 60) + NPC.timeLeft = 60; + + return; + } + } + else if (NPC.timeLeft < 1800) + NPC.timeLeft = 1800; + + float tileEnrageMult = CalamityWorld.MaliceMode ? 1.5f : 1f; + NPC.Calamity().CurrentlyEnraged = tileEnrageMult > 1f && !BossRushEvent.BossRushActive; + + // Set AI variable to be used by Dark Energies + NPC.ai[1] = tileEnrageMult; + + // Increase projectile fire rate based on number of nearby active tiles + float projectileFireRateMultiplier = MathHelper.Lerp(0.5f, 1.5f, 1f - ((tileEnrageMult - 1f) / 0.5f)); + + // Decides whether Ceaseless moves closer to its target or not + float distanceRequiredToMove = CalamityWorld.LegendaryMode ? 300f : 720f; + bool move = Vector2.Distance(NPC.Center, player.Center) > distanceRequiredToMove || !Collision.CanHit(NPC.Center, 1, 1, player.Center, 1, 1); + + // Succ attack + if (!anyDarkEnergies) + { + // This is here because it's used in multiple places + float suckDistance = CalamityWorld.MaliceMode ? 2400f : death ? 1600f : revenge ? 1440f : expertMode ? 1280f : 1040f; + + // Move closer to the target before trying to succ + if (movingDuringSuccPhase) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (move) + Movement(true); + else + NPC.ai[3] = 1f; + } + else + { + // Set damage + NPC.damage = NPC.defDamage; + + // Use this to generate more and more dust in final phase + float finalPhaseDustRatio = 1f; + if (succSoHardThatYouDie) + { + finalPhaseDustRatio = 5f; + } + else if (theBigSucc) + { + float amount = (10f - (float)(NPC.life / (double)NPC.lifeMax) * 100f) / 10f; + finalPhaseDustRatio += MathHelper.Lerp(0f, 2f, amount); + } + + // Slow down + if (NPC.velocity.Length() > 0.5f) + NPC.velocity *= 0.8f; + else + NPC.velocity = Vector2.Zero; + + // Move towards target again if they get outside the succ radius + float moveCloserGateValue = suckDistance * 0.8f; + if (Vector2.Distance(NPC.Center, player.Center) > moveCloserGateValue) + NPC.ai[3] = 0f; + + // Ceaseless Void sucks in dark energy in different patterns + // This attack also sucks in all players that are within reach of the succ + for (int h = 0; h < 3; h++) + { + float distanceDivisor = h + 1f; + float dustDistance = suckDistance / distanceDivisor; + int numDust = (int)(0.1f * MathHelper.TwoPi * dustDistance); + Vector2 dustOffset = Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * dustDistance; + + int var = (int)(dustDistance / finalPhaseDustRatio); + float dustVelocity = 24f / distanceDivisor * finalPhaseDustRatio; + for (int i = 0; i < numDust; i++) + { + if (Main.rand.NextBool(var)) + { + dustOffset = dustOffset.RotatedBy(MathHelper.TwoPi / numDust); + Vector2 dustSpawn = NPC.Center + dustOffset; + Dust dust = Dust.NewDustPerfect(dustSpawn, DustType(), Utils.DirectionTo(dustSpawn, NPC.Center) * dustVelocity, Scale: 3 - h); + dust.fadeIn = 1f; + } + } + } + + float succPower = 0.125f + finalPhaseDustRatio * 0.125f; + for (int i = 0; i < Main.maxPlayers; i++) + { + float distance = Vector2.Distance(Main.player[i].Center, NPC.Center); + if (distance < suckDistance && Main.player[i].grappling[0] == -1) + { + if (Collision.CanHit(NPC.Center, 1, 1, Main.player[i].Center, 1, 1)) + { + float distanceRatio = distance / suckDistance; + float multiplier = 1f - distanceRatio; + + if (Main.player[i].Center.X < NPC.Center.X) + Main.player[i].velocity.X += succPower * multiplier; + else + Main.player[i].velocity.X -= succPower * multiplier; + } + } + } + + // Slowly die in final phase and then implode + // This phase lasts 20 seconds + if (theBigSucc && calamityGlobalNPC.newAI[1] % 60f == 0f) + { + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int damageAmt = NPC.lifeMax / 200; + NPC.life -= damageAmt; + NPC.DamageEffect(damageAmt); + } + + if (NPC.life <= (NPC.lifeMax / 40) && !playedbuildsound) + { + SoundEngine.PlaySound(BuildupSound, NPC.Center); + playedbuildsound = true; + } + + if (NPC.life <= 0) + { + NPC.life = 0; + NPC.HitEffect(); + NPC.checkDead(); + } + + NPC.netUpdate = true; + } + + // Beam Portals + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (calamityGlobalNPC.newAI[1] == 0f) + { + int numBeamPortals = revenge ? 3 : 2; + float degrees = 360 / numBeamPortals; + float beamPortalDistance = death ? 400f : revenge ? 420f : expertMode ? 440f : 480f; + int type = ProjectileType(); + for (int i = 0; i < numBeamPortals; i++) + { + float ai1 = i * degrees; + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (float)(Math.Sin(i * degrees) * beamPortalDistance), player.Center.Y + (float)(Math.Cos(i * degrees) * beamPortalDistance), 0f, 0f, type, BeamPortalDamage, 0f, Main.myPlayer, ai1, 0f); + } + } + } + + // Use this timer to lessen Dark Energy projectile rate of fire while Beam Portals are active + float beamPortalTimeLeft = 600f; + bool summonLessDarkEnergies = false; + if (calamityGlobalNPC.newAI[1] < beamPortalTimeLeft) + { + calamityGlobalNPC.newAI[1] += 1f; + summonLessDarkEnergies = true; + } + else if (theBigSucc) + calamityGlobalNPC.newAI[1] += 1f; + + // Suck in Dark Energy projectiles from far away + calamityGlobalNPC.newAI[3] += 1f; + float darkEnergySpiralGateValue = (summonLessDarkEnergies ? 24f : 12f) * projectileFireRateMultiplier; + if (calamityGlobalNPC.newAI[3] >= darkEnergySpiralGateValue) + { + calamityGlobalNPC.newAI[3] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ProjectileType(); + bool normalSpread = NPC.localAI[0] % 2f == 0f; + float speed = 0.5f; + int totalProjectiles = 4; + Vector2 spinningPoint = new Vector2(normalSpread ? 0f : -speed, -speed); + float radialOffset = MathHelper.ToRadians(NPC.localAI[1]); + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 spawnVector = NPC.Center + Vector2.Normalize(spinningPoint.RotatedBy(MathHelper.TwoPi / totalProjectiles * i + radialOffset)) * suckDistance; + Vector2 velocity = Vector2.Normalize(NPC.Center - spawnVector) * speed; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, DarkEnergyProjectileDamage, 0f, Main.myPlayer); + } + } + + NPC.localAI[1] += 10f; + } + + // Summon some extra projectiles in Expert Mode + if (phase2 && expertMode) + { + NPC.localAI[2] += 1f; + if (NPC.localAI[2] >= 60f * projectileFireRateMultiplier) + { + NPC.localAI[2] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ProjectileType(); + bool normalSpread = NPC.localAI[0] % 2f != 0f; + float speed = 2f; + int totalProjectiles = 2; + float radians = MathHelper.TwoPi / totalProjectiles; + double angleA = radians * 0.5; + double angleB = MathHelper.ToRadians(90f) - angleA; + float velocityX = (float)(speed * Math.Sin(angleA) / Math.Sin(angleB)); + Vector2 spinningPoint = new Vector2(normalSpread ? 0f : -velocityX, -speed); + float radialOffset = MathHelper.ToRadians(NPC.localAI[1] * 0.25f); + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 spawnVector = NPC.Center + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; + Vector2 velocity = Vector2.Normalize(NPC.Center - spawnVector) * speed; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, DarkEnergyProjectileDamage, 0f, Main.myPlayer); + } + } + } + } + + // Summon some extra projectiles in Revengeance Mode + if (phase4 && revenge) + { + NPC.localAI[3] += 1f; + if (NPC.localAI[3] >= 90f * projectileFireRateMultiplier) + { + NPC.localAI[3] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int type = ProjectileType(); + bool normalSpread = NPC.localAI[0] % 2f == 0f; + float speed = 4f; + int totalProjectiles = 2; + float radians = MathHelper.TwoPi / totalProjectiles; + double angleA = radians * 0.5; + double angleB = MathHelper.ToRadians(90f) - angleA; + float velocityX = (float)(speed * Math.Sin(angleA) / Math.Sin(angleB)); + Vector2 spinningPoint = new Vector2(normalSpread ? 0f : -velocityX, -speed); + float radialOffset = MathHelper.ToRadians(NPC.localAI[1] * 0.25f); + for (int i = 0; i < totalProjectiles; i++) + { + Vector2 spawnVector = NPC.Center + Vector2.Normalize(spinningPoint.RotatedBy(radians * i + radialOffset)) * suckDistance; + Vector2 velocity = Vector2.Normalize(NPC.Center - spawnVector) * speed; + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnVector, velocity, type, DarkEnergyProjectileDamage, 0f, Main.myPlayer); + } + } + } + } + } + } + else + { + // Avoid cheap bullshit + NPC.damage = 0; + if (move) + { + madeItToLocation = false; + } + if (!madeItToLocation) + { + Movement(false); + } + else + { + // Slow down + if (NPC.velocity.Length() > 0.5f) + NPC.velocity *= 0.8f; + else + NPC.velocity = Vector2.Zero; + } + + // Count up all Dark Energy HP values + int totalDarkEnergyHP = 0; + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC darkEnergy = Main.npc[i]; + if (darkEnergy.active && darkEnergy.type == NPCType()) + totalDarkEnergyHP += darkEnergy.life; + } + + // Destroy all Dark Energies if their total HP is below 20% + 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); + + int totalDarkEnergiesSpawned = darkEnergyAmt * 3 + 2; + int totalDarkEnergyMaxHP = darkEnergyMaxHP * totalDarkEnergiesSpawned; + int succPhaseGateValue = (int)(totalDarkEnergyMaxHP * 0.2); + if (totalDarkEnergyHP < succPhaseGateValue) + { + SoundEngine.PlaySound(SoundID.NPCDeath44, NPC.Center); + + // Kill all Dark Energies + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC darkEnergy = Main.npc[i]; + if (darkEnergy.active && darkEnergy.type == NPCType()) + { + darkEnergy.HitEffect(); + darkEnergy.active = false; + darkEnergy.netUpdate = true; + } + } + + // Generate a dust explosion + int dustAmt = 30; + int random = 3; + for (int j = 0; j < 10; j++) + { + random += j * 2; + for (int d = 0; d < dustAmt; d++) + { + Vector2 dustVelocity = new Vector2(Main.rand.Next(-random, random), Main.rand.Next(-random, random)); + dustVelocity = Vector2.Normalize(dustVelocity) * random * 2f; + Dust realDust = Dust.NewDustPerfect(NPC.Center + Main.rand.NextVector2CircularEdge(10f, 10f), (int)CalamityDusts.PurpleCosmilite, dustVelocity, 100, default, 5f); + realDust.noGravity = true; + } + } + } + } + + // Basic movement towards a location + void Movement(bool succ) + { + float velocity = moveVeryFast ? 25f : ((expertMode ? 7.5f : 6f) + (float)(death ? 2f * (1D - lifeRatio) : 0f)) * tileEnrageMult; + float acceleration = (moveVeryFast ? 0.75f : death ? 0.2f : expertMode ? 0.16f : 0.12f) + (float)(death ? 0.04f * (1D - lifeRatio) : 0f) * tileEnrageMult; + + // Increase speed dramatically in succ phase + if (succ) + { + velocity *= 2f; + acceleration *= 2f; + } + + if (!madeItToLocation) + { + + velocity *= 2f; + acceleration *= 5f; + } + + if (CalamityWorld.LegendaryMode) + { + velocity *= 1.15f; + acceleration *= 1.15f; + } + + Vector2 destination = player.Center; + + // Move between 8 different positions around the player, in order + float maxDistance = 320f; + Vector2 moveToOffset = succ ? Vector2.Zero : CalamityWorld.LegendaryMode ? new Vector2(0f, -maxDistance) : Vector2.Zero; + if ((!succ && CalamityWorld.LegendaryMode) || !madeItToLocation) + { + // Move to a new location every few seconds + calamityGlobalNPC.newAI[2] += 1f; + float newPositionGateValue = death ? 180f : revenge ? 210f : expertMode ? 240f : 300f; + if (calamityGlobalNPC.newAI[2] > newPositionGateValue) + { + calamityGlobalNPC.newAI[2] = 0f; + + NPC.ai[0] += 1f; + if (NPC.ai[0] > 7f) + NPC.ai[0] = 0f; + } + moveToOffset += new Vector2(maxDistance, 0).RotatedBy(NPC.ai[0] / 8f * MathHelper.TwoPi); + } + + destination += moveToOffset; + + // How far Ceaseless Void is from where it's supposed to be + Vector2 distanceFromDestination = destination - NPC.Center; + + // Movement + if (NPC.Distance(destination) > maxDistance || succ || (!CalamityWorld.LegendaryMode && !madeItToLocation)) + CalamityUtils.SmoothMovement(NPC, 0f, distanceFromDestination, velocity, acceleration, true); + if (NPC.Distance(destination) < 80) + { + madeItToLocation = true; + } + } + + // Spawn more Dark Energies as the fight progresses + if (calamityGlobalNPC.newAI[0] == 0f && NPC.life > 0) + calamityGlobalNPC.newAI[0] = NPC.lifeMax; + + if (NPC.life > 0) + { + int healthGateValue = (int)(NPC.lifeMax * 0.3); + if ((NPC.life + healthGateValue) < calamityGlobalNPC.newAI[0]) + { + NPC.TargetClosest(); + calamityGlobalNPC.newAI[0] = NPC.life; + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + calamityGlobalNPC.newAI[3] = 0f; + NPC.ai[3] = 0f; + NPC.localAI[0] += 1f; + NPC.localAI[1] = 0f; + NPC.localAI[2] = 0f; + NPC.localAI[3] = 0f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + if (phase4) + { + madeItToLocation = false; + for (int i = 0; i < darkEnergyAmt; i++) + { + for (int j = 0; j < 3; j++) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(NPC.Center.Y + (Math.Cos(i * spacing) * distance2)), NPCType(), NPC.whoAmI, i * spacing, j * 2f); + } + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 1f); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 3f); + } + else if (phase3) + { + madeItToLocation = false; + for (int i = 0; i < darkEnergyAmt; i++) + { + for (int j = 0; j < 3; j++) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(NPC.Center.Y + (Math.Cos(i * spacing) * distance2)), NPCType(), NPC.whoAmI, i * spacing, j * 1.5f); + } + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 0.5f); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 2f); + } + else + { + madeItToLocation = false; + for (int i = 0; i < darkEnergyAmt; i++) + { + for (int j = 0; j < 3; j++) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + (Math.Sin(i * spacing) * distance2)), (int)(NPC.Center.Y + (Math.Cos(i * spacing) * distance2)), NPCType(), NPC.whoAmI, i * spacing, j); + } + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 1.5f); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)(NPC.Center.Y + distance2), NPCType(), NPC.whoAmI, 0f, 2.5f); + } + } + + // Despawn potentially hazardous projectiles when entering a new phase + for (int i = 0; i < Main.maxProjectiles; i++) + { + Projectile projectile = Main.projectile[i]; + if (projectile.active) + { + if (projectile.type == ProjectileType() || projectile.type == ProjectileType() || + projectile.type == ProjectileType() || projectile.type == ProjectileType()) + { + if (projectile.timeLeft > 30) + projectile.timeLeft = 30; + } + } + } + } + } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -219,7 +755,7 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void ModifyNPCLoot(NPCLoot npcLoot) { - npcLoot.Add(ItemDropRule.BossBag(ModContent.ItemType())); + npcLoot.Add(ItemDropRule.BossBag(ItemType())); // Normal drops: Everything that would otherwise be in the bag LeadingConditionRule normalOnly = new LeadingConditionRule(new Conditions.NotExpert()); @@ -228,40 +764,40 @@ namespace CalamityMod.NPCs.CeaselessVoid // Weapons int[] weapons = new int[] { - ModContent.ItemType(), - ModContent.ItemType(), + ItemType(), + ItemType(), }; normalOnly.Add(DropHelper.CalamityStyle(DropHelper.NormalWeaponDropRateFraction, weapons)); // Materials - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 10, 12)); + normalOnly.Add(DropHelper.PerPlayer(ItemType(), 1, 10, 12)); // Equipment - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType())); + normalOnly.Add(DropHelper.PerPlayer(ItemType())); // Vanity - normalOnly.Add(ModContent.ItemType(), 7); - var godSlayerVanity = ItemDropRule.Common(ModContent.ItemType(), 20); - godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); - godSlayerVanity.OnSuccess(ItemDropRule.Common(ModContent.ItemType())); + normalOnly.Add(ItemType(), 7); + var godSlayerVanity = ItemDropRule.Common(ItemType(), 20); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ItemType())); + godSlayerVanity.OnSuccess(ItemDropRule.Common(ItemType())); normalOnly.Add(godSlayerVanity); - normalOnly.Add(ModContent.ItemType(), ThankYouPainting.DropInt); + normalOnly.Add(ItemType(), ThankYouPainting.DropInt); } - npcLoot.Add(ModContent.ItemType(), 10); + npcLoot.Add(ItemType(), 10); // Relic - npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ModContent.ItemType()); + npcLoot.DefineConditionalDropSet(DropHelper.RevAndMaster).Add(ItemType()); // GFB Eclipse Mirror and Nucleogenesis drop var GFBOnly = npcLoot.DefineConditionalDropSet(DropHelper.GFB); { - GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType()), hideLootReport: true); - GFBOnly.Add(DropHelper.PerPlayer(ModContent.ItemType()), hideLootReport: true); + GFBOnly.Add(DropHelper.PerPlayer(ItemType()), hideLootReport: true); + GFBOnly.Add(DropHelper.PerPlayer(ItemType()), hideLootReport: true); } // Lore - npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCeaselessVoid, ModContent.ItemType(), desc: DropHelper.FirstKillText); + npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedCeaselessVoid, ItemType(), desc: DropHelper.FirstKillText); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) @@ -269,9 +805,9 @@ 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 = ModContent.ItemType(); + potionType = ItemType(); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/CeaselessVoid/DarkEnergy.cs b/NPCs/CeaselessVoid/DarkEnergy.cs index 52f34259d9..c242ed17af 100644 --- a/NPCs/CeaselessVoid/DarkEnergy.cs +++ b/NPCs/CeaselessVoid/DarkEnergy.cs @@ -45,9 +45,9 @@ namespace CalamityMod.NPCs.CeaselessVoid public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.dontTakeDamage = true; NPC.width = NPC.height = HitboxSize; NPC.defense = 50; @@ -59,10 +59,6 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.HitSound = SoundID.NPCHit53; NPC.DeathSound = SoundID.NPCDeath44; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -123,7 +119,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (NPC.Opacity > 1f) NPC.Opacity = 1f; - NPC.scale = MathHelper.Lerp(0.05f, Main.getGoodWorld ? 0.5f : 1f, NPC.Opacity); + NPC.scale = MathHelper.Lerp(0.05f, CalamityWorld.LegendaryMode ? 0.5f : 1f, NPC.Opacity); } else { @@ -161,16 +157,15 @@ namespace CalamityMod.NPCs.CeaselessVoid NPC.timeLeft = 1800; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Gets how enraged Ceaseless Void is float tileEnrageMult = Main.npc[CalamityGlobalNPC.voidBoss].ai[1]; // Distance from Ceaseless Void - double maxDistance = bossRush ? 1200D : death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; + double maxDistance = death ? 1040D : revenge ? 960D : expertMode ? 880D : minMaxDistance; double rateOfChangeIncrease = (maxDistance / minMaxDistance) - 1D; double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + (tileEnrageMult - 1f) + rateOfChangeIncrease; if (NPC.Calamity().newAI[0] == 0f) @@ -284,7 +279,7 @@ namespace CalamityMod.NPCs.CeaselessVoid if (Main.zenithWorld) { if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Obstructed, 30, true); + target.AddBuff(BuffID.Blackout, 30, true); } } diff --git a/NPCs/Crabulon/CrabShroom.cs b/NPCs/Crabulon/CrabShroom.cs index 2c3e928208..7a979cac62 100644 --- a/NPCs/Crabulon/CrabShroom.cs +++ b/NPCs/Crabulon/CrabShroom.cs @@ -28,16 +28,16 @@ namespace CalamityMod.NPCs.Crabulon public override void SetDefaults() { NPC.aiStyle = -1; - NPC.GetNPCDamage(); + NPC.damage = 18; // 36 NPC.width = 14; NPC.height = 14; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; - NPC.lifeMax = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 180 : 15; + NPC.lifeMax = CalamityWorld.LegendaryMode ? 180 : 15; if (BossRushEvent.BossRushActive) - NPC.lifeMax = 8000; - if (Main.getGoodWorld) + NPC.lifeMax = 6000; + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; AIType = -1; NPC.knockBackResist = 0.5f; @@ -48,10 +48,6 @@ namespace CalamityMod.NPCs.Crabulon NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) @@ -70,8 +66,8 @@ namespace CalamityMod.NPCs.Crabulon bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - float xVelocityLimit = BossRushEvent.BossRushActive ? 12f : death ? 8f : revenge ? 6f : 5f; - float yVelocityLimit = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; + float xVelocityLimit = death ? 8f : revenge ? 6f : 5f; + float yVelocityLimit = CalamityWorld.LegendaryMode ? 0.25f : death ? 0.75f : revenge ? 0.9f : 1f; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -103,7 +99,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.rotation = NPC.velocity.X * 0.1f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { float pushVelocity = 0.5f; foreach (NPC n in Main.ActiveNPCs) diff --git a/NPCs/Crabulon/Crabulon.cs b/NPCs/Crabulon/Crabulon.cs index fedab5f87a..19533f9192 100644 --- a/NPCs/Crabulon/Crabulon.cs +++ b/NPCs/Crabulon/Crabulon.cs @@ -73,11 +73,13 @@ namespace CalamityMod.NPCs.Crabulon } } + public static int MushroomShotDamage = 9; // 36 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 40; // 64 (1.6x expert scaling) NPC.npcSlots = 14f; - NPC.GetNPCDamage(); NPC.width = 196; NPC.height = 196; NPC.defense = 8; @@ -88,21 +90,18 @@ namespace CalamityMod.NPCs.Crabulon NPC.noTileCollide = false; NPC.boss = true; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 5, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.HitSound = HitSound; NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { NPC.scale *= 1.5f; NPC.defense += 12; } - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -132,10 +131,9 @@ namespace CalamityMod.NPCs.Crabulon { Lighting.AddLight(NPC.Center, 0f, 0.3f, 0.7f); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; NPC.spriteDirection = NPC.direction; @@ -186,7 +184,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--; @@ -194,21 +192,21 @@ 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; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrageScale += 0.5f; if (NPC.ai[0] < 2f) @@ -240,7 +238,7 @@ namespace CalamityMod.NPCs.Crabulon { float yVelocity = death ? 1f : expertMode ? 2.5f : 4f; Vector2 projectileVelocity = (Vector2.Normalize(player.Center - NPC.Center) * mushBombSpeed) - Vector2.UnitY * yVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, NPC.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -285,7 +283,7 @@ namespace CalamityMod.NPCs.Crabulon walkingVelocity += 0.75f; if (phase4) walkingVelocity += 1f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) walkingVelocity *= 2f; bool shouldWalkSlower = false; @@ -409,7 +407,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; @@ -517,26 +515,25 @@ namespace CalamityMod.NPCs.Crabulon SoundEngine.PlaySound(SlamSound, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if ((NPC.ai[2] % 2f == 0f || death) && ((phase2 && revenge) || (phase3 && expertMode))) { SoundEngine.PlaySound(SoundID.Item42, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - float projectileVelocity = BossRushEvent.BossRushActive ? 24f : CalamityWorld.death ? 15f : 10f; + float projectileVelocity = CalamityWorld.death ? 15f : 10f; Vector2 destination = new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center; destination.Normalize(); destination *= projectileVelocity; // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = bossRush ? 24 : phase4 ? 14 : CalamityWorld.death ? (phase3 ? 10 : 16) : 12; + int numProj = phase4 ? 14 : CalamityWorld.death ? (phase3 ? 10 : 16) : 12; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Vector2 randomVelocityVector = new Vector2((Main.rand.NextFloat() - 0.5f) * 4f, (Main.rand.NextFloat() - 0.5f) * 4f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -549,19 +546,19 @@ namespace CalamityMod.NPCs.Crabulon SoundEngine.PlaySound(SoundID.Item42, NPC.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - float projectileVelocity = BossRushEvent.BossRushActive ? 24f : CalamityWorld.death ? 15f : 10f; + float projectileVelocity = CalamityWorld.death ? 15f : 10f; Vector2 destination = new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center; destination.Normalize(); destination *= projectileVelocity; // Less mushrooms in Death Mode phase 3 because otherwise it's an absolute shitshow. - int numProj = bossRush ? 16 : phase4 ? 8 : (phase3 && death) ? 6 : 8; + int numProj = phase4 ? 8 : (phase3 && death) ? 6 : 8; float rotation = MathHelper.ToRadians(60); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Vector2 randomVelocityVector = new Vector2((Main.rand.NextFloat() - 0.5f) * 4f, (Main.rand.NextFloat() - 0.5f) * 4f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, new Vector2(perturbedSpeed.X, -projectileVelocity) + randomVelocityVector, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -719,7 +716,7 @@ namespace CalamityMod.NPCs.Crabulon NPC.ai[3] = NPC.Bottom.Y; NPC.noTileCollide = true; - float leapVelocity = bossRush ? 24f : death ? 18f : 16f; + float leapVelocity = death ? 18f : 16f; NPC.velocity = center - NPC.Center; NPC.velocity = NPC.velocity.SafeNormalize(Vector2.Zero); NPC.velocity *= leapVelocity; @@ -740,7 +737,6 @@ namespace CalamityMod.NPCs.Crabulon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float yVelocity = death ? 3f : 2f; if (death) { @@ -750,11 +746,11 @@ namespace CalamityMod.NPCs.Crabulon for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = initialVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, perturbedSpeed, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } else - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.UnitY * yVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.UnitY * yVelocity, type, MushroomShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -774,7 +770,6 @@ namespace CalamityMod.NPCs.Crabulon NPC.netUpdate = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -784,10 +779,10 @@ namespace CalamityMod.NPCs.Crabulon Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(0f, 8f); for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity - ((i / (float)numProj) * initialVelocity), type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), initialVelocity - ((i / (float)numProj) * initialVelocity), type, MushroomShotDamage, 0f, Main.myPlayer); for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation - new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), -(initialVelocity - ((i / (float)numProj) * initialVelocity)), type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation - new Vector2(Main.rand.Next(0, 81), Main.rand.Next(-20, 1)), -(initialVelocity - ((i / (float)numProj) * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer); } for (int j = (int)NPC.position.X - 20; j < (int)NPC.position.X + NPC.width + 40; j += 20) @@ -876,7 +871,6 @@ namespace CalamityMod.NPCs.Crabulon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int maxColumns = 5; int mushroomsPerColumn = 8; Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(210f, 8f); @@ -889,7 +883,7 @@ namespace CalamityMod.NPCs.Crabulon for (int j = 0; j < mushroomsPerColumn; j++) { initialVelocity += Vector2.UnitX * Main.rand.NextFloat(-0.5f, 0.5f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(70f * (i + 1), 0f), -(initialVelocity - ((j / (float)mushroomsPerColumn) * initialVelocity)), type, damage, 0f, Main.myPlayer, 1f, NPC.Bottom.Y - 16f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(70f * (i + 1), 0f), -(initialVelocity - ((j / (float)mushroomsPerColumn) * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer, 1f, NPC.Bottom.Y - 16f); } initialVelocity = Vector2.UnitY * 16f; @@ -907,17 +901,16 @@ namespace CalamityMod.NPCs.Crabulon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float xVelocity = death ? 3f : 1.5f; int numProj = 3; Vector2 initialVelocity = Vector2.UnitX * xVelocity; Vector2 initialSpawnLocation = NPC.Bottom - new Vector2(0f, 8f); for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 41), 0f), initialVelocity - ((i / (float)numProj) * initialVelocity), type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation + new Vector2(Main.rand.Next(0, 41), 0f), initialVelocity - ((i / (float)numProj) * initialVelocity), type, MushroomShotDamage, 0f, Main.myPlayer); for (int i = 0; i < numProj; i++) - Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation - new Vector2(Main.rand.Next(0, 41), 0f), -(initialVelocity - ((i / (float)numProj) * initialVelocity)), type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), initialSpawnLocation - new Vector2(Main.rand.Next(0, 41), 0f), -(initialVelocity - ((i / (float)numProj) * initialVelocity)), type, MushroomShotDamage, 0f, Main.myPlayer); } float playerLocation = NPC.Center.X - player.Center.X; @@ -982,7 +975,7 @@ namespace CalamityMod.NPCs.Crabulon { if (Main.netMode != NetmodeID.MultiplayerClient) { - int crabShroomSpawnFreq = (int)(NPC.lifeMax * ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.01 : Main.getGoodWorld ? 0.02 : 0.05)); + int crabShroomSpawnFreq = (int)(NPC.lifeMax * (CalamityWorld.LegendaryMode ? 0.02 : 0.05)); if ((NPC.life + crabShroomSpawnFreq) < NPC.localAI[0]) { NPC.localAI[0] = NPC.life; @@ -994,8 +987,8 @@ namespace CalamityMod.NPCs.Crabulon int npcType = ModContent.NPCType(); int crabShroom = NPC.NewNPC(NPC.GetSource_FromAI(), x, y, npcType); Main.npc[crabShroom].SetDefaults(npcType); - Main.npc[crabShroom].velocity.X = Main.rand.Next(-50, 51) * (Main.getGoodWorld ? 0.2f : 0.1f); - Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (Main.getGoodWorld ? 0.2f : 0.1f); + Main.npc[crabShroom].velocity.X = Main.rand.Next(-50, 51) * (CalamityWorld.LegendaryMode ? 0.2f : 0.1f); + Main.npc[crabShroom].velocity.Y = Main.rand.Next(-50, -31) * (CalamityWorld.LegendaryMode ? 0.2f : 0.1f); if (Main.dedServ && crabShroom < Main.maxNPCs) NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, crabShroom); } @@ -1003,6 +996,7 @@ namespace CalamityMod.NPCs.Crabulon } } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; // Can only hit the target if within certain distance public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -1261,7 +1255,7 @@ namespace CalamityMod.NPCs.Crabulon public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Crags/CalamityEye.cs b/NPCs/Crags/CalamityEye.cs index 622541bb79..bdd3bce54c 100644 --- a/NPCs/Crags/CalamityEye.cs +++ b/NPCs/Crags/CalamityEye.cs @@ -29,10 +29,10 @@ namespace CalamityMod.NPCs.Crags NPC.width = 30; NPC.height = 30; NPC.defense = 12; - NPC.lifeMax = 180; + NPC.lifeMax = 140; NPC.knockBackResist = 0.75f; AnimationType = NPCID.DemonEye; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; if (DownedBossSystem.downedProvidence) @@ -47,10 +47,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/DespairStone.cs b/NPCs/Crags/DespairStone.cs index a386dfd7fa..62d3df7ee4 100644 --- a/NPCs/Crags/DespairStone.cs +++ b/NPCs/Crags/DespairStone.cs @@ -5,7 +5,7 @@ using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Crags; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.Particles; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -35,10 +35,9 @@ namespace CalamityMod.NPCs.Crags NPC.width = 66; NPC.height = 64; NPC.defense = 38; - NPC.DR_NERD(0.35f); NPC.lifeMax = 180; NPC.knockBackResist = 0.1f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit41; NPC.DeathSound = SoundID.NPCDeath14; NPC.behindTiles = true; @@ -55,10 +54,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/HeatSpirit.cs b/NPCs/Crags/HeatSpirit.cs index 1c14f41f6e..cfc7c0469f 100644 --- a/NPCs/Crags/HeatSpirit.cs +++ b/NPCs/Crags/HeatSpirit.cs @@ -37,7 +37,7 @@ namespace CalamityMod.NPCs.Crags NPC.defense = 8; NPC.lifeMax = 50; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.noGravity = true; @@ -47,10 +47,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/InfernalCongealment.cs b/NPCs/Crags/InfernalCongealment.cs index e398dc8703..4cfd936e34 100644 --- a/NPCs/Crags/InfernalCongealment.cs +++ b/NPCs/Crags/InfernalCongealment.cs @@ -25,11 +25,11 @@ namespace CalamityMod.NPCs.Crags NPC.damage = 40; NPC.width = 40; NPC.height = 30; - NPC.defense = 10; - NPC.lifeMax = 380; + NPC.defense = 30; + NPC.lifeMax = 250; NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = true; NPC.noGravity = false; @@ -48,10 +48,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/RenegadeWarlock.cs b/NPCs/Crags/RenegadeWarlock.cs index b2d3445b4a..bcccb39aeb 100644 --- a/NPCs/Crags/RenegadeWarlock.cs +++ b/NPCs/Crags/RenegadeWarlock.cs @@ -26,11 +26,11 @@ namespace CalamityMod.NPCs.Crags NPC.width = 18; NPC.height = 40; NPC.defense = 16; - NPC.lifeMax = 100; + NPC.lifeMax = 300; NPC.knockBackResist = 0.5f; AnimationType = NPCID.ZombieXmas; AIType = NPCID.ChaosElemental; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath50; if (DownedBossSystem.downedProvidence) @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/Scryllar.cs b/NPCs/Crags/Scryllar.cs index 22af9262fa..8fc4cdedc4 100644 --- a/NPCs/Crags/Scryllar.cs +++ b/NPCs/Crags/Scryllar.cs @@ -32,10 +32,10 @@ namespace CalamityMod.NPCs.Crags NPC.width = 80; NPC.height = 80; NPC.defense = 18; - NPC.lifeMax = 120; + NPC.lifeMax = 160; NPC.alpha = 100; NPC.knockBackResist = 0.7f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit49; NPC.DeathSound = SoundID.NPCDeath51; NPC.noGravity = true; @@ -53,10 +53,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Crags/ScryllarRage.cs b/NPCs/Crags/ScryllarRage.cs index 310531060d..e81d366f5d 100644 --- a/NPCs/Crags/ScryllarRage.cs +++ b/NPCs/Crags/ScryllarRage.cs @@ -23,10 +23,10 @@ namespace CalamityMod.NPCs.Crags NPC.width = 80; NPC.height = 80; NPC.defense = 10; - NPC.lifeMax = 75; + NPC.lifeMax = 100; NPC.alpha = 100; NPC.knockBackResist = 0.9f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit49; NPC.DeathSound = SoundID.NPCDeath51; NPC.noGravity = true; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Crags/SoulSlurper.cs b/NPCs/Crags/SoulSlurper.cs index 9e3be9a95a..e90d2850ea 100644 --- a/NPCs/Crags/SoulSlurper.cs +++ b/NPCs/Crags/SoulSlurper.cs @@ -40,10 +40,9 @@ namespace CalamityMod.NPCs.Crags NPC.width = 40; NPC.height = 40; NPC.defense = 30; - NPC.DR_NERD(0.15f); NPC.lifeMax = 80; NPC.knockBackResist = 0.65f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.noGravity = true; NPC.lavaImmune = true; NPC.HitSound = SoundID.NPCHit4; @@ -60,10 +59,6 @@ namespace CalamityMod.NPCs.Crags NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Cryogen/Cryogen.cs b/NPCs/Cryogen/Cryogen.cs index 0f477936d4..53fa4fd862 100644 --- a/NPCs/Cryogen/Cryogen.cs +++ b/NPCs/Cryogen/Cryogen.cs @@ -89,11 +89,15 @@ namespace CalamityMod.NPCs.Cryogen } } + public static int IceBlastDamage = 23; // 92; Also applies to GFB darts + public static int IceRainDamage = 23; // 92; Also applies to GFB darts + public static int IceBombDamage = 30; // 120; Also applies to GFB fireblasts + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 69; // 138 NPC.npcSlots = 24f; - NPC.GetNPCDamage(); NPC.width = 86; NPC.height = 88; NPC.defense = 15; @@ -102,7 +106,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 16, 0, 0); + NPC.value = Item.buyPrice(gold: 6); NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); NPC.noGravity = true; @@ -111,7 +115,7 @@ namespace CalamityMod.NPCs.Cryogen NPC.HitSound = HitSound; NPC.DeathSound = DeathSound; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; if (Main.zenithWorld) @@ -126,9 +130,6 @@ namespace CalamityMod.NPCs.Cryogen NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; } - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -183,13 +184,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--; @@ -197,21 +197,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; @@ -294,7 +291,7 @@ namespace CalamityMod.NPCs.Cryogen else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { int spawnType = Main.zenithWorld ? NPCID.RedDevil : NPCID.IceGolem; if (!NPC.AnyNPCs(spawnType)) @@ -320,15 +317,15 @@ namespace CalamityMod.NPCs.Cryogen } } - float chargePhaseGateValue = bossRush ? 240f : 360f; + float chargePhaseGateValue = 360f; float chargeDuration = 60f; - float chargeTelegraphTime = NPC.ai[0] == 2f ? ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 60f : 80f) : ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 90f : 120f); + float chargeTelegraphTime = NPC.ai[0] == 2f ? (CalamityWorld.LegendaryMode ? 60f : 80f) : (CalamityWorld.LegendaryMode ? 90f : 120f); float chargeTelegraphMaxRotationIncrement = 1f; float chargeTelegraphRotationIncrement = chargeTelegraphMaxRotationIncrement / chargeTelegraphTime; float chargeSlowDownTime = 15f; - float chargeVelocityMin = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 24f : 12f; - float chargeVelocityMax = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 42f : 30f; - if (Main.getGoodWorld) + float chargeVelocityMin = CalamityWorld.LegendaryMode ? 24f : 12f; + float chargeVelocityMax = CalamityWorld.LegendaryMode ? 42f : 30f; + if (CalamityWorld.LegendaryMode) { chargePhaseGateValue *= 0.7f; chargeDuration *= 0.8f; @@ -340,7 +337,7 @@ namespace CalamityMod.NPCs.Cryogen if (expertMode && (NPC.ai[0] < 5f || !phase6) && !chargePhase) { calamityGlobalNPC.newAI[3] += 1f; - if (calamityGlobalNPC.newAI[3] >= (bossRush ? 660f : 900f)) + if (calamityGlobalNPC.newAI[3] >= 900f) { calamityGlobalNPC.newAI[3] = 0f; SoundEngine.PlaySound(Main.zenithWorld ? SoundID.NPCHit41 : HitSound, NPC.Center); @@ -350,7 +347,6 @@ namespace CalamityMod.NPCs.Cryogen int totalProjectiles = 3; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBomb; - int damage = NPC.GetProjectileDamage(type); float velocity = 2f + NPC.ai[0]; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -359,7 +355,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBombDamage, 0f, Main.myPlayer); } } } @@ -382,10 +378,9 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 24 : 16; + int totalProjectiles = 16; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); float velocity = 9f + enrageScale; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) @@ -395,7 +390,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } @@ -414,7 +409,7 @@ namespace CalamityMod.NPCs.Cryogen playerYDist *= playerDistance; float inertia = 50f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -458,10 +453,9 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 18 : 12; + int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); float velocity2 = 9f + enrageScale; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) @@ -471,7 +465,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } @@ -538,7 +532,6 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - int damage = NPC.GetProjectileDamage(type); float maxVelocity = 9f + enrageScale; float velocity = maxVelocity - (calamityGlobalNPC.newAI[0] * maxVelocity * 0.5f); int totalProjectiles = 10; @@ -559,7 +552,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectilesShot; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceRainDamage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); } } } @@ -656,10 +649,9 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 18 : 12; + int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); float velocity = 9f + enrageScale; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) @@ -669,7 +661,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } @@ -688,7 +680,7 @@ namespace CalamityMod.NPCs.Cryogen playerYDist *= playerDistance; float inertia = 50f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -708,7 +700,6 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - int damage = NPC.GetProjectileDamage(type); float maxVelocity = 9f + enrageScale; float velocity = maxVelocity - (calamityGlobalNPC.newAI[0] * maxVelocity * 0.5f); int totalProjectiles = calamityGlobalNPC.newAI[1] == 0f ? 8 : 4; @@ -729,7 +720,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectilesShot; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceRainDamage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); } } } @@ -819,10 +810,9 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = bossRush ? 18 : 12; + int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); float velocity = 10f + enrageScale; float projectileVelocityToPass = 0f; if (type == ModContent.ProjectileType()) @@ -832,7 +822,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); } } } @@ -851,7 +841,7 @@ namespace CalamityMod.NPCs.Cryogen playerYDist *= playerDistance; float inertia = 50f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerXDist) / (inertia + 1f); @@ -927,11 +917,10 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceRain; - int damage = NPC.GetProjectileDamage(type); 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; @@ -949,7 +938,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceRainDamage, 0f, Main.myPlayer, 0f, type == ModContent.ProjectileType() ? 0f : velocity, projectileVelocityToPass); } } } @@ -1028,12 +1017,11 @@ namespace CalamityMod.NPCs.Cryogen if (Main.netMode != NetmodeID.MultiplayerClient) { int type = iceBlast; - int damage = NPC.GetProjectileDamage(type); float velocity = 1.5f + enrageScale * 0.5f; int totalSpreads = phase7 ? 3 : 2; for (int i = 0; i < totalSpreads; i++) { - int totalProjectiles = bossRush ? 3 : 2; + int totalProjectiles = 2; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = velocity - (velocity * (phase7 ? 0.25f : 0.5f) * i); float projectileVelocityToPass = 0f; @@ -1052,7 +1040,7 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer, ai, type == ModContent.ProjectileType() ? 0f : 1f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBlastDamage, 0f, Main.myPlayer, ai, type == ModContent.ProjectileType() ? 0f : 1f, projectileVelocityToPass); } } } @@ -1130,7 +1118,7 @@ namespace CalamityMod.NPCs.Cryogen } float inertia = 30f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia + playerchargeXDist) / (inertia + 1f); @@ -1156,14 +1144,13 @@ namespace CalamityMod.NPCs.Cryogen NPC.rotation = NPC.velocity.X * 0.1f; calamityGlobalNPC.newAI[3] += 1f; - if (calamityGlobalNPC.newAI[3] >= (bossRush ? 50f : 75f)) + if (calamityGlobalNPC.newAI[3] >= 75f) { calamityGlobalNPC.newAI[3] = 0f; SoundEngine.PlaySound(Main.zenithWorld ? SoundID.NPCHit41 : HitSound, NPC.Center); int totalProjectiles = 2; float radians = MathHelper.TwoPi / totalProjectiles; int type = iceBomb; - int damage = NPC.GetProjectileDamage(type); float velocity2 = 6f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -1172,12 +1159,12 @@ namespace CalamityMod.NPCs.Cryogen for (int k = 0; k < totalProjectiles; k++) { Vector2 projSpreadRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(projSpreadRotation) * 30f, projSpreadRotation, type, IceBombDamage, 0f, Main.myPlayer); } } NPC.ai[1] += 1f; - if (NPC.ai[1] >= (bossRush ? 120f : 180f)) + if (NPC.ai[1] >= 180f) { NPC.TargetClosest(); NPC.ai[0] = 4f; @@ -1341,7 +1328,6 @@ namespace CalamityMod.NPCs.Cryogen public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void ModifyTypeName(ref string typeName) @@ -1391,7 +1377,7 @@ namespace CalamityMod.NPCs.Cryogen } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -1506,15 +1492,9 @@ namespace CalamityMod.NPCs.Cryogen if (hurtInfo.Damage > 0) { if (Main.zenithWorld) - { - target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); - } else - { - target.AddBuff(BuffID.Frostburn, 360); target.AddBuff(BuffID.Chilled, 120); - } } } } diff --git a/NPCs/Cryogen/CryogenShield.cs b/NPCs/Cryogen/CryogenShield.cs index bb4ee5cc49..b936f757f6 100644 --- a/NPCs/Cryogen/CryogenShield.cs +++ b/NPCs/Cryogen/CryogenShield.cs @@ -24,14 +24,14 @@ namespace CalamityMod.NPCs.Cryogen public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 60; // 120 NPC.aiStyle = -1; AIType = -1; NPC.noTileCollide = true; NPC.coldDamage = true; - NPC.GetNPCDamage(); NPC.width = 216; NPC.height = 216; - NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || Main.getGoodWorld) ? 0.8f : 1f; + NPC.scale *= (CalamityWorld.death || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode) ? 0.8f : 1f; NPC.DR_NERD(0.4f); NPC.LifeMaxNERB(2800, 3360, 33600); NPC.Opacity = 0f; @@ -115,15 +115,9 @@ namespace CalamityMod.NPCs.Cryogen if (hurtInfo.Damage > 0) { if (Main.zenithWorld) - { - target.AddBuff(ModContent.BuffType(), 180); target.AddBuff(ModContent.BuffType(), 180); - } else - { - target.AddBuff(BuffID.Frostburn, 360); target.AddBuff(BuffID.Chilled, 120); - } } } diff --git a/NPCs/DesertScourge/DesertNuisanceBody.cs b/NPCs/DesertScourge/DesertNuisanceBody.cs index c5c3c4229e..1af12df8f8 100644 --- a/NPCs/DesertScourge/DesertNuisanceBody.cs +++ b/NPCs/DesertScourge/DesertNuisanceBody.cs @@ -39,16 +39,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 88; NPC.height = 88; NPC.defense = 5; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 27; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4800; NPC.aiStyle = -1; AIType = -1; @@ -64,18 +64,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[3] > 0f) { @@ -170,28 +166,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2; NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * segmentOffset; NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt(); - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHead.SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? DesertNuisanceHead.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHead.SegmentVelocity_Death : - DesertNuisanceHead.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CheckActive() => false; diff --git a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs index fc10337135..6fff24e78e 100644 --- a/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceBodyYoung.cs @@ -39,16 +39,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 78; NPC.height = 78; NPC.defense = 4; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 26; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; @@ -64,18 +64,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[3] > 0f) { @@ -178,28 +174,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.rotation = directionToNextSegment.ToRotation() + MathHelper.PiOver2; NPC.Center = aheadSegment.Center - directionToNextSegment.SafeNormalize(Vector2.Zero) * NPC.scale * segmentOffset; NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt(); - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHeadYoung.SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? DesertNuisanceHeadYoung.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHeadYoung.SegmentVelocity_Death : - DesertNuisanceHeadYoung.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CheckActive() => false; diff --git a/NPCs/DesertScourge/DesertNuisanceHead.cs b/NPCs/DesertScourge/DesertNuisanceHead.cs index f1bc6a6ad5..24e74f0275 100644 --- a/NPCs/DesertScourge/DesertNuisanceHead.cs +++ b/NPCs/DesertScourge/DesertNuisanceHead.cs @@ -53,17 +53,17 @@ namespace CalamityMod.NPCs.DesertScourge { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 25; // 40 (1.6x expert scaling) NPC.defense = 3; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 19; NPC.width = 88; NPC.height = 88; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4800; NPC.aiStyle = -1; AIType = -1; @@ -79,9 +79,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); - if (Main.zenithWorld) NPC.scale *= 2; } @@ -110,16 +107,15 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Become angry when the other Nuisance dies. bool getMad = (!NPC.AnyNPCs(ModContent.NPCType()) && revenge) || death; // Enrage - if (!Main.player[NPC.target].ZoneDesert && !bossRush) + if (!Main.player[NPC.target].ZoneDesert && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -127,12 +123,12 @@ namespace CalamityMod.NPCs.DesertScourge else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : getMad ? 0.5f : 0f; + float enrageScale = getMad ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -146,7 +142,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -168,7 +164,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) minLength *= 2; int bodyTypeAIVariable = 0; @@ -272,7 +268,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? SegmentVelocity_GoodWorld : + CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -299,7 +295,7 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { speed *= 1.5f; turnSpeed *= 1.5f; @@ -457,19 +453,6 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.Distance(destination) > (getMad ? 750f : 1000f)) NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -600,6 +583,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.7f * balance); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs index 58cd825560..45b3676e8b 100644 --- a/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceHeadYoung.cs @@ -45,17 +45,17 @@ namespace CalamityMod.NPCs.DesertScourge { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 25; // 40 (1.6x expert scaling) NPC.defense = 2; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 18; NPC.width = 78; NPC.height = 78; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; @@ -71,9 +71,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); - if (Main.zenithWorld) NPC.scale *= 2; } @@ -106,16 +103,15 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Become angry when the other Nuisance dies. bool getMad = (!NPC.AnyNPCs(ModContent.NPCType()) && revenge) || death; // Enrage - if (!Main.player[NPC.target].ZoneDesert && !bossRush) + if (!Main.player[NPC.target].ZoneDesert && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -123,12 +119,12 @@ namespace CalamityMod.NPCs.DesertScourge else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : getMad ? 0.5f : 0f; + float enrageScale = getMad ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -142,7 +138,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.07f * enrageScale; turnSpeed += 0.14f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -175,7 +171,6 @@ namespace CalamityMod.NPCs.DesertScourge float rotation = MathHelper.ToRadians(spread); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); @@ -188,7 +183,7 @@ namespace CalamityMod.NPCs.DesertScourge if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, DesertScourgeHead.SpitDamage, 0f, Main.myPlayer); Main.projectile[proj].aiStyle = -1; Main.projectile[proj].netUpdate = true; } @@ -203,7 +198,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) minLength *= 2; int bodyTypeAIVariable = 0; @@ -311,7 +306,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? SegmentVelocity_GoodWorld : + CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : SegmentVelocity_Expert; maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); @@ -338,7 +333,7 @@ namespace CalamityMod.NPCs.DesertScourge } } - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { speed *= 1.5f; turnSpeed *= 1.5f; @@ -493,19 +488,6 @@ namespace CalamityMod.NPCs.DesertScourge if (NPC.Distance(destination) > (getMad ? 750f : 1000f)) NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -638,6 +620,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.7f * balance); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DesertScourge/DesertNuisanceTail.cs b/NPCs/DesertScourge/DesertNuisanceTail.cs index 6769923e9b..06b472173f 100644 --- a/NPCs/DesertScourge/DesertNuisanceTail.cs +++ b/NPCs/DesertScourge/DesertNuisanceTail.cs @@ -21,16 +21,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 88; NPC.height = 88; NPC.defense = 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 34; NPC.LifeMaxNERB(1500, 1800, 40000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4800; NPC.aiStyle = -1; AIType = -1; @@ -46,18 +46,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -134,28 +130,6 @@ namespace CalamityMod.NPCs.DesertScourge else if (playerXPos > 0f) NPC.spriteDirection = -1; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHead.SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? DesertNuisanceHead.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHead.SegmentVelocity_Death : - DesertNuisanceHead.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs index 8b502c0df0..6bec098fe0 100644 --- a/NPCs/DesertScourge/DesertNuisanceTailYoung.cs +++ b/NPCs/DesertScourge/DesertNuisanceTailYoung.cs @@ -21,16 +21,16 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 78; NPC.height = 78; NPC.defense = 7; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.defense += 33; NPC.LifeMaxNERB(1300, 1560, 35000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax = 4000; NPC.aiStyle = -1; AIType = -1; @@ -46,18 +46,14 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -142,28 +138,6 @@ namespace CalamityMod.NPCs.DesertScourge else if (playerXPos > 0f) NPC.spriteDirection = -1; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertNuisanceHeadYoung.SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? DesertNuisanceHeadYoung.SegmentVelocity_GoodWorld : - death ? DesertNuisanceHeadYoung.SegmentVelocity_Death : - DesertNuisanceHeadYoung.SegmentVelocity_Expert; - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - if (death) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DesertScourge/DesertScourgeBody.cs b/NPCs/DesertScourge/DesertScourgeBody.cs index 23d2a5c5a6..ea3d5a8279 100644 --- a/NPCs/DesertScourge/DesertScourgeBody.cs +++ b/NPCs/DesertScourge/DesertScourgeBody.cs @@ -43,14 +43,13 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 16; // 32 NPC.width = 104; NPC.height = 104; NPC.defense = 6; - NPC.DR_NERD(0.05f); NPC.LifeMaxNERB(4200, 5000, 1150000); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.aiStyle = -1; AIType = -1; @@ -65,15 +64,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => false; @@ -92,9 +88,8 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[3] > 0f) { @@ -214,30 +209,6 @@ namespace CalamityMod.NPCs.DesertScourge bool burrow = head.Calamity().newAI[0] >= burrowTimeGateValue; bool lungeUpward = burrow && head.Calamity().newAI[1] == 1f; bool quickFall = head.Calamity().newAI[1] == 2f; - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertScourgeHead.SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? DesertScourgeHead.SegmentVelocity_GoodWorld : - death ? DesertScourgeHead.SegmentVelocity_Death : - expertMode ? DesertScourgeHead.SegmentVelocity_Expert : - DesertScourgeHead.SegmentVelocity_Normal; - if (burrow || lungeUpward) - maxChaseSpeed *= 1.5f; - if (expertMode) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity || NPC.dontTakeDamage) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DesertScourge/DesertScourgeHead.cs b/NPCs/DesertScourge/DesertScourgeHead.cs index de32d8946f..4440d7ba44 100644 --- a/NPCs/DesertScourge/DesertScourgeHead.cs +++ b/NPCs/DesertScourge/DesertScourgeHead.cs @@ -56,7 +56,6 @@ namespace CalamityMod.NPCs.DesertScourge public const float LungeUpwardCutoffDistance = 420f; public const float BurrowDistance_Hide = 1080f; public const float BurrowDistance = 800f; - public const float BurrowDistance_BossRush = 400f; public const float OpenMouthForBiteDistance = 220f; private const int OpenMouthStopFrame = 4; @@ -85,23 +84,25 @@ namespace CalamityMod.NPCs.DesertScourge NPCID.Sets.MPAllowedEnemies[Type] = true; } + public static int SpitDamage = 8; // 32 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 64 (1.6x expert scaling) NPC.defense = 4; NPC.npcSlots = 12f; NPC.width = 104; NPC.height = 104; NPC.LifeMaxNERB(4200, 5000, 1150000); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; NPC.boss = true; - NPC.value = Item.buyPrice(0, 2, 0, 0); + NPC.value = Item.buyPrice(gold: 1); NPC.alpha = 255; NPC.behindTiles = true; NPC.noGravity = true; @@ -110,7 +111,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.4f; if (Main.zenithWorld) @@ -119,9 +120,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -165,10 +163,9 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Check for Nuisances bool hide = (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType())) && !death; @@ -191,7 +188,7 @@ namespace CalamityMod.NPCs.DesertScourge Player player = Main.player[NPC.target]; // Enrage - if (!player.ZoneDesert && !bossRush) + if (!player.ZoneDesert && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -199,12 +196,12 @@ namespace CalamityMod.NPCs.DesertScourge else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -237,7 +234,7 @@ namespace CalamityMod.NPCs.DesertScourge bool lungeUpward = burrow && NPC.Calamity().newAI[1] == 1f; bool quickFall = NPC.Calamity().newAI[1] == 2f; - float burrowDistance = hide ? BurrowDistance_Hide : bossRush ? BurrowDistance_BossRush : BurrowDistance; + float burrowDistance = hide ? BurrowDistance_Hide : BurrowDistance; float speed = death ? 0.105f : 0.085f; float turnSpeed = death ? 0.21f : 0.17f; @@ -257,7 +254,7 @@ namespace CalamityMod.NPCs.DesertScourge speed += 0.085f * enrageScale; turnSpeed += 0.17f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { speed *= 1.1f; turnSpeed *= 1.2f; @@ -310,12 +307,11 @@ namespace CalamityMod.NPCs.DesertScourge if (death) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < 7; i++) { Vector2 sandSpitPos = new Vector2((i - 2) * 16f, -Math.Abs((i - 2) * 16f)); Vector2 sandSpitVelocity = ((sandSplashSpawnPos + Vector2.UnitY * 80f) - (sandSplashSpawnPos + sandSpitPos)).SafeNormalize(Vector2.UnitY) * -((Math.Abs(i - 3) + 1) * 3f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, SpitDamage, 0f, Main.myPlayer); } } } @@ -365,12 +361,11 @@ namespace CalamityMod.NPCs.DesertScourge if (death) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < 7; i++) { Vector2 sandSpitPos = new Vector2((i - 2) * 16f, -Math.Abs((i - 2) * 16f)); Vector2 sandSpitVelocity = ((sandSplashSpawnPos + Vector2.UnitY * 80f) - (sandSplashSpawnPos + sandSpitPos)).SafeNormalize(Vector2.UnitY) * -((Math.Abs(i - 3) + 1) * 3f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), sandSplashSpawnPos + sandSpitPos, sandSpitVelocity, type, SpitDamage, 0f, Main.myPlayer); } } } @@ -431,7 +426,7 @@ namespace CalamityMod.NPCs.DesertScourge { int previous = NPC.whoAmI; int minLength = death ? 24 : revenge ? 21 : expertMode ? 18 : 15; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) minLength *= 3; int bodyTypeAIVariable = 0; @@ -542,7 +537,7 @@ namespace CalamityMod.NPCs.DesertScourge NPC.spriteDirection = -1; float maxChaseSpeed = Main.zenithWorld ? SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? SegmentVelocity_GoodWorld : + CalamityWorld.LegendaryMode ? SegmentVelocity_GoodWorld : death ? SegmentVelocity_Death : expertMode ? SegmentVelocity_Expert : SegmentVelocity_Normal; @@ -601,15 +596,14 @@ namespace CalamityMod.NPCs.DesertScourge { // Spit a huge spread of sand upwards that falls down SoundEngine.PlaySound(SandBlastSound, NPC.Center); - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 16f : bossRush ? 10f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f; + float velocity = CalamityWorld.LegendaryMode ? 16f : death ? 8.5f : revenge ? 8f : expertMode ? 7.5f : 6f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 projectileVelocity = (NPC.Center + NPC.velocity * 10f - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; - int numProj = bossRush ? 30 : death ? 24 : revenge ? 21 : expertMode ? 18 : 12; - if (Main.getGoodWorld) + int numProj = death ? 24 : revenge ? 21 : expertMode ? 18 : 12; + if (CalamityWorld.LegendaryMode) numProj *= 2; - int spread = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 120 : 90; + int spread = CalamityWorld.LegendaryMode ? 120 : 90; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { @@ -622,7 +616,7 @@ namespace CalamityMod.NPCs.DesertScourge } if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(perturbedSpeed) * 5f, perturbedSpeed, type, SpitDamage, 0f, Main.myPlayer); } NPC.TargetClosest(); @@ -807,26 +801,6 @@ namespace CalamityMod.NPCs.DesertScourge NPC.velocity += (destination - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (hide) - { - NPC.damage = 0; - } - else - { - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -946,7 +920,7 @@ namespace CalamityMod.NPCs.DesertScourge } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.SandBlock; } @@ -1072,7 +1046,7 @@ namespace CalamityMod.NPCs.DesertScourge public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DesertScourge/DesertScourgeTail.cs b/NPCs/DesertScourge/DesertScourgeTail.cs index 5415c8e938..4647a5e631 100644 --- a/NPCs/DesertScourge/DesertScourgeTail.cs +++ b/NPCs/DesertScourge/DesertScourgeTail.cs @@ -23,14 +23,13 @@ namespace CalamityMod.NPCs.DesertScourge public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 14; // 28 NPC.width = 104; NPC.height = 104; NPC.defense = 9; - NPC.DR_NERD(0.1f); NPC.LifeMaxNERB(4200, 5000, 1150000); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.aiStyle = -1; AIType = -1; @@ -45,15 +44,12 @@ namespace CalamityMod.NPCs.DesertScourge NPC.netAlways = true; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.4f; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -72,9 +68,8 @@ namespace CalamityMod.NPCs.DesertScourge public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -176,30 +171,6 @@ namespace CalamityMod.NPCs.DesertScourge bool burrow = head.Calamity().newAI[0] >= burrowTimeGateValue; bool lungeUpward = burrow && head.Calamity().newAI[1] == 1f; bool quickFall = head.Calamity().newAI[1] == 2f; - - // Calculate contact damage based on velocity - float maxChaseSpeed = Main.zenithWorld ? DesertScourgeHead.SegmentVelocity_ZenithSeed : - Main.getGoodWorld ? DesertScourgeHead.SegmentVelocity_GoodWorld : - death ? DesertScourgeHead.SegmentVelocity_Death : - expertMode ? DesertScourgeHead.SegmentVelocity_Expert : - DesertScourgeHead.SegmentVelocity_Normal; - if (burrow || lungeUpward) - maxChaseSpeed *= 1.5f; - if (expertMode) - maxChaseSpeed += maxChaseSpeed * 0.2f * (1f - lifeRatio); - - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity || NPC.dontTakeDamage) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) diff --git a/NPCs/DevourerofGods/CosmicGuardianBody.cs b/NPCs/DevourerofGods/CosmicGuardianBody.cs index 8041253706..6188c4cf81 100644 --- a/NPCs/DevourerofGods/CosmicGuardianBody.cs +++ b/NPCs/DevourerofGods/CosmicGuardianBody.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 120; // 240 NPC.width = 34; NPC.height = 34; NPC.defense = 60; @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.dontCountMe = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -142,21 +138,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.position.X = NPC.position.X + targetX; NPC.position.Y = NPC.position.Y + targetY; } - - // Calculate contact damage based on velocity - float segmentVelocity = BossRushEvent.BossRushActive ? 30f : CalamityWorld.revenge ? 25f : 23f; - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/DevourerofGods/CosmicGuardianHead.cs b/NPCs/DevourerofGods/CosmicGuardianHead.cs index 6eb9fba049..378971f286 100644 --- a/NPCs/DevourerofGods/CosmicGuardianHead.cs +++ b/NPCs/DevourerofGods/CosmicGuardianHead.cs @@ -50,7 +50,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 180; // 360 NPC.width = 64; NPC.height = 76; NPC.defense = 40; @@ -65,10 +65,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -189,8 +185,8 @@ namespace CalamityMod.NPCs.DevourerofGods Vector2 segmentDirection = NPC.Center; float dogHeadX = Main.npc[CalamityGlobalNPC.DoGHead].position.X + (Main.npc[CalamityGlobalNPC.DoGHead].width / 2); float dogHeadY = Main.npc[CalamityGlobalNPC.DoGHead].position.Y + (Main.npc[CalamityGlobalNPC.DoGHead].height / 2); - float segmentVelocity = BossRushEvent.BossRushActive ? 30f : CalamityWorld.revenge ? 25f : 23f; - float velocityMult = BossRushEvent.BossRushActive ? 0.9f : CalamityWorld.revenge ? 0.75f : 0.23f; + float segmentVelocity = CalamityWorld.revenge ? 25f : 23f; + float velocityMult = CalamityWorld.revenge ? 0.75f : 0.23f; float maxDistanceFromDoGHead = 160f; if (increaseSpeedMore) @@ -337,19 +333,6 @@ namespace CalamityMod.NPCs.DevourerofGods } } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; } diff --git a/NPCs/DevourerofGods/CosmicGuardianTail.cs b/NPCs/DevourerofGods/CosmicGuardianTail.cs index be71961cd5..ac3627b1c3 100644 --- a/NPCs/DevourerofGods/CosmicGuardianTail.cs +++ b/NPCs/DevourerofGods/CosmicGuardianTail.cs @@ -33,7 +33,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.width = 30; NPC.height = 50; NPC.defense = 70; @@ -49,10 +49,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; NPC.dontCountMe = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -139,21 +135,6 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.position.X = NPC.position.X + targetX; NPC.position.Y = NPC.position.Y + targetY; } - - // Calculate contact damage based on velocity - float segmentVelocity = BossRushEvent.BossRushActive ? 30f : CalamityWorld.revenge ? 25f : 23f; - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) diff --git a/NPCs/DevourerofGods/DevourerofGodsBody.cs b/NPCs/DevourerofGods/DevourerofGodsBody.cs index 79e71a6b1d..4df6789f0d 100644 --- a/NPCs/DevourerofGods/DevourerofGodsBody.cs +++ b/NPCs/DevourerofGods/DevourerofGodsBody.cs @@ -62,7 +62,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 120; // 240 NPC.npcSlots = 5f; NPC.width = 56; NPC.height = 56; @@ -89,11 +89,8 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -159,10 +156,9 @@ namespace CalamityMod.NPCs.DevourerofGods float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase2 = lifeRatio < 0.6f; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (phase2) { @@ -272,25 +268,11 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.spriteDirection = (directionToNextSegment.X > 0).ToDirectionInt(); // Velocity variables - float segmentVelocity = bossRush ? 19f : death ? 17.5f : 16f; + float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) segmentVelocity *= 1.1f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -438,7 +420,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DevourerofGods/DevourerofGodsHead.cs b/NPCs/DevourerofGods/DevourerofGodsHead.cs index 2d1b9fc913..50fbc9d04e 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; @@ -191,10 +192,13 @@ namespace CalamityMod.NPCs.DevourerofGods }); } + public static int LaserWallDamage = 75; // 300 + public static int FireballDamage = 60; // 240; Also applies to Legendary Mode Ichor Blob + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 250; // 500 NPC.npcSlots = 5f; NPC.width = 104; NPC.height = 104; @@ -205,7 +209,7 @@ namespace CalamityMod.NPCs.DevourerofGods AIType = -1; NPC.knockBackResist = 0f; NPC.boss = true; - NPC.value = Item.buyPrice(2, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1, gold: 50); NPC.Opacity = 0f; NPC.behindTiles = true; NPC.noGravity = true; @@ -213,11 +217,8 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.DeathSound = SoundID.NPCDeath14; NPC.netAlways = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -363,10 +364,9 @@ namespace CalamityMod.NPCs.DevourerofGods bool flyUpDuringLaserWalls = laserWallPhase == (int)LaserWallPhase.FireLaserWalls || (laserWallPhase == (int)LaserWallPhase.End && teleportTimer > 0); bool flies = NPC.ai[3] == 0f || flyUpDuringLaserWalls; Vector2 destination = flyUpDuringLaserWalls ? (player.Center - Vector2.UnitY * 480f) : player.Center; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -401,14 +401,14 @@ namespace CalamityMod.NPCs.DevourerofGods extrapitch = Main.zenithWorld ? 0.3f : 0f; // Velocity variables - float segmentVelocity = bossRush ? 19f : death ? 17.5f : 16f; + float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - float speed = bossRush ? 18f : death ? 16.5f : 15f; - float turnSpeed = bossRush ? 0.36f : death ? 0.33f : 0.3f; - float homingSpeed = bossRush ? 36f : death ? 30f : 24f; - float homingTurnSpeed = bossRush ? 0.48f : death ? 0.405f : 0.33f; + float speed = death ? 16.5f : 15f; + float turnSpeed = death ? 0.33f : 0.3f; + float homingSpeed = death ? 30f : 24f; + float homingTurnSpeed = death ? 0.405f : 0.33f; if (expertMode) { @@ -418,14 +418,14 @@ namespace CalamityMod.NPCs.DevourerofGods homingTurnSpeed += 0.15f * (1f - lifeRatio); } - float groundPhaseTurnSpeed = bossRush ? 0.3f : death ? 0.24f : 0.18f; + float groundPhaseTurnSpeed = death ? 0.24f : 0.18f; if (expertMode) groundPhaseTurnSpeed += 0.1f * (1f - lifeRatio); groundPhaseTurnSpeed += Vector2.Distance(destination, NPC.Center) * 0.0002f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { segmentVelocity *= 1.1f; speed *= 1.1f; @@ -499,7 +499,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.localAI[2] == timeWhenDoGShouldTeleportDuringPhase2Countdown + (death ? TimeBeforeTeleport_Death : CalamityWorld.revenge ? TimeBeforeTeleport_Revengeance : Main.expertMode ? TimeBeforeTeleport_Expert : TimeBeforeTeleport_Normal)) SpawnTeleportLocation(player, true); if (NPC.localAI[2] == timeWhenDoGShouldTeleportDuringPhase2Countdown) - Teleport(player, bossRush, death, revenge, expertMode, phase5); + Teleport(player, death, revenge, expertMode, phase5); // Just in case the projectile cap is reached and the teleport rift doesn't spawn. if (AwaitingPhase2Teleport && NPC.localAI[2] == 0f) @@ -550,7 +550,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Dialogue the moment the second phase starts - if (NPC.localAI[2] == 60f && !bossRush) + if (NPC.localAI[2] == 60f && !BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.EdgyBossText5"; Color messageColor = Color.Cyan; @@ -621,7 +621,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Teleport if (teleportTimer == 0) - Teleport(player, bossRush, death, revenge, expertMode, phase5); + Teleport(player, death, revenge, expertMode, phase5); } // Do the death animation once killed. @@ -642,7 +642,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Laser walls - float adjustedAlphaGateValue = AlphaGateValue - (bossRush ? 360f : death ? 180f : 0f); + float adjustedAlphaGateValue = AlphaGateValue - (death ? 180f : 0f); if (phase4 && !spawnedGuardians3 && postTeleportTimer <= 0) { if (laserWallPhase == (int)LaserWallPhase.SetUp) @@ -668,7 +668,7 @@ namespace CalamityMod.NPCs.DevourerofGods } // Fire laser walls every X seconds after a laser wall phase ends - float laserWallGateValue = LaserWallCooldown - (bossRush ? 360f : death ? 180f : 0f); + float laserWallGateValue = LaserWallCooldown - (death ? 180f : 0f); if (calamityGlobalNPC.newAI[3] >= laserWallGateValue) { NPC.Opacity = 0f; @@ -713,7 +713,7 @@ namespace CalamityMod.NPCs.DevourerofGods calamityGlobalNPC.newAI[3] = 0f; // Anger message - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.EdgyBossText6"; Color messageColor = Color.Cyan; @@ -751,10 +751,10 @@ namespace CalamityMod.NPCs.DevourerofGods // Fireballs // Check angle and distance to make sure it's realistic that they'd be fired - if (NPC.Opacity >= 1f && (distanceFromTarget > 480f || (CalamityWorld.LegendaryMode && CalamityWorld.revenge)) && (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) + if (NPC.Opacity >= 1f && (distanceFromTarget > 480f || CalamityWorld.LegendaryMode) && (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) { calamityGlobalNPC.newAI[0] += 1f; - if (calamityGlobalNPC.newAI[0] >= ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 30f : 150f) && calamityGlobalNPC.newAI[0] % ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 30f : phase7 ? 30f : 60f) == 0f) + if (calamityGlobalNPC.newAI[0] >= (CalamityWorld.LegendaryMode ? 30f : 150f) && calamityGlobalNPC.newAI[0] % (CalamityWorld.LegendaryMode ? 30f : phase7 ? 30f : 60f) == 0f) { float fireballSpeed = 8f; Vector2 fireballVelocity = Vector2.Normalize(player.Center - NPC.Center) * fireballSpeed + NPC.velocity * 0.5f; @@ -764,12 +764,12 @@ namespace CalamityMod.NPCs.DevourerofGods Dust.NewDust(NPC.Center, 52, 52, (int)CalamityDusts.PurpleCosmilite, dustVelocity.X, dustVelocity.Y); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = FireballDamage; if (Main.netMode != NetmodeID.MultiplayerClient) Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, fireballVelocity, type, damage, 0f, Main.myPlayer); - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { for (int l = 0; l < 8; l++) { @@ -786,13 +786,12 @@ namespace CalamityMod.NPCs.DevourerofGods int numBlobs = 4; type = ModContent.ProjectileType(); - damage = 60; for (int i = 0; i < numBlobs; i++) { Vector2 blobVelocity = new Vector2(Main.rand.Next(-100, 101), Main.rand.Next(-100, 101)); blobVelocity.Normalize(); - blobVelocity *= Main.rand.Next(400, 801) * (bossRush ? 0.02f : 0.01f); + blobVelocity *= Main.rand.Next(400, 801) * 0.01f; blobVelocity *= Main.rand.NextFloat() + 1f; float blobVelocityYAdd = Math.Abs(blobVelocity.Y) * 0.5f; @@ -812,7 +811,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (!spawnedGuardians3 && laserWallPhase == (int)LaserWallPhase.FireLaserWalls) { float spawnOffset = 1200f; - float divisor = bossRush ? 100f : 150f; + float divisor = 150f; if (calamityGlobalNPC.newAI[1] % divisor == 0f) { @@ -821,7 +820,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Side walls float targetPosY = player.position.Y; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = LaserWallDamage; int halfTotalDiagonalShots = totalDiagonalShots / 2; Vector2 start = default; Vector2 velocity = default; @@ -1112,7 +1111,7 @@ namespace CalamityMod.NPCs.DevourerofGods speedCopy += Vector2.Distance(destination, NPC.Center) * 0.005f; turnSpeedCopy += Vector2.Distance(destination, NPC.Center) * 0.00025f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -1270,7 +1269,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -1386,8 +1385,8 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - double maximumSpeed1 = bossRush ? 0.52 : death ? 0.46 : 0.4; - double maximumSpeed2 = bossRush ? 1.25 : death ? 1.125 : 1D; + double maximumSpeed1 = death ? 0.46 : 0.4; + double maximumSpeed2 = death ? 1.125 : 1D; if (expertMode) { @@ -1533,7 +1532,7 @@ namespace CalamityMod.NPCs.DevourerofGods if (revenge) spawnDoGCountdown = 10; - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.EdgyBossText"; Color messageColor = Color.Cyan; @@ -1582,8 +1581,8 @@ namespace CalamityMod.NPCs.DevourerofGods } // Laser barrage attack variables - float laserBarrageGateValue = bossRush ? 1080f : death ? 1320f : 1440f; - float laserBarrageShootGateValue = bossRush ? 160f : 240f; + float laserBarrageGateValue = death ? 1320f : 1440f; + float laserBarrageShootGateValue = 240f; float laserBarragePhaseGateValue = laserBarrageGateValue - laserBarrageShootGateValue; // Spawn segments @@ -1635,7 +1634,7 @@ namespace CalamityMod.NPCs.DevourerofGods // Side walls int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = LaserWallDamage; Vector2 start = default; Vector2 velocity = default; Vector2 aim = expertMode ? player.Center + player.velocity * 20f : Vector2.Zero; @@ -1871,7 +1870,7 @@ namespace CalamityMod.NPCs.DevourerofGods turnSpeedCopy += distanceFromTarget * 0.0001f * (1f - lifeRatio); } - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) speedCopy *= 2f; @@ -2015,7 +2014,7 @@ namespace CalamityMod.NPCs.DevourerofGods else if (increaseSpeed) groundPhaseTurnSpeed *= 2f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if ((player.Center - NPC.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(NPC.velocity.ToRotation(), MathHelper.PiOver4) == NPC.velocity.ToRotation()) segmentVelocity *= 2f; @@ -2131,8 +2130,8 @@ namespace CalamityMod.NPCs.DevourerofGods } else { - double maximumSpeed1 = bossRush ? 0.52 : death ? 0.46 : 0.4; - double maximumSpeed2 = bossRush ? 1.25 : death ? 1.125 : 1D; + double maximumSpeed1 = death ? 0.46 : 0.4; + double maximumSpeed2 = death ? 1.125 : 1D; if (expertMode) { @@ -2266,19 +2265,6 @@ namespace CalamityMod.NPCs.DevourerofGods if (NPC.Distance(player.Center) > 2400f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - if (NPC.life > Main.npc[(int)NPC.ai[0]].life) NPC.life = Main.npc[(int)NPC.ai[0]].life; } @@ -2313,7 +2299,7 @@ namespace CalamityMod.NPCs.DevourerofGods } } - private void Teleport(Player player, bool bossRush, bool death, bool revenge, bool expertMode, bool phase5) + private void Teleport(Player player, bool death, bool revenge, bool expertMode, bool phase5) { Vector2 newPosition = GetRiftLocation(true); @@ -2325,13 +2311,13 @@ namespace CalamityMod.NPCs.DevourerofGods if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = FireballDamage; float finalVelocity = 10f; int totalSpreads = revenge ? 6 : 3; float mult = revenge ? 1.5f : 3f; for (int i = 0; i < totalSpreads; i++) { - int totalProjectiles = (CalamityWorld.LegendaryMode && revenge) ? 30 : bossRush ? 18 : 12; + int totalProjectiles = (CalamityWorld.LegendaryMode) ? 30 : 12; float radians = MathHelper.TwoPi / totalProjectiles; float newVelocity = finalVelocity - i * mult; float velocityMult = 1f + ((finalVelocity - newVelocity) / (newVelocity * 2f) / 100f); @@ -2351,7 +2337,7 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.TargetClosest(); NPC.position = newPosition; - float chargeVelocity = bossRush ? 30f : death ? 26f : revenge ? 24f : expertMode ? 22f : 20f; + float chargeVelocity = death ? 26f : revenge ? 24f : expertMode ? 22f : 20f; float maxChargeDistance = 1600f; postTeleportTimer = (int)Math.Round(maxChargeDistance / chargeVelocity); AwaitingPhase2Teleport = false; @@ -2550,7 +2536,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(); } @@ -2811,7 +2797,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 ac2e7d6dc6..c2bca730da 100644 --- a/NPCs/DevourerofGods/DevourerofGodsTail.cs +++ b/NPCs/DevourerofGods/DevourerofGodsTail.cs @@ -65,7 +65,7 @@ namespace CalamityMod.NPCs.DevourerofGods public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 100; // 200 NPC.npcSlots = 5f; NPC.width = 66; NPC.height = 66; @@ -85,11 +85,8 @@ namespace CalamityMod.NPCs.DevourerofGods NPC.takenDamageMultiplier = 1.25f; NPC.dontCountMe = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.5f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -160,9 +157,8 @@ namespace CalamityMod.NPCs.DevourerofGods float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase2 = lifeRatio < 0.6f; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (phase2) { @@ -277,7 +273,6 @@ namespace CalamityMod.NPCs.DevourerofGods segmentDirection.Y = (int)(segmentDirection.Y / 16f) * 16; playerXDist -= segmentDirection.X; playerYDist -= segmentDirection.Y; - float playerDistance = (float)System.Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); if (NPC.ai[1] > 0f && NPC.ai[1] < Main.npc.Length) { try @@ -290,7 +285,7 @@ namespace CalamityMod.NPCs.DevourerofGods { } NPC.rotation = (float)System.Math.Atan2(playerYDist, playerXDist) + MathHelper.PiOver2; - playerDistance = (float)System.Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); + float playerDistance = (float)System.Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); int segmentWidth = NPC.width; playerDistance = (playerDistance - segmentWidth) / playerDistance; playerXDist *= playerDistance; @@ -306,25 +301,11 @@ namespace CalamityMod.NPCs.DevourerofGods } // Velocity variables - float segmentVelocity = bossRush ? 19f : death ? 17.5f : 16f; + float segmentVelocity = death ? 17.5f : 16f; if (expertMode) segmentVelocity += 4f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) segmentVelocity *= 1.1f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -475,7 +456,6 @@ namespace CalamityMod.NPCs.DevourerofGods public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/DraedonLabThings/RepairUnitCritter.cs b/NPCs/DraedonLabThings/RepairUnitCritter.cs index 9134f87a5f..767b505105 100644 --- a/NPCs/DraedonLabThings/RepairUnitCritter.cs +++ b/NPCs/DraedonLabThings/RepairUnitCritter.cs @@ -124,7 +124,6 @@ namespace CalamityMod.NPCs.DraedonLabThings Initialized = true; } - NPC.Calamity().ShouldFallThroughPlatforms = false; switch (CurrentState) { case BehaviorState.WalkAround: @@ -147,6 +146,7 @@ namespace CalamityMod.NPCs.DraedonLabThings } } } + public override bool? CanFallThroughPlatforms() => CurrentState == BehaviorState.WalkOnWalls; public void WalkAroundOnGround() { @@ -263,7 +263,6 @@ namespace CalamityMod.NPCs.DraedonLabThings { StuckCount = 0f; WantsToClimbOnSomeWall = false; - NPC.Calamity().ShouldFallThroughPlatforms = true; // Generate unusual movement patterns based on sines. float offsetAngle = CalamityUtils.AperiodicSin(Time / 360f, 0f, 1f) * 0.006f; diff --git a/NPCs/ExoMechs/Apollo/Apollo.cs b/NPCs/ExoMechs/Apollo/Apollo.cs index b00a9ac876..254c93ea4e 100644 --- a/NPCs/ExoMechs/Apollo/Apollo.cs +++ b/NPCs/ExoMechs/Apollo/Apollo.cs @@ -144,11 +144,15 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo } } + public static int FireballDamage = 85; // 340 + public static int BoltDamage = 75; // 300 + public static int RocketDamage = 100; // 400 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 250; // 500 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 204; NPC.height = 226; NPC.defense = 100; @@ -158,7 +162,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.noGravity = true; NPC.noTileCollide = true; NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; @@ -167,9 +171,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -237,10 +238,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -416,15 +416,15 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo // Phase 7 - 0, 1, 2 // Gate values - float reducedTimeForGateValue = bossRush ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; + float reducedTimeForGateValue = death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; float reducedTimeForGateValue_Berserk = reducedTimeForGateValue * 0.5f; float normalAttackTime = 360f - reducedTimeForGateValue; float berserkAttackTime = lastMechAlive ? 225f - reducedTimeForGateValue_Berserk : 270f - reducedTimeForGateValue_Berserk; float attackPhaseGateValue = shouldGetBuffedByBerserkPhase ? berserkAttackTime : normalAttackTime; float timeToLineUpAttack = 30f; - float timeToLineUpCharge = bossRush ? 45f : death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; + float timeToLineUpCharge = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { timeToLineUpAttack *= 0.5f; timeToLineUpCharge *= 0.5f; @@ -435,7 +435,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float chargeLocationDistanceGateValue = 40f; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (AIState == (int)Phase.LineUpChargeCombo ? 40f : 20f) * baseVelocityMult; // Attack gate values @@ -443,9 +443,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo bool doBigAttack = calamityGlobalNPC.newAI[3] >= attackPhaseGateValue + 2f + timeToLineUpAttack; // Charge velocity - float chargeVelocity = bossRush ? 115f : death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; + float chargeVelocity = death ? 105f : revenge ? 101.25f : expertMode ? 97.5f : 90f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { baseVelocity *= 1.5f; chargeVelocity *= 1.15f; @@ -466,7 +466,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo float rocketPhaseDuration = lastMechAlive ? 60f : 90f; int numRockets = nerfedAttacks ? 2 : 3; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numRockets += 3; // Default vector to fly to @@ -488,7 +488,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; @@ -993,10 +993,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 plasmaVelocity = Vector2.Normalize(aimedVector) * projectileVelocity; Vector2 offset = Vector2.Normalize(plasmaVelocity) * 70f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, plasmaVelocity, type, damage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, plasmaVelocity, type, FireballDamage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); } } } @@ -1057,10 +1056,9 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 rocketVelocity = Vector2.Normalize(aimedVector) * projectileVelocity * 1.2f; Vector2 offset = Vector2.Normalize(rocketVelocity) * 70f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, rocketVelocity, type, damage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, rocketVelocity, type, RocketDamage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); } } @@ -1180,12 +1178,11 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo NPC.ForceNetUpdate(); // Plasma bolts on charge - if (Main.netMode != NetmodeID.MultiplayerClient && (!(Main.zenithWorld && !exoMechdusa) || (CalamityWorld.LegendaryMode && revenge))) + if (Main.netMode != NetmodeID.MultiplayerClient && (!(Main.zenithWorld && !exoMechdusa) || (CalamityWorld.LegendaryMode))) { - int totalProjectiles = bossRush ? 16 : death ? 12 : 8; + int totalProjectiles = death ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = (int)(NPC.GetProjectileDamage(ModContent.ProjectileType()) * 0.8); float velocity = 0.5f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -1194,7 +1191,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity2, type, BoltDamage, 0f, Main.myPlayer); } } @@ -1673,7 +1670,7 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1819,7 +1816,6 @@ namespace CalamityMod.NPCs.ExoMechs.Apollo public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Ares/AresBody.cs b/NPCs/ExoMechs/Ares/AresBody.cs index 167ada2582..055a1b2733 100644 --- a/NPCs/ExoMechs/Ares/AresBody.cs +++ b/NPCs/ExoMechs/Ares/AresBody.cs @@ -138,7 +138,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public const float deathrayTelegraphDuration_Expert = 120f; public const float deathrayTelegraphDuration_Rev = 105f; public const float deathrayTelegraphDuration_Death = 90f; - public const float deathrayTelegraphDuration_BossRush = 60f; // Total duration of the deathrays public const float deathrayDuration = 600f; @@ -220,10 +219,15 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int BlenderDamage = 110; // 440 + + // Hekate (GFB) + public static int NeuronLaserDamage = 85; // 340 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 220; NPC.height = 252; NPC.defense = 100; @@ -233,7 +237,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.noGravity = true; NPC.noTileCollide = true; NPC.DeathSound = CommonCalamitySounds.ExoDeathSound; @@ -242,9 +246,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.BossBar = ModContent.GetInstance(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -300,10 +301,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (NPC.ai[2] > 0f) NPC.realLife = (int)NPC.ai[2]; @@ -386,8 +386,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 betweenL = NeuronLeft + velocity * 650; SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound with { Volume = CommonCalamitySounds.LaserCannonSound.Volume - 0.2f, Pitch = CommonCalamitySounds.LaserCannonSound.Pitch + 0.2f }, NeuronRight); - Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenL, betweenL + velocity, ModContent.ProjectileType(), 111, 0f, Main.myPlayer, 7, NPC.whoAmI); - Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenR, betweenR + velocity, ModContent.ProjectileType(), 111, 0f, Main.myPlayer, 7, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenL, betweenL + velocity, ModContent.ProjectileType(), NeuronLaserDamage, 0f, Main.myPlayer, 7, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), betweenR, betweenR + velocity, ModContent.ProjectileType(), NeuronLaserDamage, 0f, Main.myPlayer, 7, NPC.whoAmI); } neurontimer = 0; @@ -505,11 +505,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Prevent mechs from being respawned - if (otherExoMechWasFirst) + // CIT 08JUN2025: This code is pointless and makes me unable to work swapping the laser arm position. Commenting it out. + /*if (otherExoMechWasFirst) { if (NPC.ai[3] < 1f) NPC.ai[3] = 1f; - } + }*/ // Phases bool spawnOtherExoMechs = lifeRatio < 0.7f && NPC.ai[3] == 0f; @@ -606,7 +607,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = SecondaryAIState == (float)SecondaryPhase.PassiveAndImmune ? new Vector2(player.Center.X, player.Center.Y - 800f) : AIState != (float)Phase.Deathrays ? new Vector2(player.Center.X, player.Center.Y - 425f) : player.Center; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (EnragedState == (float)Enraged.Yes ? 22f : 14f) * baseVelocityMult; float baseAcceleration = shouldGetBuffedByBerserkPhase ? 1.25f : 1f; float decelerationVelocityMult = 0.85f; @@ -888,7 +889,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares else { // Enrage if the target is more than the deathray length away - if ((distanceFromTarget > DeathrayEnrageDistance || (CalamityWorld.LegendaryMode && revenge)) && EnragedState == (float)Enraged.No) + if ((distanceFromTarget > DeathrayEnrageDistance || (CalamityWorld.LegendaryMode)) && EnragedState == (float)Enraged.No) { // Play enrage sound if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < soundDistance) @@ -907,8 +908,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares calamityGlobalNPC.newAI[3] = 1f; NPC.velocity *= decelerationVelocityMult; - int totalProjectiles = bossRush ? 12 : death ? 10 : revenge ? 9 : expertMode ? 8 : 6; - if (Main.getGoodWorld) + int totalProjectiles = death ? 10 : revenge ? 9 : expertMode ? 8 : 6; + if (CalamityWorld.LegendaryMode) totalProjectiles += 4; float radians = MathHelper.TwoPi / totalProjectiles; @@ -920,8 +921,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX2, -velocity); spinningPoint.Normalize(); - float deathrayTelegraphDuration = bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : - revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : + expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; calamityGlobalNPC.newAI[2] += (EnragedState == (float)Enraged.Yes && calamityGlobalNPC.newAI[2] % 2f == 0f) ? 2f : 1f; if (calamityGlobalNPC.newAI[2] < deathrayTelegraphDuration) @@ -991,12 +992,11 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 spawnPoint = NPC.Center + new Vector2(-1f, 23f); for (int k = 0; k < totalProjectiles; k++) { Vector2 laserVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPoint + Vector2.Normalize(laserVelocity) * 35f, laserVelocity, type, BlenderDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -1105,8 +1105,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { scale = 2f; @@ -1495,7 +1493,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1710,7 +1708,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresGaussNuke.cs b/NPCs/ExoMechs/Ares/AresGaussNuke.cs index 7234ce1600..ca65cea2bd 100644 --- a/NPCs/ExoMechs/Ares/AresGaussNuke.cs +++ b/NPCs/ExoMechs/Ares/AresGaussNuke.cs @@ -85,10 +85,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int NukeDamage = 135; // 540 + public static int SparkDamage = 75; // 300 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 170; NPC.height = 120; NPC.defense = 100; @@ -106,9 +109,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -146,10 +146,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -238,7 +237,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.Calamity().newAI[3] = 0f; // Predictiveness - float predictionAmt = bossRush ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; + float predictionAmt = death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -326,7 +325,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center + (calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? offset2 : offset); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -422,9 +421,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float nukeOffset = 40f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(gaussNukeVelocity) * nukeOffset, gaussNukeVelocity, type, damage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.Normalize(gaussNukeVelocity) * nukeOffset, gaussNukeVelocity, type, NukeDamage, 0f, Main.myPlayer, 0f, Main.player[targetIndex].Center.Y); } // Recoil @@ -487,8 +485,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using gauss nuke @@ -702,7 +698,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresLaserCannon.cs b/NPCs/ExoMechs/Ares/AresLaserCannon.cs index 81107f0d5a..52ce8f335c 100644 --- a/NPCs/ExoMechs/Ares/AresLaserCannon.cs +++ b/NPCs/ExoMechs/Ares/AresLaserCannon.cs @@ -88,10 +88,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int LaserDamage = 85; // 340 + public static int BeamDamage = 110; // 440 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 154; NPC.height = 90; NPC.defense = 100; @@ -109,9 +112,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -151,10 +151,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -184,6 +183,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool nerfedAttacks = false; if (exoTwinsAlive) nerfedAttacks = Main.npc[CalamityGlobalNPC.draedonExoMechTwinGreen].Calamity().newAI[1] != (float)Apollo.Apollo.SecondaryPhase.PassiveAndImmune; + // Used to make the beam only sweep horizontally during mecha mayhem phase + bool mechaMayhem = nerfedAttacks && exoWormAlive && Main.npc[CalamityGlobalNPC.draedonExoMechWorm].Calamity().newAI[1] != (float)ThanatosHead.SecondaryPhase.PassiveAndImmune; // Phases bool berserk = lifeRatio < 0.4f || (otherExoMechsAlive == 0 && lifeRatio < 0.7f); @@ -325,7 +326,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; float baseAcceleration = shouldGetBuffedByBerserkPhase ? 1.25f : 1f; @@ -346,7 +347,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares else if (shouldGetBuffedByBerserkPhase) deathrayPhaseGateValue *= 0.5f; - float deathrayPhaseVelocity = (nerfedAttacks ? 6f : passivePhase ? 9f : 12f) * baseVelocityMult; + float deathrayPhaseVelocity = (nerfedAttacks ? 8f : passivePhase ? 9f : 12f) * baseVelocityMult; if (lastMechAlive) deathrayPhaseVelocity *= 1.2f; else if (shouldGetBuffedByBerserkPhase) @@ -356,8 +357,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, Main.player[targetIndex].Center) > 320f || !fireNormalLasers; // Telegraph duration for deathray spiral - float deathraySpiralTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathraySpiralTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to disable deathray firing bool doNotFire = calamityGlobalNPC_Body.newAI[1] == (float)AresBody.SecondaryPhase.PassiveAndImmune || @@ -455,10 +456,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 laserVelocity = Vector2.Normalize(Main.player[targetIndex].Center - NPC.Center); Vector2 laserOffset = laserVelocity * 70f + Vector2.UnitY * 16f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserOffset, Main.player[targetIndex].Center, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserOffset, Main.player[targetIndex].Center, type, LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -486,7 +486,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float beamOffset = 84f; float beamOffset2 = 16f; Vector2 source = horizontalLaserSweep ? new Vector2(NPC.Center.X - beamOffset2 * NPC.direction, NPC.Center.Y + beamOffset) : new Vector2(NPC.Center.X + beamOffset * NPC.direction, NPC.Center.Y + beamOffset2); @@ -494,7 +493,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (laserVelocity.HasNaNs()) laserVelocity = -Vector2.UnitY; - Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, laserVelocity, type, BeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -512,10 +511,21 @@ namespace CalamityMod.NPCs.ExoMechs.Ares AIState = (float)Phase.Nothing; calamityGlobalNPC.newAI[2] = 0f; - // Change deathray sweep type for next deathray phase + // Change deathray sweep type for next deathray phase; this does not affect anything during mecha mayhem calamityGlobalNPC.newAI[3] += 1f; if (calamityGlobalNPC.newAI[3] > 1f) calamityGlobalNPC.newAI[3] = 0f; + + // If mecha mayhem, make Ares swap the position of the laser and gauss arms, and ensure the beam always sweeps horizontal + if (mechaMayhem) + { + calamityGlobalNPC.newAI[3] = 0f; + if (Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] == 0f) + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] = 1f; + else + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ai[3] = 0f; + Main.npc[CalamityGlobalNPC.draedonExoMechPrime].ForceNetUpdate(); + } } break; @@ -536,8 +546,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using deathrays @@ -751,7 +759,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs index 65d8a89c91..93d07c3f3a 100644 --- a/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs +++ b/NPCs/ExoMechs/Ares/AresPlasmaFlamethrower.cs @@ -82,10 +82,13 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int FireballDamage = 85; // 340 + public static int BoltDamage = 75; // 300 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 152; NPC.height = 90; NPC.defense = 100; @@ -103,9 +106,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -145,10 +145,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -237,7 +236,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.Calamity().newAI[3] = 0f; // Predictiveness - float predictionAmt = bossRush ? 20f : death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; + float predictionAmt = death ? 15f : revenge ? 13.75f : expertMode ? 12.5f : 10f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -338,7 +337,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center + (calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? offset2 : offset); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -354,8 +353,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, Main.player[targetIndex].Center) > 320f || calamityGlobalNPC_Body.newAI[0] != (float)AresBody.Phase.Deathrays; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to cancel plasma bolt firing bool doNotFire = calamityGlobalNPC_Body.newAI[1] == (float)AresBody.SecondaryPhase.PassiveAndImmune || @@ -444,13 +443,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 plasmaOffset = Vector2.Normalize(plasmaBoltVelocity) * 40f + Vector2.UnitY * 16f; if (boltsSplitLess) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, -1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, FireballDamage, 0f, Main.myPlayer, -1f); else - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, damage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + plasmaOffset, plasmaBoltVelocity, type, FireballDamage, 0f, Main.myPlayer, Main.player[targetIndex].Center.X, Main.player[targetIndex].Center.Y); } // Recoil @@ -487,8 +485,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using plasma bolts @@ -700,7 +696,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs index 50617f35d7..3a73886432 100644 --- a/NPCs/ExoMechs/Ares/AresTeslaCannon.cs +++ b/NPCs/ExoMechs/Ares/AresTeslaCannon.cs @@ -83,10 +83,12 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } + public static int OrbDamage = 85; // 340 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; - NPC.damage = 100; NPC.width = 172; NPC.height = 108; NPC.defense = 100; @@ -104,9 +106,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.hide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -146,10 +145,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].life / (float)Main.npc[CalamityGlobalNPC.draedonExoMechPrime].lifeMax; @@ -238,7 +236,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares NPC.localAI[0] = 0f; // Predictiveness - float predictionAmt = bossRush ? 40f : death ? 30f : revenge ? 27.5f : expertMode ? 25f : 20f; + float predictionAmt = death ? 30f : revenge ? 27.5f : expertMode ? 25f : 20f; if (nerfedAttacks) predictionAmt *= 0.5f; if (passivePhase) @@ -341,7 +339,7 @@ namespace CalamityMod.NPCs.ExoMechs.Ares Vector2 destination = Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Center + (calamityGlobalNPC_Body.newAI[0] == (float)AresBody.Phase.Deathrays ? offset2 : offset); // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = (enraged ? 38f : 30f) * baseVelocityMult; baseVelocity *= 1f + Main.npc[(int)NPC.ai[2]].localAI[2]; @@ -354,8 +352,8 @@ namespace CalamityMod.NPCs.ExoMechs.Ares bool canFire = Vector2.Distance(NPC.Center, Main.player[targetIndex].Center) > 320f || calamityGlobalNPC_Body.newAI[0] != (float)AresBody.Phase.Deathrays; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; // Variable to cancel tesla orb firing bool doNotFire = calamityGlobalNPC_Body.newAI[1] == (float)AresBody.SecondaryPhase.PassiveAndImmune || @@ -443,10 +441,9 @@ namespace CalamityMod.NPCs.ExoMechs.Ares if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 orbOffset = Vector2.Normalize(teslaOrbVelocity) * 40f + Vector2.UnitY * 8f; float identity = fireMoreOrbs ? -2f : calamityGlobalNPC.newAI[3] + (calamityGlobalNPC.newAI[2] - teslaOrbTelegraphDuration) / divisor; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + orbOffset, teslaOrbVelocity, type, damage, 0f, Main.myPlayer, identity); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + orbOffset, teslaOrbVelocity, type, OrbDamage, 0f, Main.myPlayer, identity); } // Recoil @@ -484,8 +481,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override void FindFrame(int frameHeight) { // Use telegraph frames when using tesla orbs @@ -696,7 +691,6 @@ namespace CalamityMod.NPCs.ExoMechs.Ares public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } } } diff --git a/NPCs/ExoMechs/Artemis/Artemis.cs b/NPCs/ExoMechs/Artemis/Artemis.cs index 7818bae958..51e7694438 100644 --- a/NPCs/ExoMechs/Artemis/Artemis.cs +++ b/NPCs/ExoMechs/Artemis/Artemis.cs @@ -174,11 +174,14 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } } + public static int LaserDamage = 85; // 340 + public static int BeamDamage = 110; // 440 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 200; // 400 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 204; NPC.height = 226; NPC.defense = 100; @@ -196,9 +199,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.BossBar = ModContent.GetInstance(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -270,10 +270,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis NPC.frame = new Rectangle(NPC.width * frameX, NPC.height * frameY, NPC.width, NPC.height); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Get a target if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) @@ -450,14 +449,14 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis // Phase 7 - 0, 1, 2 // Gate values - float reducedTimeForGateValue = bossRush ? 48f : death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; + float reducedTimeForGateValue = death ? 32f : revenge ? 24f : expertMode ? 16f : 0f; float reducedTimeForGateValue_Berserk = reducedTimeForGateValue * 0.5f; float normalAttackTime = 360f - reducedTimeForGateValue; float berserkAttackTime = lastMechAlive ? 225f - reducedTimeForGateValue_Berserk : 270f - reducedTimeForGateValue_Berserk; float attackPhaseGateValue = shouldGetBuffedByBerserkPhase ? berserkAttackTime : normalAttackTime; float timeToLineUpAttack = phase2 ? 30f : 45f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) timeToLineUpAttack *= 0.5f; // Spin variables @@ -494,9 +493,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis float movementDistanceGateValue = 100f; // Charge variables - float chargeVelocity = nerfedAttacks ? 60f : bossRush ? 81f : death ? 74f : revenge ? 70.5f : expertMode ? 67f : 60f; + float chargeVelocity = nerfedAttacks ? 60f : death ? 74f : revenge ? 70.5f : expertMode ? 67f : 60f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; float chargeDistance = 2000f; @@ -517,11 +516,11 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis predictionAmt *= 0.5f; // Velocity and acceleration values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (bossRush ? 1.15f : death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.25f : 0f) + (death ? 1.1f : revenge ? 1.075f : expertMode ? 1.05f : 1f); float baseVelocity = ((AIState == (int)Phase.Deathray || lineUpAttack || AIState == (int)Phase.LaserShotgun) ? 40f : 20f) * baseVelocityMult; float decelerationVelocityMult = 0.85f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.5f; // Laser shotgun variables @@ -535,7 +534,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis int randomLocationVarianceX = shouldGetBuffedByBerserkPhase ? 50 : 20; int randomLocationVarianceY = shouldGetBuffedByBerserkPhase ? 250 : 100; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { randomLocationVarianceX *= 2; randomLocationVarianceY *= 2; @@ -777,10 +776,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 offset = laserVelocity * 70f; float setVelocityInAI = 7.5f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileDestination, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + offset, projectileDestination, type, LaserDamage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -832,10 +830,9 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 laserVelocity = chargeVelocityNormalized * 10f; - int numLasersPerSpread = bossRush ? 10 : death ? 8 : expertMode ? 6 : 4; - int spread = bossRush ? 30 : death ? 26 : expertMode ? 21 : 15; + int numLasersPerSpread = death ? 8 : expertMode ? 6 : 4; + int spread = death ? 26 : expertMode ? 21 : 15; float rotation = MathHelper.ToRadians(spread); float distanceFromTarget = Vector2.Distance(NPC.Center, NPC.Center + chargeVelocityNormalized * chargeDistance); float setVelocityInAI = death ? 7f : revenge ? 6.75f : expertMode ? 6.5f : 6f; @@ -848,7 +845,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 offset = normalizedPerturbedSpeed * 70f; Vector2 newCenter = NPC.Center + offset; - Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, LaserDamage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } } @@ -929,14 +926,13 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 laserVelocity = Vector2.Normalize(aimedVector) * 10f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); /* Spread: * lastMechAlive = 20, 25, 30 * normal = 16, 20, 24 * nerfedAttacks = 12, 15, 18 */ - int numLasersAddedByDifficulty = bossRush ? 3 : death ? 2 : expertMode ? 1 : 0; + int numLasersAddedByDifficulty = death ? 2 : expertMode ? 1 : 0; int numLasersPerSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 3 : lastMechAlive ? 7 : 5) + numLasersAddedByDifficulty; int baseSpread = ((nerfedAttacks || nerfedLaserShotgun) ? 9 : lastMechAlive ? 20 : 15) + numLasersAddedByDifficulty * 2; int spread = baseSpread + (int)(calamityGlobalNPC.newAI[2] / divisor2) * (baseSpread / 4); @@ -954,7 +950,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis Vector2 newCenter = NPC.Center + offset; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, damage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), newCenter, newCenter + normalizedPerturbedSpeed * distanceFromTarget, type, LaserDamage, 0f, Main.myPlayer, setVelocityInAI, NPC.whoAmI); } } @@ -1087,8 +1083,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int laser = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.whoAmI); + int laser = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, BeamDamage, 0f, Main.myPlayer, NPC.whoAmI); if (Main.projectile.IndexInRange(laser)) { Main.projectile[laser].ai[0] = NPC.whoAmI; @@ -1099,7 +1094,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis else { // This first variable is used to adjust how long it takes for the rotation rate to reach max - float rotationSpeedMult = bossRush ? 6.66f : death ? 4f : revenge ? 3f : expertMode ? 2.5f : 2f; + float rotationSpeedMult = death ? 4f : revenge ? 3f : expertMode ? 2.5f : 2f; // This is used to adjust both the radians and the velocity of the spin moved per frame // At 15% progress it will be at max rotation in Boss Rush @@ -1592,7 +1587,7 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1619,7 +1614,6 @@ namespace CalamityMod.NPCs.ExoMechs.Artemis public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs index e2eda50072..208d7695ab 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody1.cs @@ -65,8 +65,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 150; // 300 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 88; NPC.height = 88; NPC.defense = 100; @@ -88,9 +88,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -141,10 +138,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Check if other segments are still alive, if not, die bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); @@ -254,7 +250,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = bossRush ? 42D : death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; + double numSegmentsAbleToFire = death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.25; @@ -306,10 +302,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -364,12 +359,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) predictionAmt *= 0.5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(CommonCalamitySounds.ExoLaserShootSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -378,7 +372,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { @@ -386,18 +380,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -522,7 +516,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -531,22 +525,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.15f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -690,7 +670,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs index 411630ec67..5c35828c78 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosBody2.cs @@ -64,8 +64,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 150; // 300 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 90; NPC.height = 90; NPC.defense = 100; @@ -87,9 +87,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -140,10 +137,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Check if other segments are still alive, if not, die bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); @@ -253,7 +249,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = bossRush ? 42D : death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; + double numSegmentsAbleToFire = death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.25; @@ -305,10 +301,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -363,12 +358,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) predictionAmt *= 0.5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(CommonCalamitySounds.ExoLaserShootSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -377,7 +371,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { @@ -385,18 +379,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -525,7 +519,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -534,22 +528,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.15f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -695,7 +675,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs index d4eb16b82b..ac548a2b24 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosHead.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosHead.cs @@ -166,11 +166,14 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } + public static int LaserDamage = 85; // 340 + public static int BeamDamage = 135; // 540 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 250; // 500 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 164; NPC.height = 164; NPC.defense = 100; @@ -181,7 +184,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -192,9 +195,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.chaseable = false; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -253,7 +253,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } public float GetSlowdownAreaEdgeRadius(bool lastMechAlive) => - (BossRushEvent.BossRushActive ? 400f : CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.6f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : Main.getGoodWorld ? 0.5f : 1f); + (CalamityWorld.death ? 600f : CalamityWorld.revenge ? 700f : Main.expertMode ? 800f : 1000f) * (lastMechAlive ? 0.75f : 1f) * (Main.zenithWorld && !exoMechdusa ? 2 : CalamityWorld.LegendaryMode ? 0.5f : 1f); public int CheckForOtherMechs(ref int targetIndex, out bool exoPrimeAlive, out bool exoTwinsAlive) { @@ -297,10 +297,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos CalamityGlobalNPC.draedonExoMechWorm = NPC.whoAmI; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -518,7 +517,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos float laserBarrageLocationDistance = turnDistance * 3f; // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -527,7 +526,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.15f; float turnDegrees = baseVelocity * 0.1f * (shouldGetBuffedByBerserkPhase ? 1.25f : 1.1f); @@ -941,8 +940,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, BeamDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -1046,19 +1044,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } } - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -1245,7 +1230,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1367,7 +1352,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs index 8faffda3d8..748c09e955 100644 --- a/NPCs/ExoMechs/Thanatos/ThanatosTail.cs +++ b/NPCs/ExoMechs/Thanatos/ThanatosTail.cs @@ -64,8 +64,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.npcSlots = 5f; - NPC.GetNPCDamage(); NPC.width = 76; NPC.height = 110; NPC.defense = 100; @@ -87,9 +87,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadSlot(ref int index) @@ -140,10 +137,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos NPC.life = Main.npc[(int)NPC.ai[1]].life; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Check if other segments are still alive, if not, die bool shouldDespawn = !NPC.AnyNPCs(ModContent.NPCType()); @@ -253,7 +249,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (NPC.Calamity().newAI[0] == 0f) NPC.ai[3] += 1f; - double numSegmentsAbleToFire = bossRush ? 42D : death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; + double numSegmentsAbleToFire = death ? 36D : revenge ? 34D : expertMode ? 30D : 24D; if (shouldGetBuffedByBerserkPhase) numSegmentsAbleToFire *= 1.25; @@ -305,10 +301,9 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -363,12 +358,11 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } } - float predictionAmt = bossRush ? 24f : death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; + float predictionAmt = death ? 20f : revenge ? 18f : expertMode ? 16f : 12f; if (NPC.ai[0] % 3f == 0f) predictionAmt *= 0.5f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(CommonCalamitySounds.ExoLaserShootSound, NPC.Center); for (int i = 0; i < numProjectiles; i++) { @@ -377,7 +371,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos { // Normal laser if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } else { @@ -385,18 +379,18 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos if (shouldGetBuffedByBerserkPhase && NPC.ai[0] % 3f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, targetCenterArray[i], type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } // Predictive laser Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); // Opposite laser projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt; if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, damage, 0f, Main.myPlayer, 0f, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileDestination, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, NPC.whoAmI); } } } @@ -523,7 +517,7 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos } // Velocity and turn speed values - float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (bossRush ? 1.25f : death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); + float baseVelocityMult = (shouldGetBuffedByBerserkPhase ? 0.15f : 0f) + (death ? 1.2f : revenge ? 1.175f : expertMode ? 1.15f : 1.1f); float baseVelocity = 10f * baseVelocityMult; // Increase top velocity if target is dead or if Thanatos is uncoiling @@ -532,22 +526,8 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos else baseVelocity *= increaseSpeedMult; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.15f; - - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = baseVelocity * 0.25f; - float minimalDamageVelocity = baseVelocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CanHitPlayer(Player target, ref int cooldownSlot) @@ -694,7 +674,6 @@ namespace CalamityMod.NPCs.ExoMechs.Thanatos public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/GreatSandShark/GreatSandShark.cs b/NPCs/GreatSandShark/GreatSandShark.cs index 008c2637d5..42af41cb27 100644 --- a/NPCs/GreatSandShark/GreatSandShark.cs +++ b/NPCs/GreatSandShark/GreatSandShark.cs @@ -52,12 +52,11 @@ namespace CalamityMod.NPCs.GreatSandShark NPC.width = 300; NPC.height = 120; NPC.defense = 40; - NPC.DR_NERD(0.25f); NPC.LifeMaxNERB(9200, 11000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 5, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPCID.Sets.TrailCacheLength[Type] = 8; NPCID.Sets.TrailingMode[Type] = 1; NPC.behindTiles = true; diff --git a/NPCs/HiveMind/DankCreeper.cs b/NPCs/HiveMind/DankCreeper.cs index 9e5ae8406a..64a3323cd2 100644 --- a/NPCs/HiveMind/DankCreeper.cs +++ b/NPCs/HiveMind/DankCreeper.cs @@ -16,7 +16,7 @@ namespace CalamityMod.NPCs.HiveMind public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 24; // 48 NPC.width = 70; NPC.height = 70; NPC.defense = 6; @@ -24,10 +24,10 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 120; if (BossRushEvent.BossRushActive) NPC.lifeMax = 2000; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; - if ((CalamityWorld.LegendaryMode && CalamityWorld.revenge)) + if (CalamityWorld.LegendaryMode) NPC.reflectsProjectiles = true; NPC.aiStyle = -1; @@ -40,10 +40,6 @@ namespace CalamityMod.NPCs.HiveMind NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -68,8 +64,6 @@ namespace CalamityMod.NPCs.HiveMind bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; float speed = death ? 15f : revenge ? 13f : 11f; - if (BossRushEvent.BossRushActive) - speed = 18f; if (NPC.ai[1] < 90f) NPC.ai[1] += 1f; @@ -126,7 +120,7 @@ namespace CalamityMod.NPCs.HiveMind if (hurtInfo.Damage < 0) return; - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 120); } public override void HitEffect(NPC.HitInfo hit) @@ -157,8 +151,7 @@ namespace CalamityMod.NPCs.HiveMind if ((Main.expertMode || BossRushEvent.BossRushActive) && Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, HiveMind.ShaderainDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/HiveMind/DarkHeart.cs b/NPCs/HiveMind/DarkHeart.cs index e44757e78c..dd5b6714b7 100644 --- a/NPCs/HiveMind/DarkHeart.cs +++ b/NPCs/HiveMind/DarkHeart.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.HiveMind public override void SetDefaults() { - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 32; NPC.height = 32; NPC.defense = 2; @@ -29,12 +29,12 @@ namespace CalamityMod.NPCs.HiveMind NPC.lifeMax = 75; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1800; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.aiStyle = -1; AIType = -1; - NPC.knockBackResist = BossRushEvent.BossRushActive ? 0f : 0.4f; + NPC.knockBackResist = 0.4f; NPC.noGravity = true; NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = SoundID.NPCDeath21; @@ -73,15 +73,19 @@ namespace CalamityMod.NPCs.HiveMind if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) NPC.TargetClosest(); - float velocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10f : death ? 7f : revenge ? 6f : 4f; - float acceleration = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f; - float deceleration = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f; - if (BossRushEvent.BossRushActive) + // Despawn if Hive Mind isn't present + if (CalamityGlobalNPC.hiveMind == -1) { - velocity *= 2f; - acceleration *= 2f; + NPC.life = 0; + NPC.HitEffect(); + NPC.checkDead(); + NPC.active = false; } + float velocity = CalamityWorld.LegendaryMode ? 10f : death ? 7f : revenge ? 6f : 4f; + float acceleration = CalamityWorld.LegendaryMode ? 0.5f : death ? 0.35f : revenge ? 0.3f : 0.2f; + float deceleration = CalamityWorld.LegendaryMode ? 0.9f : death ? 0.95f : revenge ? 0.96f : 0.98f; + if (NPC.position.Y > Main.player[NPC.target].position.Y - 400f) { if (NPC.velocity.Y > 0f) @@ -121,17 +125,16 @@ namespace CalamityMod.NPCs.HiveMind if (dropRain && Main.netMode != NetmodeID.MultiplayerClient) { NPC.ai[0] += 1f; - float rainDropRate = Main.getGoodWorld ? 10f : death ? 15f : revenge ? 20f : 30f; + float rainDropRate = CalamityWorld.LegendaryMode ? 10f : death ? 15f : revenge ? 20f : 30f; if (NPC.ai[0] >= rainDropRate) { NPC.ai[0] = 0f; int shaderainXPos = (int)(NPC.position.X + 10f + Main.rand.Next(NPC.width - 20)); int shaderainYos = (int)(NPC.position.Y + NPC.height + 4f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - float randomXVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.rand.NextFloat() * 5f : 0f; + float randomXVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextFloat() * 5f : 0f; float velocityY = 8f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), shaderainXPos, shaderainYos, randomXVelocity, velocityY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shaderainXPos, shaderainYos, randomXVelocity, velocityY, type, HiveMind.ShaderainDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/HiveMind/HiveBlob.cs b/NPCs/HiveMind/HiveBlob.cs index e3bcc35ee9..a836b51da9 100644 --- a/NPCs/HiveMind/HiveBlob.cs +++ b/NPCs/HiveMind/HiveBlob.cs @@ -23,18 +23,23 @@ namespace CalamityMod.NPCs.HiveMind NPCID.Sets.NeedsExpertScaling[Type] = true; } + public static int VileClotDamage = 8; // 32 + + // Legendary Mode exclusive + public static int CursedFlameDamage = 15; // 60 + public override void SetDefaults() { NPC.npcSlots = 0.1f; NPC.aiStyle = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 25; NPC.height = 25; NPC.lifeMax = 50; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1300; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.knockBackResist = 0.9f; @@ -110,7 +115,7 @@ namespace CalamityMod.NPCs.HiveMind float hiveMindVelocity = Main.npc[hiveMind].velocity.Length(); float relocateSpeed = getFuckedAI ? 1.2f : death ? 0.8f : revenge ? 0.7f : expertMode ? 0.6f : 0.5f; float acceleration = 0.8f; - float distanceFromMind = Main.getGoodWorld ? 256f : 128f; + float distanceFromMind = CalamityWorld.LegendaryMode ? 256f : 128f; float hiveMindX = Main.npc[hiveMind].Center.X; float hiveMindY = Main.npc[hiveMind].Center.Y; @@ -183,7 +188,7 @@ namespace CalamityMod.NPCs.HiveMind if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height)) { float projSpeed = death ? 8f : revenge ? 7f : expertMode ? 6f : 4f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) projSpeed *= 1.5f; Vector2 projDirection = NPC.Center; @@ -193,8 +198,8 @@ namespace CalamityMod.NPCs.HiveMind playerDist = projSpeed / playerDist; playerX *= playerDist; playerY *= playerDist; - int type = (CalamityWorld.LegendaryMode && CalamityWorld.revenge && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = type == ProjectileID.CursedFlameHostile ? 30 : NPC.GetProjectileDamage(type); + int type = (CalamityWorld.LegendaryMode && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); + int damage = type == ProjectileID.CursedFlameHostile ? CursedFlameDamage : VileClotDamage; Vector2 projectileVelocity = new Vector2(playerX, playerY); if (type == ProjectileID.CursedFlameHostile) { diff --git a/NPCs/HiveMind/HiveBlob2.cs b/NPCs/HiveMind/HiveBlob2.cs index 47acb7e3dc..afc5893ee2 100644 --- a/NPCs/HiveMind/HiveBlob2.cs +++ b/NPCs/HiveMind/HiveBlob2.cs @@ -31,14 +31,14 @@ namespace CalamityMod.NPCs.HiveMind { NPC.npcSlots = 0.1f; NPC.aiStyle = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 25; NPC.height = 25; NPC.lifeMax = 75; if (BossRushEvent.BossRushActive) NPC.lifeMax = 1300; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 2; NPC.knockBackResist = 0.9f; @@ -104,7 +104,7 @@ namespace CalamityMod.NPCs.HiveMind float hiveMindVelocity = Main.npc[hiveMind].velocity.Length(); float relocateSpeed = getFuckedAI ? 1.2f : death ? 0.8f : revenge ? 0.7f : expertMode ? 0.6f : 0.5f; float acceleration = 0.8f; - float distanceFromMind = Main.getGoodWorld ? 192f : 96f; + float distanceFromMind = CalamityWorld.LegendaryMode ? 192f : 96f; float hiveMindX = Main.npc[hiveMind].Center.X; float hiveMindY = Main.npc[hiveMind].Center.Y; @@ -177,7 +177,7 @@ namespace CalamityMod.NPCs.HiveMind if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[Main.npc[hiveMind].target].position, Main.player[Main.npc[hiveMind].target].width, Main.player[Main.npc[hiveMind].target].height)) { float projSpeed = death ? 8f : revenge ? 7f : expertMode ? 6f : 4f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) projSpeed *= 1.5f; Vector2 projDirection = NPC.Center; @@ -187,8 +187,8 @@ namespace CalamityMod.NPCs.HiveMind playerDist = projSpeed / playerDist; playerX *= playerDist; playerY *= playerDist; - int type = (CalamityWorld.LegendaryMode && CalamityWorld.revenge && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = type == ProjectileID.CursedFlameHostile ? 30 : NPC.GetProjectileDamage(type); + int type = (CalamityWorld.LegendaryMode && Main.rand.NextBool(5)) ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); + int damage = type == ProjectileID.CursedFlameHostile ? HiveBlob.CursedFlameDamage : HiveBlob.VileClotDamage; Vector2 projectileVelocity = new Vector2(playerX, playerY); if (type == ProjectileID.CursedFlameHostile) { diff --git a/NPCs/HiveMind/HiveMind.cs b/NPCs/HiveMind/HiveMind.cs index dac83e0034..1c933134f5 100644 --- a/NPCs/HiveMind/HiveMind.cs +++ b/NPCs/HiveMind/HiveMind.cs @@ -55,7 +55,7 @@ namespace CalamityMod.NPCs.HiveMind // This block of values can be modified in SetDefaults() based on difficulty mode or something private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - private int burrowTimer = 420; + private int burrowTimer = 120; private int minimumDriftTime = 300; private int teleportRadius = 300; private int decelerationTime = 30; @@ -74,7 +74,6 @@ namespace CalamityMod.NPCs.HiveMind private int rainDashAmount = 1; private int rainDashesPerformed = 0; private bool performingRainDashCombo = false; - private int vileSpitFireRate = 24; // Fire rate for Expert-exclusive Vile Spits during phase 1 teleports private int phase2timer = 360; private int rotationDirection; private double rotation; @@ -136,11 +135,13 @@ namespace CalamityMod.NPCs.HiveMind } } + public static int ShaderainDamage = 12; // 48 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 40; // 64 (1.6x expert scaling) NPC.npcSlots = 5f; - NPC.GetNPCDamage(); // this is the only allowed case for using constant directly // as it doesn't have proper frame info yet @@ -148,19 +149,18 @@ namespace CalamityMod.NPCs.HiveMind NPC.height = frameHeight_P1; NPC.defense = 8; - NPC.LifeMaxNERB(7700, 9200, 350000); + NPC.LifeMaxNERB(6150, 7350, 350000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 8, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.boss = true; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (expertMode) { @@ -176,7 +176,6 @@ namespace CalamityMod.NPCs.HiveMind lungeTime = 28; driftSpeed = 2f; driftBoost = 2f; - vileSpitFireRate = 18; } if (death) @@ -189,21 +188,9 @@ namespace CalamityMod.NPCs.HiveMind lungeTime = 23; driftSpeed = 3.5f; driftBoost = 1.5f; - vileSpitFireRate = 15; } - if (bossRush) - { - lungeRots = 0.4; - minimumDriftTime = 40; - reelbackFade = 10; - lungeTime = 16; - driftSpeed = 6f; - driftBoost = 1f; - vileSpitFireRate = 12; - } - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { reelbackFade *= 10; arcTime *= 0.5f; @@ -214,9 +201,6 @@ namespace CalamityMod.NPCs.HiveMind NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -356,10 +340,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++) @@ -405,8 +388,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; @@ -444,16 +426,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--; @@ -461,17 +442,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; } @@ -574,7 +555,7 @@ namespace CalamityMod.NPCs.HiveMind { NPC.localAI[0] = 1f; int maxBlobs = death ? 15 : revenge ? 7 : expertMode ? 6 : 5; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) maxBlobs *= 2; if (Main.zenithWorld) maxBlobs = 50; @@ -617,8 +598,8 @@ namespace CalamityMod.NPCs.HiveMind if (Main.netMode != NetmodeID.MultiplayerClient) { - int maxSpawns = bossRush ? 16 : death ? 8 : revenge ? 6 : expertMode ? Main.rand.Next(4, 6) : Main.rand.Next(3, 5); - int maxDankSpawns = bossRush ? 4 : death ? Main.rand.Next(2, 4) : revenge ? 2 : expertMode ? Main.rand.Next(1, 3) : 1; + int maxSpawns = death ? 5 : revenge ? 4 : expertMode ? Main.rand.Next(3, 5) : Main.rand.Next(2, 4); + int maxDankSpawns = death ? Main.rand.Next(2, 4) : revenge ? 2 : expertMode ? Main.rand.Next(1, 3) : 1; for (int i = 0; i < maxSpawns; i++) { @@ -674,15 +655,6 @@ namespace CalamityMod.NPCs.HiveMind burrowedDust2 = Dust.NewDust(new Vector2(NPC.position.X, NPC.Center.Y), NPC.width, NPC.height / 2, DustID.Demonite, 0f, -3f, 100, default, 2.5f * NPC.scale); Main.dust[burrowedDust2].velocity *= 1f; } - - if (expertMode) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (Collision.CanHitLine(NPC.Center, 1, 1, player.Center, 1, 1) && NPC.Distance(player.Center) > 160f && burrowTimer % vileSpitFireRate == 0) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.VileSpitEaterOfWorlds, 0, 0f, 69f); - } - } } else if (burrowTimer == -60) { @@ -735,15 +707,6 @@ namespace CalamityMod.NPCs.HiveMind burrowedDust2 = Dust.NewDust(new Vector2(NPC.position.X, NPC.Center.Y), NPC.width, NPC.height / 2, DustID.Demonite, 0f, -3f, 100, default, 2.5f * NPC.scale); Main.dust[burrowedDust2].velocity *= 1f; } - - if (expertMode) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (Collision.CanHitLine(NPC.Center, 1, 1, player.Center, 1, 1) && NPC.Distance(player.Center) > 160f && burrowTimer % vileSpitFireRate == 0) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.VileSpitEaterOfWorlds, 0, 0f, 69f); - } - } } else if (burrowTimer == 0) { @@ -765,8 +728,8 @@ namespace CalamityMod.NPCs.HiveMind { case 0: // Slowdrift - // Avoid cheap bullshit - NPC.damage = 0; + // Set damage + NPC.damage = NPC.defDamage; if (NPC.alpha > 0) { @@ -858,16 +821,6 @@ namespace CalamityMod.NPCs.HiveMind return; } - if (expertMode) - { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[2] += 1f; - if (Collision.CanHitLine(NPC.Center, 1, 1, player.Center, 1, 1) && NPC.Distance(player.Center) > 160f && NPC.localAI[2] % (vileSpitFireRate * 2) == 0) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.VileSpitEaterOfWorlds, 0, 0f, 69f); - } - } - NPC.velocity = player.Center - NPC.Center; phase2timer--; @@ -985,18 +938,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.ForceNetUpdate(); if (NPC.alpha > 0) { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); - - if (death) - { - NPC.localAI[2] += 1f; - if (Collision.CanHitLine(NPC.Center, 1, 1, player.Center, 1, 1) && NPC.Distance(player.Center) > 160f && NPC.localAI[2] % vileSpitFireRate == 0) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.VileSpitEaterOfWorlds, 0, 0f, 70f); - } - } - + NPC.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); rotation += rotationIncrement * rotationDirection; phase2timer = lungesPerformed > 0 ? (lungeDelay / (lungesPerformed + 1)) : lungeDelay; @@ -1015,7 +957,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; @@ -1024,18 +966,7 @@ namespace CalamityMod.NPCs.HiveMind } else { - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); - - if (death) - { - NPC.localAI[2] += 1f; - if (Collision.CanHitLine(NPC.Center, 1, 1, player.Center, 1, 1) && NPC.Distance(player.Center) > 160f && NPC.localAI[2] % vileSpitFireRate == 0) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.VileSpitEaterOfWorlds, 0, 0f, 70f); - } - } - + NPC.Center = player.Center + new Vector2(teleportRadius, 0).RotatedBy(rotation); rotation += rotationIncrement * rotationDirection * phase2timer / lungeDelay; } } @@ -1166,10 +1097,9 @@ namespace CalamityMod.NPCs.HiveMind if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 cloudSpawnPos = new Vector2(NPC.position.X + Main.rand.Next(NPC.width), NPC.position.Y + Main.rand.Next(NPC.height)); - Vector2 randomVelocity = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; - Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, damage, 0, Main.myPlayer, 11f); + Vector2 randomVelocity = CalamityWorld.LegendaryMode ? Main.rand.NextVector2CircularEdge(4f, 4f) : Vector2.Zero; + Projectile.NewProjectile(NPC.GetSource_FromAI(), cloudSpawnPos, randomVelocity, type, ShaderainDamage, 0, Main.myPlayer, 11f); } if (NPC.ai[0] == 10f) @@ -1313,7 +1243,7 @@ namespace CalamityMod.NPCs.HiveMind if (hurtInfo.Damage < 0) return; - target.AddBuff(ModContent.BuffType(), 360); + target.AddBuff(ModContent.BuffType(), 240); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) => NPC.scale == 1f; // Only draw HP bar while at full size @@ -1331,7 +1261,7 @@ namespace CalamityMod.NPCs.HiveMind public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } public override void HitEffect(NPC.HitInfo hit) @@ -1343,13 +1273,6 @@ namespace CalamityMod.NPCs.HiveMind { if (Main.netMode != NetmodeID.MultiplayerClient) { - if (Main.rand.NextBool(15)) - { - int hiveBlobCount = NPC.CountNPCS(ModContent.NPCType()) + NPC.CountNPCS(ModContent.NPCType()); - if (hiveBlobCount < 3) - NPC.NewNPC(NPC.GetSource_FromThis(), (int)NPC.Center.X, (int)NPC.Center.Y, Main.rand.NextBool() ? ModContent.NPCType() : ModContent.NPCType()); - } - if (Main.rand.NextBool(30)) { if (NPC.CountNPCS(NPCID.EaterofSouls) < 2) @@ -1400,7 +1323,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; } @@ -1449,7 +1372,6 @@ namespace CalamityMod.NPCs.HiveMind normalOnly.Add(ItemID.DemoniteBar, 1, 10, 15); normalOnly.Add(ItemID.RottenChunk, 1, 10, 15); normalOnly.Add(ItemID.CorruptSeeds, 1, 10, 15); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); normalOnly.Add(ItemDropRule.ByCondition(DropHelper.Hardmode(), ItemID.CursedFlame, 1, 10, 20)); // Equipment diff --git a/NPCs/HiveMind/HiveTumor.cs b/NPCs/HiveMind/HiveTumor.cs index 8a3269a23c..209437e1ea 100644 --- a/NPCs/HiveMind/HiveTumor.cs +++ b/NPCs/HiveMind/HiveTumor.cs @@ -25,7 +25,7 @@ namespace CalamityMod.NPCs.HiveMind NPC.width = 30; //324 NPC.height = 30; //216 NPC.defense = 0; - NPC.lifeMax = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10 : 1000; + NPC.lifeMax = CalamityWorld.LegendaryMode ? 10 : 1000; NPC.knockBackResist = 0f; NPC.chaseable = false; NPC.HitSound = SoundID.NPCHit1; @@ -131,7 +131,7 @@ namespace CalamityMod.NPCs.HiveMind { Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Demonite, hit.HitDirection, -1f, 0, default, 1f); } - if (Main.netMode != NetmodeID.MultiplayerClient && (!NPC.AnyNPCs(ModContent.NPCType()) || (CalamityWorld.LegendaryMode && CalamityWorld.revenge))) + if (Main.netMode != NetmodeID.MultiplayerClient && (!NPC.AnyNPCs(ModContent.NPCType()) || CalamityWorld.LegendaryMode)) { Vector2 spawnAt = NPC.Bottom; NPC.NewNPC(NPC.GetSource_Death(), (int)spawnAt.X, (int)spawnAt.Y, ModContent.NPCType()); diff --git a/NPCs/Leviathan/Anahita.cs b/NPCs/Leviathan/Anahita.cs index c1d15e08a3..d5922b0ff9 100644 --- a/NPCs/Leviathan/Anahita.cs +++ b/NPCs/Leviathan/Anahita.cs @@ -59,21 +59,26 @@ namespace CalamityMod.NPCs.Leviathan } } + public static float DashDamageMult = 1.5f; // 165 + public static int SpearDamage = 24; // 96 + public static int MistDamage = 24; // 96 + public static int SongDamage = 30; // 120 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 55; // 110 NPC.npcSlots = 16f; NPC.width = 100; NPC.height = 100; NPC.defense = 20; - NPC.DR_NERD(0.2f); NPC.LifeMaxNERB(35000, 42000, 260000); NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); - NPC.value = Item.buyPrice(0, 12, 50, 0); + NPC.value = Item.buyPrice(gold: 7, silver: 50); NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = HitSound; @@ -83,14 +88,11 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; if (Main.zenithWorld) NPC.scale *= 4f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -141,9 +143,6 @@ namespace CalamityMod.NPCs.Leviathan if (HasBegunSummoningLeviathan && CalamityGlobalNPC.LeviAndAna == -1) CalamityGlobalNPC.LeviAndAna = NPC.whoAmI; - // Set to false so she doesn't do it constantly - NPC.Calamity().canBreakPlayerDefense = false; - // Light Lighting.AddLight((int)(NPC.Center.X / 16f), (int)(NPC.Center.Y / 16f), 0f, 0.5f, 0.3f); @@ -162,14 +161,13 @@ namespace CalamityMod.NPCs.Leviathan // Variables Player player = Main.player[NPC.target]; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); // Enrage - if (notOcean && !bossRush) + if (notOcean && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -177,12 +175,12 @@ namespace CalamityMod.NPCs.Leviathan else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1.5f; } @@ -192,9 +190,9 @@ namespace CalamityMod.NPCs.Leviathan bubbleVelocity += 4f * enrageScale; if (!leviAlive) bubbleVelocity += 2f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) bubbleVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) bubbleVelocity *= 2f; // Phases @@ -239,7 +237,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.rotation = NPC.rotation.AngleTowards(idealRotation, 0.08f); - if (bossRush || Collision.WetCollision(NPC.position, NPC.width, NPC.height) || NPC.position.Y > (Main.worldSurface - 125f) * 16f) + if (BossRushEvent.BossRushActive || Collision.WetCollision(NPC.position, NPC.width, NPC.height) || NPC.position.Y > (Main.worldSurface - 125f) * 16f) { int oldAlpha = NPC.alpha; NPC.alpha = Utils.Clamp(NPC.alpha + 9, 0, 255); @@ -315,6 +313,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.dontTakeDamage = true; } + NPC.canDisplayBuffs = true; // Hover near the target, invisible if the Leviathan is present and not sufficiently injured. if ((phase3 || death) && WaitingForLeviathan && !Main.zenithWorld) { @@ -342,6 +341,7 @@ namespace CalamityMod.NPCs.Leviathan } NPC.dontTakeDamage = true; + NPC.canDisplayBuffs = false; if (NPC.ai[0] != -1f) { @@ -617,14 +617,14 @@ namespace CalamityMod.NPCs.Leviathan float velocity = death ? 13.5f : 12f; velocity += 6f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) velocity *= 1.15f; Vector2 chargeSetupLocation = Vector2.Normalize(targetVector - NPC.Center - NPC.velocity) * velocity; float acceleration = death ? 0.28f : 0.25f; acceleration += 0.2f * enrageScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) acceleration *= 1.15f; if (Math.Abs(NPC.Center.Y - targetVector.Y) > 50f * NPC.scale || Math.Abs(NPC.Center.X - player.Center.X) > 350f * NPC.scale) @@ -654,7 +654,7 @@ namespace CalamityMod.NPCs.Leviathan float telegraphDist = 500f; // In Legendary, the projectiles she fires is randomized - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { LegendaryModeAttackChosen = Main.rand.Next(3); if (LegendaryModeAttackChosen == 2) @@ -708,10 +708,10 @@ namespace CalamityMod.NPCs.Leviathan int totalProjectiles = 8; int projectileDistance = 600; int type = ModContent.ProjectileType(); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + int damage = SpearDamage; + if (CalamityWorld.LegendaryMode) { float radians = MathHelper.TwoPi / totalProjectiles; - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { switch (LegendaryModeAttackChosen) @@ -722,11 +722,13 @@ namespace CalamityMod.NPCs.Leviathan case 1: type = ModContent.ProjectileType(); + damage = MistDamage; SoundEngine.PlaySound(SoundID.Item30, player.Center); break; case 2: type = ModContent.ProjectileType(); + damage = SongDamage; float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; Main.musicPitch = soundPitch; SoundEngine.PlaySound(SoundID.Item26, player.Center); @@ -750,12 +752,14 @@ namespace CalamityMod.NPCs.Leviathan case 1: totalProjectiles = 3; type = ModContent.ProjectileType(); + damage = MistDamage; SoundEngine.PlaySound(SoundID.Item30, player.Center); break; case 2: totalProjectiles = 6; type = ModContent.ProjectileType(); + damage = SongDamage; float soundPitch = (Main.rand.NextFloat() - 0.5f) * 0.5f; Main.musicPitch = soundPitch; SoundEngine.PlaySound(SoundID.Item26, player.Center); @@ -769,7 +773,6 @@ namespace CalamityMod.NPCs.Leviathan totalProjectiles += totalProjectiles / 2; float radians = MathHelper.TwoPi / totalProjectiles; - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < totalProjectiles; i++) { Vector2 spawnVector = player.Center + Vector2.Normalize(new Vector2(0f, -projectileVelocity).RotatedBy(radians * i)) * projectileDistance; @@ -826,9 +829,11 @@ namespace CalamityMod.NPCs.Leviathan if (revenge) chargeVelocity += 2f + (death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio)); - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; + // Stunt velocity at the end of the charge attack to prevent her flying off + if (NPC.ai[0] == -1f) + chargeVelocity *= 0.3f; NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * chargeVelocity; NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); @@ -850,10 +855,9 @@ namespace CalamityMod.NPCs.Leviathan // Charge else if (NPC.ai[0] == 4f) { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.damage = (int)Math.Round(NPC.defDamage * 1.5); + NPC.damage = (int)Math.Round(NPC.defDamage * DashDamageMult); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge && NPC.ai[1] % 5f == 0f) + if (CalamityWorld.LegendaryMode && NPC.ai[1] % 5f == 0f) { SoundEngine.PlaySound(SoundID.Item85, NPC.Center); Vector2 bubbleSpawnPos = new Vector2(NPC.position.X + (NPC.width / 2) + (15 * NPC.direction * NPC.scale), NPC.position.Y + 30 * NPC.scale); @@ -923,7 +927,7 @@ namespace CalamityMod.NPCs.Leviathan Vector2 chargeSetupLocation = Vector2.Normalize(player.Center + new Vector2(NPC.localAI[0], -distance) - NPC.Center - NPC.velocity) * 12f; float acceleration = revenge ? 0.75f : 0.5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) acceleration *= 1.15f; NPC.SimpleFlyMovement(chargeSetupLocation, acceleration); @@ -980,7 +984,7 @@ namespace CalamityMod.NPCs.Leviathan if (DrawProjectileTelegraphTimer > 0) { Color telegraphColor = Color.Black; - switch (CalamityWorld.LegendaryMode && CalamityWorld.revenge ? LegendaryModeAttackChosen : (int)NPC.localAI[3]) + switch (CalamityWorld.LegendaryMode ? LegendaryModeAttackChosen : (int)NPC.localAI[3]) { case 0: telegraphColor = new Color(55, 70, 240); @@ -1021,7 +1025,7 @@ namespace CalamityMod.NPCs.Leviathan //200x636 } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -1048,7 +1052,6 @@ namespace CalamityMod.NPCs.Leviathan public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/Leviathan/AnahitasIceShield.cs b/NPCs/Leviathan/AnahitasIceShield.cs index cd2355115a..bc01f7169c 100644 --- a/NPCs/Leviathan/AnahitasIceShield.cs +++ b/NPCs/Leviathan/AnahitasIceShield.cs @@ -29,16 +29,16 @@ namespace CalamityMod.NPCs.Leviathan public override void SetDefaults() { + NPC.damage = 45; // 90 NPC.aiStyle = -1; AIType = -1; NPC.noTileCollide = true; NPC.coldDamage = true; - NPC.GetNPCDamage(); NPC.width = 100; NPC.height = 100; NPC.defense = 10; - NPC.DR_NERD(0.5f); - NPC.lifeMax = BossRushEvent.BossRushActive ? 1000 : 650; + NPC.DR_NERD(0.25f); + NPC.lifeMax = BossRushEvent.BossRushActive ? 2000 : 750; NPC.alpha = 255; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; @@ -46,7 +46,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; } diff --git a/NPCs/Leviathan/AquaticAberration.cs b/NPCs/Leviathan/AquaticAberration.cs index 59dded4f7f..152244ae2b 100644 --- a/NPCs/Leviathan/AquaticAberration.cs +++ b/NPCs/Leviathan/AquaticAberration.cs @@ -37,9 +37,8 @@ namespace CalamityMod.NPCs.Leviathan public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 50; // 100 NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 50; NPC.height = 50; NPC.defense = 14; @@ -55,12 +54,8 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.3f; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -97,10 +92,9 @@ namespace CalamityMod.NPCs.Leviathan // Avoid cheap bullshit NPC.damage = 0; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; NPC.TargetClosest(false); @@ -129,13 +123,13 @@ namespace CalamityMod.NPCs.Leviathan sirenAlive = false; } - float inertia = bossRush ? 24f : death ? 26f : revenge ? 27f : expertMode ? 28f : 30f; + float inertia = death ? 26f : revenge ? 27f : expertMode ? 28f : 30f; if (!sirenAlive || leviathanInPhase4) inertia *= 0.75f; if (NPC.ai[0] == 0f) { - float lungeSpeed = bossRush ? 14f : death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; + float lungeSpeed = death ? 12f : revenge ? 11f : expertMode ? 10f : 8f; if (!sirenAlive || leviathanInPhase4) lungeSpeed *= 1.25f; @@ -300,7 +294,5 @@ namespace CalamityMod.NPCs.Leviathan } } } - - public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemDropRule.NormalvsExpert(ItemID.AdhesiveBandage, 100, 50)); } } diff --git a/NPCs/Leviathan/Leviathan.cs b/NPCs/Leviathan/Leviathan.cs index 5a301b94a5..0eacfebad3 100644 --- a/NPCs/Leviathan/Leviathan.cs +++ b/NPCs/Leviathan/Leviathan.cs @@ -57,21 +57,23 @@ namespace CalamityMod.NPCs.Leviathan AttackTexture = ModContent.Request("CalamityMod/NPCs/Leviathan/LeviathanAttack", AssetRequestMode.AsyncLoad); } + public static int BoulderDamage = 40; // 160 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; NPC.npcSlots = 20f; - NPC.GetNPCDamage(); + NPC.damage = 100; // 200 NPC.width = 900; NPC.height = 450; NPC.defense = 40; - NPC.DR_NERD(0.3f); - NPC.LifeMaxNERB(60000, 72000, 600000); + NPC.DR_NERD(0.1f); + NPC.LifeMaxNERB(57000, 68400, 600000); NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; NPC.Opacity = 0f; - NPC.value = Item.buyPrice(0, 12, 50, 0); + NPC.value = Item.buyPrice(gold: 7, silver: 50); NPC.HitSound = SoundID.NPCHit56; NPC.DeathSound = SoundID.NPCDeath60; NPC.noTileCollide = true; @@ -84,14 +86,11 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 1.3f; if (Main.zenithWorld) NPC.scale *= 0.3f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -131,10 +130,9 @@ namespace CalamityMod.NPCs.Leviathan if (CalamityGlobalNPC.LeviAndAna == -1) CalamityGlobalNPC.LeviAndAna = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Vector2 npcCenter = NPC.Center; // Is in spawning animation @@ -201,7 +199,7 @@ namespace CalamityMod.NPCs.Leviathan bool notOcean = player.position.Y < 800f || player.position.Y > Main.worldSurface * 16D || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400)); // Enrage - if (notOcean && !bossRush) + if (notOcean && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -209,12 +207,12 @@ namespace CalamityMod.NPCs.Leviathan else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; - float enrageScale = bossRush ? 1f : 0f; + float enrageScale = 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 2f; } @@ -228,7 +226,6 @@ namespace CalamityMod.NPCs.Leviathan NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Despawn @@ -313,7 +310,7 @@ namespace CalamityMod.NPCs.Leviathan hoverAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { hoverSpeed *= 1.15f; hoverAcceleration *= 1.15f; @@ -394,7 +391,6 @@ namespace CalamityMod.NPCs.Leviathan { float speed = (sirenAlive && !phase4 && !death) ? 13.5f : 16f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (expertMode) speed = (sirenAlive && !phase4 && !death) ? 14f : 17f; @@ -413,12 +409,11 @@ namespace CalamityMod.NPCs.Leviathan if (Main.zenithWorld) { - type = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; + type = CalamityWorld.LegendaryMode ? ProjectileID.BouncyBoulder : ProjectileID.Boulder; leviCenter.Y -= 5; //Shoot a bit more up since boulders are affected by gravity - damage *= 2; } - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), leviCenter.X, leviCenter.Y, xDestination, yDestination, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), leviCenter.X, leviCenter.Y, xDestination, yDestination, type, BoulderDamage, 0f, Main.myPlayer); if (Main.zenithWorld) Main.projectile[proj].scale *= 5f; @@ -443,16 +438,8 @@ namespace CalamityMod.NPCs.Leviathan float playerDistance = (float)Math.Sqrt(playerXDist * playerXDist + playerYDist * playerYDist); NPC.ai[1] += 1f; - int activePlayerAmt = 0; - for (int i = 0; i < Main.maxPlayers; i++) - { - if (Main.player[i].active && !Main.player[i].dead && (npcCenter - Main.player[i].Center).Length() < 1000f) - activePlayerAmt++; - } - NPC.ai[1] += activePlayerAmt / 2; - bool spawnedAberration = false; - float aberrationSpawnDelay = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 20f : (!sirenAlive || phase4) ? 60f : 40f; + float aberrationSpawnDelay = CalamityWorld.LegendaryMode ? 20f : (!sirenAlive || phase4) ? 60f : 50f; if (NPC.ai[1] > aberrationSpawnDelay) { NPC.ai[1] = 0f; @@ -460,8 +447,8 @@ namespace CalamityMod.NPCs.Leviathan spawnedAberration = true; } - int spawnLimit = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10 : (sirenAlive && !phase4) ? 1 : (death ? 2 : 3); - if (spawnedAberration && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit) + int spawnLimit = CalamityWorld.LegendaryMode ? 10 : (sirenAlive && !phase4) ? 0 : 2; + if (spawnedAberration && NPC.CountNPCS(ModContent.NPCType()) < spawnLimit && NPC.ai[2] <= spawnLimit) { SoundEngine.PlaySound(soundChoice with { Pitch = soundChoice.Pitch + extrapitch }, npcCenter); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -575,7 +562,7 @@ namespace CalamityMod.NPCs.Leviathan if (revenge && (!sirenAlive || phase4)) lineupSpeed += death ? 9f * (1f - lifeRatio) : 6f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) lineupSpeed *= 1.15f; Vector2 leviChargeCenter = npcCenter; @@ -611,7 +598,7 @@ namespace CalamityMod.NPCs.Leviathan chargeAcceleration += death ? 0.15f * (1f - lifeRatio) : 0.1f * (1f - lifeRatio); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -810,7 +797,7 @@ namespace CalamityMod.NPCs.Leviathan } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -984,7 +971,6 @@ namespace CalamityMod.NPCs.Leviathan public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/Leviathan/LeviathanStart.cs b/NPCs/Leviathan/LeviathanStart.cs index 19205bd748..35ddf96f39 100644 --- a/NPCs/Leviathan/LeviathanStart.cs +++ b/NPCs/Leviathan/LeviathanStart.cs @@ -1,6 +1,7 @@ using System.IO; using CalamityMod.CalPlayer; using CalamityMod.Items.Accessories; +using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -58,7 +59,7 @@ namespace CalamityMod.NPCs.Leviathan NPC.Calamity().VulnerableToWater = false; NPC.Calamity().ProvidesProximityRage = false; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.8f; } diff --git a/NPCs/NormalNPCs/AeroSlime.cs b/NPCs/NormalNPCs/AeroSlime.cs index a72b4648a6..9ab7fe5394 100644 --- a/NPCs/NormalNPCs/AeroSlime.cs +++ b/NPCs/NormalNPCs/AeroSlime.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 75; NPC.knockBackResist = 0.8f; AnimationType = NPCID.Slimer; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; @@ -41,10 +41,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/ArmoredDiggerBody.cs b/NPCs/NormalNPCs/ArmoredDiggerBody.cs index a4ea0b9aeb..a4a5b58ce7 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerBody.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerBody.cs @@ -25,7 +25,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 38; NPC.height = 38; NPC.defense = 20; - NPC.DR_NERD(0.2f); NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; @@ -41,10 +40,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -157,21 +152,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.position.X = NPC.position.X + targetXDist; NPC.position.Y = NPC.position.Y + targetYDist; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = CalamityWorld.death ? 13.5f : 10f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/ArmoredDiggerHead.cs b/NPCs/NormalNPCs/ArmoredDiggerHead.cs index 5f230ad2bb..dfed057395 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerHead.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerHead.cs @@ -40,12 +40,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 54; NPC.height = 54; NPC.defense = 10; - NPC.DR_NERD(0.1f); NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 5, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -56,10 +55,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -394,19 +389,6 @@ namespace CalamityMod.NPCs.NormalNPCs } } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + 1.57f; if (flying) @@ -439,14 +421,14 @@ namespace CalamityMod.NPCs.NormalNPCs { if (!CalamityPlayer.areThereAnyDamnBosses && NPC.downedPlantBoss && !NPC.AnyNPCs(ModContent.NPCType())) { - float spawnRateDivisor = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 125f : CalamityWorld.revenge ? 425f : 500f; + float spawnRateDivisor = CalamityWorld.LegendaryMode ? 125f : CalamityWorld.revenge ? 425f : 500f; return 1 / spawnRateDivisor; } } return 0f; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } diff --git a/NPCs/NormalNPCs/ArmoredDiggerTail.cs b/NPCs/NormalNPCs/ArmoredDiggerTail.cs index 8aa015ef78..39359d581f 100644 --- a/NPCs/NormalNPCs/ArmoredDiggerTail.cs +++ b/NPCs/NormalNPCs/ArmoredDiggerTail.cs @@ -24,7 +24,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 34; NPC.height = 34; NPC.defense = 30; - NPC.DR_NERD(0.3f); NPC.lifeMax = 20000; NPC.knockBackResist = 0f; NPC.aiStyle = -1; @@ -40,10 +39,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -107,21 +102,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.position.X = NPC.position.X + targetXDist; NPC.position.Y = NPC.position.Y + targetYDist; } - - // Calculate contact damage based on velocity - float maxChaseSpeed = CalamityWorld.death ? 13.5f : 10f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool CheckActive() diff --git a/NPCs/NormalNPCs/AuroraSpirit.cs b/NPCs/NormalNPCs/AuroraSpirit.cs index adff77a47e..95e4beec0b 100644 --- a/NPCs/NormalNPCs/AuroraSpirit.cs +++ b/NPCs/NormalNPCs/AuroraSpirit.cs @@ -32,8 +32,8 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 24; NPC.defense = 8; NPC.alpha = 100; - NPC.lifeMax = 65; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.lifeMax = 200; + NPC.value = Item.buyPrice(silver: 1); NPC.knockBackResist = 0f; NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath15; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/BloodlettingServant.cs b/NPCs/NormalNPCs/BloodlettingServant.cs deleted file mode 100644 index d2b172c462..0000000000 --- a/NPCs/NormalNPCs/BloodlettingServant.cs +++ /dev/null @@ -1,326 +0,0 @@ -using System; -using CalamityMod.Events; -using CalamityMod.Gores; -using CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.NormalNPCs -{ - public class BloodlettingServant : ModNPC - { - private const float ChargeGateValue = 180f; - private const float ChargeTelegraphGateValue = 90f; - private const float ChargeDuration = 60f; - private const float ChargeDuration_Death = 50f; - - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 6; - NPCID.Sets.TrailingMode[Type] = 1; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; - NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); - } - - public override void SetDefaults() - { - NPC.aiStyle = -1; - AIType = -1; - NPC.GetNPCDamage(); - NPC.width = 44; - NPC.height = 30; - if (Main.tenthAnniversaryWorld) - NPC.scale *= 0.5f; - if (Main.getGoodWorld) - NPC.scale *= 1.1f; - - NPC.defense = 5; - NPC.lifeMax = 96; - NPC.knockBackResist = 0f; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath1; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToSickness = true; - } - - public override void AI() - { - Lighting.AddLight(NPC.Center, 0.3f, 0.3f, 0.3f); - - NPC.TargetClosest(); - Player target = Main.player[NPC.target]; - bool targetDead = target.dead; - - bool phase2 = NPC.life < NPC.lifeMax * 0.5; - float enrageScale = 1f + NPC.ai[2]; - - float enrageScaleMaxSpeedBonus = 2f * enrageScale; - float maxSpeedX = (phase2 ? (CalamityWorld.death ? 10f : 8f) : (CalamityWorld.death ? 8f : 6f)) + enrageScaleMaxSpeedBonus; - float maxSpeedY = (phase2 ? (CalamityWorld.death ? 8f : 6f) : (CalamityWorld.death ? 4f : 3f)) + enrageScaleMaxSpeedBonus; - float xAccel = maxSpeedX * 0.01f; - float xAccelBoost1 = maxSpeedX * 0.01f; - float xAccelBoost2 = maxSpeedX * 0.0075f; - float yAccel = maxSpeedY * 0.01f; - float yAccelBoost1 = maxSpeedY * 0.01f; - float yAccelBoost2 = maxSpeedY * 0.0075f; - - float chargeVelocity = 12f + enrageScaleMaxSpeedBonus * 2f; - bool attemptingToCharge = NPC.ai[0] >= ChargeGateValue; - bool farEnoughForCharge = NPC.Distance(target.Center) >= 320f; - bool closeEnoughForCharge = NPC.Distance(target.Center) < 480f; - bool charging = (attemptingToCharge && farEnoughForCharge && closeEnoughForCharge) || NPC.ai[1] > 0f; - - float projectileShootGateValue = CalamityWorld.death ? 180f : 270f; - if (Main.getGoodWorld) - projectileShootGateValue *= 0.5f; - - Vector2 lookAt = target.Center - NPC.Center; - float rateOfRotation = charging ? 0f : 0.1f; - float chargeDuration = CalamityWorld.death ? ChargeDuration_Death : ChargeDuration; - NPC.Calamity().canBreakPlayerDefense = charging; - if (charging) - { - if (NPC.ai[1] == 0f) - { - SoundEngine.PlaySound(SoundID.NPCDeath9, NPC.Center); - NPC.velocity = lookAt.SafeNormalize(Vector2.UnitY) * chargeVelocity; - NPC.spriteDirection = lookAt.X < 0f ? -1 : 1; - NPC.rotation = NPC.velocity.ToRotation() + (lookAt.X < 0f ? MathHelper.Pi : 0f); - - NPC.ai[1] = 1f; - if (NPC.ai[3] > projectileShootGateValue * 0.5f) - NPC.ai[3] = projectileShootGateValue * 0.5f; - - NPC.ForceNetUpdate(); - } - - if (NPC.ai[1] < ChargeDuration + 1f) - { - NPC.ai[1] += 1f; - if (NPC.ai[1] > ChargeDuration + 1f - 10f) - NPC.velocity *= 0.8f; - - if (NPC.ai[1] >= ChargeDuration + 1f) - { - NPC.ai[0] = 0f; - NPC.ai[1] = 0f; - NPC.ForceNetUpdate(); - } - } - } - else - { - if (lookAt.X > 0f) - { - NPC.spriteDirection = 1; - NPC.rotation = lookAt.ToRotation(); - } - if (lookAt.X < 0f) - { - NPC.spriteDirection = -1; - NPC.rotation = lookAt.ToRotation() + MathHelper.Pi; - } - } - - if (phase2) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 1.3); - - if (NPC.ai[0] < ChargeGateValue && !targetDead) - { - NPC.ai[0] += 1f; - if (NPC.ai[0] == ChargeGateValue) - NPC.ForceNetUpdate(); - } - } - else - NPC.damage = NPC.defDamage; - - if (targetDead) - { - NPC.velocity.Y -= 0.04f; - - if (NPC.timeLeft > 10) - NPC.timeLeft = 10; - } - else if (!attemptingToCharge) - { - DemonEyeAI.DemonEyeBatMovement(NPC, maxSpeedX, maxSpeedY, xAccel, xAccelBoost1, xAccelBoost2, yAccel, yAccelBoost1, yAccelBoost2); - - NPC.ai[3] += enrageScale; - bool shootProjectile = Collision.CanHitLine(NPC.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(NPC.Center, target.Center) > 240f; - if (NPC.ai[3] >= projectileShootGateValue && shootProjectile) - { - NPC.ai[3] = 0f; - float projectileSpeed = CalamityWorld.death ? 16f : 12f; - Vector2 projectileVelocity = NPC.SafeDirectionTo(target.Center) * projectileSpeed; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int projType = ProjectileID.BloodShot; - int projDamage = NPC.GetProjectileDamage(projType); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 10f, projectileVelocity, projType, projDamage, 0f, Main.myPlayer); - Main.projectile[proj].timeLeft = 600; - } - - NPC.ForceNetUpdate(); - } - - float pushVelocity = 0.2f * enrageScale; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active) - { - if (i != NPC.whoAmI && Main.npc[i].type == NPC.type) - { - if (Vector2.Distance(NPC.Center, Main.npc[i].Center) < 48f * NPC.scale) - { - if (NPC.position.X < Main.npc[i].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; - - if (NPC.position.Y < Main.npc[i].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } - } - } - } - } - else if (!charging) - { - Vector2 destination = target.Center + new Vector2(-280f * NPC.spriteDirection, -280f); - Vector2 desiredVelocity = NPC.SafeDirectionTo(destination, -Vector2.UnitY) * chargeVelocity; - NPC.SimpleFlyMovement(desiredVelocity, enrageScale); - } - - if (Main.rand.NextBool(20)) - { - Vector2 dustSpawnTopLeft = new Vector2(NPC.position.X, NPC.position.Y + NPC.height * 0.25f); - Dust blood = Dust.NewDustDirect(dustSpawnTopLeft, NPC.width, NPC.height / 2, DustID.Blood, NPC.velocity.X, 2f, 0, new Color(128, 0, 0, 255 - NPC.alpha), 1f); - blood.velocity.X *= 0.5f; - blood.velocity.Y *= 0.1f; - } - } - - public override void FindFrame(int frameHeight) - { - NPC.frameCounter += 1D; - if (NPC.life < NPC.lifeMax * 0.5) - { - if (NPC.frame.Y < frameHeight * 3) - NPC.frame.Y = frameHeight * 3; - if (NPC.frameCounter >= 8D) - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - if (NPC.frame.Y > frameHeight * 5) - NPC.frame.Y = frameHeight * 3; - } - } - else - { - if (NPC.frameCounter >= 8D) - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - if (NPC.frame.Y > frameHeight * 2) - NPC.frame.Y = 0; - } - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - if (NPC.ai[0] >= ChargeTelegraphGateValue) - { - Texture2D npcTexture = TextureAssets.Npc[Type].Value; - Color originalColor = NPC.GetAlpha(drawColor); - Color newColor = new Color(192, 0, 0, 255 - NPC.alpha); - Vector2 drawPosition = NPC.Center - screenPos + new Vector2(0, NPC.gfxOffY); - Vector2 origin = NPC.frame.Size() / 2; - - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - float telegraphScalar = MathHelper.Clamp((NPC.ai[0] - ChargeTelegraphGateValue) / ChargeTelegraphGateValue, 0f, 1f); - Color telegraphColor = Color.Lerp(originalColor, newColor, telegraphScalar); - - if (CalamityClientConfig.Instance.Afterimages && NPC.ai[1] > 0f) - { - int afterimageAmount = 10; - int afterImageIncrement = 2; - for (int j = 0; j < afterimageAmount; j += afterImageIncrement) - { - Color afterimageColor = telegraphColor; - afterimageColor = Color.Lerp(afterimageColor, originalColor, 0.5f); - afterimageColor = NPC.GetAlpha(afterimageColor); - afterimageColor *= (afterimageAmount - j) / 15f; - Vector2 afterimagePos = NPC.oldPos[j] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(npcTexture.Width, npcTexture.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; - afterimagePos += origin * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(npcTexture, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - } - } - - spriteBatch.Draw(npcTexture, drawPosition, NPC.frame, telegraphColor, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - - return false; - } - - return true; - } - - public override void HitEffect(NPC.HitInfo hit) - { - if (Main.dedServ) - return; - - if (NPC.life > 0) - { - for (int i = 0; i < hit.Damage / (double)NPC.lifeMax * 100; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f); - - if (NPC.life < NPC.lifeMax * 0.5f && NPC.localAI[0] == 0f) - { - NPC.localAI[0] = 1f; - Gore.NewGore(NPC.GetSource_FromThis(), NPC.Center, NPC.velocity, Mod.Find("BloodlettingServant1").Type); - for (int i = 0; i < 50; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 2f * hit.HitDirection, -2f); - Main.dust[dust].scale = Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].velocity *= Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].color = new Color(128, 0, 0, 255 - NPC.alpha); - } - } - } - else - { - for (int i = 0; i < 100; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 2f * hit.HitDirection, -2f); - Main.dust[dust].scale = Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].velocity *= Main.rand.NextFloat(1.6f, 2.4f); - Main.dust[dust].color = new Color(128, 0, 0, 255 - NPC.alpha); - } - for (int g = 2; g <= 4; g++) - { - Vector2 goreVel = NPC.velocity.RotatedByRandom(MathHelper.Pi); - Gore.NewGore(NPC.GetSource_Death(), NPC.Center, goreVel, Mod.Find("BloodlettingServant" + g).Type); - } - } - } - } -} diff --git a/NPCs/NormalNPCs/BloodlettingServant.png b/NPCs/NormalNPCs/BloodlettingServant.png deleted file mode 100644 index 5bb5258c6c..0000000000 Binary files a/NPCs/NormalNPCs/BloodlettingServant.png and /dev/null differ diff --git a/NPCs/NormalNPCs/BloomSlime.cs b/NPCs/NormalNPCs/BloomSlime.cs index bc4f8c9849..283baad070 100644 --- a/NPCs/NormalNPCs/BloomSlime.cs +++ b/NPCs/NormalNPCs/BloomSlime.cs @@ -23,11 +23,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 80; NPC.width = 40; NPC.height = 30; - NPC.defense = 25; - NPC.lifeMax = 1500; + NPC.defense = 40; + NPC.lifeMax = 2000; NPC.knockBackResist = 0.3f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 25, 0); + NPC.value = Item.buyPrice(silver: 25); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Bohldohr.cs b/NPCs/NormalNPCs/Bohldohr.cs index a6a4b88510..a7c0f35756 100644 --- a/NPCs/NormalNPCs/Bohldohr.cs +++ b/NPCs/NormalNPCs/Bohldohr.cs @@ -1,7 +1,6 @@ using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.SummonItems; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.NPCs.Other; using CalamityMod.World; using Terraria; @@ -16,16 +15,15 @@ namespace CalamityMod.NPCs.NormalNPCs { public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.aiStyle = -1; AIType = -1; NPC.damage = 80; NPC.width = 40; NPC.height = 40; - NPC.defense = 18; - NPC.lifeMax = 375; + NPC.defense = 32; + NPC.lifeMax = 600; NPC.knockBackResist = 0.95f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit7; NPC.DeathSound = SoundID.NPCDeath35; NPC.behindTiles = true; @@ -33,10 +31,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/BucketZombie.cs b/NPCs/NormalNPCs/BucketZombie.cs index d0b4edf209..34e87385bb 100644 --- a/NPCs/NormalNPCs/BucketZombie.cs +++ b/NPCs/NormalNPCs/BucketZombie.cs @@ -25,20 +25,16 @@ namespace CalamityMod.NPCs.NormalNPCs AnimationType = NPCID.Zombie; NPC.aiStyle = NPCAIStyleID.Fighter; NPC.CloneDefaults(NPCID.Zombie); - NPC.lifeMax = 50; + NPC.lifeMax = 60; NPC.defense = 15; NPC.damage = 16; NPC.knockBackResist = 0.45f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); Banner = NPCID.Zombie; BannerItem = ItemID.ZombieBanner; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool PreAI() diff --git a/NPCs/CalamityAIs/CalamityRegularEnemyAIs/CalamityRegularEnemyAI.cs b/NPCs/NormalNPCs/CalamityRegularEnemyAI.cs similarity index 65% rename from NPCs/CalamityAIs/CalamityRegularEnemyAIs/CalamityRegularEnemyAI.cs rename to NPCs/NormalNPCs/CalamityRegularEnemyAI.cs index f0ec92c278..14ee15c69d 100644 --- a/NPCs/CalamityAIs/CalamityRegularEnemyAIs/CalamityRegularEnemyAI.cs +++ b/NPCs/NormalNPCs/CalamityRegularEnemyAI.cs @@ -1,25 +1,10 @@ using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.CalPlayer; using CalamityMod.Dusts; -using CalamityMod.Events; using CalamityMod.NPCs.Abyss; -using CalamityMod.NPCs.AquaticScourge; -using CalamityMod.NPCs.AstrumAureus; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.NPCs.BrimstoneElemental; -using CalamityMod.NPCs.Bumblebirb; -using CalamityMod.NPCs.CalClone; -using CalamityMod.NPCs.CeaselessVoid; using CalamityMod.NPCs.Crags; -using CalamityMod.NPCs.NormalNPCs; -using CalamityMod.NPCs.OldDuke; using CalamityMod.NPCs.SulphurousSea; using CalamityMod.NPCs.SunkenSea; -using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Enemy; -using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -27,23 +12,23 @@ using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs +namespace CalamityMod.NPCs.NormalNPCs { public static class CalamityRegularEnemyAI { #region Gem Crawler AI public static void GemCrawlerAI(NPC npc, Mod mod, float speedDetect, float speedAdditive) { - int turnAroundDelay = 30; - bool unusedFlag = false; - bool isRunning = false; - bool shouldTurnAround = false; - if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction > 0) || (npc.velocity.X < 0f && npc.direction < 0))) + var turnAroundDelay = 30; + var unusedFlag = false; + var isRunning = false; + var shouldTurnAround = false; + if (npc.velocity.Y == 0f && (npc.velocity.X > 0f && npc.direction > 0 || npc.velocity.X < 0f && npc.direction < 0)) { isRunning = true; npc.ai[3] += 1f; } - if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)turnAroundDelay) | isRunning) + if ((npc.position.X == npc.oldPosition.X || npc.ai[3] >= turnAroundDelay) | isRunning) { npc.ai[3] += 1f; shouldTurnAround = true; @@ -52,7 +37,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { npc.ai[3] -= 1f; } - if (npc.ai[3] > (float)(turnAroundDelay * 10)) + if (npc.ai[3] > turnAroundDelay * 10) { npc.ai[3] = 0f; } @@ -60,19 +45,19 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { npc.ai[3] = 0f; } - if (npc.ai[3] == (float)turnAroundDelay) + if (npc.ai[3] == turnAroundDelay) { npc.netUpdate = true; } - Vector2 npcPos = new Vector2(npc.Center.X, npc.Center.Y); - float xDist = Main.player[npc.target].Center.X - npcPos.X; - float yDist = Main.player[npc.target].Center.Y - npcPos.Y; - float targetDist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); + var npcPos = new Vector2(npc.Center.X, npc.Center.Y); + var xDist = Main.player[npc.target].Center.X - npcPos.X; + var yDist = Main.player[npc.target].Center.Y - npcPos.Y; + var targetDist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); if (targetDist < 200f && !shouldTurnAround) { npc.ai[3] = 0f; } - if (npc.ai[3] < (float)turnAroundDelay) + if (npc.ai[3] < turnAroundDelay) { npc.TargetClosest(true); } @@ -101,9 +86,9 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs npc.direction = 1; } } - float maxVelocity = speedDetect; //5 - float acceleration = speedAdditive; //0.05 - if (!unusedFlag && (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction > 0) || (npc.velocity.X >= 0f && npc.direction < 0))) + var maxVelocity = speedDetect; //5 + var acceleration = speedAdditive; //0.05 + if (!unusedFlag && (npc.velocity.Y == 0f || npc.wet || npc.velocity.X <= 0f && npc.direction > 0 || npc.velocity.X >= 0f && npc.direction < 0)) { if (npc.velocity.X < -maxVelocity || npc.velocity.X > maxVelocity) { @@ -131,7 +116,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs } if (npc.velocity.Y >= 0f) { - int faceDirection = 0; + var faceDirection = 0; if (npc.velocity.X < 0f) { faceDirection = -1; @@ -140,13 +125,13 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { faceDirection = 1; } - Vector2 position = npc.position; + var position = npc.position; position.X += npc.velocity.X; - int x = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * faceDirection)) / 16f); - int y = (int)((position.Y + (float)npc.height - 1f) / 16f); - if ((float)(x * 16) < position.X + (float)npc.width && (float)(x * 16 + 16) > position.X && ((Main.tile[x, y].HasUnactuatedTile && !Main.tile[x, y].TopSlope && !Main.tile[x, y - 1].TopSlope && Main.tileSolid[(int)Main.tile[x, y].TileType] && !Main.tileSolidTop[(int)Main.tile[x, y].TileType]) || (Main.tile[x, y - 1].IsHalfBlock && Main.tile[x, y - 1].HasUnactuatedTile)) && (!Main.tile[x, y - 1].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[x, y - 1].TileType] || Main.tileSolidTop[(int)Main.tile[x, y - 1].TileType] || (Main.tile[x, y - 1].IsHalfBlock && (!Main.tile[x, y - 4].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[x, y - 4].TileType] || Main.tileSolidTop[(int)Main.tile[x, y - 4].TileType]))) && (!Main.tile[x, y - 2].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[x, y - 2].TileType] || Main.tileSolidTop[(int)Main.tile[x, y - 2].TileType]) && (!Main.tile[x, y - 3].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[x, y - 3].TileType] || Main.tileSolidTop[(int)Main.tile[x, y - 3].TileType]) && (!Main.tile[x - faceDirection, y - 3].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[x - faceDirection, y - 3].TileType])) + var x = (int)((position.X + npc.width / 2 + (npc.width / 2 + 1) * faceDirection) / 16f); + var y = (int)((position.Y + npc.height - 1f) / 16f); + if (x * 16 < position.X + npc.width && x * 16 + 16 > position.X && (Main.tile[x, y].HasUnactuatedTile && !Main.tile[x, y].TopSlope && !Main.tile[x, y - 1].TopSlope && Main.tileSolid[Main.tile[x, y].TileType] && !Main.tileSolidTop[Main.tile[x, y].TileType] || Main.tile[x, y - 1].IsHalfBlock && Main.tile[x, y - 1].HasUnactuatedTile) && (!Main.tile[x, y - 1].HasUnactuatedTile || !Main.tileSolid[Main.tile[x, y - 1].TileType] || Main.tileSolidTop[Main.tile[x, y - 1].TileType] || Main.tile[x, y - 1].IsHalfBlock && (!Main.tile[x, y - 4].HasUnactuatedTile || !Main.tileSolid[Main.tile[x, y - 4].TileType] || Main.tileSolidTop[Main.tile[x, y - 4].TileType])) && (!Main.tile[x, y - 2].HasUnactuatedTile || !Main.tileSolid[Main.tile[x, y - 2].TileType] || Main.tileSolidTop[Main.tile[x, y - 2].TileType]) && (!Main.tile[x, y - 3].HasUnactuatedTile || !Main.tileSolid[Main.tile[x, y - 3].TileType] || Main.tileSolidTop[Main.tile[x, y - 3].TileType]) && (!Main.tile[x - faceDirection, y - 3].HasUnactuatedTile || !Main.tileSolid[Main.tile[x - faceDirection, y - 3].TileType])) { - float npcBottom = (float)(y * 16); + var npcBottom = (float)(y * 16); if (Main.tile[x, y].IsHalfBlock) { npcBottom += 8f; @@ -155,13 +140,13 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { npcBottom -= 8f; } - if (npcBottom < position.Y + (float)npc.height) + if (npcBottom < position.Y + npc.height) { - float percentageTileRisen = position.Y + (float)npc.height - npcBottom; + var percentageTileRisen = position.Y + npc.height - npcBottom; if (percentageTileRisen <= 16.1f) { - npc.gfxOffY += npc.position.Y + (float)npc.height - npcBottom; - npc.position.Y = npcBottom - (float)npc.height; + npc.gfxOffY += npc.position.Y + npc.height - npcBottom; + npc.position.Y = npcBottom - npc.height; if (percentageTileRisen < 9f) { npc.stepSpeed = 1f; @@ -181,11 +166,11 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs public static void DungeonSpiritAI(NPC npc, Mod mod, float speed, float rotation, bool lantern = false) { npc.TargetClosest(true); - Vector2 npcPos = new Vector2(npc.Center.X, npc.Center.Y); - float xDist = Main.player[npc.target].Center.X - npcPos.X; - float yDist = Main.player[npc.target].Center.Y - npcPos.Y; - float targetDist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); - float homingSpeed = speed; + var npcPos = new Vector2(npc.Center.X, npc.Center.Y); + var xDist = Main.player[npc.target].Center.X - npcPos.X; + var yDist = Main.player[npc.target].Center.Y - npcPos.Y; + var targetDist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); + var homingSpeed = speed; if (lantern) { @@ -212,7 +197,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs if (lantern) { npc.rotation = npc.velocity.X * 0.08f; - npc.spriteDirection = (npc.direction > 0) ? 1 : -1; + npc.spriteDirection = npc.direction > 0 ? 1 : -1; } else npc.rotation = (float)Math.Atan2((double)yDist, (double)xDist) + rotation; @@ -222,23 +207,23 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs #region Unicorn AI public static void UnicornAI(NPC npc, Mod mod, bool spin, float bounciness, float speedDetect, float speedAdditive, float bouncy1 = -8.5f, float bouncy2 = -7.5f, float bouncy3 = -7f, float bouncy4 = -6f, float bouncy5 = -8f) { - bool DogPhase1 = npc.type == ModContent.NPCType() && npc.life > npc.lifeMax * (CalamityWorld.death ? 0.9 : CalamityWorld.revenge ? 0.7 : 0.5); - bool DogPhase2 = npc.type == ModContent.NPCType() && npc.life <= npc.lifeMax * (CalamityWorld.death ? 0.9 : CalamityWorld.revenge ? 0.7 : 0.5); - int turnAroundDelay = 30; - bool isRunning = false; - bool shouldTurnAround = false; - if (npc.velocity.Y == 0f && ((npc.velocity.X > 0f && npc.direction < 0) || (npc.velocity.X < 0f && npc.direction > 0))) + var DogPhase1 = npc.type == ModContent.NPCType() && npc.life > npc.lifeMax * (CalamityWorld.death ? 0.9 : CalamityWorld.revenge ? 0.7 : 0.5); + var DogPhase2 = npc.type == ModContent.NPCType() && npc.life <= npc.lifeMax * (CalamityWorld.death ? 0.9 : CalamityWorld.revenge ? 0.7 : 0.5); + var turnAroundDelay = 30; + var isRunning = false; + var shouldTurnAround = false; + if (npc.velocity.Y == 0f && (npc.velocity.X > 0f && npc.direction < 0 || npc.velocity.X < 0f && npc.direction > 0)) { isRunning = true; npc.ai[3] += 1f; } - int turnAroundDelayMult = DogPhase1 ? 10 : 4; + var turnAroundDelayMult = DogPhase1 ? 10 : 4; if (!DogPhase1) { - bool noYVelocity = npc.velocity.Y == 0f; - for (int i = 0; i < Main.maxNPCs; i++) + var noYVelocity = npc.velocity.Y == 0f; + for (var i = 0; i < Main.maxNPCs; i++) { - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < (float)npc.width) + if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type && Math.Abs(npc.position.X - Main.npc[i].position.X) + Math.Abs(npc.position.Y - Main.npc[i].position.Y) < npc.width) { if (npc.position.X < Main.npc[i].position.X) { @@ -263,7 +248,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs npc.velocity.Y = 0f; } } - if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= (float)turnAroundDelay || isRunning) + if (npc.position.X == npc.oldPosition.X || npc.ai[3] >= turnAroundDelay || isRunning) { npc.ai[3] += 1f; shouldTurnAround = true; @@ -272,7 +257,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { npc.ai[3] -= 1f; } - if (npc.ai[3] > (float)(turnAroundDelay * turnAroundDelayMult)) + if (npc.ai[3] > turnAroundDelay * turnAroundDelayMult) { npc.ai[3] = 0f; } @@ -280,33 +265,33 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { npc.ai[3] = 0f; } - if (npc.ai[3] == (float)turnAroundDelay) + if (npc.ai[3] == turnAroundDelay) { npc.netUpdate = true; } - Vector2 npcPos = new Vector2(npc.Center.X, npc.Center.Y); - float xDist = Main.player[npc.target].Center.X - npcPos.X; - float yDist = Main.player[npc.target].Center.Y - npcPos.Y; - float targetDist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); + var npcPos = new Vector2(npc.Center.X, npc.Center.Y); + var xDist = Main.player[npc.target].Center.X - npcPos.X; + var yDist = Main.player[npc.target].Center.Y - npcPos.Y; + var targetDist = (float)Math.Sqrt((double)(xDist * xDist + yDist * yDist)); if (targetDist < 200f && !shouldTurnAround) { npc.ai[3] = 0f; } if (!DogPhase1) { - if (npc.velocity.Y == 0f && Math.Abs(npc.velocity.X) > 3f && ((npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f) || (npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f))) + if (npc.velocity.Y == 0f && Math.Abs(npc.velocity.X) > 3f && (npc.Center.X < Main.player[npc.target].Center.X && npc.velocity.X > 0f || npc.Center.X > Main.player[npc.target].Center.X && npc.velocity.X < 0f)) { npc.velocity.Y -= bounciness; if (npc.type == ModContent.NPCType()) { SoundEngine.PlaySound(SoundID.Item14, npc.Center); - for (int k = 0; k < 10; k++) + for (var k = 0; k < 10; k++) { Dust.NewDust(npc.position, npc.width, npc.height, (int)CalamityDusts.Brimstone, 0f, -1f, 0, default, 1f); } if (Main.zenithWorld) { - float screenShakePower = 2 * Utils.GetLerpValue(1300f, 0f, npc.Distance(Main.LocalPlayer.Center), true); + var screenShakePower = 2 * Utils.GetLerpValue(1300f, 0f, npc.Distance(Main.LocalPlayer.Center), true); if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower; } @@ -317,21 +302,21 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs } if (DogPhase2) { - for (int k = 0; k < 5; k++) + for (var k = 0; k < 5; k++) { Dust.NewDust(npc.position, npc.width, npc.height, DustID.Water, 0f, -1f, 0, default, 1f); } } if (npc.type == ModContent.NPCType()) { - for (int k = 0; k < 5; k++) + for (var k = 0; k < 5; k++) { Dust.NewDust(npc.position, npc.width, npc.height, DustID.Water, 0f, -1f, 0, default, 1f); } } } } - if (npc.ai[3] < (float)turnAroundDelay) + if (npc.ai[3] < turnAroundDelay) { npc.TargetClosest(true); } @@ -361,19 +346,19 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs } } - if (npc.velocity.Y == 0f || npc.wet || (npc.velocity.X <= 0f && npc.direction < 0) || (npc.velocity.X >= 0f && npc.direction > 0)) + if (npc.velocity.Y == 0f || npc.wet || npc.velocity.X <= 0f && npc.direction < 0 || npc.velocity.X >= 0f && npc.direction > 0) { if (Math.Sign(npc.velocity.X) != npc.direction && !DogPhase1) { npc.velocity.X *= 0.92f; } - float sandstormPush = MathHelper.Lerp(0.6f, 1f, Math.Abs(Main.windSpeedCurrent)) * (float)Math.Sign(Main.windSpeedCurrent); + var sandstormPush = MathHelper.Lerp(0.6f, 1f, Math.Abs(Main.windSpeedCurrent)) * Math.Sign(Main.windSpeedCurrent); if (!Main.player[npc.target].ZoneSandstorm) { sandstormPush = 0f; } - float maxVelocity = speedDetect; - float acceleration = speedAdditive; + var maxVelocity = speedDetect; + var acceleration = speedAdditive; if (npc.velocity.X < -maxVelocity || npc.velocity.X > maxVelocity) { if (npc.velocity.Y == 0f) @@ -400,7 +385,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs } if (npc.velocity.Y >= 0f) { - int faceDirection = 0; + var faceDirection = 0; if (npc.velocity.X < 0f) { faceDirection = -1; @@ -409,30 +394,30 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { faceDirection = 1; } - Vector2 position = npc.position; + var position = npc.position; position.X += npc.velocity.X; - int x = (int)((position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 1) * faceDirection)) / 16f); - int y = (int)((position.Y + (float)npc.height - 1f) / 16f); + var x = (int)((position.X + npc.width / 2 + (npc.width / 2 + 1) * faceDirection) / 16f); + var y = (int)((position.Y + npc.height - 1f) / 16f); // 21JAN2023: Ozzatron -- this is probably the single most unmaintainable if statement I've ever seen // I have broken all the individual statements out even though I do not fully understand the code. - Tile t_xy = CalamityUtils.ParanoidTileRetrieval(x, y); - Tile t_xy1 = CalamityUtils.ParanoidTileRetrieval(x, y - 1); - Tile t_xy2 = CalamityUtils.ParanoidTileRetrieval(x, y - 2); - Tile t_xy3 = CalamityUtils.ParanoidTileRetrieval(x, y - 3); - Tile t_xOffY3 = CalamityUtils.ParanoidTileRetrieval(x - faceDirection, y - 3); // 3 down, offset 1 in the direction of the NPC's movement - Tile t_xy4 = CalamityUtils.ParanoidTileRetrieval(x, y - 4); - bool positionCheck = (float)(x * 16) < position.X + (float)npc.width && (float)(x * 16 + 16) > position.X; - bool tileSolidityCheck1 = t_xy.HasUnactuatedTile && !t_xy.TopSlope && !t_xy1.TopSlope && Main.tileSolid[t_xy.TileType] && !Main.tileSolidTop[t_xy.TileType]; - bool oneBelowIsSolidHalf = t_xy1.IsHalfBlock && t_xy1.HasUnactuatedTile; - bool canFallThrough = !t_xy1.HasUnactuatedTile || !Main.tileSolid[t_xy1.TileType] || Main.tileSolidTop[t_xy1.TileType] || (t_xy1.IsHalfBlock && (!t_xy4.HasUnactuatedTile || !Main.tileSolid[t_xy4.TileType] || Main.tileSolidTop[t_xy4.TileType])); - bool twoDownIsNonSolid = !t_xy2.HasUnactuatedTile || !Main.tileSolid[t_xy2.TileType] || Main.tileSolidTop[t_xy2.TileType]; - bool threeDownIsNonSolid = !t_xy3.HasUnactuatedTile || !Main.tileSolid[t_xy3.TileType] || Main.tileSolidTop[t_xy3.TileType]; + var t_xy = CalamityUtils.ParanoidTileRetrieval(x, y); + var t_xy1 = CalamityUtils.ParanoidTileRetrieval(x, y - 1); + var t_xy2 = CalamityUtils.ParanoidTileRetrieval(x, y - 2); + var t_xy3 = CalamityUtils.ParanoidTileRetrieval(x, y - 3); + var t_xOffY3 = CalamityUtils.ParanoidTileRetrieval(x - faceDirection, y - 3); // 3 down, offset 1 in the direction of the NPC's movement + var t_xy4 = CalamityUtils.ParanoidTileRetrieval(x, y - 4); + var positionCheck = x * 16 < position.X + npc.width && x * 16 + 16 > position.X; + var tileSolidityCheck1 = t_xy.HasUnactuatedTile && !t_xy.TopSlope && !t_xy1.TopSlope && Main.tileSolid[t_xy.TileType] && !Main.tileSolidTop[t_xy.TileType]; + var oneBelowIsSolidHalf = t_xy1.IsHalfBlock && t_xy1.HasUnactuatedTile; + var canFallThrough = !t_xy1.HasUnactuatedTile || !Main.tileSolid[t_xy1.TileType] || Main.tileSolidTop[t_xy1.TileType] || t_xy1.IsHalfBlock && (!t_xy4.HasUnactuatedTile || !Main.tileSolid[t_xy4.TileType] || Main.tileSolidTop[t_xy4.TileType]); + var twoDownIsNonSolid = !t_xy2.HasUnactuatedTile || !Main.tileSolid[t_xy2.TileType] || Main.tileSolidTop[t_xy2.TileType]; + var threeDownIsNonSolid = !t_xy3.HasUnactuatedTile || !Main.tileSolid[t_xy3.TileType] || Main.tileSolidTop[t_xy3.TileType]; // Notice it doesn't check for platforms in ther offset position. This is why walking AIs twirl on 1-wide platforms in hellevators. They have to turn around before this check succeeds. - bool threeDownOffsetIsNonSolid = !t_xOffY3.HasUnactuatedTile || !Main.tileSolid[t_xOffY3.TileType]; + var threeDownOffsetIsNonSolid = !t_xOffY3.HasUnactuatedTile || !Main.tileSolid[t_xOffY3.TileType]; if (positionCheck && (tileSolidityCheck1 || oneBelowIsSolidHalf) && canFallThrough && twoDownIsNonSolid && threeDownIsNonSolid && threeDownOffsetIsNonSolid) { - float tilePixelPosition = (float)(y * 16); + var tilePixelPosition = (float)(y * 16); if (Main.tile[x, y].IsHalfBlock) { tilePixelPosition += 8f; @@ -441,13 +426,13 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { tilePixelPosition -= 8f; } - if (tilePixelPosition < position.Y + (float)npc.height) + if (tilePixelPosition < position.Y + npc.height) { - float percentageTileRisen = position.Y + (float)npc.height - tilePixelPosition; + var percentageTileRisen = position.Y + npc.height - tilePixelPosition; if ((double)percentageTileRisen <= 16.1) { - npc.gfxOffY += npc.position.Y + (float)npc.height - tilePixelPosition; - npc.position.Y = tilePixelPosition - (float)npc.height; + npc.gfxOffY += npc.position.Y + npc.height - tilePixelPosition; + npc.position.Y = tilePixelPosition - npc.height; if (percentageTileRisen < 9f) { npc.stepSpeed = 1f; @@ -462,15 +447,15 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs } if (npc.velocity.Y == 0f) { - int npcTileX = (int)((npc.position.X + (float)(npc.width / 2) + (float)((npc.width / 2 + 2) * npc.direction) + npc.velocity.X * 5f) / 16f); - int npcTileY = (int)((npc.position.Y + (float)npc.height - 15f) / 16f); - int spriteDirection = npc.spriteDirection; + var npcTileX = (int)((npc.position.X + npc.width / 2 + (npc.width / 2 + 2) * npc.direction + npc.velocity.X * 5f) / 16f); + var npcTileY = (int)((npc.position.Y + npc.height - 15f) / 16f); + var spriteDirection = npc.spriteDirection; spriteDirection *= -1; - if ((npc.velocity.X < 0f && spriteDirection == -1) || (npc.velocity.X > 0f && spriteDirection == 1)) + if (npc.velocity.X < 0f && spriteDirection == -1 || npc.velocity.X > 0f && spriteDirection == 1) { - if (Main.tile[npcTileX, npcTileY - 2].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[npcTileX, npcTileY - 2].TileType]) + if (Main.tile[npcTileX, npcTileY - 2].HasUnactuatedTile && Main.tileSolid[Main.tile[npcTileX, npcTileY - 2].TileType]) { - if (Main.tile[npcTileX, npcTileY - 3].HasUnactuatedTile && Main.tileSolid[(int)Main.tile[npcTileX, npcTileY - 3].TileType]) + if (Main.tile[npcTileX, npcTileY - 3].HasUnactuatedTile && Main.tileSolid[Main.tile[npcTileX, npcTileY - 3].TileType]) { npc.velocity.Y = bouncy1; npc.netUpdate = true; @@ -481,17 +466,17 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs npc.netUpdate = true; } } - else if (Main.tile[npcTileX, npcTileY - 1].HasUnactuatedTile && !Main.tile[npcTileX, npcTileY - 1].TopSlope && Main.tileSolid[(int)Main.tile[npcTileX, npcTileY - 1].TileType]) + else if (Main.tile[npcTileX, npcTileY - 1].HasUnactuatedTile && !Main.tile[npcTileX, npcTileY - 1].TopSlope && Main.tileSolid[Main.tile[npcTileX, npcTileY - 1].TileType]) { npc.velocity.Y = bouncy3; npc.netUpdate = true; } - else if (npc.position.Y + (float)npc.height - (float)(npcTileY * 16) > 20f && Main.tile[npcTileX, npcTileY].HasUnactuatedTile && !Main.tile[npcTileX, npcTileY].TopSlope && Main.tileSolid[(int)Main.tile[npcTileX, npcTileY].TileType]) + else if (npc.position.Y + npc.height - npcTileY * 16 > 20f && Main.tile[npcTileX, npcTileY].HasUnactuatedTile && !Main.tile[npcTileX, npcTileY].TopSlope && Main.tileSolid[Main.tile[npcTileX, npcTileY].TileType]) { npc.velocity.Y = bouncy4; npc.netUpdate = true; } - else if ((npc.directionY < 0 || Math.Abs(npc.velocity.X) > 3f) && (!Main.tile[npcTileX, npcTileY + 1].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[npcTileX, npcTileY + 1].TileType]) && (!Main.tile[npcTileX, npcTileY + 2].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[npcTileX, npcTileY + 2].TileType]) && (!Main.tile[npcTileX + npc.direction, npcTileY + 3].HasUnactuatedTile || !Main.tileSolid[(int)Main.tile[npcTileX + npc.direction, npcTileY + 3].TileType])) + else if ((npc.directionY < 0 || Math.Abs(npc.velocity.X) > 3f) && (!Main.tile[npcTileX, npcTileY + 1].HasUnactuatedTile || !Main.tileSolid[Main.tile[npcTileX, npcTileY + 1].TileType]) && (!Main.tile[npcTileX, npcTileY + 2].HasUnactuatedTile || !Main.tileSolid[Main.tile[npcTileX, npcTileY + 2].TileType]) && (!Main.tile[npcTileX + npc.direction, npcTileY + 3].HasUnactuatedTile || !Main.tileSolid[Main.tile[npcTileX + npc.direction, npcTileY + 3].TileType])) { npc.velocity.Y = bouncy5; npc.netUpdate = true; @@ -515,21 +500,21 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs public static void PassiveSwimmingAI(NPC npc, Mod mod, int passiveness, float detectRange, float xSpeed, float ySpeed, float speedLimitX, float speedLimitY, float rotation, bool spriteFacesLeft = true) { if (spriteFacesLeft) - npc.spriteDirection = (npc.direction > 0) ? 1 : -1; + npc.spriteDirection = npc.direction > 0 ? 1 : -1; else - npc.spriteDirection = (npc.direction > 0) ? -1 : 1; + npc.spriteDirection = npc.direction > 0 ? -1 : 1; npc.noGravity = true; if (npc.direction == 0) npc.TargetClosest(); - Player target = Main.player[npc.target]; + var target = Main.player[npc.target]; if (npc.justHit && passiveness != 3) npc.chaseable = true; if (npc.wet) { - bool hasWetTarget = npc.chaseable; + var hasWetTarget = npc.chaseable; npc.TargetClosest(false); target = Main.player[npc.target]; @@ -610,18 +595,18 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs // Swim away from the player if (passiveness == 3) { - npc.velocity.X = npc.velocity.X - (float)npc.direction * xSpeed; - npc.velocity.Y = npc.velocity.Y - (float)npc.directionY * ySpeed; + npc.velocity.X = npc.velocity.X - npc.direction * xSpeed; + npc.velocity.Y = npc.velocity.Y - npc.directionY * ySpeed; } // Swim toward the player else { - npc.velocity.X = npc.velocity.X + (float)npc.direction * (CalamityWorld.death ? 2f * xSpeed : CalamityWorld.revenge ? 1.5f * xSpeed : xSpeed); - npc.velocity.Y = npc.velocity.Y + (float)npc.directionY * (CalamityWorld.death ? 2f * ySpeed : CalamityWorld.revenge ? 1.5f * ySpeed : ySpeed); + npc.velocity.X = npc.velocity.X + npc.direction * (CalamityWorld.death ? 2f * xSpeed : CalamityWorld.revenge ? 1.5f * xSpeed : xSpeed); + npc.velocity.Y = npc.velocity.Y + npc.directionY * (CalamityWorld.death ? 2f * ySpeed : CalamityWorld.revenge ? 1.5f * ySpeed : ySpeed); } - float velocityCapX = CalamityWorld.death && passiveness != 3 ? 2f * speedLimitX : CalamityWorld.revenge ? 1.5f * speedLimitX : speedLimitX; - float velocityCapY = CalamityWorld.death && passiveness != 3 ? 2f * speedLimitY : CalamityWorld.revenge ? 1.5f * speedLimitY : speedLimitY; + var velocityCapX = CalamityWorld.death && passiveness != 3 ? 2f * speedLimitX : CalamityWorld.revenge ? 1.5f * speedLimitX : speedLimitX; + var velocityCapY = CalamityWorld.death && passiveness != 3 ? 2f * speedLimitY : CalamityWorld.revenge ? 1.5f * speedLimitY : speedLimitY; npc.velocity.X = MathHelper.Clamp(npc.velocity.X, -velocityCapX, velocityCapX); npc.velocity.Y = MathHelper.Clamp(npc.velocity.Y, -velocityCapY, velocityCapY); @@ -631,22 +616,22 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs // Laserfish shoot the player if (npc.type == ModContent.NPCType()) { - npc.localAI[0] += (CalamityWorld.death ? 2f : CalamityWorld.revenge ? 1.5f : 1f); + npc.localAI[0] += CalamityWorld.death ? 2f : CalamityWorld.revenge ? 1.5f : 1f; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, target.position, target.width, target.height)) { - float speed = 5f; - Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); - float velX = target.Center.X - vector.X + Main.rand.NextFloat(-20f, 20f); - float velY = target.Center.Y - vector.Y + Main.rand.NextFloat(-20f, 20f); - float dist = (float)Math.Sqrt((double)(velX * velX + velY * velY)); + var speed = 5f; + var vector = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height / 2); + var velX = target.Center.X - vector.X + Main.rand.NextFloat(-20f, 20f); + var velY = target.Center.Y - vector.Y + Main.rand.NextFloat(-20f, 20f); + var dist = (float)Math.Sqrt((double)(velX * velX + velY * velY)); dist = speed / dist; velX *= dist; velY *= dist; - int damage = Main.masterMode ? 34 : Main.expertMode ? 40 : 50; - int beam = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + (npc.spriteDirection == 1 ? 25f : -25f), npc.Center.Y + (target.position.Y > npc.Center.Y ? 5f : -5f), velX, velY, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer); + var damage = Main.masterMode ? 34 : Main.expertMode ? 40 : 50; + var beam = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + (npc.spriteDirection == 1 ? 25f : -25f), npc.Center.Y + (target.position.Y > npc.Center.Y ? 5f : -5f), velX, velY, ProjectileID.EyeBeam, damage, 0f, Main.myPlayer); Main.projectile[beam].tileCollide = true; } } @@ -657,21 +642,21 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs { if ((target.Center - npc.Center).Length() < 350f) { - npc.localAI[0] += (CalamityWorld.death ? 3f : CalamityWorld.revenge ? 2f : 1f); + npc.localAI[0] += CalamityWorld.death ? 3f : CalamityWorld.revenge ? 2f : 1f; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= 180f) { npc.localAI[0] = 0f; if (Collision.CanHit(npc.position, npc.width, npc.height, target.position, target.width, target.height)) { - float speed = 4f; - Vector2 vector = new Vector2(npc.position.X + (float)npc.width * 0.5f, npc.position.Y + (float)(npc.height / 2)); - float velX = target.Center.X - vector.X + Main.rand.NextFloat(-20f, 20f); - float velY = target.Center.Y - vector.Y + Main.rand.NextFloat(-20f, 20f); - float dist = (float)Math.Sqrt((double)(velX * velX + velY * velY)); + var speed = 4f; + var vector = new Vector2(npc.position.X + npc.width * 0.5f, npc.position.Y + npc.height / 2); + var velX = target.Center.X - vector.X + Main.rand.NextFloat(-20f, 20f); + var velY = target.Center.Y - vector.Y + Main.rand.NextFloat(-20f, 20f); + var dist = (float)Math.Sqrt((double)(velX * velX + velY * velY)); dist = speed / dist; velX *= dist; velY *= dist; - int damage = Main.masterMode ? 21 : Main.expertMode ? 25 : 35; + var damage = Main.masterMode ? 21 : Main.expertMode ? 25 : 35; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + (npc.spriteDirection == 1 ? 10f : -10f), npc.Center.Y, velX, velY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer); } } @@ -685,7 +670,7 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs else { // No target behavior - npc.velocity.X += (float)npc.direction * 0.1f; + npc.velocity.X += npc.direction * 0.1f; if (npc.velocity.X < -2.5f || npc.velocity.X > 2.5f) npc.velocity.X *= 0.95f; @@ -703,8 +688,8 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs } } - int npcTileX = (int)(npc.position.X + (float)(npc.width / 2)) / 16; - int npcTileY = (int)(npc.position.Y + (float)(npc.height / 2)) / 16; + var npcTileX = (int)(npc.position.X + npc.width / 2) / 16; + var npcTileY = (int)(npc.position.Y + npc.height / 2) / 16; if (Main.tile[npcTileX, npcTileY - 1].LiquidAmount > 128) { if (Main.tile[npcTileX, npcTileY + 1].HasTile) @@ -733,8 +718,8 @@ namespace CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs npc.ai[0] = 1f; } - npc.rotation = npc.velocity.Y * (float)npc.direction * rotation; - float rotationLimit = 2f * rotation; + npc.rotation = npc.velocity.Y * npc.direction * rotation; + var rotationLimit = 2f * rotation; npc.rotation = MathHelper.Clamp(npc.rotation, -rotationLimit, rotationLimit); } #endregion diff --git a/NPCs/NormalNPCs/CladCrab.cs b/NPCs/NormalNPCs/CladCrab.cs index 286ae38309..13144ab802 100644 --- a/NPCs/NormalNPCs/CladCrab.cs +++ b/NPCs/NormalNPCs/CladCrab.cs @@ -35,7 +35,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 100; NPC.aiStyle = -1; NPC.knockBackResist = 0.4f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit41 with { Pitch = 0.6f }; NPC.DeathSound = SoundID.NPCDeath36 with { Pitch = -0.4f }; Banner = NPC.type; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/NormalNPCs/CloudElemental.cs b/NPCs/NormalNPCs/CloudElemental.cs index 11bbb3861e..59e654931e 100644 --- a/NPCs/NormalNPCs/CloudElemental.cs +++ b/NPCs/NormalNPCs/CloudElemental.cs @@ -75,10 +75,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 80; NPC.height = 140; NPC.defense = 18; - NPC.DR_NERD(0.05f); NPC.lifeMax = 6000; NPC.knockBackResist = 0.05f; - NPC.value = Item.buyPrice(0, 1, 50, 0); + NPC.value = Item.buyPrice(gold: 1, silver: 50); NPC.HitSound = SoundID.NPCHit23; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; @@ -91,10 +90,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = false; NPC.Calamity().VulnerableToHeat = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Cnidrion.cs b/NPCs/NormalNPCs/Cnidrion.cs index 56a6b55f02..836d928cba 100644 --- a/NPCs/NormalNPCs/Cnidrion.cs +++ b/NPCs/NormalNPCs/Cnidrion.cs @@ -35,11 +35,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 6; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.DR_NERD(0.05f); NPC.lifeMax = 280; NPC.knockBackResist = 0.05f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 25, 0); + NPC.value = Item.buyPrice(silver: 25); NPC.HitSound = SoundID.NPCHit12; NPC.DeathSound = SoundID.NPCDeath18; NPC.rarity = 2; @@ -48,10 +47,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerAmber.cs b/NPCs/NormalNPCs/CrawlerAmber.cs index f954995ab2..227d0ecc74 100644 --- a/NPCs/NormalNPCs/CrawlerAmber.cs +++ b/NPCs/NormalNPCs/CrawlerAmber.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -28,9 +27,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 10; - NPC.lifeMax = 115; + NPC.lifeMax = 150; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerAmethyst.cs b/NPCs/NormalNPCs/CrawlerAmethyst.cs index a4e87c0b90..6b16f0d70a 100644 --- a/NPCs/NormalNPCs/CrawlerAmethyst.cs +++ b/NPCs/NormalNPCs/CrawlerAmethyst.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -30,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 75; NPC.knockBackResist = 0.75f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 60); + NPC.value = Item.buyPrice(copper: 60); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerCrystal.cs b/NPCs/NormalNPCs/CrawlerCrystal.cs index e1a0792b18..ff2d4b4d03 100644 --- a/NPCs/NormalNPCs/CrawlerCrystal.cs +++ b/NPCs/NormalNPCs/CrawlerCrystal.cs @@ -3,7 +3,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Melee; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -27,11 +26,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 35; NPC.width = 44; NPC.height = 34; - NPC.defense = 12; - NPC.lifeMax = 375; + NPC.defense = 22; + NPC.lifeMax = 400; NPC.knockBackResist = 0.15f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -39,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerDiamond.cs b/NPCs/NormalNPCs/CrawlerDiamond.cs index 09e32974f5..0ebb7f1a93 100644 --- a/NPCs/NormalNPCs/CrawlerDiamond.cs +++ b/NPCs/NormalNPCs/CrawlerDiamond.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -26,11 +25,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 24; NPC.width = 44; NPC.height = 34; - NPC.defense = 8; - NPC.lifeMax = 190; + NPC.defense = 10; + NPC.lifeMax = 180; NPC.knockBackResist = 0.35f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerEmerald.cs b/NPCs/NormalNPCs/CrawlerEmerald.cs index 83098672ad..9b30b0aacc 100644 --- a/NPCs/NormalNPCs/CrawlerEmerald.cs +++ b/NPCs/NormalNPCs/CrawlerEmerald.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -30,7 +29,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 135; NPC.knockBackResist = 0.55f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 20); + NPC.value = Item.buyPrice(silver: 1, copper: 20); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerRuby.cs b/NPCs/NormalNPCs/CrawlerRuby.cs index 85e11808ee..1d25a513f7 100644 --- a/NPCs/NormalNPCs/CrawlerRuby.cs +++ b/NPCs/NormalNPCs/CrawlerRuby.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -27,10 +26,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 8; - NPC.lifeMax = 170; + NPC.lifeMax = 150; NPC.knockBackResist = 0.45f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 60); + NPC.value = Item.buyPrice(silver: 1, copper: 60); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerSapphire.cs b/NPCs/NormalNPCs/CrawlerSapphire.cs index 82e676db37..e307c06005 100644 --- a/NPCs/NormalNPCs/CrawlerSapphire.cs +++ b/NPCs/NormalNPCs/CrawlerSapphire.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -27,10 +26,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 6; - NPC.lifeMax = 115; + NPC.lifeMax = 120; NPC.knockBackResist = 0.65f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrawlerTopaz.cs b/NPCs/NormalNPCs/CrawlerTopaz.cs index 3ce4c15784..029c66b7bd 100644 --- a/NPCs/NormalNPCs/CrawlerTopaz.cs +++ b/NPCs/NormalNPCs/CrawlerTopaz.cs @@ -2,7 +2,6 @@ using CalamityMod.Items.Accessories; using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -27,10 +26,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 34; NPC.defense = 4; - NPC.lifeMax = 60; + NPC.lifeMax = 90; NPC.knockBackResist = 0.85f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 60); + NPC.value = Item.buyPrice(copper: 60); NPC.HitSound = SoundID.NPCHit33; NPC.DeathSound = SoundID.NPCDeath36; Banner = NPC.type; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CrimulanBlightSlime.cs b/NPCs/NormalNPCs/CrimulanBlightSlime.cs index 71ef2aa14a..71a4064edc 100644 --- a/NPCs/NormalNPCs/CrimulanBlightSlime.cs +++ b/NPCs/NormalNPCs/CrimulanBlightSlime.cs @@ -24,10 +24,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 42; NPC.defense = 8; - NPC.lifeMax = 165; + NPC.lifeMax = 130; NPC.knockBackResist = 0.3f; AnimationType = NPCID.RainbowSlime; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.alpha = 105; NPC.lavaImmune = false; NPC.noGravity = false; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/CryoSlime.cs b/NPCs/NormalNPCs/CryoSlime.cs index d9aa5f45f2..30e71d6f11 100644 --- a/NPCs/NormalNPCs/CryoSlime.cs +++ b/NPCs/NormalNPCs/CryoSlime.cs @@ -22,11 +22,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 30; NPC.width = 40; NPC.height = 30; - NPC.defense = 8; - NPC.lifeMax = 180; + NPC.defense = 24; + NPC.lifeMax = 280; NPC.knockBackResist = 0.6f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Cryon.cs b/NPCs/NormalNPCs/Cryon.cs index b82920a32c..7dad72a7b4 100644 --- a/NPCs/NormalNPCs/Cryon.cs +++ b/NPCs/NormalNPCs/Cryon.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.World; using Terraria; using Terraria.GameContent.Bestiary; @@ -23,11 +22,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 42; NPC.width = 50; NPC.height = 64; - NPC.defense = 10; - NPC.DR_NERD(0.1f); - NPC.lifeMax = 375; + NPC.defense = 25; + NPC.lifeMax = 300; NPC.knockBackResist = 0.4f; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; Banner = NPC.type; @@ -36,10 +34,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/EbonianBlightSlime.cs b/NPCs/NormalNPCs/EbonianBlightSlime.cs index 98a2b2a496..52d7ad737c 100644 --- a/NPCs/NormalNPCs/EbonianBlightSlime.cs +++ b/NPCs/NormalNPCs/EbonianBlightSlime.cs @@ -24,10 +24,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 60; NPC.height = 42; NPC.defense = 8; - NPC.lifeMax = 165; + NPC.lifeMax = 130; NPC.knockBackResist = 0.3f; AnimationType = NPCID.RainbowSlime; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.alpha = 105; NPC.lavaImmune = false; NPC.noGravity = false; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Eidolist.cs b/NPCs/NormalNPCs/Eidolist.cs index 7fde916b9d..eed93943a1 100644 --- a/NPCs/NormalNPCs/Eidolist.cs +++ b/NPCs/NormalNPCs/Eidolist.cs @@ -43,7 +43,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 80; NPC.lifeMax = 5000; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.Opacity = 0f; NPC.noGravity = true; NPC.noTileCollide = false; @@ -57,10 +57,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs index af1c94e9ad..5d6caef76d 100644 --- a/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs +++ b/NPCs/NormalNPCs/FearlessGoldfishWarrior.cs @@ -27,9 +27,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 36; NPC.height = 32; NPC.defense = Main.hardMode ? 10 : 2; - NPC.lifeMax = Main.hardMode ? 190 : 65; + NPC.lifeMax = Main.hardMode ? 150 : 50; NPC.knockBackResist = Main.hardMode ? 0.2f : 0.5f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Foveanator.cs b/NPCs/NormalNPCs/Foveanator.cs deleted file mode 100644 index 30d5b09bca..0000000000 --- a/NPCs/NormalNPCs/Foveanator.cs +++ /dev/null @@ -1,977 +0,0 @@ -using System; -using System.IO; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.DataStructures; -using CalamityMod.Events; -using CalamityMod.NPCs.AstrumDeus; -using CalamityMod.Projectiles.Boss; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.Chat; -using Terraria.GameContent; -using Terraria.GameContent.Achievements; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.NormalNPCs -{ - public class Foveanator : ModNPC - { - public static int phase1IconIndex; - public static int phase2IconIndex; - - public static Asset GlowTexture; - - public override void Load() - { - string phase1IconPath = "CalamityMod/NPCs/NormalNPCs/Foveanator_Head_Boss"; - string phase2IconPath = "CalamityMod/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss"; - - phase1IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase1IconPath, -1); - phase2IconIndex = CalamityMod.Instance.AddBossHeadTexture(phase2IconPath, -1); - } - - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 6; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; - NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); - - if (!Main.dedServ) - GlowTexture = ModContent.Request("CalamityMod/NPCs/NormalNPCs/FoveanatorGlow", AssetRequestMode.AsyncLoad); - } - - public override void SetDefaults() - { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.aiStyle = -1; - AIType = -1; - NPC.GetNPCDamage(); - NPC.DR_NERD(0.2f); - - NPC.width = 100; - NPC.height = 100; - if (Main.tenthAnniversaryWorld) - NPC.scale *= 0.5f; - if (Main.getGoodWorld) - NPC.scale *= 0.8f; - - NPC.defense = 10; - NPC.lifeMax = 24000; - NPC.knockBackResist = 0f; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.boss = true; - NPC.SpawnWithHigherTime(30); - NPC.HitSound = SoundID.NPCHit1; - NPC.DeathSound = SoundID.NPCDeath14; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToSickness = true; - AnimationType = NPCID.Retinazer; - Music = MusicID.Boss2; - - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(NPC.localAI[0]); - writer.Write(NPC.localAI[1]); - writer.Write(NPC.localAI[2]); - writer.Write(NPC.localAI[3]); - for (int i = 0; i < 4; i++) - writer.Write(NPC.Calamity().newAI[i]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - NPC.localAI[0] = reader.ReadSingle(); - NPC.localAI[1] = reader.ReadSingle(); - NPC.localAI[2] = reader.ReadSingle(); - NPC.localAI[3] = reader.ReadSingle(); - for (int i = 0; i < 4; i++) - NPC.Calamity().newAI[i] = reader.ReadSingle(); - } - - public override void BossHeadSlot(ref int index) => index = NPC.ai[0] >= 3f ? phase2IconIndex : phase1IconIndex; - - public override void AI() - { - CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - - // Get a target - if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead || !Main.player[NPC.target].active) - CalamityUtils.CalamityTargeting(NPC, default); - - float enrageScale = bossRush ? 0.5f : 0.3f; - if (Main.IsItDay() || bossRush) - { - NPC.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - - // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; - - // Check for Retinazer - bool retAlive = false; - if (CalamityGlobalNPC.laserEye != -1) - retAlive = Main.npc[CalamityGlobalNPC.laserEye].active; - - // Check for Spazmatism or Retinazer - bool spazAlive = false; - if (CalamityGlobalNPC.fireEye != -1) - spazAlive = Main.npc[CalamityGlobalNPC.fireEye].active; - - // Explode if ret and spaz are dead - if (!retAlive && !spazAlive) - { - NPC.life = 0; - NPC.HitEffect(); - NPC.active = false; - NPC.netUpdate = true; - return; - } - - Vector2 lookDirection = NPC.Center - Main.player[NPC.target].Center; - int direction = (NPC.Center.X < Main.player[NPC.target].position.X + Main.player[NPC.target].width) ? -1 : 1; - - float hoverRotation = lookDirection.ToRotation() + MathHelper.PiOver2; - if (hoverRotation < 0f) - hoverRotation += MathHelper.TwoPi; - else if (hoverRotation > MathHelper.TwoPi) - hoverRotation -= MathHelper.TwoPi; - - // Rotate faster during energy bomb and laser barrage - float rotationRate = NPC.ai[1] == 3f ? 0.25f : 0.15f; - NPC.rotation = NPC.rotation.AngleTowards(hoverRotation, rotationRate); - - if (Main.rand.NextBool(5)) - { - int foveaDust = Dust.NewDust(new Vector2(NPC.position.X, NPC.position.Y + NPC.height * 0.25f), NPC.width, (int)(NPC.height * 0.5f), DustID.Blood, NPC.velocity.X, 2f, 0, default, 1f); - Dust dust = Main.dust[foveaDust]; - dust.velocity.X *= 0.5f; - dust.velocity.Y *= 0.1f; - } - - if (Main.netMode != NetmodeID.MultiplayerClient && !Main.player[NPC.target].dead && NPC.timeLeft < 10) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (i != NPC.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism || Main.npc[i].type == NPC.type) && Main.npc[i].timeLeft - 1 > NPC.timeLeft) - NPC.timeLeft = Main.npc[i].timeLeft - 1; - } - } - - // Phase HP ratios - float phase2LifeRatio = 0.85f; - float finalPhaseLifeRatio = 0.4f; - - // Movement variables - float phase1MaxSpeedIncrease = 2f; - float phase1MaxAccelerationIncrease = 0.025f; - float phase1MaxChargeSpeedIncrease = 1f; - - // Phase duration variables - float phase1MaxLaserPhaseDurationDecrease = 120f; - - // Go to phase 2 early if Spaz and Ret health total goes below 50% - // Go to final phase early if Spaz and Ret health total goes below 20% - float retAndSpazHPRatio = 0f; - if (CalamityGlobalNPC.fireEye != -1) - { - if (Main.npc[CalamityGlobalNPC.fireEye].active) - retAndSpazHPRatio += Main.npc[CalamityGlobalNPC.fireEye].life / (float)Main.npc[CalamityGlobalNPC.fireEye].lifeMax; - } - if (CalamityGlobalNPC.laserEye != -1) - { - if (Main.npc[CalamityGlobalNPC.laserEye].active) - retAndSpazHPRatio += Main.npc[CalamityGlobalNPC.laserEye].life / (float)Main.npc[CalamityGlobalNPC.laserEye].lifeMax; - } - - // Phase checks - bool phase2 = lifeRatio < phase2LifeRatio || retAndSpazHPRatio < 0.5f; - bool finalPhase = lifeRatio < finalPhaseLifeRatio || retAndSpazHPRatio < 0.2f; - - Vector2 mechQueenSpacing = Vector2.Zero; - if (NPC.IsMechQueenUp) - { - NPC NPC = Main.npc[NPC.mechQueen]; - Vector2 mechQueenCenter = NPC.GetMechQueenCenter(); - Vector2 eyePosition = new Vector2(0f, -300f); - eyePosition *= 0.75f; - float mechdusaRotation = NPC.velocity.X * 0.025f; - mechQueenSpacing = mechQueenCenter + eyePosition; - mechQueenSpacing = mechQueenSpacing.RotatedBy(mechdusaRotation, mechQueenCenter); - } - - NPC.reflectsProjectiles = false; - - // Despawn - if (Main.player[NPC.target].dead) - { - NPC.velocity.Y -= 0.04f; - if (NPC.timeLeft > 10) - { - NPC.timeLeft = 10; - return; - } - } - - else if (NPC.ai[0] == 0f) - { - if (NPC.ai[1] == 0f) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float maxVelocity = 8.5f; - float acceleration = 0.12f; - maxVelocity += 4.5f * enrageScale; - acceleration += 0.06f * enrageScale; - - if (death) - { - maxVelocity += phase1MaxSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - } - - if (Main.getGoodWorld) - { - maxVelocity *= 1.15f; - acceleration *= 1.15f; - } - - // Foveanator stays further away from the player than Retinazer (Retinazer distance is 300, Foveanator distance is 450) - float distanceFromTarget = 450f; - Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction - Vector2.UnitY * distanceFromTarget; - float distanceFromDestination = (destination - NPC.Center).Length(); - Vector2 idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitX * direction); - - if (NPC.IsMechQueenUp) - { - maxVelocity = 14f; - - destination = mechQueenSpacing; - distanceFromDestination = (destination - NPC.Center).Length(); - idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitY); - - if (distanceFromDestination > maxVelocity) - idealVelocity *= maxVelocity / distanceFromDestination; - - float inertia = 60f; - NPC.velocity = (NPC.velocity * (inertia - 1f) + idealVelocity) / inertia; - } - else - NPC.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); - - // Foveanator stays in this phase longer than Retinazer (Foveanator time is 450, Retinazer time is 300) - // Foveanator has longer cooldown between firing projectiles than Retinazer (Foveanator cooldown is 60, Retinazer cooldown is 30) - float phaseGateValue = 450f - (death ? phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - float laserGateValue = 60f; - if (NPC.IsMechQueenUp) - { - phaseGateValue = 1350f; - laserGateValue = ((!NPC.npcsFoundForCheckActive[NPCID.TheDestroyerBody]) ? 120f : 180f); - } - - NPC.ai[2] += 1f; - if (NPC.ai[2] >= phaseGateValue) - { - NPC.ai[1] = 1f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - - CalamityUtils.CalamityTargeting(NPC, default); - - NPC.netUpdate = true; - } - else if (distanceFromDestination < (death ? 960f : 800f)) - { - if (!Main.player[NPC.target].dead) - { - NPC.ai[3] += 1f; - if (Main.getGoodWorld) - NPC.ai[3] += 0.5f; - } - - if (NPC.ai[3] >= laserGateValue) - { - NPC.ai[3] = 0f; - - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - float laserSpeed = 6f + 1.5f * enrageScale; - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Vector2 laserVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 60f, laserVelocity, type, damage, 0f, Main.myPlayer); - } - } - } - } - else if (NPC.ai[1] == 1f) - { - // Set damage - NPC.damage = NPC.defDamage; - - NPC.rotation = hoverRotation; - - float chargeSpeed = 4f; - chargeSpeed += 1f * enrageScale; - if (death) - chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) - chargeSpeed += 1f; - - NPC.velocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; - - NPC.ai[1] = 2f; - } - else if (NPC.ai[1] == 2f) - { - // Set damage - NPC.damage = NPC.defDamage; - - NPC.ai[2] += 1f; - float decelerateGateValue = 72f + (death ? 12f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - if (NPC.ai[2] >= decelerateGateValue) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float decelerationMultiplier = 0.8f - (death ? 0.2f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - NPC.velocity *= decelerationMultiplier; - - if (Math.Abs(NPC.velocity.X) < 0.1) - NPC.velocity.X = 0f; - if (Math.Abs(NPC.velocity.Y) < 0.1) - NPC.velocity.Y = 0f; - } - else - { - // Accelerative charge - float maxVelocity = 24f; - maxVelocity += 6f * enrageScale; - if (death) - maxVelocity += (phase1MaxChargeSpeedIncrease * 6f) * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) - maxVelocity += 6f; - - if (NPC.velocity.Length() < maxVelocity) - { - NPC.velocity *= 1.04f; - if (NPC.velocity.Length() > maxVelocity) - { - NPC.velocity.Normalize(); - NPC.velocity *= maxVelocity; - } - } - - NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2; - } - - float delayBeforeChargingAgain = 96f - (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - if (NPC.ai[2] >= delayBeforeChargingAgain) - { - NPC.ai[3] += 1f; - NPC.ai[2] = 0f; - - NPC.rotation = hoverRotation; - - float totalCharges = death ? 3f : 2f; - if (NPC.ai[3] >= totalCharges) - { - NPC.ai[1] = 0f; - NPC.ai[3] = 0f; - - CalamityUtils.CalamityTargeting(NPC, default); - } - else - NPC.ai[1] = 1f; - } - } - - // Enter phase 2 - if (phase2) - { - NPC.ai[0] = 1f; - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - - CalamityUtils.CalamityTargeting(NPC, default); - - NPC.netUpdate = true; - } - } - - else if (NPC.ai[0] == 1f || NPC.ai[0] == 2f) - { - // Avoid cheap bullshit - NPC.damage = 0; - - if (NPC.IsMechQueenUp) - NPC.reflectsProjectiles = true; - - if (NPC.ai[0] == 1f) - { - NPC.ai[2] += 0.005f; - if (NPC.ai[2] > 0.5f) - NPC.ai[2] = 0.5f; - } - else - { - NPC.ai[2] -= 0.005f; - if (NPC.ai[2] < 0f) - NPC.ai[2] = 0f; - } - - NPC.rotation += NPC.ai[2]; - - NPC.ai[1] += 1f; - if (NPC.ai[2] >= 0.2f) - { - if (NPC.ai[1] % 10f == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - bool shootLaser = NPC.ai[1] % 20f == 0f; - - int type = shootLaser ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - float projectileSpeed = shootLaser ? (6f + 1.5f * enrageScale) : 16f; - float ai0 = shootLaser ? 0f : (death ? 1f : 0f); - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; - int numProj = shootLaser ? 4 : 2; - int spread = shootLaser ? 15 : 30; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 60f, perturbedSpeed, type, damage, 0f, Main.myPlayer, ai0); - } - } - } - } - - if (NPC.ai[1] == 100f) - { - NPC.ai[0] += 1f; - NPC.ai[1] = 0f; - if (NPC.ai[0] == 3f) - { - NPC.ai[2] = 0f; - } - else - { - SoundEngine.PlaySound(SoundID.NPCHit1, NPC.Center); - - if (!Main.dedServ) - { - for (int i = 0; i < 2; i++) - { - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), Mod.Find("Foveanator1").Type, NPC.scale); - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 7, NPC.scale); - Gore.NewGore(NPC.GetSource_FromAI(), NPC.position, new Vector2(Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f), 6, NPC.scale); - } - } - - for (int j = 0; j < 20; j++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - } - } - - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, Main.rand.Next(-30, 31) * 0.2f, Main.rand.Next(-30, 31) * 0.2f, 0, default, 1f); - - NPC.velocity *= 0.98f; - if (Math.Abs(NPC.velocity.X) < 0.1) - NPC.velocity.X = 0f; - if (Math.Abs(NPC.velocity.Y) < 0.1) - NPC.velocity.Y = 0f; - } - else - { - // If in phase 2 but Spaz or Ret aren't - bool spazOrRetInPhase1 = false; - if (CalamityGlobalNPC.fireEye != -1) - { - if (Main.npc[CalamityGlobalNPC.fireEye].active) - spazOrRetInPhase1 = Main.npc[CalamityGlobalNPC.fireEye].ai[0] == 1f || Main.npc[CalamityGlobalNPC.fireEye].ai[0] == 2f || Main.npc[CalamityGlobalNPC.fireEye].ai[0] == 0f; - } - if (CalamityGlobalNPC.laserEye != -1) - { - if (Main.npc[CalamityGlobalNPC.laserEye].active) - spazOrRetInPhase1 = Main.npc[CalamityGlobalNPC.laserEye].ai[0] == 1f || Main.npc[CalamityGlobalNPC.laserEye].ai[0] == 2f || Main.npc[CalamityGlobalNPC.laserEye].ai[0] == 0f; - } - - NPC.chaseable = !spazOrRetInPhase1; - - int setDamage = (int)Math.Round(NPC.defDamage * 1.5); - NPC.defense = NPC.defDefense + 14; - calamityGlobalNPC.DR = spazOrRetInPhase1 ? 0.9999f : 0.2f; - calamityGlobalNPC.unbreakableDR = spazOrRetInPhase1; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = spazOrRetInPhase1; - - NPC.HitSound = SoundID.NPCHit4; - - if (NPC.ai[1] == 0f) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float maxVelocity = 4f + (death ? 1.2f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.06f + (death ? 0.02f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 2f * enrageScale; - acceleration += 0.04f * enrageScale; - - float distanceFromTarget = 360f; - Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction; - float distanceFromDestination = (destination - NPC.Center).Length(); - Vector2 idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitX * direction); - - if (!NPC.IsMechQueenUp) - { - // Boost speed if too far from target - if (distanceFromDestination > distanceFromTarget) - maxVelocity += MathHelper.Lerp(0f, 12f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); - - if (Main.getGoodWorld) - { - maxVelocity *= 1.15f; - acceleration *= 1.15f; - } - - NPC.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); - } - - // Fire flamethrower for x seconds - NPC.ai[2] += (retAlive && spazAlive) ? 1f : 2f; - float phaseGateValue = NPC.IsMechQueenUp ? 1350f : 360f - (death ? 90f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - if (NPC.ai[2] >= phaseGateValue) - { - // Go to charge phase or fire large barrage of lasers and energy bombs if in final phase - NPC.ai[1] = finalPhase ? 3f : 1f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - NPC.netUpdate = true; - } - - // Fire fireballs and flamethrower - else if (Collision.CanHit(NPC.position, NPC.width, NPC.height, Main.player[NPC.target].position, Main.player[NPC.target].width, Main.player[NPC.target].height)) - { - // Play flame sound on timer - NPC.localAI[2] += 1f; - if (NPC.localAI[2] > 22f) - { - NPC.localAI[2] = 0f; - SoundEngine.PlaySound(SoundID.Item34, NPC.Center); - } - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[1] += 1f; - if (NPC.localAI[1] > 4f) - { - NPC.localAI[1] = 0f; - - float foveanatorFlamethrowerSpeed = 4f + 2f * enrageScale; - float timeForFlamethrowerToReachMaxVelocity = (retAlive && spazAlive) ? 120f : 60f; - float flamethrowerSpeedScalar = MathHelper.Clamp(NPC.ai[2] / timeForFlamethrowerToReachMaxVelocity, 0f, 1f); - foveanatorFlamethrowerSpeed = MathHelper.Lerp(0.1f, foveanatorFlamethrowerSpeed, flamethrowerSpeedScalar); - - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Vector2 flamethrowerVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * foveanatorFlamethrowerSpeed + NPC.velocity * 0.5f; - - if (NPC.IsMechQueenUp) - flamethrowerVelocity = (NPC.rotation + MathHelper.PiOver2).ToRotationVector2() * foveanatorFlamethrowerSpeed + NPC.velocity * 0.5f; - - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 100f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); - } - } - } - - if (NPC.IsMechQueenUp) - { - maxVelocity = 14f; - - destination = mechQueenSpacing; - distanceFromDestination = (destination - NPC.Center).Length(); - idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitY); - - if (distanceFromDestination > maxVelocity) - idealVelocity *= maxVelocity / distanceFromDestination; - - float inertia = 60f; - NPC.velocity = (NPC.velocity * (inertia - 1f) + idealVelocity) / inertia; - } - } - - // Charge - else if (NPC.ai[1] == 1f) - { - // Set damage - NPC.damage = setDamage; - - // Play charge sound - // TODO - Make this a jet turbine sound or something - //SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Set rotation and velocity - NPC.rotation = hoverRotation; - - float chargeSpeed = 4.5f + (death ? 1.25f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 4f * enrageScale; - if (Main.getGoodWorld) - chargeSpeed *= 1.2f; - - NPC.velocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; - - NPC.ai[1] = 2f; - } - - // Maintain charge velocity until deceleration - else if (NPC.ai[1] == 2f) - { - // Set damage - NPC.damage = setDamage; - - NPC.ai[2] += 1f; - - float chargeTime = 60f - (death ? 20f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - - // Slow down - if (NPC.ai[2] >= chargeTime) - { - // Avoid cheap bullshit - NPC.damage = 0; - - float deceleration = 0.8f - (death ? 0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - NPC.velocity *= deceleration; - - if (Math.Abs(NPC.velocity.X) < 0.1) - NPC.velocity.X = 0f; - if (Math.Abs(NPC.velocity.Y) < 0.1) - NPC.velocity.Y = 0f; - } - else - { - // Accelerative charge - float maxVelocity = 27f; - maxVelocity += 6f * enrageScale; - if (death) - maxVelocity += 7.5f * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) - maxVelocity *= 1.2f; - - // Spawn Energy Bombs along the way - float energyBombFireRate = 8f; - if (NPC.ai[2] % energyBombFireRate == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.velocity.SafeNormalize(Vector2.UnitY) * 60f, Vector2.Zero, type, damage, 0f, Main.myPlayer, death ? 2f : 1f); - } - } - - if (NPC.velocity.Length() < maxVelocity) - { - NPC.velocity *= 1.06f; - if (NPC.velocity.Length() > maxVelocity) - { - NPC.velocity.Normalize(); - NPC.velocity *= maxVelocity; - } - } - - NPC.rotation = NPC.velocity.ToRotation() - MathHelper.PiOver2; - } - - // Charge 2 times - if (NPC.ai[2] >= chargeTime * 1.3f) - { - NPC.ai[3] += 1f; - NPC.ai[2] = 0f; - - NPC.rotation = hoverRotation; - - float maxCharges = 2f; - if (NPC.ai[3] >= maxCharges) - { - NPC.ai[1] = 0f; - NPC.ai[3] = 0f; - } - else - NPC.ai[1] = 1f; - } - } - - // Laser and energy bomb barrage - else if (NPC.ai[1] == 3f) - { - float maxVelocity = 12f + (death ? 2.4f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.16f + (death ? 0.32f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 6f * enrageScale; - acceleration += 0.08f * enrageScale; - - if (Main.getGoodWorld) - { - maxVelocity *= 1.15f; - acceleration *= 1.15f; - } - - float distanceFromTarget = 640f; - Vector2 destination = Main.player[NPC.target].Center + Vector2.UnitX * distanceFromTarget * direction; - float distanceFromDestination = (destination - NPC.Center).Length(); - Vector2 idealVelocity = (destination - NPC.Center).SafeNormalize(Vector2.UnitX * direction); - - bool gettingIntoPosition = NPC.ai[2] == 0f; - if (NPC.Distance(Main.player[NPC.target].Center) < distanceFromTarget && gettingIntoPosition) - { - NPC.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); - } - else - { - NPC.SimpleFlyMovement(idealVelocity * maxVelocity * 0.5f, acceleration * 0.5f); - - // Fire 2 spreads (3 in Death Mode) of energy bombs and lasers - int totalSpreads = death ? 6 : 4; - - // Fire rates - float laserBarrageFireRate = 45f; - float energyBombFireRate = 90f; - - NPC.ai[2] += 1f; - - // Energy bombs - if (NPC.ai[2] % energyBombFireRate == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * 16f; - int numProj = 3; - int spread = 30; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 60f, perturbedSpeed, type, damage, 0f, Main.myPlayer, death ? 1f : 0f); - } - } - - NPC.ai[3] += 1f; - } - - else if (NPC.ai[2] % laserBarrageFireRate == 0f) - { - SoundEngine.PlaySound(AstrumDeusHead.LaserSound, NPC.Center); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - float projectileSpeed = 8f + 2f * enrageScale; - Vector2 projectileVelocity = (Main.player[NPC.target].Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; - int numProj = 4; - int spread = 40; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 60f, perturbedSpeed, type, damage, 0f, Main.myPlayer); - } - } - - NPC.ai[3] += 1f; - } - - // Charge - if (NPC.ai[3] >= totalSpreads) - { - NPC.ai[1] = 1f; - NPC.ai[2] = 0f; - NPC.ai[3] = 0f; - NPC.netUpdate = true; - } - } - } - } - } - - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; - - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) - { - NPC.lifeMax = (int)(NPC.lifeMax * 0.75f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - spriteBatch.Draw(TextureAssets.Npc[Type].Value, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0f); - - Texture2D glowTexture = GlowTexture.Value; - spriteBatch.Draw(glowTexture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, Color.White, NPC.rotation, NPC.frame.Size() / 2, NPC.scale, spriteEffects, 0f); - - return false; - } - - public override void HitEffect(NPC.HitInfo hit) - { - if (NPC.life > 0) - { - for (int i = 0; (double)i < hit.Damage / (double)NPC.lifeMax * 100D; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, hit.HitDirection, -1f); - - return; - } - - for (int i = 0; i < 150; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 2 * hit.HitDirection, -2f); - - if (!Main.dedServ) - { - for (int i = 0; i < 2; i++) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 2, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 7, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), 9, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, new Vector2((float)Main.rand.Next(-30, 31) * 0.2f, (float)Main.rand.Next(-30, 31) * 0.2f), Mod.Find("Foveanator2").Type, NPC.scale); - } - } - - for (int i = 0; i < 10; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, 31, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].velocity *= 1.4f; - } - - for (int i = 0; i < 5; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, 0f, 0f, 100, default, 2.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 5f; - dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, 6, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].velocity *= 3f; - } - - if (!Main.dedServ) - { - int gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y -= 1f; - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default, Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y -= 1f; - } - } - } -} diff --git a/NPCs/NormalNPCs/Foveanator.png b/NPCs/NormalNPCs/Foveanator.png deleted file mode 100644 index 67291fe4aa..0000000000 Binary files a/NPCs/NormalNPCs/Foveanator.png and /dev/null differ diff --git a/NPCs/NormalNPCs/FoveanatorGlow.png b/NPCs/NormalNPCs/FoveanatorGlow.png deleted file mode 100644 index d8b3325658..0000000000 Binary files a/NPCs/NormalNPCs/FoveanatorGlow.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Foveanator_Head_Boss.png b/NPCs/NormalNPCs/Foveanator_Head_Boss.png deleted file mode 100644 index 7c93efb49e..0000000000 Binary files a/NPCs/NormalNPCs/Foveanator_Head_Boss.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss.png b/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss.png deleted file mode 100644 index 6a6b7c7532..0000000000 Binary files a/NPCs/NormalNPCs/Foveanator_Phase2_Head_Boss.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Frogfish.cs b/NPCs/NormalNPCs/Frogfish.cs index 3c4fe4c6f8..0e64c5dc05 100644 --- a/NPCs/NormalNPCs/Frogfish.cs +++ b/NPCs/NormalNPCs/Frogfish.cs @@ -1,6 +1,5 @@ using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Potions; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -26,7 +25,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 100; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.5f; @@ -37,10 +36,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Horse.cs b/NPCs/NormalNPCs/Horse.cs index 23da274c57..6c6806ec9b 100644 --- a/NPCs/NormalNPCs/Horse.cs +++ b/NPCs/NormalNPCs/Horse.cs @@ -40,12 +40,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 230; NPC.height = 230; NPC.defense = 20; - NPC.DR_NERD(0.1f); NPC.lifeMax = 3800; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0.05f; - NPC.value = Item.buyPrice(0, 1, 50, 0); + NPC.value = Item.buyPrice(gold: 1, silver: 50); NPC.dontTakeDamage = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -55,10 +54,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/IceClasper.cs b/NPCs/NormalNPCs/IceClasper.cs index dd5b9c3d62..737450557d 100644 --- a/NPCs/NormalNPCs/IceClasper.cs +++ b/NPCs/NormalNPCs/IceClasper.cs @@ -81,12 +81,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 50; NPC.height = 50; NPC.defense = 12; - NPC.lifeMax = 750; + NPC.lifeMax = 500; NPC.knockBackResist = 0.25f; NPC.noTileCollide = true; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.rarity = 2; @@ -96,10 +96,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/ImpiousImmolator.cs b/NPCs/NormalNPCs/ImpiousImmolator.cs index 923a6e30ad..0cf4327328 100644 --- a/NPCs/NormalNPCs/ImpiousImmolator.cs +++ b/NPCs/NormalNPCs/ImpiousImmolator.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 3000; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.HitSound = SoundID.NPCHit5; NPC.DeathSound = SoundID.NPCDeath7; NPC.knockBackResist = 0.2f; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs b/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs index 18b6c3c052..0379b92424 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelEmerald.cs @@ -36,7 +36,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); + NPC.damage = 24; // 72 (Death exlusive) NPC.width = 32; NPC.height = 32; NPC.defense = 15; diff --git a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs index 4e3236cde9..78e7fd1c13 100644 --- a/NPCs/NormalNPCs/KingSlimeJewelRuby.cs +++ b/NPCs/NormalNPCs/KingSlimeJewelRuby.cs @@ -25,9 +25,10 @@ namespace CalamityMod.NPCs.NormalNPCs private const int BoltShootGateValue = 60; private const int BoltShootGateValue_Death = 75; - private const int BoltShootGateValue_BossRush = 45; private const float LightTelegraphDuration = 45f; + public static int JewelBoltDamage = 10; // 40 + public override void SetStaticDefaults() { NPCID.Sets.NeedsExpertScaling[Type] = true; @@ -39,7 +40,7 @@ namespace CalamityMod.NPCs.NormalNPCs { NPC.aiStyle = -1; AIType = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; NPC.width = 32; NPC.height = 32; NPC.defense = 10; @@ -55,8 +56,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Despawn if (!CalamityPlayer.areThereAnyDamnBosses) @@ -126,7 +126,7 @@ namespace CalamityMod.NPCs.NormalNPCs // Fire projectiles NPC.ai[0] += 1f; - if (NPC.ai[0] >= (bossRush ? BoltShootGateValue_BossRush : death ? BoltShootGateValue_Death : BoltShootGateValue)) + if (NPC.ai[0] >= (death ? BoltShootGateValue_Death : BoltShootGateValue)) { NPC.ai[0] = 0f; @@ -153,7 +153,6 @@ namespace CalamityMod.NPCs.NormalNPCs if (Main.netMode != NetmodeID.MultiplayerClient) { - int damage = NPC.GetProjectileDamage(type); if (death) { int numProj = 4; @@ -161,11 +160,11 @@ namespace CalamityMod.NPCs.NormalNPCs for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projVector.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, perturbedSpeed, type, JewelBoltDamage, 0f, Main.myPlayer); } } else - Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, projVector, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), npcPos, projVector, type, JewelBoltDamage, 0f, Main.myPlayer); } NPC.netUpdate = true; @@ -194,7 +193,7 @@ namespace CalamityMod.NPCs.NormalNPCs float alph = 0f; - float colorTelegraphGateValue = (BossRushEvent.BossRushActive ? BoltShootGateValue_BossRush : (CalamityWorld.death ? BoltShootGateValue_Death : BoltShootGateValue)) - LightTelegraphDuration; + float colorTelegraphGateValue = (CalamityWorld.death ? BoltShootGateValue_Death : BoltShootGateValue) - LightTelegraphDuration; if (NPC.ai[0] > colorTelegraphGateValue) alph = MathHelper.Lerp(0f, 1f, (NPC.ai[0] - colorTelegraphGateValue) / LightTelegraphDuration); diff --git a/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs b/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs index 38cd0a6c25..3ec2597317 100644 --- a/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs +++ b/NPCs/NormalNPCs/LavaSlimeNoLavaDrop.cs @@ -44,10 +44,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/MantisShrimp.cs b/NPCs/NormalNPCs/MantisShrimp.cs index 0bd649cac1..6d8f03f37b 100644 --- a/NPCs/NormalNPCs/MantisShrimp.cs +++ b/NPCs/NormalNPCs/MantisShrimp.cs @@ -29,11 +29,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 24; NPC.defense = 10; - NPC.DR_NERD(0.1f); - NPC.lifeMax = 50; + NPC.lifeMax = 60; NPC.aiStyle = NPCAIStyleID.Fighter; AIType = NPCID.Crab; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; @@ -42,10 +41,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/OverloadedSoldier.cs b/NPCs/NormalNPCs/OverloadedSoldier.cs index 1419f7e2b8..7c121bb4a4 100644 --- a/NPCs/NormalNPCs/OverloadedSoldier.cs +++ b/NPCs/NormalNPCs/OverloadedSoldier.cs @@ -29,20 +29,15 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 18; NPC.height = 40; NPC.defense = 18; - NPC.DR_NERD(0.15f); - NPC.lifeMax = NPC.downedMoonlord ? 1700 : 170; + NPC.lifeMax = NPC.downedMoonlord ? 3000 : 300; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit2; NPC.DeathSound = SoundID.NPCDeath2; Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PerennialSlime.cs b/NPCs/NormalNPCs/PerennialSlime.cs index eb62be6480..623c3f6f76 100644 --- a/NPCs/NormalNPCs/PerennialSlime.cs +++ b/NPCs/NormalNPCs/PerennialSlime.cs @@ -22,11 +22,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 35; NPC.width = 40; NPC.height = 30; - NPC.defense = 12; - NPC.lifeMax = 225; + NPC.defense = 20; + NPC.lifeMax = 360; NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.alpha = 50; NPC.lavaImmune = false; NPC.noGravity = false; @@ -37,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PhantomSpirit.cs b/NPCs/NormalNPCs/PhantomSpirit.cs index 1f94654c10..1d05b99e30 100644 --- a/NPCs/NormalNPCs/PhantomSpirit.cs +++ b/NPCs/NormalNPCs/PhantomSpirit.cs @@ -1,7 +1,6 @@ using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -23,12 +22,12 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 70; NPC.width = 16; NPC.height = 16; - NPC.defense = 10; - NPC.lifeMax = 1250; + NPC.defense = 40; + NPC.lifeMax = 1500; NPC.knockBackResist = 0.2f; AnimationType = NPCID.DungeonSpirit; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; @@ -36,10 +35,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PhantomSpiritL.cs b/NPCs/NormalNPCs/PhantomSpiritL.cs index 2f7849b747..f533643661 100644 --- a/NPCs/NormalNPCs/PhantomSpiritL.cs +++ b/NPCs/NormalNPCs/PhantomSpiritL.cs @@ -3,7 +3,6 @@ using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -23,18 +22,20 @@ namespace CalamityMod.NPCs.NormalNPCs Main.npcFrameCount[Type] = 5; } + public static int ShotDamage = 60; // 240 + public override void SetDefaults() { + NPC.damage = 100; // 200 NPC.aiStyle = -1; - NPC.damage = 100; NPC.width = 32; NPC.height = 80; NPC.scale *= 1.2f; - NPC.defense = 30; - NPC.lifeMax = 3750; + NPC.defense = 60; + NPC.lifeMax = 3500; NPC.knockBackResist = 0.1f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 60, 0); + NPC.value = Item.buyPrice(silver: 60); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; @@ -42,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = ModContent.NPCType(); BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -88,11 +85,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.ai[2] = 0f; float projSpeed = 10f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); targetDistance = projSpeed / targetDistance; targetXDist *= targetDistance; targetYDist *= targetDistance; - Projectile.NewProjectile(NPC.GetSource_FromAI(), spiritPosition.X, spiritPosition.Y, targetXDist, targetYDist, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spiritPosition.X, spiritPosition.Y, targetXDist, targetYDist, type, ShotDamage, 0f, Main.myPlayer, 0f, 0f); } } diff --git a/NPCs/NormalNPCs/PhantomSpiritM.cs b/NPCs/NormalNPCs/PhantomSpiritM.cs index 5d35236eba..e36da27bba 100644 --- a/NPCs/NormalNPCs/PhantomSpiritM.cs +++ b/NPCs/NormalNPCs/PhantomSpiritM.cs @@ -1,7 +1,6 @@ using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -26,11 +25,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 32; NPC.height = 80; NPC.scale *= 1.1f; - NPC.defense = 25; + NPC.defense = 50; NPC.lifeMax = 2500; NPC.knockBackResist = 0.15f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 40, 0); + NPC.value = Item.buyPrice(silver: 40); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; @@ -38,10 +37,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = ModContent.NPCType(); BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/PhantomSpiritS.cs b/NPCs/NormalNPCs/PhantomSpiritS.cs index 9608b72321..75b6ca3667 100644 --- a/NPCs/NormalNPCs/PhantomSpiritS.cs +++ b/NPCs/NormalNPCs/PhantomSpiritS.cs @@ -1,7 +1,6 @@ using CalamityMod.Dusts; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -25,11 +24,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.damage = 80; NPC.width = 32; NPC.height = 80; - NPC.defense = 20; - NPC.lifeMax = 1875; + NPC.defense = 45; + NPC.lifeMax = 2000; NPC.knockBackResist = 0.2f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 30, 0); + NPC.value = Item.buyPrice(silver: 30); NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.noGravity = true; @@ -37,10 +36,6 @@ namespace CalamityMod.NPCs.NormalNPCs Banner = ModContent.NPCType(); BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Piggy.cs b/NPCs/NormalNPCs/Piggy.cs index 4b2106e519..9782a5d91d 100644 --- a/NPCs/NormalNPCs/Piggy.cs +++ b/NPCs/NormalNPCs/Piggy.cs @@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.aiStyle = NPCAIStyleID.Passive; AIType = NPCID.Squirrel; NPC.knockBackResist = 0.99f; - NPC.value = Item.buyPrice(0, 2, 0, 0); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; Banner = NPC.type; diff --git a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs index d766fc1f04..0ab71a7709 100644 --- a/NPCs/NormalNPCs/PlanterasFreeTentacle.cs +++ b/NPCs/NormalNPCs/PlanterasFreeTentacle.cs @@ -28,11 +28,9 @@ namespace CalamityMod.NPCs.NormalNPCs public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 60; NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); - NPC.DR_NERD(0.1f); NPC.width = 24; NPC.height = 24; NPC.defense = 20; @@ -45,10 +43,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) @@ -81,7 +75,7 @@ namespace CalamityMod.NPCs.NormalNPCs bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { if (Main.rand.NextBool(5)) NPC.reflectsProjectiles = true; @@ -135,7 +129,7 @@ namespace CalamityMod.NPCs.NormalNPCs Vector2 idealVelocity = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (death ? 7f : 5.5f); float acceleration = death ? 0.14f : 0.105f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { idealVelocity *= 1.2f; acceleration *= 1.4f; @@ -190,13 +184,7 @@ namespace CalamityMod.NPCs.NormalNPCs public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * balance); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(BuffID.Poisoned, 180); + NPC.damage = (int)(NPC.damage * 1.15f); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/NormalNPCs/ProfanedEnergyBody.cs b/NPCs/NormalNPCs/ProfanedEnergyBody.cs index 31fd92aaa5..2942860f46 100644 --- a/NPCs/NormalNPCs/ProfanedEnergyBody.cs +++ b/NPCs/NormalNPCs/ProfanedEnergyBody.cs @@ -31,11 +31,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 72; NPC.height = 36; NPC.defense = 50; - NPC.DR_NERD(0.1f); NPC.lifeMax = 2500; NPC.knockBackResist = 0f; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 50, 0); + NPC.value = Item.buyPrice(silver: 50); NPC.lavaImmune = true; NPC.noGravity = true; NPC.HitSound = SoundID.NPCHit52; @@ -46,10 +45,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Rimehound.cs b/NPCs/NormalNPCs/Rimehound.cs index 4fb5748983..b3e68cefb3 100644 --- a/NPCs/NormalNPCs/Rimehound.cs +++ b/NPCs/NormalNPCs/Rimehound.cs @@ -1,7 +1,6 @@ using System.IO; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.World; using Terraria; using Terraria.Audio; @@ -38,17 +37,17 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 56; NPC.height = 56; NPC.defense = 4; - NPC.lifeMax = 65; + NPC.lifeMax = 80; if (DownedBossSystem.downedCryogen) { NPC.damage = 60; NPC.defense = 10; - NPC.lifeMax = 1250; + NPC.lifeMax = 600; } NPC.knockBackResist = 0.3f; AnimationType = NPCID.Hellhound; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = HitSound; NPC.DeathSound = SoundID.NPCDeath5; Banner = NPC.type; @@ -57,10 +56,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = false; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Rotdog.cs b/NPCs/NormalNPCs/Rotdog.cs index 71a8eab684..fb733e8c7c 100644 --- a/NPCs/NormalNPCs/Rotdog.cs +++ b/NPCs/NormalNPCs/Rotdog.cs @@ -27,7 +27,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 75; NPC.knockBackResist = 0.3f; AIType = NPCID.Wolf; - NPC.value = Item.buyPrice(0, 0, 1, 50); + NPC.value = Item.buyPrice(silver: 1, copper: 50); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath5; Banner = NPC.type; @@ -35,10 +35,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/ScornEater.cs b/NPCs/NormalNPCs/ScornEater.cs index 343fafa2b4..2891aa5e74 100644 --- a/NPCs/NormalNPCs/ScornEater.cs +++ b/NPCs/NormalNPCs/ScornEater.cs @@ -40,12 +40,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 160; NPC.height = 160; NPC.defense = 38; - NPC.DR_NERD(0.05f); NPC.lifeMax = 9000; - NPC.knockBackResist = 0.1f; + NPC.knockBackResist = 0f; AIType = -1; NPC.lavaImmune = true; - NPC.value = Item.buyPrice(0, 0, 75, 0); + NPC.value = Item.buyPrice(silver: 75); NPC.DeathSound = DeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); @@ -53,10 +52,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -79,8 +74,6 @@ namespace CalamityMod.NPCs.NormalNPCs if (NPC.velocity.Y == 0f) { - NPC.knockBackResist = 0f; - // Avoid cheap bullshit NPC.damage = 0; @@ -141,8 +134,6 @@ namespace CalamityMod.NPCs.NormalNPCs } else { - NPC.knockBackResist = 0.1f; - if (NPC.direction == 1 && NPC.velocity.X < 1f) { NPC.velocity.X += 0.1f; diff --git a/NPCs/NormalNPCs/ShockstormShuttle.cs b/NPCs/NormalNPCs/ShockstormShuttle.cs index c41c3b21dc..fc28052dc9 100644 --- a/NPCs/NormalNPCs/ShockstormShuttle.cs +++ b/NPCs/NormalNPCs/ShockstormShuttle.cs @@ -4,6 +4,7 @@ using CalamityMod.Items.Accessories.Vanity; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Placeables.Ores; +using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.Bestiary; @@ -28,12 +29,11 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 64; NPC.height = 38; NPC.defense = 15; - NPC.DR_NERD(0.15f); - NPC.lifeMax = 190; + NPC.lifeMax = 250; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; NPC.noGravity = true; @@ -42,10 +42,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -89,8 +85,8 @@ namespace CalamityMod.NPCs.NormalNPCs npcPos.X += velocity.X; npcPos.Y += velocity.Y; - int spread = Main.getGoodWorld ? 100 : 20; - for (int i = 0; i < (Main.getGoodWorld ? 10 : 2); i++) + int spread = CalamityWorld.LegendaryMode ? 100 : 20; + for (int i = 0; i < (CalamityWorld.LegendaryMode ? 10 : 2); i++) { velocity = Main.player[NPC.target].Center - npcPos; targetDist = velocity.Length(); @@ -408,7 +404,7 @@ namespace CalamityMod.NPCs.NormalNPCs { return 0f; } - return SpawnCondition.Sky.Chance * (Main.getGoodWorld ? 0.5f : 0.1f); + return SpawnCondition.Sky.Chance * (CalamityWorld.LegendaryMode ? 0.5f : 0.1f); } public override void ModifyNPCLoot(NPCLoot npcLoot) diff --git a/NPCs/NormalNPCs/SkeletronPrime2.cs b/NPCs/NormalNPCs/SkeletronPrime2.cs deleted file mode 100644 index 76ea9c25c2..0000000000 --- a/NPCs/NormalNPCs/SkeletronPrime2.cs +++ /dev/null @@ -1,921 +0,0 @@ -using System; -using System.IO; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.DataStructures; -using CalamityMod.Events; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using ReLogic.Content; -using Terraria; -using Terraria.Audio; -using Terraria.Chat; -using Terraria.GameContent.Achievements; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.NPCs.NormalNPCs -{ - [AutoloadBossHead] - public class SkeletronPrime2 : ModNPC - { - public override string BossHeadTexture => $"Terraria/Images/NPC_Head_Boss_18"; - - public static Asset EyeTexture; - - public const int BombTimeLeft = 600; - - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 6; - NPCID.Sets.NPCBestiaryDrawModifiers bestiaryData = new NPCID.Sets.NPCBestiaryDrawModifiers() { Hide = true }; - NPCID.Sets.NPCBestiaryDrawOffset.Add(Type, bestiaryData); - if (!Main.dedServ) - { - EyeTexture = ModContent.Request("CalamityMod/ExtraTextures/SkeletronPrime2HeadGlow"); - } - } - - public override void SetDefaults() - { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.aiStyle = NPCAIStyleID.SkeletronPrimeHead; - NPC.GetNPCDamage(); - NPC.DR_NERD(0.2f); - - NPC.width = 80; - NPC.height = 102; - if (Main.tenthAnniversaryWorld) - NPC.scale *= 0.5f; - if (Main.getGoodWorld) - NPC.scale *= 1.1f; - - NPC.defense = 24; - NPC.lifeMax = 28000; - NPC.knockBackResist = 0f; - NPC.noGravity = true; - NPC.noTileCollide = true; - NPC.boss = true; - NPC.HitSound = SoundID.NPCHit4; - NPC.DeathSound = SoundID.NPCDeath14; - NPC.Calamity().VulnerableToElectricity = true; - NPC.Calamity().VulnerableToSickness = false; - AnimationType = NPCID.SkeletronPrime; - Music = MusicID.Boss3; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(NPC.localAI[0]); - writer.Write(NPC.localAI[1]); - writer.Write(NPC.localAI[2]); - writer.Write(NPC.localAI[3]); - for (int i = 0; i < 4; i++) - writer.Write(NPC.Calamity().newAI[i]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - NPC.localAI[0] = reader.ReadSingle(); - NPC.localAI[1] = reader.ReadSingle(); - NPC.localAI[2] = reader.ReadSingle(); - NPC.localAI[3] = reader.ReadSingle(); - for (int i = 0; i < 4; i++) - NPC.Calamity().newAI[i] = reader.ReadSingle(); - } - - public override void BossHeadRotation(ref float rotation) - { - rotation = (NPC.ai[1] == 1f || NPC.ai[1] == 2f) ? NPC.rotation : 0f; - } - - public override void AI() - { - CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - - // Percent life remaining - float lifeRatio = NPC.life / (float)NPC.lifeMax; - - // Spawn arms - if (calamityGlobalNPC.newAI[1] == 0f) - { - calamityGlobalNPC.newAI[1] = 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - // This head owns the Cannon and the Vice in Master Mode - int arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.PrimeCannon, NPC.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = NPC.whoAmI; - Main.npc[arm].target = NPC.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X, (int)NPC.Center.Y, NPCID.PrimeVice, NPC.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = NPC.whoAmI; - Main.npc[arm].target = NPC.target; - Main.npc[arm].ai[3] = 150f; - Main.npc[arm].netUpdate = true; - } - - NPC.SyncExtraAI(); - } - - if (!Main.npc[(int)NPC.ai[0]].active || Main.npc[(int)NPC.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) - { - NPC.life = 0; - NPC.HitEffect(); - NPC.active = false; - NPC.netUpdate = true; - } - else - { - // Set direction to the other head's direction - NPC.direction = Main.npc[(int)NPC.ai[0]].direction; - - // Link the HP of both heads - if (NPC.life > Main.npc[(int)NPC.ai[0]].life) - NPC.life = Main.npc[(int)NPC.ai[0]].life; - - // Push away from the lead head if too close, pull closer if too far, if Mechdusa isn't real - if (!NPC.IsMechQueenUp) - { - float pushVelocity = 0.25f; - if (Vector2.Distance(NPC.Center, Main.npc[(int)NPC.ai[0]].Center) < 80f * NPC.scale) - { - if (NPC.position.X < Main.npc[(int)NPC.ai[0]].position.X) - NPC.velocity.X -= pushVelocity; - else - NPC.velocity.X += pushVelocity; - - if (NPC.position.Y < Main.npc[(int)NPC.ai[0]].position.Y) - NPC.velocity.Y -= pushVelocity; - else - NPC.velocity.Y += pushVelocity; - } - else if (Vector2.Distance(NPC.Center, Main.npc[(int)NPC.ai[0]].Center) > 240f * NPC.scale) - { - if (NPC.position.X < Main.npc[(int)NPC.ai[0]].position.X) - NPC.velocity.X += pushVelocity; - else - NPC.velocity.X -= pushVelocity; - - if (NPC.position.Y < Main.npc[(int)NPC.ai[0]].position.Y) - NPC.velocity.Y += pushVelocity; - else - NPC.velocity.Y -= pushVelocity; - } - } - } - - // Check if arms are alive - bool cannonAlive = false; - bool laserAlive = false; - bool viceAlive = false; - bool sawAlive = false; - if (CalamityGlobalNPC.primeCannon != -1) - { - if (Main.npc[CalamityGlobalNPC.primeCannon].active) - cannonAlive = true; - } - if (CalamityGlobalNPC.primeLaser != -1) - { - if (Main.npc[CalamityGlobalNPC.primeLaser].active) - laserAlive = true; - } - if (CalamityGlobalNPC.primeVice != -1) - { - if (Main.npc[CalamityGlobalNPC.primeVice].active) - viceAlive = true; - } - if (CalamityGlobalNPC.primeSaw != -1) - { - if (Main.npc[CalamityGlobalNPC.primeSaw].active) - sawAlive = true; - } - bool allArmsDead = !cannonAlive && !laserAlive && !viceAlive && !sawAlive; - NPC.chaseable = allArmsDead; - - NPC.defense = NPC.defDefense; - - // Phases - bool phase2 = lifeRatio < 0.66f; - bool phase3 = lifeRatio < 0.33f; - bool spawnSpazmatism = lifeRatio < 0.5f && !bossRush && NPC.localAI[2] == 0f; - - // Spawn Spazmatism in Master Mode (just like Oblivion from Avalon) - if (spawnSpazmatism) - { - Player spazmatismSpawnPlayer = Main.player[Player.FindClosest(NPC.position, NPC.width, NPC.height)]; - SoundEngine.PlaySound(SoundID.Roar, spazmatismSpawnPlayer.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int spazmatism = NPC.NewNPC(NPC.GetBossSpawnSource(spazmatismSpawnPlayer.whoAmI), (int)spazmatismSpawnPlayer.Center.X, (int)spazmatismSpawnPlayer.Center.Y - 810, NPCID.Retinazer, 1); - if (spazmatism != Main.maxNPCs) - { - Main.npc[spazmatism].target = spazmatismSpawnPlayer.whoAmI; - Main.npc[spazmatism].timeLeft *= 20; - Main.npc[spazmatism].localAI[3] = 1f; - Main.npc[spazmatism].SyncVanillaLocalAI(); - string typeName = Main.npc[spazmatism].TypeName; - if (Main.dedServ && spazmatism < Main.maxNPCs) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, spazmatism); - - AchievementsHelper.CheckMechaMayhem(); - } - } - - NPC.localAI[2] = 1f; - NPC.SyncVanillaLocalAI(); - } - - // Despawn - if (Main.npc[(int)NPC.ai[0]].ai[1] == 3f) - NPC.ai[1] = 3f; - - // Activate daytime enrage - if (Main.IsItDay() && !bossRush && NPC.ai[1] != 3f && NPC.ai[1] != 2f) - { - // Heal - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int healAmt = NPC.life - 300; - if (healAmt < 0) - { - int absHeal = Math.Abs(healAmt); - NPC.life += absHeal; - NPC.HealEffect(absHeal, true); - NPC.netUpdate = true; - } - } - - NPC.ai[1] = 2f; - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - } - - // Adjust slowing debuff immunity - bool immuneToSlowingDebuffs = NPC.ai[1] == 5f; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; - - bool normalLaserRotation = NPC.localAI[1] % 2f == 0f; - - // Prevents cheap hits - bool canUseAttackInMaster = NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 350f; - - // Float near player - if (NPC.ai[1] == 0f || NPC.ai[1] == 4f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - // Start other phases; if arms are dead, start with spin phase - bool otherHeadChargingOrSpinning = Main.npc[(int)NPC.ai[0]].ai[1] == 5f || Main.npc[(int)NPC.ai[0]].ai[1] == 1f; - - // Start spin phase after 1.875 seconds - NPC.ai[2] += phase3 ? 1.2f : 0.8f; - if (NPC.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || phase3) && canUseAttackInMaster) - { - bool shouldSpinAround = NPC.ai[1] == 4f && NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - 320f && - Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) < 600f && Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 400f; - - bool shouldCharge = !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; - if (shouldCharge) - { - NPC.ai[2] = 0f; - NPC.ai[1] = 1f; - NPC.netUpdate = true; - } - else if (shouldSpinAround || NPC.ai[1] != 4f) - { - if (shouldSpinAround) - { - NPC.localAI[3] = 300f; - NPC.SyncVanillaLocalAI(); - } - - NPC.ai[2] = 0f; - NPC.ai[1] = shouldSpinAround ? 5f : 1f; - NPC.netUpdate = true; - } - } - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation = NPC.velocity.X / 15f; - - float acceleration = (bossRush ? 0.16f : 0.12f) + (death ? 0.05f * (1f - lifeRatio) : 0f); - float accelerationMult = 1f; - if (!cannonAlive) - { - acceleration += 0.0125f; - accelerationMult += 0.25f; - } - if (!laserAlive) - { - acceleration += 0.0125f; - accelerationMult += 0.25f; - } - if (!viceAlive) - acceleration += 0.0125f; - if (!sawAlive) - acceleration += 0.0125f; - acceleration *= accelerationMult; - - float topVelocity = acceleration * 100f; - float deceleration = 0.7f; - - float headDecelerationUpDist = 0f; - float headDecelerationDownDist = 0f; - float headDecelerationHorizontalDist = 0f; - int headHorizontalDirection = ((!(Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X < NPC.Center.X)) ? 1 : (-1)); - if (NPC.IsMechQueenUp) - { - headDecelerationHorizontalDist = -150f * (float)headHorizontalDirection; - headDecelerationUpDist = 50f; - headDecelerationDownDist = 50f; - } - - if (NPC.position.Y > Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - (320f + headDecelerationUpDist)) - { - if (NPC.velocity.Y > 0f) - NPC.velocity.Y *= deceleration; - - NPC.velocity.Y -= acceleration; - - if (NPC.velocity.Y > topVelocity) - NPC.velocity.Y = topVelocity; - } - else if (NPC.position.Y < Main.player[Main.npc[(int)NPC.ai[0]].target].position.Y - (360f + headDecelerationDownDist)) - { - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= deceleration; - - NPC.velocity.Y += acceleration; - - if (NPC.velocity.Y < -topVelocity) - NPC.velocity.Y = -topVelocity; - } - - if (NPC.Center.X > Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X + (400f + headDecelerationHorizontalDist)) - { - if (NPC.velocity.X > 0f) - NPC.velocity.X *= deceleration; - - NPC.velocity.X -= acceleration; - - if (NPC.velocity.X > topVelocity) - NPC.velocity.X = topVelocity; - } - if (NPC.Center.X < Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - (400f + headDecelerationHorizontalDist)) - { - if (NPC.velocity.X < 0f) - NPC.velocity.X *= deceleration; - - NPC.velocity.X += acceleration; - - if (NPC.velocity.X < -topVelocity) - NPC.velocity.X = -topVelocity; - } - } - - else - { - // Spinning - if (NPC.ai[1] == 1f) - { - NPC.defense *= 2; - NPC.damage = NPC.defDamage * 2; - - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; - - if (phase2 && Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= 60f) - { - NPC.localAI[0] = 0f; - - int totalProjectiles = bossRush ? 20 : death ? 12 : 10; - float radians = MathHelper.TwoPi / totalProjectiles; - int type = ProjectileID.FrostBeam; - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - float velocity = 4.5f; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 laserFireDirection = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 140f, laserFireDirection, type, damage, 0f, Main.myPlayer, 1f, 0f); - Main.projectile[proj].timeLeft = 600; - } - NPC.localAI[1] += 1f; - } - } - - NPC.ai[2] += 1f; - if (NPC.ai[2] == 2f) - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Spin for 3 seconds then return to floating phase - float phaseTimer = 240f; - if (phase2 && !phase3) - phaseTimer += 60f; - - if (NPC.ai[2] >= (phaseTimer - (death ? 60f * (1f - lifeRatio) : 0f))) - { - NPC.ai[2] = 0f; - NPC.ai[1] = 4f; - NPC.localAI[0] = 0f; - } - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation += NPC.direction * 0.3f; - - Vector2 headPosition = NPC.Center; - float headTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headPosition.X; - float headTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headPosition.Y; - float headTargetDistance = (float)Math.Sqrt(headTargetX * headTargetX + headTargetY * headTargetY); - - float speed = bossRush ? 12f : 8f; - if (phase2) - speed += 0.5f; - if (phase3) - speed += 0.5f; - - if (headTargetDistance > 150f) - { - float baseDistanceVelocityMult = 1f + MathHelper.Clamp((headTargetDistance - 150f) * 0.0015f, 0.05f, 1.5f); - speed *= baseDistanceVelocityMult; - } - - if (NPC.IsMechQueenUp) - { - float mechdusaSpeedMult = (NPC.npcsFoundForCheckActive[NPCID.TheDestroyerBody] ? 0.6f : 0.75f); - speed *= mechdusaSpeedMult; - } - - headTargetDistance = speed / headTargetDistance; - NPC.velocity.X = headTargetX * headTargetDistance; - NPC.velocity.Y = headTargetY * headTargetDistance; - - if (NPC.IsMechQueenUp) - { - float mechdusaAccelMult = Vector2.Distance(NPC.Center, Main.player[Main.npc[(int)NPC.ai[0]].target].Center); - if (mechdusaAccelMult < 0.1f) - mechdusaAccelMult = 0f; - - if (mechdusaAccelMult < speed) - NPC.velocity = NPC.velocity.SafeNormalize(Vector2.Zero) * mechdusaAccelMult; - } - } - - // Daytime enrage - if (NPC.ai[1] == 2f) - { - NPC.damage = 1000; - calamityGlobalNPC.DR = 0.9999f; - calamityGlobalNPC.unbreakableDR = true; - - calamityGlobalNPC.CurrentlyEnraged = true; - calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; - - if (NPC.IsMechQueenUp) - NPC.rotation = NPC.rotation.AngleLerp(NPC.velocity.X / 15f * 0.5f, 0.75f); - else - NPC.rotation += NPC.direction * 0.3f; - - Vector2 enragedHeadPosition = NPC.Center; - float enragedHeadTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - enragedHeadPosition.X; - float enragedHeadTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - enragedHeadPosition.Y; - float enragedHeadTargetDist = (float)Math.Sqrt(enragedHeadTargetX * enragedHeadTargetX + enragedHeadTargetY * enragedHeadTargetY); - - float enragedHeadSpeed = 10f; - enragedHeadSpeed += enragedHeadTargetDist / 100f; - if (enragedHeadSpeed < 8f) - enragedHeadSpeed = 8f; - if (enragedHeadSpeed > 32f) - enragedHeadSpeed = 32f; - - enragedHeadTargetDist = enragedHeadSpeed / enragedHeadTargetDist; - NPC.velocity.X = enragedHeadTargetX * enragedHeadTargetDist; - NPC.velocity.Y = enragedHeadTargetY * enragedHeadTargetDist; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - NPC.localAI[0] += 1f; - if (NPC.localAI[0] >= 60f) - { - NPC.localAI[0] = 0f; - Vector2 headCenter = NPC.Center; - if (Collision.CanHit(headCenter, 1, 1, Main.player[Main.npc[(int)NPC.ai[0]].target].position, Main.player[Main.npc[(int)NPC.ai[0]].target].width, Main.player[Main.npc[(int)NPC.ai[0]].target].height)) - { - enragedHeadSpeed = 7f; - float enragedHeadSkullTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headCenter.X + Main.rand.Next(-20, 21); - float enragedHeadSkullTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21); - float enragedHeadSkullTargetDist = (float)Math.Sqrt(enragedHeadSkullTargetX * enragedHeadSkullTargetX + enragedHeadSkullTargetY * enragedHeadSkullTargetY); - enragedHeadSkullTargetDist = enragedHeadSpeed / enragedHeadSkullTargetDist; - enragedHeadSkullTargetX *= enragedHeadSkullTargetDist; - enragedHeadSkullTargetY *= enragedHeadSkullTargetDist; - - Vector2 value = new Vector2(enragedHeadSkullTargetX * 1f + Main.rand.Next(-50, 51) * 0.01f, enragedHeadSkullTargetY * 1f + Main.rand.Next(-50, 51) * 0.01f).SafeNormalize(Vector2.UnitY); - value *= enragedHeadSpeed; - value += NPC.velocity; - enragedHeadSkullTargetX = value.X; - enragedHeadSkullTargetY = value.Y; - - int type = ProjectileID.Skull; - headCenter += value * 5f; - int enragedSkulls = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, 250, 0f, Main.myPlayer, -1f, 0f); - Main.projectile[enragedSkulls].timeLeft = 300; - } - } - } - } - - // Despawning - if (NPC.ai[1] == 3f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - if (NPC.IsMechQueenUp) - { - int mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Retinazer); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].EncourageDespawn(5); - - mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Spazmatism); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].EncourageDespawn(5); - - if (!NPC.AnyNPCs(NPCID.Retinazer) && !NPC.AnyNPCs(NPCID.Spazmatism)) - { - mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.TheDestroyer); - if (mechdusaBossDespawning >= 0) - Main.npc[mechdusaBossDespawning].Transform(NPCID.TheDestroyerTail); - - NPC.EncourageDespawn(5); - } - - NPC.velocity.Y += 0.1f; - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= 0.95f; - - NPC.velocity.X *= 0.95f; - if (NPC.velocity.Y > 13f) - NPC.velocity.Y = 13f; - } - else - { - NPC.velocity.Y += 0.1f; - if (NPC.velocity.Y < 0f) - NPC.velocity.Y *= 0.9f; - - NPC.velocity.X *= 0.9f; - - if (NPC.timeLeft > 500) - NPC.timeLeft = 500; - } - } - - // Fly around in a circle - if (NPC.ai[1] == 5f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - NPC.ai[2] += 1f; - - NPC.rotation = NPC.velocity.X / 50f; - - float bombSpawnDivisor = bossRush ? 14f : death ? 22f - (float)Math.Round(5f * (1f - lifeRatio)) : 22f; - float totalBombs = 6f; - int bombSpread = bossRush ? 250 : death ? 125 : 100; - - // Spin for about 3 seconds - float spinVelocity = 24f; - if (NPC.ai[2] == 2f) - { - // Play angry noise - SoundEngine.PlaySound(SoundID.ForceRoar, NPC.Center); - - // Set spin direction - if (Main.player[Main.npc[(int)NPC.ai[0]].target].velocity.X > 0f) - calamityGlobalNPC.newAI[0] = 1f; - else if (Main.player[Main.npc[(int)NPC.ai[0]].target].velocity.X < 0f) - calamityGlobalNPC.newAI[0] = -1f; - else - calamityGlobalNPC.newAI[0] = Main.player[Main.npc[(int)NPC.ai[0]].target].direction; - - // Set spin velocity - NPC.velocity.X = MathHelper.Pi * NPC.localAI[3] / spinVelocity; - NPC.velocity *= -calamityGlobalNPC.newAI[0]; - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - - // Maintain velocity and spit homing bombs - else if (NPC.ai[2] > 2f) - { - NPC.velocity = NPC.velocity.RotatedBy(MathHelper.Pi / spinVelocity * -calamityGlobalNPC.newAI[0]); - if (NPC.ai[2] == 3f) - NPC.velocity *= 0.6f; - - if (NPC.ai[2] % bombSpawnDivisor == 0f) - { - NPC.localAI[0] += 1f; - - if (Vector2.Distance(Main.player[Main.npc[(int)NPC.ai[0]].target].Center, NPC.Center) > 64f) - { - SoundEngine.PlaySound(SoundID.Item61, NPC.Center); - CreateParticles(NPC, new Vector2(NPC.Center.X + Main.rand.Next(NPC.width / 2), NPC.Center.Y + 4f)); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - Vector2 headCenter = NPC.Center; - float enragedHeadSpeed = 6f + (death ? 2f * (1f - lifeRatio) : 0f); - float enragedHeadBombTargetX = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X - headCenter.X + Main.rand.Next(-20, 21); - float enragedHeadBombTargetY = Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - headCenter.Y + Main.rand.Next(-20, 21); - float enragedHeadBombTargetDist = (float)Math.Sqrt(enragedHeadBombTargetX * enragedHeadBombTargetX + enragedHeadBombTargetY * enragedHeadBombTargetY); - enragedHeadBombTargetDist = enragedHeadSpeed / enragedHeadBombTargetDist; - enragedHeadBombTargetX *= enragedHeadBombTargetDist; - enragedHeadBombTargetY *= enragedHeadBombTargetDist; - - Vector2 value = new Vector2(enragedHeadBombTargetX + Main.rand.Next(-bombSpread, bombSpread + 1) * 0.01f, enragedHeadBombTargetY + Main.rand.Next(-bombSpread, bombSpread + 1) * 0.01f).SafeNormalize(Vector2.UnitY); - value *= enragedHeadSpeed; - enragedHeadBombTargetX = value.X; - enragedHeadBombTargetY = value.Y; - - int type = ProjectileID.BombSkeletronPrime; - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - int enragedBombs = Projectile.NewProjectile(NPC.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadBombTargetX, enragedHeadBombTargetY, type, damage, 0f, Main.myPlayer, -1f); - Main.projectile[enragedBombs].timeLeft = BombTimeLeft; - Main.projectile[enragedBombs].tileCollide = false; - } - } - - // Go to floating phase, or spinning phase if in phase 2 - if (NPC.localAI[0] >= totalBombs) - { - NPC.velocity = NPC.velocity.SafeNormalize(Vector2.UnitY); - - // Fly overhead and spit spreads of bombs into the air if on low health - NPC.ai[1] = phase3 ? 6f : 1f; - NPC.ai[2] = 0f; - NPC.localAI[3] = 0f; - NPC.localAI[0] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.SyncVanillaLocalAI(); - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - } - } - } - - // Fly overhead and spit bombs - if (NPC.ai[1] == 6f) - { - // Avoid unfair bullshit - NPC.damage = 0; - - NPC.rotation = NPC.velocity.X / 15f; - - float flightVelocity = bossRush ? 28f : death ? 25f : 22f; - float flightAcceleration = bossRush ? 1.16f : death ? 0.96f : 0.76f; - - Vector2 destination = new Vector2(Main.player[Main.npc[(int)NPC.ai[0]].target].Center.X, Main.player[Main.npc[(int)NPC.ai[0]].target].Center.Y - 420f); - NPC.SimpleFlyMovement((destination - NPC.Center).SafeNormalize(Vector2.UnitY) * flightVelocity, flightAcceleration); - - // Spit bombs and then go to floating phase - NPC.localAI[3] += 1f; - if (Vector2.Distance(NPC.Center, destination) < 160f || NPC.ai[2] > 0f || NPC.localAI[3] > 120f) - { - float bombSpawnDivisor = death ? 50f : 60f; - float totalBombSpreads = 2f; - NPC.ai[2] += 1f; - if (NPC.ai[2] % bombSpawnDivisor == 0f) - { - NPC.localAI[0] += 1f; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int totalProjectiles = bossRush ? 24 : 12; - float radians = MathHelper.TwoPi / totalProjectiles; - int type = ProjectileID.BombSkeletronPrime; - int damage = NPC.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - float velocity = 12f; - double angleA = radians * 0.5; - double angleB = MathHelper.ToRadians(90f) - angleA; - float velocityX = (float)(velocity * Math.Sin(angleA) / Math.Sin(angleB)); - Vector2 spinningPoint = normalLaserRotation ? new Vector2(0f, -velocity) : new Vector2(-velocityX, -velocity); - Vector2 upwardVelocity = Vector2.UnitY * velocity; - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 bombVelocity = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f + bombVelocity.SafeNormalize(Vector2.UnitY) * 15f, bombVelocity - upwardVelocity, type, damage, 0f, Main.myPlayer, -2f); - Main.projectile[proj].timeLeft = BombTimeLeft; - Main.projectile[proj].tileCollide = false; - } - NPC.localAI[1] += 1f; - } - - SoundEngine.PlaySound(SoundID.Item62, NPC.Center); - CreateParticles(NPC, new Vector2(NPC.Center.X, NPC.Center.Y + 4f), 5); - - if (NPC.localAI[0] >= totalBombSpreads) - { - NPC.ai[1] = 0f; - NPC.ai[2] = 0f; - NPC.localAI[3] = 0f; - calamityGlobalNPC.newAI[0] = 0f; - NPC.localAI[0] = 0f; - NPC.SyncVanillaLocalAI(); - NPC.SyncExtraAI(); - NPC.netUpdate = true; - } - } - } - } - } - } - - private void CreateParticles(NPC npc, Vector2 position, int amountMultiplier = 1) - { - int firstDustCloudParticleAmount = 30 * amountMultiplier; - int secondDustCloudParticleAmount = 20 * amountMultiplier; - int goreAmount = 2 * amountMultiplier; - - for (int dustIndex = 0; dustIndex < firstDustCloudParticleAmount; dustIndex++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 1.4f; - } - - for (int dustIndex = 0; dustIndex < secondDustCloudParticleAmount; dustIndex++) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 3.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 7f; - dust = Dust.NewDust(npc.position, npc.width, npc.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 3f; - } - - for (int goreIndex = 0; goreIndex < goreAmount; goreIndex++) - { - float goreVelocityMultiplier = 0.4f; - if (goreIndex >= goreAmount / 2) - goreVelocityMultiplier = 0.8f; - - int gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y += 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y -= 1f; - gore = Gore.NewGore(npc.GetSource_FromAI(), npc.Center, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= goreVelocityMultiplier; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y -= 1f; - } - } - - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; - - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) - { - NPC.lifeMax = (int)(NPC.lifeMax * 0.75f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override bool CheckActive() => false; - - public override bool CheckDead() - { - // Kill the lead head if he's still alive when this head dies - for (int i = 0; i < Main.maxNPCs; i++) - { - NPC nPC = Main.npc[i]; - if (nPC.active && nPC.type == NPCID.SkeletronPrime && nPC.life > 0) - { - nPC.life = 0; - nPC.HitEffect(); - nPC.checkDead(); - nPC.active = false; - nPC.netUpdate = true; - } - } - - return true; - } - - public override void HitEffect(NPC.HitInfo hit) - { - if (NPC.life <= 0) - { - if (!Main.dedServ) - { - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_1").Type, NPC.scale); - Gore.NewGore(NPC.GetSource_Death(), NPC.position, NPC.velocity, Mod.Find("SkeletronPrime2_2").Type, NPC.scale); - - int gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y += 1f; - - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y += 1f; - - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X += 1f; - Main.gore[gore].velocity.Y -= 1f; - - gore = Gore.NewGore(NPC.GetSource_Death(), NPC.position, default(Vector2), Main.rand.Next(61, 64)); - Main.gore[gore].velocity *= 0.4f; - Main.gore[gore].velocity.X -= 1f; - Main.gore[gore].velocity.Y -= 1f; - } - - for (int i = 0; i < 10; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 1.4f; - } - - for (int i = 0; i < 5; i++) - { - int dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 5f; - - dust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Torch, 0f, 0f, 100, default(Color), 1.5f); - Main.dust[dust].velocity *= 3f; - } - } - } - } -} diff --git a/NPCs/NormalNPCs/SkeletronPrime2.png b/NPCs/NormalNPCs/SkeletronPrime2.png deleted file mode 100644 index c019c31308..0000000000 Binary files a/NPCs/NormalNPCs/SkeletronPrime2.png and /dev/null differ diff --git a/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png b/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png deleted file mode 100644 index 38362cb253..0000000000 Binary files a/NPCs/NormalNPCs/SkeletronPrime2_Head_Boss.png and /dev/null differ diff --git a/NPCs/NormalNPCs/Stormlion.cs b/NPCs/NormalNPCs/Stormlion.cs index 54d7a9714c..9616633e81 100644 --- a/NPCs/NormalNPCs/Stormlion.cs +++ b/NPCs/NormalNPCs/Stormlion.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 100; NPC.knockBackResist = 0.2f; AnimationType = NPCID.WalkingAntlion; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = HitSound; NPC.DeathSound = DeathSound; Banner = NPC.type; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/Sunskater.cs b/NPCs/NormalNPCs/Sunskater.cs index d866ccbd01..8b5242520f 100644 --- a/NPCs/NormalNPCs/Sunskater.cs +++ b/NPCs/NormalNPCs/Sunskater.cs @@ -34,10 +34,10 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 58; NPC.height = 22; NPC.defense = 4; - NPC.lifeMax = 125; + NPC.lifeMax = 160; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = Main.zenithWorld ? AresGaussNuke.NukeExplosionSound : DeathSound; NPC.knockBackResist = 0.7f; @@ -47,10 +47,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/SuperDummyNPC.cs b/NPCs/NormalNPCs/SuperDummyNPC.cs index 655778feb8..d910753482 100644 --- a/NPCs/NormalNPCs/SuperDummyNPC.cs +++ b/NPCs/NormalNPCs/SuperDummyNPC.cs @@ -28,7 +28,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.lifeMax = 9999999; NPC.HitSound = null; NPC.DeathSound = SoundID.NPCDeath2; - NPC.value = 0f; NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = NPCAIStyleID.FaceClosestPlayer; diff --git a/NPCs/NormalNPCs/WildBumblebirb.cs b/NPCs/NormalNPCs/WildBumblebirb.cs new file mode 100644 index 0000000000..9ad32c868c --- /dev/null +++ b/NPCs/NormalNPCs/WildBumblebirb.cs @@ -0,0 +1,384 @@ +using CalamityMod.Items.Materials; +using CalamityMod.Items.Placeables.Banners; +using CalamityMod.Projectiles.Boss; +using CalamityMod.Sounds; +using CalamityMod.World; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.GameContent; +using Terraria.GameContent.Bestiary; +using Terraria.ID; +using Terraria.ModLoader; +using Terraria.ModLoader.Utilities; + +namespace CalamityMod.NPCs.NormalNPCs +{ + public class WildBumblebirb : ModNPC + { + public override void SetStaticDefaults() + { + Main.npcFrameCount[Type] = 5; + NPCID.Sets.TrailingMode[Type] = 1; + NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() + { + Position = Vector2.UnitX * 36f + }; + NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; + } + + public override string Texture => "CalamityMod/NPCs/Bumblebirb/BumbleFolly"; + + public override void SetDefaults() + { + NPC.npcSlots = 1f; + NPC.aiStyle = -1; + AIType = -1; + NPC.damage = 90; + NPC.width = 120; + NPC.height = 80; + NPC.defense = 20; + NPC.LifeMaxNERB(9375, 11250, 5000); // Old HP - 12000, 15000 + NPC.knockBackResist = 0.15f; + NPC.lavaImmune = true; + NPC.noTileCollide = true; + NPC.noGravity = true; + NPC.HitSound = SoundID.NPCHit51; + NPC.DeathSound = SoundID.NPCDeath46; + Banner = NPC.type; + BannerItem = ModContent.ItemType(); + NPC.Calamity().VulnerableToHeat = true; + NPC.Calamity().VulnerableToCold = true; + NPC.Calamity().VulnerableToSickness = true; + } + + public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) + { + bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] + { + BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, + new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.WildBumblefuck") + }); + } + + public override float SpawnChance(NPCSpawnInfo spawnInfo) + { + if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneSunkenSea || !spawnInfo.Player.ZoneJungle) + return 0f; + + // Keep this as a separate if check, because it's a loop and we don't want to be checking it constantly. + if (NPC.AnyNPCs(NPC.type)) + return 0f; + + return SpawnCondition.SurfaceJungle.Chance * 0.14f; + } + + public override void AI() + { + Player player = Main.player[NPC.target]; + + float rotationMult = 4f; + float rotationAmt = 0.04f; + + if (Vector2.Distance(player.Center, NPC.Center) > 5600f) + { + if (NPC.timeLeft > 5) + NPC.timeLeft = 5; + } + + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt * 1.25f) / 10f; + + if (NPC.ai[0] == 0f || NPC.ai[0] == 1f) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + if (i != NPC.whoAmI && Main.npc[i].active && Main.npc[i].type == NPC.type) + { + Vector2 otherSwarmerDirection = Main.npc[i].Center - NPC.Center; + if (otherSwarmerDirection.Length() < (NPC.width + NPC.height)) + { + otherSwarmerDirection.Normalize(); + otherSwarmerDirection *= -0.1f; + NPC.velocity += otherSwarmerDirection; + NPC nPC6 = Main.npc[i]; + nPC6.velocity -= otherSwarmerDirection; + } + } + } + } + + if (NPC.target < 0 || Main.player[NPC.target].dead || !Main.player[NPC.target].active) + { + NPC.TargetClosest(true); + Vector2 swarmerTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (Main.player[NPC.target].dead || swarmerTargetDist.Length() > 2800f) + NPC.ai[0] = -1f; + } + else + { + Vector2 swarmerCatchUpTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (NPC.ai[0] > 1f && swarmerCatchUpTargetDist.Length() > 3600f) + NPC.ai[0] = 1f; + } + + if (NPC.ai[0] == -1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + Vector2 swarmerDespawnVelMult = new Vector2(0f, -8f); + NPC.velocity = (NPC.velocity * 21f + swarmerDespawnVelMult) / 10f; + return; + } + + if (NPC.ai[0] == 0f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + NPC.TargetClosest(true); + NPC.spriteDirection = NPC.direction; + + Vector2 swarmerIdleTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (swarmerIdleTargetDist.Length() > 2800f) + { + NPC.ai[0] = 1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + } + else if (swarmerIdleTargetDist.Length() > 400f) + { + float swarmerIdleSpeed = 7f + swarmerIdleTargetDist.Length() / 100f + NPC.ai[1] / 15f; + swarmerIdleTargetDist.Normalize(); + swarmerIdleTargetDist *= swarmerIdleSpeed; + NPC.velocity = (NPC.velocity * 29f + swarmerIdleTargetDist) / 30f; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + } + else if (NPC.velocity.Length() > 2f) + NPC.velocity *= 0.95f; + else if (NPC.velocity.Length() < 1f) + NPC.velocity *= 1.05f; + + NPC.ai[1] += 1f; + if (NPC.ai[1] >= 105f) + { + NPC.ai[1] = 0f; + NPC.ai[0] = 2f; + } + } + else + { + if (NPC.ai[0] == 1f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.target < 0 || !Main.player[NPC.target].active || Main.player[NPC.target].dead) + NPC.TargetClosest(true); + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult + NPC.velocity.X * rotationAmt) / 10f; + + Vector2 swarmerChargeTargetDist = Main.player[NPC.target].Center - NPC.Center; + if (swarmerChargeTargetDist.Length() < 800f && !Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + } + + NPC.ai[2] += 0.0166666675f; + float swarmerChargeSpeed = 9f + NPC.ai[2] + swarmerChargeTargetDist.Length() / 150f; + float swarmerChargeVelMult = 25f; + swarmerChargeTargetDist.Normalize(); + swarmerChargeTargetDist *= swarmerChargeSpeed; + NPC.velocity = (NPC.velocity * (swarmerChargeVelMult - 1f) + swarmerChargeTargetDist) / swarmerChargeVelMult; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + + NPC.ForceNetUpdate(); + + return; + } + + if (NPC.ai[0] == 2f) + { + // Avoid cheap bullshit + NPC.damage = 0; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + NPC.rotation = (NPC.rotation * rotationMult * 0.75f + NPC.velocity.X * rotationAmt * 1.25f) / 8f; + + Vector2 swarmerDecelerateTargetDist = Main.player[NPC.target].Center - NPC.Center; + swarmerDecelerateTargetDist.Y -= 8f; + float swarmerDecelerateSpeed = 14f; + float swarmerDecelerateVelMult = 8f; + swarmerDecelerateTargetDist.Normalize(); + swarmerDecelerateTargetDist *= swarmerDecelerateSpeed; + NPC.velocity = (NPC.velocity * (swarmerDecelerateVelMult - 1f) + swarmerDecelerateTargetDist) / swarmerDecelerateVelMult; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + + NPC.ai[1] += 1f; + if (NPC.ai[1] > 10f) + { + // Set damage + NPC.damage = NPC.defDamage; + + NPC.velocity = swarmerDecelerateTargetDist; + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) + NPC.velocity *= 1.15f; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else + NPC.direction = 1; + + NPC.ai[0] = 2.1f; + NPC.ai[1] = 0f; + } + } + else if (NPC.ai[0] == 2.1f) + { + // Set damage + NPC.damage = NPC.defDamage; + + if (NPC.velocity.X < 0f) + NPC.direction = -1; + else if (NPC.velocity.X > 0f) + NPC.direction = 1; + + NPC.spriteDirection = NPC.direction; + + NPC.velocity *= 1.01f; + + NPC.ai[1] += 1f; + if (NPC.ai[1] > 30f) + { + if (!Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + return; + } + + if (NPC.ai[1] > 60f) + { + NPC.ai[0] = 1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + } + } + } + } + + public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 5, 7); + public override void OnKill() + { + if (Main.zenithWorld) + { + SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + for (int i = 0; i < 5; i++) + { + Vector2 fireFrom = new Vector2(NPC.Center.X + (40 * i) - 120, NPC.Center.Y - 900f); + Vector2 ai0 = NPC.Center - fireFrom; + float ai = Main.rand.Next(100); + Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), 45, 0f, Main.myPlayer, ai0.ToRotation(), ai); + } + } + } + } + + public override void FindFrame(int frameHeight) + { + NPC.frameCounter += NPC.ai[0] == 2.1f ? 1.5 : 1D; + if (Main.zenithWorld) + { + NPC.frameCounter += 2D; + } + if (NPC.frameCounter > 4D) //iban said the time between frames was 5 so using that as a base + { + NPC.frameCounter = 0D; + NPC.frame.Y += frameHeight; + } + if (NPC.frame.Y >= frameHeight * 4) + { + NPC.frame.Y = 0; + } + } + + public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) + { + SpriteEffects spriteEffects = SpriteEffects.None; + if (NPC.spriteDirection == 1) + spriteEffects = SpriteEffects.FlipHorizontally; + + Texture2D texture2D15 = TextureAssets.Npc[Type].Value; + Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); + int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0; + + if (CalamityClientConfig.Instance.Afterimages) + { + for (int i = 1; i < afterimageAmt; i += 2) + { + Color afterimageColor = drawColor; + afterimageColor = Color.Lerp(afterimageColor, Color.Gold, 0.5f); + afterimageColor = NPC.GetAlpha(afterimageColor); + afterimageColor *= (afterimageAmt - i) / 15f; + Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; + afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; + afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + } + } + + Vector2 drawLocation = NPC.Center - screenPos; + drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; + drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); + spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + + return false; + } + + public override void HitEffect(NPC.HitInfo hit) + { + for (int k = 0; k < 5; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); + } + if (NPC.life <= 0) + { + for (int k = 0; k < 50; k++) + { + Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); + } + } + } + } +} diff --git a/NPCs/NormalNPCs/WildBumblefuck.cs b/NPCs/NormalNPCs/WildBumblefuck.cs deleted file mode 100644 index b0be162495..0000000000 --- a/NPCs/NormalNPCs/WildBumblefuck.cs +++ /dev/null @@ -1,173 +0,0 @@ -using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; -using CalamityMod.Projectiles.Boss; -using CalamityMod.Sounds; -using CalamityMod.World; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.GameContent.Bestiary; -using Terraria.ID; -using Terraria.ModLoader; -using Terraria.ModLoader.Utilities; - -namespace CalamityMod.NPCs.NormalNPCs -{ - public class WildBumblefuck : ModNPC - { - public override void SetStaticDefaults() - { - Main.npcFrameCount[Type] = 5; - NPCID.Sets.TrailingMode[Type] = 1; - NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() - { - Position = Vector2.UnitX * 36f - }; - NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; - } - - public override string Texture => "CalamityMod/NPCs/Bumblebirb/BumbleFolly"; - - public override void SetDefaults() - { - NPC.npcSlots = 1f; - NPC.aiStyle = -1; - AIType = -1; - NPC.damage = 90; - NPC.width = 120; - NPC.height = 80; - NPC.defense = 20; - NPC.LifeMaxNERB(9375, 11250, 5000); // Old HP - 12000, 15000 - NPC.knockBackResist = 0.15f; - NPC.lavaImmune = true; - NPC.noTileCollide = true; - NPC.noGravity = true; - NPC.HitSound = SoundID.NPCHit51; - NPC.DeathSound = SoundID.NPCDeath46; - Banner = NPC.type; - BannerItem = ModContent.ItemType(); - NPC.Calamity().VulnerableToHeat = true; - NPC.Calamity().VulnerableToCold = true; - NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); - } - - public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) - { - bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[] - { - BestiaryDatabaseNPCsPopulator.CommonTags.SpawnConditions.Biomes.Jungle, - new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.WildBumblefuck") - }); - } - - public override float SpawnChance(NPCSpawnInfo spawnInfo) - { - if (spawnInfo.PlayerSafe || !NPC.downedMoonlord || spawnInfo.Player.Calamity().ZoneSunkenSea || !spawnInfo.Player.ZoneJungle) - return 0f; - - // Keep this as a separate if check, because it's a loop and we don't want to be checking it constantly. - if (NPC.AnyNPCs(NPC.type)) - return 0f; - - return SpawnCondition.SurfaceJungle.Chance * 0.14f; - } - - public override void AI() - { - BumblebirbAI.VanillaBumblebirb2AI(NPC, Mod, false); - } - - public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ModContent.ItemType(), 1, 5, 7); - public override void OnKill() - { - if (Main.zenithWorld) - { - SoundEngine.PlaySound(CommonCalamitySounds.LightningSound, NPC.Center - Vector2.UnitY * 300f); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - for (int i = 0; i < 5; i++) - { - Vector2 fireFrom = new Vector2(NPC.Center.X + (40 * i) - 120, NPC.Center.Y - 900f); - Vector2 ai0 = NPC.Center - fireFrom; - float ai = Main.rand.Next(100); - Vector2 velocity = Vector2.Normalize(ai0.RotatedByRandom(MathHelper.PiOver4)) * 7f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom.X, fireFrom.Y, velocity.X, velocity.Y, ModContent.ProjectileType(), NPC.damage, 0f, Main.myPlayer, ai0.ToRotation(), ai); - } - } - } - } - - public override void FindFrame(int frameHeight) - { - NPC.frameCounter += NPC.ai[0] == 2.1f ? 1.5 : 1D; - if (Main.zenithWorld) - { - NPC.frameCounter += 2D; - } - if (NPC.frameCounter > 4D) //iban said the time between frames was 5 so using that as a base - { - NPC.frameCounter = 0D; - NPC.frame.Y += frameHeight; - } - if (NPC.frame.Y >= frameHeight * 4) - { - NPC.frame.Y = 0; - } - } - - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Texture2D texture2D15 = TextureAssets.Npc[Type].Value; - Vector2 halfSizeTexture = new Vector2(TextureAssets.Npc[Type].Value.Width / 2, TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2); - int afterimageAmt = NPC.ai[0] == 2.1f ? 7 : 0; - - if (CalamityClientConfig.Instance.Afterimages) - { - for (int i = 1; i < afterimageAmt; i += 2) - { - Color afterimageColor = drawColor; - afterimageColor = Color.Lerp(afterimageColor, Color.Gold, 0.5f); - afterimageColor = NPC.GetAlpha(afterimageColor); - afterimageColor *= (afterimageAmt - i) / 15f; - Vector2 afterimagePos = NPC.oldPos[i] + new Vector2(NPC.width, NPC.height) / 2f - screenPos; - afterimagePos -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; - afterimagePos += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, afterimagePos, NPC.frame, afterimageColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - } - } - - Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2(texture2D15.Width, texture2D15.Height / Main.npcFrameCount[Type]) * NPC.scale / 2f; - drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - - return false; - } - - public override void HitEffect(NPC.HitInfo hit) - { - for (int k = 0; k < 5; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); - } - if (NPC.life <= 0) - { - for (int k = 0; k < 50; k++) - { - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.CopperCoin, hit.HitDirection, -1f, 0, default, 1f); - } - } - } - } -} diff --git a/NPCs/NormalNPCs/WulfrumAmplifier.cs b/NPCs/NormalNPCs/WulfrumAmplifier.cs index 80a086b0d8..8546cfcaf7 100644 --- a/NPCs/NormalNPCs/WulfrumAmplifier.cs +++ b/NPCs/NormalNPCs/WulfrumAmplifier.cs @@ -51,9 +51,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 44; NPC.height = 44; NPC.defense = 4; - NPC.lifeMax = Main.zenithWorld ? 90 : 58; + NPC.lifeMax = Main.zenithWorld ? 200 : 100; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.noGravity = false; NPC.noTileCollide = false; NPC.HitSound = Hit; @@ -64,10 +64,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = true; if (Main.zenithWorld) NPC.scale = 1.5f; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumDrone.cs b/NPCs/NormalNPCs/WulfrumDrone.cs index 58beddcec3..784c9cd5f4 100644 --- a/NPCs/NormalNPCs/WulfrumDrone.cs +++ b/NPCs/NormalNPCs/WulfrumDrone.cs @@ -70,9 +70,9 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 32; NPC.height = 32; NPC.defense = 4; - NPC.lifeMax = 27; + NPC.lifeMax = 25; NPC.knockBackResist = 0.35f; - NPC.value = Item.buyPrice(0, 0, 0, 80); + NPC.value = Item.buyPrice(copper: 80); NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = WulfrumAmplifier.Hit; @@ -81,10 +81,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumGyrator.cs b/NPCs/NormalNPCs/WulfrumGyrator.cs index 8427304eff..6d089b7204 100644 --- a/NPCs/NormalNPCs/WulfrumGyrator.cs +++ b/NPCs/NormalNPCs/WulfrumGyrator.cs @@ -55,19 +55,15 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.width = 40; NPC.height = 40; NPC.defense = 5; - NPC.lifeMax = 23; + NPC.lifeMax = 25; NPC.knockBackResist = 0.15f; - NPC.value = Item.buyPrice(0, 0, 0, 75); + NPC.value = Item.buyPrice(copper: 75); NPC.HitSound = WulfrumAmplifier.Hit; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumHovercraft.cs b/NPCs/NormalNPCs/WulfrumHovercraft.cs index b278e299f7..56c020c681 100644 --- a/NPCs/NormalNPCs/WulfrumHovercraft.cs +++ b/NPCs/NormalNPCs/WulfrumHovercraft.cs @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.height = 38; NPC.defense = 4; NPC.lifeMax = 25; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = WulfrumAmplifier.Hit; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; NPC.noGravity = true; @@ -88,10 +88,6 @@ namespace CalamityMod.NPCs.NormalNPCs BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/NormalNPCs/WulfrumRover.cs b/NPCs/NormalNPCs/WulfrumRover.cs index 32f84de137..ced5a43f1d 100644 --- a/NPCs/NormalNPCs/WulfrumRover.cs +++ b/NPCs/NormalNPCs/WulfrumRover.cs @@ -59,7 +59,7 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.defense = 4; NPC.lifeMax = 40; NPC.knockBackResist = Main.zenithWorld ? 0f : 0.15f; - NPC.value = Item.buyPrice(0, 0, 0, 75); + NPC.value = Item.buyPrice(copper: 75); NPC.HitSound = WulfrumAmplifier.Hit; NPC.DeathSound = CommonCalamitySounds.WulfrumNPCDeathSound; Banner = NPC.type; @@ -68,10 +68,6 @@ namespace CalamityMod.NPCs.NormalNPCs NPC.Calamity().VulnerableToElectricity = true; if (Main.zenithWorld) NPC.scale = 2f; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/OldDuke/OldDuke.cs b/NPCs/OldDuke/OldDuke.cs index 88e48e8dbe..d45c0316c4 100644 --- a/NPCs/OldDuke/OldDuke.cs +++ b/NPCs/OldDuke/OldDuke.cs @@ -18,9 +18,9 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; -using CalamityMod.NPCs.CalamityAIs.CalamityBossAIs; using CalamityMod.NPCs.TownNPCs; using CalamityMod.Particles; +using CalamityMod.Projectiles.Boss; using CalamityMod.Systems; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -59,8 +59,8 @@ namespace CalamityMod.NPCs.OldDuke public static readonly SoundStyle VortexSpawnSound = new("CalamityMod/Sounds/Custom/OldDukeVortexSpawn"); public static readonly SoundStyle DashSound = new("CalamityMod/Sounds/Custom/OldDukeDash"); public static readonly SoundStyle DashSoundP3 = new("CalamityMod/Sounds/Custom/OldDukeDashP3"); - - public SlotId RoarSoundSlot; + private static Color FireGreen = new Color(155, 255, 55); + private SlotId RoarSoundSlot; public static Asset GlowTexture; @@ -84,14 +84,23 @@ namespace CalamityMod.NPCs.OldDuke } } + public static float Phase2ContactDamageMult = 1.1f; // 308 + public static float Phase3ContactDamageMult = 1.2f; // 336 + public static int GoreDamage = 60; // 240 + public static int VortexDamage = 105; // 420 + + // GFB exclusive + public static int FartDamage = 80; // 320 + public override void SetDefaults() { + NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 140; // 280 NPC.alpha = 255; NPC.width = 150; NPC.height = 100; NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.defense = 90; NPC.DR_NERD(0.5f, null, null, null, true); NPC.LifeMaxNERB(500000, 600000, 400000); @@ -101,7 +110,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.npcSlots = 15f; NPC.HitSound = SoundID.NPCHit14; NPC.DeathSound = SoundID.NPCDeath20; - NPC.value = Item.buyPrice(2, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1, gold: 50); NPC.boss = true; NPC.netAlways = true; NPC.timeLeft = NPC.activeTime * 30; @@ -110,9 +119,6 @@ namespace CalamityMod.NPCs.OldDuke NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -143,30 +149,1615 @@ namespace CalamityMod.NPCs.OldDuke NPC.Calamity().newAI[i] = reader.ReadSingle(); } + #region Visual Helper Methods + static void DoChargeBurst(NPC npc, int phase) + { + SoundEngine.PlaySound(phase > 1 ? DashSoundP3 : DashSound, npc.Center); + + if (phase > 1) + { + for (int i = 0; i < 30; i++) + { + float fl = Main.rand.NextFloat(-60f, 60f); + GeneralParticleHandler.SpawnParticle(new SparkParticle(npc.Center + (Vector2.Zero.DirectionTo(npc.velocity) * 20f) + new Vector2(0f, fl).RotatedBy(Vector2.Zero.AngleTo(npc.velocity)), (-npc.velocity * Main.rand.NextFloat(2f)).RotatedBy(MathHelper.ToRadians(fl)), false, 25, Main.rand.NextFloat(0.3f, 1.2f), FireGreen)); + } + + CalamityUtils.AddScreenshakeAt(npc.Center, 10f, 3000f); + + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, npc.Center); + SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, npc.Center); + GeneralParticleHandler.SpawnParticle(new CustomPulse(npc.Center, -npc.velocity / 3f, FireGreen, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1.2f), Vector2.Zero.AngleTo(npc.velocity) + (Main.rand.NextBool() ? 0 : -MathHelper.Pi), 0.05f, 0.2f, 20)); + GeneralParticleHandler.SpawnParticle(new CustomPulse(npc.Center, -npc.velocity / 2f, FireGreen, "CalamityMod/Particles/FlameExplosion", new Vector2(0.4f, 1.2f), Vector2.Zero.AngleTo(npc.velocity) + (Main.rand.NextBool() ? 0 : -MathHelper.Pi), 0.1f, 0.4f, 20)); + } + } + static void DoChargeVisual(NPC npc, int phase) + { + float progress = npc.ai[2]; + int chargeTime = 36; + + Color col = Color.Lerp(phase > 0 ? FireGreen : new Color(100, 100, 100, 55), new Color(55, 55, 55, 55), progress / chargeTime); + + if (phase > 1) + { + if (Math.Floor(VisualTimerSystem.GlobalVisualTimer % 6f) < 1f) + GeneralParticleHandler.SpawnParticle(new CustomPulse(npc.Center, npc.velocity / 3f, col, "CalamityMod/Particles/DustyCircleHardEdge", new Vector2(0.4f, 1f), Vector2.Zero.AngleTo(npc.velocity) + (Main.rand.NextBool() ? 0 : -MathHelper.Pi), 0.04f, 0.1f, 20)); + + (npc.ModNPC as OldDuke).NuclearOverlayVisual = 1f; + } + + if (Main.rand.NextBool()) + GeneralParticleHandler.SpawnParticle(new CustomSpark(npc.Center - (npc.velocity * 2f), npc.velocity / 2f, "CalamityMod/Particles/ForwardSmear", false, 10, Main.rand.NextFloat(0.3f, 0.5f), col, new Vector2(1f, Main.rand.NextFloat(1.45f, 1.6f)), fadeIn: true, extraRotation: MathHelper.ToRadians(180f))); + } + #endregion + public override void AI() { + CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); shake = MathHelper.Lerp(shake, 0f, 0.1f); + // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + // Variables + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + float exhaustionGateValue = 360f; + if (CalamityWorld.LegendaryMode) + exhaustionGateValue *= 0.5f; + + float numberOfAttacksBeforeExhaustion = 12f; + float exhaustionIncreasePerAttack = exhaustionGateValue * (1f / numberOfAttacksBeforeExhaustion); + bool exhausted = calamityGlobalNPC.newAI[1] == 1f; bool phase2 = lifeRatio <= (death ? LifePercentagePhase2_Death : revenge ? LifePercentagePhase2_Revenge : LifePercentagePhase2_Normal); bool phase3 = lifeRatio <= (death ? LifePercentagePhase3_Death : (revenge ? LifePercentagePhase3_Revenge : LifePercentagePhase3_Expert)) && expertMode; - + bool phase2AI = NPC.ai[0] > 4f; + bool phase3AI = NPC.ai[0] > 9f; + Phase = phase3 ? 2 : phase2 ? 1 : 0; NuclearOverlayVisual = (Phase == 2 && NPC.Calamity().newAI[1] != 1) ? MathHelper.Lerp(NuclearOverlayVisual, 0.2f, 0.2f) : MathHelper.Lerp(NuclearOverlayVisual, 0f, 0.1f); - OldDukeAI.VanillaOldDukeAI(NPC, Mod); + bool charging = NPC.ai[3] < 10f; + if (calamityGlobalNPC.newAI[0] >= exhaustionGateValue) + calamityGlobalNPC.newAI[1] = 1f; + + float alphaScale = (255 - NPC.alpha) / 255f; + float redLight = (phase3AI ? 0.4f : phase2AI ? 0.64f : 0.88f) * alphaScale; + float greenLight = (phase3AI ? 1.2f : phase2AI ? 0.8f : 0.4f) * alphaScale; + Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), redLight, greenLight, 0f); + + if (CalamityServerConfig.Instance.BossesStopWeather) + CalamityWorld.StopRain(); + else if (!Main.raining && !BossRushEvent.BossRushActive) + CalamityWorld.StartRain(); + + // Adjust stats + NPC.damage = NPC.defDamage; + calamityGlobalNPC.DR = exhausted ? 0f : 0.5f; + NPC.defense = exhausted ? 0 : NPC.defDefense; + if (phase3AI) + { + NPC.damage = (int)Math.Round(NPC.defDamage * Phase3ContactDamageMult); + NPC.defense = exhausted ? 0 : NPC.defDefense - 40; + } + else if (phase2AI) + { + NPC.damage = (int)Math.Round(NPC.defDamage * Phase2ContactDamageMult); + NPC.defense = exhausted ? 0 : NPC.defDefense - 20; + } + + int idlePhaseTimer = expertMode ? 55 : 60; + float idlePhaseAcceleration = expertMode ? 0.75f : 0.7f; + float idlePhaseVelocity = expertMode ? 14f : 13f; + if (phase3AI) + { + idlePhaseAcceleration = expertMode ? 0.6f : 0.55f; + idlePhaseVelocity = expertMode ? 12f : 11f; + } + else if (phase2AI & charging) + { + idlePhaseAcceleration = expertMode ? 0.8f : 0.75f; + idlePhaseVelocity = expertMode ? 15f : 14f; + } + + int chargeTime = expertMode ? 34 : 36; + float chargeVelocity = expertMode ? 20f : 19f; + if (phase3AI) + { + chargeTime = expertMode ? 28 : 30; + chargeVelocity = expertMode ? 26f : 25f; + } + else if (charging & phase2AI) + { + chargeTime = expertMode ? 31 : 33; + chargeVelocity = expertMode ? 24f : 23f; + } + + if (death) + { + idlePhaseTimer = 51; + idlePhaseAcceleration *= 1.05f; + idlePhaseVelocity *= 1.05f; + chargeTime -= 2; + chargeVelocity *= 1.1f; + } + else if (revenge) + { + idlePhaseTimer = 53; + idlePhaseAcceleration *= 1.025f; + idlePhaseVelocity *= 1.025f; + chargeTime -= 1; + chargeVelocity *= 1.05f; + } + + // The dumbest thing to ever exist + if (CalamityWorld.MaliceMode) + chargeVelocity *= 1.25f; + + if (exhausted) + idlePhaseVelocity *= 0.25f; + + // Variables + int maxToothBallBelches = death ? 4 : 3; + int toothBallBelchPhaseDivisor = death ? 30 : 40; + int toothBallBelchPhaseTimer = toothBallBelchPhaseDivisor * maxToothBallBelches; + 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 = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + int attackTimer = 120; + int phaseTransitionTimer = 180; + int teleportPauseTimer = 30; + int toothBallSpinPhaseDivisor = death ? 32 : 45; + int toothBallSpinTimer = maxToothBallBelches * toothBallSpinPhaseDivisor; + float spinTime = toothBallSpinTimer / 2f; + float toothBallSpinToothBallVelocity = death ? 9.5f : 9f; + float spinAttackSpeed = Main.zenithWorld ? 44f : 22f; + float spinSpeed = MathHelper.TwoPi / spinTime; + + Player player = Main.player[NPC.target]; + + // Get target + if (NPC.target < 0 || NPC.target == Main.maxPlayers || player.dead || !player.active) + { + NPC.TargetClosest(); + player = Main.player[NPC.target]; + NPC.netUpdate = true; + } + + // Despawn safety, make sure to target another player if the current player target is too far away + if (Vector2.Distance(player.Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) + NPC.TargetClosest(); + + // Despawn + if (player.dead || Vector2.Distance(player.Center, NPC.Center) > 8800f) + { + NPC.TargetClosest(); + + NPC.velocity.Y -= 0.4f; + + if (NPC.timeLeft > 10) + NPC.timeLeft = 10; + + if (NPC.timeLeft == 1) + { + AcidRainEvent.AccumulatedKillPoints = 0; + AcidRainEvent.HasTriedToSummonOldDuke = false; + AcidRainEvent.UpdateInvasion(false); + NPC.timeLeft = 0; + } + + if (NPC.ai[0] > 4f) + NPC.ai[0] = 5f; + else + NPC.ai[0] = 0f; + + NPC.ai[2] = 0f; + } + + if (exhausted) + { + // Disable contact damage while tired + NPC.damage = 0; + + // Play exhausted sound + if (calamityGlobalNPC.newAI[0] % 60f == 0f && Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f) + SoundEngine.PlaySound(HuffSound with { Volume = HuffSound.Volume * 1.25f }, Main.LocalPlayer.Center); + + if (Main.zenithWorld) + { + float screenShakePower = 10 * Utils.GetLerpValue(800f, 0f, NPC.Distance(Main.LocalPlayer.Center), true); + if (Main.LocalPlayer.Calamity().GeneralScreenShakePower < screenShakePower) + Main.LocalPlayer.Calamity().GeneralScreenShakePower = screenShakePower; + + if (calamityGlobalNPC.newAI[0] == exhaustionGateValue) + SoundEngine.PlaySound(SoundID.NPCDeath64 with { Pitch = SoundID.NPCDeath64.Pitch - 0.9f, Volume = SoundID.NPCDeath64.Volume + 0.4f }, player.Center); // fart + + if (Main.netMode != NetmodeID.MultiplayerClient && calamityGlobalNPC.newAI[0] % 5f == 0f) + { + Vector2 dist = player.Center - NPC.Center; + dist.Normalize(); + dist *= 3; + dist.X += Main.rand.NextFloat(-0.5f, 0.5f); + dist.Y += Main.rand.NextFloat(-0.5f, 0.5f); + int type = ModContent.ProjectileType(); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, -dist, type, FartDamage, 0, Main.myPlayer); + } + } + + calamityGlobalNPC.newAI[0] -= 1f; + if (calamityGlobalNPC.newAI[0] <= 0f) + { + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[1] = 0f; + } + } + + // Enrage variable + 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 = !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))); + } + + // Enrage + if (enrage) + { + if (NPC.localAI[1] > 0f) + NPC.localAI[1] -= 1f; + } + else + NPC.localAI[1] = CalamityGlobalNPC.biomeEnrageTimerMax; + + bool biomeEnraged = NPC.localAI[1] <= 0f; + + 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) ? 0.75f : 0.5f; + + calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = NPC.ai[0] == -1f || NPC.ai[0] == 4f || NPC.ai[0] == 9f; + + // Enrage + if (biomeEnraged) + { + toothBallBelchPhaseTimer = 60; + toothBallBelchPhaseDivisor = 20; + toothBallBelchPhaseAcceleration = 1f; + toothBallBelchPhaseVelocity = 15f; + goreVelocityX = 12f; + goreVelocityY = 16f; + sharkronVelocity = 20f; + idlePhaseTimer = 20; + idlePhaseAcceleration = 1.2f; + idlePhaseVelocity = 20f; + chargeTime = 25; + chargeVelocity += 8f; + toothBallSpinPhaseDivisor = 24; + toothBallSpinToothBallVelocity = 15f; + NPC.damage *= 2; + NPC.defense = NPC.defDefense * 3; + } + + // The dumbest thing to ever exist + if (CalamityWorld.MaliceMode) + chargeTime *= 2; + + // Set variables for spawn effects + if (NPC.localAI[0] == 0f) + { + NPC.alpha = 255; + + NPC.velocity.Y = -12f; + NPC.velocity.X = Main.rand.NextFloat(-2f, 2f); + + NPC.localAI[0] = 1f; + NPC.rotation = 0f; + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.ai[0] = -1f; + NPC.netUpdate = true; + } + } + + // Rotation + float rateOfRotation = 0.04f; + if (NPC.ai[0] == 1f || NPC.ai[0] == 6f || NPC.ai[0] == 7f || NPC.ai[0] == 14f) + rateOfRotation = 0f; + if (NPC.ai[0] == 3f || NPC.ai[0] == 4f) + rateOfRotation = 0.01f; + if (NPC.ai[0] == 8f || NPC.ai[0] == 13f) + rateOfRotation = 0.05f; + + Vector2 rotationVector = player.Center - NPC.Center; + if (calamityGlobalNPC.newAI[1] != 1f && !player.dead) + { + // Rotate to show direction of predictive charge + if (NPC.ai[0] == 0f && !phase2) + { + if (NPC.ai[3] < 6f) + { + rateOfRotation = 0.1f; + rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - NPC.Center) * chargeVelocity; + } + } + else if (NPC.ai[0] == 5f && !phase3) + { + if (NPC.ai[3] < 4f) + { + rateOfRotation = 0.1f; + rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - NPC.Center) * chargeVelocity; + } + } + else if (NPC.ai[0] == 10f) + { + if (NPC.ai[3] < 8f && NPC.ai[3] != 1f && NPC.ai[3] != 4f) + { + rateOfRotation = 0.1f; + rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - NPC.Center) * chargeVelocity; + } + } + } + + float dukeRotationSpeed = (float)Math.Atan2(rotationVector.Y, rotationVector.X); + if (NPC.spriteDirection == 1) + dukeRotationSpeed += MathHelper.Pi; + if (dukeRotationSpeed < 0f) + dukeRotationSpeed += MathHelper.TwoPi; + if (dukeRotationSpeed > MathHelper.TwoPi) + dukeRotationSpeed -= MathHelper.TwoPi; + if (NPC.ai[0] == -1f || NPC.ai[0] == 3f || NPC.ai[0] == 4f) + dukeRotationSpeed = 0f; + if (NPC.ai[0] == 8f || NPC.ai[0] == 13f) + dukeRotationSpeed = MathHelper.Pi * 0.1666666667f * NPC.spriteDirection; + + if (NPC.rotation < dukeRotationSpeed) + { + if (dukeRotationSpeed - NPC.rotation > MathHelper.Pi) + NPC.rotation -= rateOfRotation; + else + NPC.rotation += rateOfRotation; + } + if (NPC.rotation > dukeRotationSpeed) + { + if (NPC.rotation - dukeRotationSpeed > MathHelper.Pi) + NPC.rotation += rateOfRotation; + else + NPC.rotation -= rateOfRotation; + } + + if ((NPC.ai[0] != 8f && NPC.ai[0] != 13f) || NPC.spriteDirection == 1) + { + if (NPC.rotation > dukeRotationSpeed - rateOfRotation && NPC.rotation < dukeRotationSpeed + rateOfRotation) + NPC.rotation = dukeRotationSpeed; + if (NPC.rotation < 0f) + NPC.rotation += MathHelper.TwoPi; + if (NPC.rotation > MathHelper.TwoPi) + NPC.rotation -= MathHelper.TwoPi; + if (NPC.rotation > dukeRotationSpeed - rateOfRotation && NPC.rotation < dukeRotationSpeed + rateOfRotation) + NPC.rotation = dukeRotationSpeed; + } + + // Alpha adjustments + if (NPC.ai[0] != -1f && (NPC.ai[0] < 9f || NPC.ai[0] > 12f)) + { + if (Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) + NPC.alpha += 15; + else + NPC.alpha -= 15; + + if (NPC.alpha < 0) + NPC.alpha = 0; + if (NPC.alpha > 150) + NPC.alpha = 150; + } + + // Spawn effects + if (NPC.ai[0] == -1f) + { + NPC.alpha = (int)MathHelper.Lerp(NPC.alpha, 0, 0.2f); + + // Disable contact damage while spawning + NPC.damage = 0; + + // Velocity + if (NPC.Calamity().newAI[3] == 0f) + NPC.velocity *= 0.98f; + + // Direction + int dukeFaceDirection = Math.Sign(player.Center.X - NPC.Center.X); + if (dukeFaceDirection != 0) + { + NPC.direction = dukeFaceDirection; + NPC.spriteDirection = -NPC.direction; + } + + // Alpha + if (NPC.ai[2] > 20f) + { + NPC.velocity *= 0.9f; + + NPC.alpha -= 5; + if (Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) + NPC.alpha += 15; + if (NPC.alpha < 0) + NPC.alpha = 0; + if (NPC.alpha > 150) + NPC.alpha = 150; + } + + if (NPC.ai[2] == 75) + { + RoarSoundSlot = SoundEngine.PlaySound(RoarSound, NPC.Center); + + CalamityUtils.AddScreenshakeAt(NPC.Center, 14); + SoundEngine.PlaySound(SoundID.DD2_BetsyFlameBreath.WithPitchOffset(-0.5f), NPC.Center); + SoundEngine.PlaySound(DashSoundP3, NPC.Center); + } + + if (NPC.ai[2] >= 75f) + { + float sd = player.Center.X > NPC.Center.X ? -1f : 1f; + + shake = 2f; + NPC.rotation = MathHelper.Lerp(MathHelper.WrapAngle(NPC.rotation), MathHelper.ToRadians(sd == 1f ? 75f : -75f), 0.2f); + + if (NPC.ai[2] % 5f == 1f) + { + Vector2 mouthCenter = NPC.Center + new Vector2(-80 * sd, 0).RotatedBy(NPC.rotation); + + float factor = (NPC.ai[2] - 75f) / 50f; + + float a = MathHelper.Lerp(1f, 0f, factor); + + GeneralParticleHandler.SpawnParticle(new CustomPulse(mouthCenter, Vector2.Zero, new Color(55, 55, 55).MultiplyRGBA(new Color(a, a, a, a)), "CalamityMod/Particles/DustyCircleHardEdge", Vector2.One, Main.rand.NextFloat(MathHelper.TwoPi), 0.05f, 0.08f + (0.15f * factor), 10)); + } + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= 125f) + { + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.netUpdate = true; + } + } + + // Phase 1 + else if (NPC.ai[0] == 0f && !player.dead) + { + // Velocity + if (NPC.ai[1] == 0f) + NPC.ai[1] = 500 * Math.Sign((NPC.Center - player.Center).X); + + Vector2 phase1IdleSpeed = Vector2.Normalize(player.Center + new Vector2(NPC.ai[1], -300f) - NPC.Center - NPC.velocity) * idlePhaseVelocity; + NPC.SimpleFlyMovement(phase1IdleSpeed, idlePhaseAcceleration); + + // Rotation and direction + int dukeLookAt = Math.Sign(player.Center.X - NPC.Center.X); + if (dukeLookAt != 0) + { + if (NPC.ai[2] == 0f && dukeLookAt != NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.direction = dukeLookAt; + + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + // Phase switch + if (calamityGlobalNPC.newAI[1] != 1f || (phase2 && !phase2AI)) + { + NPC.ai[2] += 1f; + if (NPC.ai[2] >= idlePhaseTimer || (phase2 && !phase2AI)) + { + int oldDukeAttackPicker = 0; + switch ((int)NPC.ai[3]) + { + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + oldDukeAttackPicker = 1; + break; + case 6: + NPC.ai[3] = 1f; + oldDukeAttackPicker = 2; + break; + case 7: + NPC.ai[3] = 0f; + oldDukeAttackPicker = 3; + break; + } + + if (phase2) + oldDukeAttackPicker = 4; + + // Set velocity for charge + if (oldDukeAttackPicker == 1) + { + NPC.ai[0] = 1f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + // Velocity + Vector2 distanceVector = player.Center + player.velocity * 20f - NPC.Center; + NPC.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + DoChargeBurst(NPC, 0); + + // Direction + if (dukeLookAt != 0) + { + NPC.direction = dukeLookAt; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + } + + // Tooth Balls + else if (oldDukeAttackPicker == 2) + { + NPC.ai[0] = 2f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + // Call sharks from the sides of the screen + else if (oldDukeAttackPicker == 3) + { + NPC.ai[0] = 3f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + // Go to phase 2 + else if (oldDukeAttackPicker == 4) + { + NPC.ai[0] = 4f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + NPC.netUpdate = true; + } + } + } + + // Charge + else if (NPC.ai[0] == 1f) + { + // The dumbest thing to ever exist + if (CalamityWorld.MaliceMode && NPC.ai[2] % 10f == 0f) + { + // Rotation and direction + int dir = Math.Sign(player.Center.X - NPC.Center.X); + if (dir != 0) + { + if (NPC.ai[2] == 0f && dir != NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.direction = dir; + + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + Vector2 distanceVector = player.Center + player.velocity * 20f - NPC.Center; + NPC.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + // Direction + if (dir != 0) + { + NPC.direction = dir; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + } + else + { + // Accelerate + NPC.velocity *= 1.01f; + } + + // Spawn dust + Vector2 vel = NPC.velocity; + vel.Normalize(); + vel *= 55f; + + DoChargeVisual(NPC, Phase); + + GeneralParticleHandler.SpawnParticle(new SparkParticle(NPC.Center + vel + vel.RotatedBy(MathHelper.ToRadians(90)), vel / 7f, false, 20, 0.75f, new Color(155, 155, 155, 55), true)); + GeneralParticleHandler.SpawnParticle(new SparkParticle(NPC.Center + vel + vel.RotatedBy(MathHelper.ToRadians(-90)), vel / 7f, false, 20, 0.75f, new Color(155, 155, 155, 55), true)); + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= chargeTime) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] += 2f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Tooth Ball belch + else if (NPC.ai[0] == 2f) + { + // Velocity + if (NPC.ai[1] == 0f) + NPC.ai[1] = 500 * Math.Sign((NPC.Center - player.Center).X); + + Vector2 toothBallBelchPhaseSpeed = Vector2.Normalize(player.Center + new Vector2(NPC.ai[1], -300f) - NPC.Center - NPC.velocity) * toothBallBelchPhaseVelocity; + NPC.SimpleFlyMovement(toothBallBelchPhaseSpeed, toothBallBelchPhaseAcceleration); + + // Play sounds and spawn Tooth Balls + if (NPC.ai[2] == 0f) + RoarSoundSlot = SoundEngine.PlaySound(RoarSound, NPC.Center); + + if (NPC.ai[2] % toothBallBelchPhaseDivisor == 0f) + { + if (NPC.ai[2] != 0f) + SoundEngine.PlaySound(VomitSound, NPC.Center); + + Vector2 toothBallDirection = Vector2.Normalize(player.Center - NPC.Center) * (NPC.width + 20) / 2f + NPC.Center; + Vector2 toothBallVelocity = Vector2.Normalize(Main.player[NPC.target].Center - NPC.Center) * toothBallFinalVelocity; + Vector2 toothBallSpawnPos = new Vector2(toothBallDirection.X, toothBallDirection.Y + 45f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int toothBall = NPC.NewNPC(NPC.GetSource_FromAI(), (int)toothBallSpawnPos.X, (int)toothBallSpawnPos.Y, ModContent.NPCType(), 0, toothBallVelocity.X, toothBallVelocity.Y); + Main.npc[toothBall].velocity = Vector2.Normalize(toothBallVelocity) * NPC.velocity.Length(); + Main.npc[toothBall].netUpdate = true; + } + + for (int i = 0; i < 50; i++) + { + int dustID; + switch (Main.rand.Next(6)) + { + case 0: + case 1: + case 2: + case 3: + dustID = (int)CalamityDusts.SulphurousSeaAcid; + break; + default: + dustID = DustID.Blood; + break; + } + + // Choose a random speed and angle to belch out the vomit + float dustSpeed = Main.rand.NextFloat(3.0f, 12.0f); + float angleRandom = 0.06f; + Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(toothBallVelocity.ToRotation()); + dustVel = dustVel.RotatedBy(-angleRandom); + dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); + + // Pick a size for the vomit particles + float scale = Main.rand.NextFloat(1f, 2f); + + // Actually spawn the vomit + int idx = Dust.NewDust(toothBallSpawnPos, 40, 40, dustID, dustVel.X, dustVel.Y, 0, default, scale); + Main.dust[idx].noGravity = true; + } + } + + // Direction + int toothBallLookAt = Math.Sign(player.Center.X - NPC.Center.X); + if (toothBallLookAt != 0) + { + NPC.direction = toothBallLookAt; + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + NPC.spriteDirection = -NPC.direction; + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= toothBallBelchPhaseTimer) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Call sharks from the sides of the screen + else if (NPC.ai[0] == 3f) + { + // Velocity + NPC.velocity *= 0.98f; + NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); + + // Play sound and spawn sharks + if (NPC.ai[2] == attackTimer - 30) + SoundEngine.PlaySound(VomitSound, NPC.Center); + + if (NPC.ai[2] >= attackTimer - 90) + { + if (NPC.ai[2] % 18f == 0f) + { + calamityGlobalNPC.newAI[2] += 100f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 900f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 900f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + + if (CalamityWorld.LegendaryMode) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 1800f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 1800f), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + } + } + } + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= attackTimer) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + calamityGlobalNPC.newAI[2] = 0f; + NPC.ai[0] = 0f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Transition to phase 2 and call sharks from below + else if (NPC.ai[0] == 4f) + { + // Velocity + NPC.velocity *= 0.98f; + NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); + + // Sound + if (NPC.ai[2] == phaseTransitionTimer - 60) + RoarSoundSlot = SoundEngine.PlaySound(RoarSound, NPC.Center); + + if (NPC.ai[2] >= phaseTransitionTimer - 60) + { + if (NPC.ai[2] % 18f == 0f) + { + calamityGlobalNPC.newAI[2] += 150f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y + 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); + + if (CalamityWorld.LegendaryMode) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); + } + } + } + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= phaseTransitionTimer) + { + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + NPC.ai[0] = 5f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Phase 2 + else if (NPC.ai[0] == 5f && !player.dead) + { + // Velocity + if (NPC.ai[1] == 0f) + NPC.ai[1] = 500 * Math.Sign((NPC.Center - player.Center).X); + + Vector2 dukePhase2IdleSpeed = Vector2.Normalize(player.Center + new Vector2(NPC.ai[1], -300f) - NPC.Center - NPC.velocity) * idlePhaseVelocity; + NPC.SimpleFlyMovement(dukePhase2IdleSpeed, idlePhaseAcceleration); + + // Direction and rotation + int phase2FaceDirection = Math.Sign(player.Center.X - NPC.Center.X); + if (phase2FaceDirection != 0) + { + if (NPC.ai[2] == 0f && phase2FaceDirection != NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.direction = phase2FaceDirection; + + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + // Phase switch + if (calamityGlobalNPC.newAI[1] != 1f || (phase3 && !phase3AI)) + { + NPC.ai[2] += 1f; + if (NPC.ai[2] >= idlePhaseTimer || (phase3 && !phase3AI)) + { + int phase2AttackPicker = 0; + switch ((int)NPC.ai[3]) + { + case 0: + case 1: + case 2: + case 3: + phase2AttackPicker = 1; + break; + case 4: + NPC.ai[3] = 1f; + phase2AttackPicker = 2; + break; + case 5: + NPC.ai[3] = 0f; + phase2AttackPicker = 3; + break; + } + + if (phase3) + phase2AttackPicker = 4; + + // Set velocity for charge + if (phase2AttackPicker == 1) + { + NPC.ai[0] = 6f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + // Velocity and rotation + Vector2 distanceVector = player.Center + player.velocity * 20f - NPC.Center; + NPC.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + // Direction + if (phase2FaceDirection != 0) + { + NPC.direction = phase2FaceDirection; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + DoChargeBurst(NPC, 1); + } + + // Set velocity for spin + else if (phase2AttackPicker == 2) + { + // Velocity and rotation + NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * spinAttackSpeed; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + // Direction + if (phase2FaceDirection != 0) + { + NPC.direction = phase2FaceDirection; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + NPC.ai[0] = 7f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + else if (phase2AttackPicker == 3) + { + NPC.ai[0] = 8f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + // Go to next phase + else if (phase2AttackPicker == 4) + { + NPC.ai[0] = 9f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + NPC.netUpdate = true; + } + } + } + + // Charge + else if (NPC.ai[0] == 6f) + { + // The dumbest thing to ever exist + if (CalamityWorld.MaliceMode && NPC.ai[2] % 8f == 0f) + { + // Rotation and direction + int dir = Math.Sign(player.Center.X - NPC.Center.X); + if (dir != 0) + { + if (NPC.ai[2] == 0f && dir != NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.direction = dir; + + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + Vector2 distanceVector = player.Center + player.velocity * 20f - NPC.Center; + NPC.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + // Direction + if (dir != 0) + { + NPC.direction = dir; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + } + else + { + // Accelerate + NPC.velocity *= 1.01f; + } + + DoChargeVisual(NPC, Phase); + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= chargeTime) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + NPC.ai[0] = 5f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] += 2f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Tooth Ball and Vortex spin + else if (NPC.ai[0] == 7f) + { + // Play sounds and spawn Tooth Balls and a Vortex + if (NPC.ai[2] == 0f) + { + RoarSoundSlot = SoundEngine.PlaySound(RoarSound, NPC.Center); + + SoundEngine.PlaySound(VortexSpawnSound, NPC.Center); + int type = ModContent.ProjectileType(); + Vector2 vortexSpawn = NPC.Center + NPC.velocity.RotatedBy(MathHelper.PiOver2 * -NPC.direction) * spinTime / MathHelper.TwoPi; + if (Main.netMode != NetmodeID.MultiplayerClient) + Projectile.NewProjectile(NPC.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, VortexDamage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + } + + if (NPC.ai[2] % toothBallSpinPhaseDivisor == 0f) + { + if (NPC.ai[2] != 0f) + SoundEngine.PlaySound(VomitSound, NPC.Center); + + Vector2 phase2ToothBallDirection = Vector2.Normalize(NPC.velocity) * (NPC.width + 20) / 2f + NPC.Center; + Vector2 toothBallVelocity = Vector2.Normalize(NPC.velocity).RotatedBy(MathHelper.PiOver2 * NPC.direction) * toothBallSpinToothBallVelocity; + Vector2 toothBallSpawnPos = new Vector2(phase2ToothBallDirection.X, phase2ToothBallDirection.Y + 45f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int toothBall = NPC.NewNPC(NPC.GetSource_FromAI(), (int)toothBallSpawnPos.X, (int)toothBallSpawnPos.Y, ModContent.NPCType(), 0, toothBallVelocity.X, toothBallVelocity.Y); + Main.npc[toothBall].target = NPC.target; + Main.npc[toothBall].velocity = Vector2.Normalize(toothBallVelocity) * toothBallSpinToothBallVelocity * 0.5f; + Main.npc[toothBall].netUpdate = true; + Main.npc[toothBall].ai[3] = 30f; + } + + for (int i = 0; i < 50; i++) + { + int dustID; + switch (Main.rand.Next(6)) + { + case 0: + case 1: + case 2: + case 3: + dustID = (int)CalamityDusts.SulphurousSeaAcid; + break; + default: + dustID = DustID.Blood; + break; + } + + // Choose a random speed and angle to belch out the vomit + float dustSpeed = Main.rand.NextFloat(3.0f, 12.0f); + float angleRandom = 0.06f; + Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(toothBallVelocity.ToRotation()); + dustVel = dustVel.RotatedBy(-angleRandom); + dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); + + // Pick a size for the vomit particles + float scale = Main.rand.NextFloat(1f, 2f); + + // Actually spawn the vomit + int idx = Dust.NewDust(toothBallSpawnPos, 40, 40, dustID, dustVel.X, dustVel.Y, 0, default, scale); + Main.dust[idx].noGravity = true; + } + } + + // Velocity and rotation + NPC.velocity = NPC.velocity.RotatedBy(-(double)spinSpeed * (float)NPC.direction); + NPC.rotation -= spinSpeed * NPC.direction; + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= toothBallSpinTimer) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + NPC.ai[0] = 5f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Vomit a huge amount of gore into the sky and call sharks from the sides of the screen + else if (NPC.ai[0] == 8f) + { + // Velocity + NPC.velocity *= 0.98f; + NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); + + // Play sound + if (NPC.ai[2] == attackTimer - 30) + { + SoundEngine.PlaySound(VomitSound, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Vector2 phase2GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; + int type = ModContent.ProjectileType(); + int totalGore = CalamityWorld.LegendaryMode ? 40 : 20; + for (int i = 0; i < totalGore; i++) + { + float velocityX = NPC.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); + float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); + + if (CalamityWorld.LegendaryMode) + { + velocityX *= Main.rand.NextFloat() + 0.5f; + velocityY *= Main.rand.NextFloat() + 0.5f; + } + + Projectile.NewProjectile(NPC.GetSource_FromAI(), phase2GoreDirection.X, phase2GoreDirection.Y, velocityX, -velocityY, type, GoreDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + + if (NPC.ai[2] >= attackTimer - 90) + { + if (NPC.ai[2] % 18f == 0f) + { + calamityGlobalNPC.newAI[2] += 100f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float x = 900f - calamityGlobalNPC.newAI[2]; + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + } + } + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= attackTimer) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + calamityGlobalNPC.newAI[2] = 0f; + NPC.ai[0] = 5f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Transition to phase 3 and summon sharks from above + else if (NPC.ai[0] == 9f) + { + // Velocity + NPC.velocity *= 0.98f; + NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); + + // Sound + if (NPC.ai[2] == phaseTransitionTimer - 60) + RoarSoundSlot = SoundEngine.PlaySound(RoarSound, NPC.Center); + + if (NPC.ai[2] >= phaseTransitionTimer - 60) + { + if (NPC.ai[2] % 18f == 0f) + { + calamityGlobalNPC.newAI[2] += 200f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, 1f, sharkronVelocity, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2]), (int)(NPC.Center.Y - 540f), ModContent.NPCType(), 0, 0f, 0f, -1f, sharkronVelocity, 255); + + if (CalamityWorld.LegendaryMode) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + 50f + calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, 1f, -sharkronVelocity, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - 50f - calamityGlobalNPC.newAI[2] * 0.5f), (int)(NPC.Center.Y + 270f), ModContent.NPCType(), 0, 0f, 0f, -1f, -sharkronVelocity, 255); + } + } + } + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= phaseTransitionTimer) + { + calamityGlobalNPC.newAI[0] = 0f; + calamityGlobalNPC.newAI[1] = 0f; + calamityGlobalNPC.newAI[2] = 0f; + NPC.ai[0] = 10f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Phase 3 + else if (NPC.ai[0] == 10f && !player.dead) + { + // Alpha + NPC.alpha -= 25; + if (NPC.alpha < 0) + NPC.alpha = 0; + + // Movement location + if (NPC.ai[1] == 0f) + NPC.ai[1] = 500 * Math.Sign((NPC.Center - player.Center).X); + + Vector2 desiredVelocity = Vector2.Normalize(player.Center + new Vector2(-NPC.ai[1], -300f) - NPC.Center - NPC.velocity) * idlePhaseVelocity; + NPC.SimpleFlyMovement(desiredVelocity, idlePhaseAcceleration); + + // Rotation and direction + int phase3FaceDirection = Math.Sign(player.Center.X - NPC.Center.X); + if (phase3FaceDirection != 0) + { + if (NPC.ai[2] == 0f && phase3FaceDirection != NPC.direction) + { + NPC.rotation += MathHelper.Pi; + for (int l = 0; l < NPC.oldPos.Length; l++) + NPC.oldPos[l] = Vector2.Zero; + } + + NPC.direction = phase3FaceDirection; + + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + // Phase switch + if (calamityGlobalNPC.newAI[1] != 1f) + { + NPC.ai[2] += 1f; + if (NPC.ai[2] >= idlePhaseTimer) + { + int phase3AttackPicker = 0; + switch ((int)NPC.ai[3]) + { + case 0: + case 2: + case 3: + case 5: + case 6: + case 7: + phase3AttackPicker = 1; + break; + case 1: + case 8: + phase3AttackPicker = 2; + break; + case 4: + NPC.ai[3] = 1f; + phase3AttackPicker = 3; + break; + case 9: + NPC.ai[3] = 6f; + phase3AttackPicker = 4; + break; + } + + // Set velocity for charge + if (phase3AttackPicker == 1) + { + NPC.ai[0] = 11f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + // Velocity and rotation + Vector2 distanceVector = player.Center + player.velocity * 20f - NPC.Center; + NPC.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + // Direction + if (phase3FaceDirection != 0) + { + NPC.direction = phase3FaceDirection; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + DoChargeBurst(NPC, 2); + } + + // Pause + else if (phase3AttackPicker == 2) + { + NPC.ai[0] = 12f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + else if (phase3AttackPicker == 3) + { + NPC.ai[0] = 13f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + // Set velocity for spin + else if (phase3AttackPicker == 4) + { + // Velocity and rotation + NPC.velocity = Vector2.Normalize(player.Center - NPC.Center) * spinAttackSpeed; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + // Direction + if (phase3FaceDirection != 0) + { + NPC.direction = phase3FaceDirection; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + NPC.ai[0] = 14f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + } + + NPC.netUpdate = true; + } + } + } + + // Charge + else if (NPC.ai[0] == 11f) + { + // The dumbest thing to ever exist + if (CalamityWorld.MaliceMode && NPC.ai[2] % 6f == 0f) + { + // Rotation and direction + int dir = Math.Sign(player.Center.X - NPC.Center.X); + if (dir != 0) + { + if (NPC.ai[2] == 0f && dir != NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.direction = dir; + + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + + Vector2 distanceVector = player.Center + player.velocity * 20f - NPC.Center; + NPC.velocity = Vector2.Normalize(distanceVector) * chargeVelocity; + NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X); + + // Direction + if (dir != 0) + { + NPC.direction = dir; + + if (NPC.spriteDirection == 1) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + } + else + { + // Accelerate + NPC.velocity *= 1.01f; + } + + DoChargeVisual(NPC, Phase); + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= chargeTime) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + NPC.ai[0] = 10f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.ai[3] += 2f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Pause before teleport + else if (NPC.ai[0] == 12f) + { + // Disable contact damage during the teleporting phase + NPC.damage = 0; + + // Alpha + if (NPC.alpha < 255 && NPC.ai[2] >= teleportPauseTimer - 15f) + { + NPC.alpha += 17; + if (NPC.alpha > 255) + NPC.alpha = 255; + } + + // Velocity + NPC.velocity *= 0.98f; + NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); + + // Play sound + if (NPC.ai[2] == teleportPauseTimer / 2) + RoarSoundSlot = SoundEngine.PlaySound(RoarSound, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient && NPC.ai[2] == teleportPauseTimer - 1f) + { + // Teleport location + if (NPC.ai[1] == 0f) + NPC.ai[1] = 600 * Math.Sign((NPC.Center - player.Center).X); + + // Rotation and direction + Vector2 center = player.Center + new Vector2(NPC.ai[1], -300f); + Vector2 npcCenter = NPC.Center = center; + int phase3TeleportFaceDirection = Math.Sign(player.Center.X - npcCenter.X); + if (phase3TeleportFaceDirection != 0) + { + if (NPC.ai[2] == 0f && phase3TeleportFaceDirection != NPC.direction) + { + NPC.rotation += MathHelper.Pi; + for (int n = 0; n < NPC.oldPos.Length; n++) + NPC.oldPos[n] = Vector2.Zero; + } + + NPC.direction = phase3TeleportFaceDirection; + + if (NPC.spriteDirection != -NPC.direction) + NPC.rotation += MathHelper.Pi; + + NPC.spriteDirection = -NPC.direction; + } + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= teleportPauseTimer) + { + NPC.ai[0] = 10f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + + NPC.ai[3] += 2f; + if (NPC.ai[3] >= 9f) + NPC.ai[3] = 0f; + + NPC.netUpdate = true; + } + } + + // Vomit a huge amount of gore into the sky and call sharks from the sides of the screen + else if (NPC.ai[0] == 13f) + { + // Velocity + NPC.velocity *= 0.98f; + NPC.velocity.Y = MathHelper.Lerp(NPC.velocity.Y, 0f, 0.02f); + + // Play sound + if (NPC.ai[2] == attackTimer - 30) + { + SoundEngine.PlaySound(VomitSound, NPC.Center); + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + Vector2 phase3GoreDirection = NPC.rotation.ToRotationVector2() * (Vector2.UnitX * NPC.direction) * (NPC.width + 20) / 2f + NPC.Center; + int type = ModContent.ProjectileType(); + int totalGore = CalamityWorld.LegendaryMode ? 40 : 20; + for (int i = 0; i < totalGore; i++) + { + float velocityX = NPC.direction * goreVelocityX * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); + float velocityY = goreVelocityY * (Main.rand.NextFloat(0.2f, 0.8f) + 0.5f); + + if (CalamityWorld.LegendaryMode) + { + velocityX *= Main.rand.NextFloat() + 0.5f; + velocityY *= Main.rand.NextFloat() + 0.5f; + } + + Projectile.NewProjectile(NPC.GetSource_FromAI(), phase3GoreDirection.X, phase3GoreDirection.Y, velocityX, -velocityY, type, GoreDamage, 0f, Main.myPlayer, 0f, 0f); + } + } + } + + if (NPC.ai[2] >= attackTimer - 90) + { + if (NPC.ai[2] % 18f == 0f) + { + calamityGlobalNPC.newAI[2] += 150f; + + if (Main.netMode != NetmodeID.MultiplayerClient) + { + float x = 900f - calamityGlobalNPC.newAI[2]; + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2]), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + + if (CalamityWorld.LegendaryMode) + { + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X + x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + NPC.NewNPC(NPC.GetSource_FromAI(), (int)(NPC.Center.X - x), (int)(NPC.Center.Y - calamityGlobalNPC.newAI[2] * 0.5f), ModContent.NPCType(), 0, 0f, 0f, NPC.whoAmI, 0f, 255); + } + } + } + } + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= attackTimer) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + calamityGlobalNPC.newAI[2] = 0f; + NPC.ai[0] = 10f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + // Tooth Ball and Vortex spin + else if (NPC.ai[0] == 14f) + { + // Play sounds and spawn Tooth Balls and a Vortex + if (NPC.ai[2] == 0f) + { + RoarSoundSlot = SoundEngine.PlaySound(RoarSound, NPC.Center); + + SoundEngine.PlaySound(VortexSpawnSound, NPC.Center); + int type = ModContent.ProjectileType(); + Vector2 vortexSpawn = NPC.Center + NPC.velocity.RotatedBy(MathHelper.PiOver2 * -NPC.direction) * spinTime / MathHelper.TwoPi; + if (Main.netMode != NetmodeID.MultiplayerClient) + Projectile.NewProjectile(NPC.GetSource_FromAI(), vortexSpawn, Vector2.Zero, type, VortexDamage, 0f, Main.myPlayer, vortexSpawn.X, vortexSpawn.Y); + } + + if (NPC.ai[2] % toothBallSpinPhaseDivisor == 0f) + { + if (NPC.ai[2] != 0f) + SoundEngine.PlaySound(VomitSound, NPC.Center); + + Vector2 phase3ToothBallDirection = Vector2.Normalize(NPC.velocity) * (NPC.width + 20) / 2f + NPC.Center; + Vector2 toothBallVelocity = Vector2.Normalize(NPC.velocity).RotatedBy(MathHelper.PiOver2 * NPC.direction) * toothBallSpinToothBallVelocity; + Vector2 toothBallSpawnPos = new Vector2(phase3ToothBallDirection.X, phase3ToothBallDirection.Y + 45f); + if (Main.netMode != NetmodeID.MultiplayerClient) + { + int toothBall = NPC.NewNPC(NPC.GetSource_FromAI(), (int)toothBallSpawnPos.X, (int)toothBallSpawnPos.Y, ModContent.NPCType(), 0, toothBallVelocity.X, toothBallVelocity.Y); + Main.npc[toothBall].target = NPC.target; + Main.npc[toothBall].velocity = Vector2.Normalize(toothBallVelocity) * toothBallSpinToothBallVelocity * 0.5f; + Main.npc[toothBall].netUpdate = true; + Main.npc[toothBall].ai[3] = 60f; + } + + for (int i = 0; i < 50; i++) + { + int dustID; + switch (Main.rand.Next(6)) + { + case 0: + case 1: + case 2: + case 3: + dustID = (int)CalamityDusts.SulphurousSeaAcid; + break; + default: + dustID = DustID.Blood; + break; + } + + // Choose a random speed and angle to belch out the vomit + float dustSpeed = Main.rand.NextFloat(3.0f, 12.0f); + float angleRandom = 0.06f; + Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(toothBallVelocity.ToRotation()); + dustVel = dustVel.RotatedBy(-angleRandom); + dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); + + // Pick a size for the vomit particles + float scale = Main.rand.NextFloat(1f, 2f); + + // Actually spawn the vomit + int idx = Dust.NewDust(toothBallSpawnPos, 40, 40, dustID, dustVel.X, dustVel.Y, 0, default, scale); + Main.dust[idx].noGravity = true; + } + } + + // Velocity and rotation + NPC.velocity = NPC.velocity.RotatedBy(-(double)spinSpeed * NPC.direction); + NPC.rotation -= spinSpeed * NPC.direction; + + NPC.ai[2] += 1f; + if (NPC.ai[2] >= toothBallSpinTimer) + { + calamityGlobalNPC.newAI[0] += exhaustionIncreasePerAttack; + NPC.ai[0] = 10f; + NPC.ai[1] = 0f; + NPC.ai[2] = 0f; + NPC.TargetClosest(); + NPC.netUpdate = true; + } + } + + if (SoundEngine.TryGetActiveSound(RoarSoundSlot, out var roarSound) && roarSound.IsPlaying) + roarSound.Position = NPC.Center; } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void ModifyTypeName(ref string typeName) @@ -449,7 +2040,7 @@ namespace CalamityMod.NPCs.OldDuke return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -523,8 +2114,8 @@ namespace CalamityMod.NPCs.OldDuke { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 480); - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), Phase == 2 ? 600 : Phase == 1 ? 480 : 360); + target.AddBuff(ModContent.BuffType(), Phase == 2 ? 300 : Phase == 1 ? 240 : 180); if (Main.zenithWorld) { target.AddBuff(BuffID.Rabies, Main.rand.Next(180, 601)); diff --git a/NPCs/OldDuke/OldDukeToothBall.cs b/NPCs/OldDuke/OldDukeToothBall.cs index 8d259c4bd9..03bc136dcb 100644 --- a/NPCs/OldDuke/OldDukeToothBall.cs +++ b/NPCs/OldDuke/OldDukeToothBall.cs @@ -21,12 +21,15 @@ namespace CalamityMod.NPCs.OldDuke this.HideFromBestiary(); } + public static int ToothDamage = 60; // 240 + public static int CloudDamage = 70; // 280 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 40; NPC.height = 40; NPC.defense = 0; @@ -45,20 +48,15 @@ namespace CalamityMod.NPCs.OldDuke NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.65f, 0.55f, 0f); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.rotation += NPC.velocity.X * 0.05f; @@ -117,7 +115,7 @@ namespace CalamityMod.NPCs.OldDuke float velocity = death ? 14f : revenge ? 13f : 12f; if (expertMode) { - float speedUpMult = bossRush ? 0.01f : 0.005f; + float speedUpMult = 0.005f; velocity += Vector2.Distance(player.Center, NPC.Center) * speedUpMult; } @@ -147,7 +145,7 @@ namespace CalamityMod.NPCs.OldDuke NPC.velocity.X = (NPC.velocity.X * inertia + targetXDist) / (inertia + 1f); NPC.velocity.Y = (NPC.velocity.Y * inertia + targetYDist) / (inertia + 1f); - float toothBallAccel = bossRush ? 0.65f : 0.5f; + float toothBallAccel = 0.5f; foreach (var n in Main.ActiveNPCs) { if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) @@ -188,7 +186,6 @@ namespace CalamityMod.NPCs.OldDuke int totalProjectiles = CalamityWorld.death ? 5 : CalamityWorld.revenge ? 4 : 3; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float velocity = 10f; double angleA = radians * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; @@ -197,14 +194,13 @@ namespace CalamityMod.NPCs.OldDuke for (int k = 0; k < totalProjectiles; k++) { Vector2 toothSpikeRotation = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, toothSpikeRotation * 0.1f, type, damage, 0f, Main.myPlayer, toothSpikeRotation.X, toothSpikeRotation.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, toothSpikeRotation * 0.1f, type, ToothDamage, 0f, Main.myPlayer, toothSpikeRotation.X, toothSpikeRotation.Y); } if (Main.expertMode) { type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, CloudDamage, 0f, Main.myPlayer); } } @@ -216,16 +212,11 @@ namespace CalamityMod.NPCs.OldDuke int type = ModContent.ProjectileType(); for (int i = 0; i < 2; i++) Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center.X + Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, - Main.rand.Next(-1, 2), Main.rand.Next(-6, -3), type, NPC.damage / 2, 0f, Main.myPlayer); + Main.rand.Next(-1, 2), Main.rand.Next(-6, -3), type, OldDuke.GoreDamage, 0f, Main.myPlayer); } } } - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment)/* tModPorter Note: bossLifeScale -> balance (bossAdjustment is different, see the docs for details) */ - { - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) { cooldownSlot = ImmunityCooldownID.Bosses; @@ -259,12 +250,6 @@ namespace CalamityMod.NPCs.OldDuke return base.PreDraw(spriteBatch, screenPos, drawColor); } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 3; k++) diff --git a/NPCs/OldDuke/SulphurousSharkron.cs b/NPCs/OldDuke/SulphurousSharkron.cs index e2b4fdfe64..ea7de4d8dd 100644 --- a/NPCs/OldDuke/SulphurousSharkron.cs +++ b/NPCs/OldDuke/SulphurousSharkron.cs @@ -28,11 +28,11 @@ namespace CalamityMod.NPCs.OldDuke public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; NPC.width = 44; NPC.height = 44; - NPC.GetNPCDamage(); NPC.defense = 100; NPC.lifeMax = 6000; if (BossRushEvent.BossRushActive) @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.OldDuke NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) @@ -74,10 +70,9 @@ namespace CalamityMod.NPCs.OldDuke { Lighting.AddLight((int)((NPC.position.X + (NPC.width / 2)) / 16f), (int)((NPC.position.Y + (NPC.height / 2)) / 16f), 0.7f * NPC.Opacity, 0.9f * NPC.Opacity, 0f); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (NPC.target < 0 || NPC.target == Main.maxPlayers || Main.player[NPC.target].dead) { @@ -106,12 +101,12 @@ namespace CalamityMod.NPCs.OldDuke // Fly up bool upwardAI = NPC.ai[3] < 0f; - float flyTowardTargetGateValue = bossRush ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; - float extraTime = bossRush ? 60f : death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; + float flyTowardTargetGateValue = death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; + float extraTime = death ? 70f : revenge ? 75f : expertMode ? 80f : 90f; float aiGateValue = flyTowardTargetGateValue + extraTime; float dieGateValue = aiGateValue + extraTime * 4f; float fallDownGateValue = aiGateValue + extraTime; - float maxVelocity = bossRush ? 22f : death ? 20f : revenge ? 19f : expertMode ? 18f : 16f; + float maxVelocity = death ? 20f : revenge ? 19f : expertMode ? 18f : 16f; if (NPC.ai[0] == 0f) { @@ -146,7 +141,7 @@ namespace CalamityMod.NPCs.OldDuke Vector2 targetDistance = Main.player[NPC.target].Center - NPC.Center; targetDistance.Normalize(); targetDistance *= scaleFactor2; - float inertia = bossRush ? 20f : death ? 23f : revenge ? 25f : expertMode ? 27f : 30f; + float inertia = death ? 23f : revenge ? 25f : expertMode ? 27f : 30f; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetDistance) / inertia; NPC.velocity.Normalize(); NPC.velocity *= scaleFactor2; @@ -212,24 +207,18 @@ namespace CalamityMod.NPCs.OldDuke if (Main.rand.NextBool(8) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2) Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart); - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) { int spawnX = NPC.width / 2; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < 10; i++) { Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X + Main.rand.Next(-spawnX, spawnX), NPC.Center.Y, - Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), type, damage, 0f, Main.myPlayer); + Main.rand.Next(-3, 4), Main.rand.Next(-12, -6), type, OldDuke.GoreDamage, 0f, Main.myPlayer); } } } - public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment)/* tModPorter Note: bossLifeScale -> balance (bossAdjustment is different, see the docs for details) */ - { - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { if (NPC.IsABestiaryIconDummy) @@ -273,12 +262,6 @@ namespace CalamityMod.NPCs.OldDuke return NPC.Opacity == 1f; } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < 5; k++) diff --git a/NPCs/Other/CalamitasEnchantDemon.cs b/NPCs/Other/CalamitasEnchantDemon.cs index 831470fdd5..bcd5e9b907 100644 --- a/NPCs/Other/CalamitasEnchantDemon.cs +++ b/NPCs/Other/CalamitasEnchantDemon.cs @@ -30,7 +30,6 @@ namespace CalamityMod.NPCs.Other NPC.DeathSound = SoundID.NPCDeath18; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = 0; diff --git a/NPCs/Other/DemonPortal.cs b/NPCs/Other/DemonPortal.cs index 4c870617d8..bef1ccef69 100644 --- a/NPCs/Other/DemonPortal.cs +++ b/NPCs/Other/DemonPortal.cs @@ -25,7 +25,6 @@ namespace CalamityMod.NPCs.Other NPC.lifeMax = 25000; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.knockBackResist = 0f; NPC.netAlways = true; NPC.aiStyle = -1; diff --git a/NPCs/Other/ExhumedHeart.cs b/NPCs/Other/ExhumedHeart.cs index dd0a285bbe..d123d5aebe 100644 --- a/NPCs/Other/ExhumedHeart.cs +++ b/NPCs/Other/ExhumedHeart.cs @@ -32,7 +32,6 @@ namespace CalamityMod.NPCs.Other NPC.lifeMax = 50000; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0f; diff --git a/NPCs/Other/LecherousOrb.cs b/NPCs/Other/LecherousOrb.cs index 5d6d4e7e7d..2ed0ff9386 100644 --- a/NPCs/Other/LecherousOrb.cs +++ b/NPCs/Other/LecherousOrb.cs @@ -33,7 +33,6 @@ namespace CalamityMod.NPCs.Other NPC.lifeMax = 180000; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.value = 0f; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath7; NPC.knockBackResist = 0f; diff --git a/NPCs/Other/THELORDE.cs b/NPCs/Other/THELORDE.cs index 360e1a19fa..5811af7d54 100644 --- a/NPCs/Other/THELORDE.cs +++ b/NPCs/Other/THELORDE.cs @@ -63,7 +63,7 @@ namespace CalamityMod.NPCs.Other NPC.defense = 100; NPC.lifeMax = 2500000; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(100, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 100); NPC.HitSound = SoundID.NPCHit13; NPC.DeathSound = null; NPC.boss = true; @@ -584,8 +584,8 @@ namespace CalamityMod.NPCs.Other public override void ModifyNPCLoot(NPCLoot npcLoot) { double pisquaredover6 = Math.Pow(MathHelper.Pi, 2) / 6; - npcLoot.AddIf(() => CalamityWorld.LegendaryMode && CalamityWorld.revenge, ModContent.ItemType()); // guaranteed in legendarev mode - npcLoot.AddIf(() => !(CalamityWorld.LegendaryMode && CalamityWorld.revenge), ModContent.ItemType(), 27); // otherwise 1 in 27 + npcLoot.AddIf(() => CalamityWorld.LegendaryMode, ModContent.ItemType()); // guaranteed in Legendary mode + npcLoot.AddIf(() => !CalamityWorld.LegendaryMode, ModContent.ItemType(), 27); // otherwise 1 in 27 npcLoot.Add(ModContent.ItemType(), 1, 22, (int)(pisquaredover6 * 100)); } } diff --git a/NPCs/Perforator/PerforatorBodyLarge.cs b/NPCs/Perforator/PerforatorBodyLarge.cs index cbc5e97425..18063cf7e3 100644 --- a/NPCs/Perforator/PerforatorBodyLarge.cs +++ b/NPCs/Perforator/PerforatorBodyLarge.cs @@ -39,12 +39,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 20; // 40 NPC.width = 60; NPC.height = 60; NPC.defense = 8; - NPC.LifeMaxNERB(2700, 3240, 80000); + NPC.LifeMaxNERB(2160, 2600, 80000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -60,9 +60,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -72,10 +70,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -147,21 +141,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) diff --git a/NPCs/Perforator/PerforatorBodyMedium.cs b/NPCs/Perforator/PerforatorBodyMedium.cs index 04b29437b1..94bbae9e1f 100644 --- a/NPCs/Perforator/PerforatorBodyMedium.cs +++ b/NPCs/Perforator/PerforatorBodyMedium.cs @@ -36,13 +36,13 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 14; // 28 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 40; NPC.defense = 6; - NPC.LifeMaxNERB(180, 216, 7000); + NPC.LifeMaxNERB(144, 172, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -58,9 +58,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -72,16 +70,11 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.realLife = -1; @@ -114,8 +107,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -130,8 +122,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.type = ModContent.NPCType(); @@ -151,8 +142,7 @@ namespace CalamityMod.NPCs.Perforator if (death && !spawnedBlob) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } int whoAmI2 = NPC.whoAmI; @@ -207,22 +197,6 @@ namespace CalamityMod.NPCs.Perforator NPC.position.Y += targetY; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -286,15 +260,14 @@ namespace CalamityMod.NPCs.Perforator if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer); for (int i = -1; i < 2; i++) //releases 3 Ichor Shots { int type2 = ModContent.ProjectileType(); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); int spread = Main.rand.Next(16, 36); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer); } } } @@ -323,8 +296,7 @@ namespace CalamityMod.NPCs.Perforator { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(BuffID.Ichor, 120); + target.AddBuff(BuffID.Ichor, 240); } } } diff --git a/NPCs/Perforator/PerforatorBodySmall.cs b/NPCs/Perforator/PerforatorBodySmall.cs index 0ef54560de..160109d293 100644 --- a/NPCs/Perforator/PerforatorBodySmall.cs +++ b/NPCs/Perforator/PerforatorBodySmall.cs @@ -34,12 +34,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.width = 42; NPC.height = 42; NPC.defense = 4; - NPC.LifeMaxNERB(1200, 1440, 50000); + NPC.LifeMaxNERB(960, 1152, 50000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -55,9 +55,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -142,22 +136,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) diff --git a/NPCs/Perforator/PerforatorHeadLarge.cs b/NPCs/Perforator/PerforatorHeadLarge.cs index 600cdb43e7..e021df330e 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 @@ -48,17 +49,20 @@ namespace CalamityMod.NPCs.Perforator } } + // GFB exclusive + public static int LaserWallDamage = 10; // 40 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 80 NPC.npcSlots = 5f; NPC.width = 70; NPC.height = 84; NPC.defense = 4; - NPC.LifeMaxNERB(2700, 3240, 80000); + NPC.LifeMaxNERB(2160, 2600, 80000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -73,9 +77,7 @@ namespace CalamityMod.NPCs.Perforator NPC.DeathSound = DeathSound; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -85,10 +87,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -120,10 +118,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) @@ -136,7 +133,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--; @@ -144,12 +141,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 @@ -223,7 +220,7 @@ namespace CalamityMod.NPCs.Perforator for (int i = 0; i < spitProjectileAmount; i++) { int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = type == ModContent.ProjectileType() ? PerforatorHive.IchorShotDamage : PerforatorHive.BloodGeyserDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), spitLocation + Main.rand.NextVector2CircularEdge(8f, 8f), NPC.velocity.SafeNormalize(Vector2.UnitY) * spitProjectileBaseVelocity + Main.rand.NextVector2CircularEdge(spitProjectileRandomVelocityLimit, spitProjectileRandomVelocityLimit), @@ -239,11 +236,10 @@ namespace CalamityMod.NPCs.Perforator for (int i = 0; i < spitBlobAmount; i++) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Projectile.NewProjectile(NPC.GetSource_FromAI(), spitLocation + Main.rand.NextVector2CircularEdge(8f, 8f), NPC.velocity.SafeNormalize(Vector2.UnitY) * spitBlobBaseVelocity + Main.rand.NextVector2CircularEdge(spitBlobRandomVelocityLimit, spitBlobRandomVelocityLimit), - type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); + type, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } } @@ -365,7 +361,7 @@ namespace CalamityMod.NPCs.Perforator float laserOffset = 1500f; float laserVelocity = 4f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = LaserWallDamage; NPC.Calamity().newAI[3]++; if (NPC.Calamity().newAI[3] > 180f) // Effectively 10 seconds but give a little headstart in case players kill it too fast @@ -537,19 +533,6 @@ namespace CalamityMod.NPCs.Perforator if (NPC.Distance(player.Center) > 1280f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChargeSpeed * 0.25f; - float minimalDamageVelocity = maxChargeSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -636,11 +619,8 @@ namespace CalamityMod.NPCs.Perforator } } - public override void BossLoot(ref string name, ref int potionType) - { - name = CalamityUtils.GetTextValue("NPCs.PerforatorLarge"); - potionType = ItemID.HealingPotion; - } + public override LocalizedText DeathMessage => CalamityUtils.GetText("NPCs.PerforatorLarge"); + public override void BossLoot(ref int potionType) => potionType = ItemID.HealingPotion; public override bool SpecialOnKill() { diff --git a/NPCs/Perforator/PerforatorHeadMedium.cs b/NPCs/Perforator/PerforatorHeadMedium.cs index 2638f557a3..73829ca465 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); @@ -48,13 +49,13 @@ namespace CalamityMod.NPCs.Perforator { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 24; // 48 NPC.npcSlots = 5f; NPC.width = 58; NPC.height = 68; NPC.defense = 2; - NPC.LifeMaxNERB(180, 216, 7000); + NPC.LifeMaxNERB(144, 172, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -69,9 +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; @@ -83,10 +82,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -104,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 @@ -166,8 +169,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -181,8 +183,7 @@ namespace CalamityMod.NPCs.Perforator if (death && !spawnedBlob) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, NPC.velocity + Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -441,19 +442,6 @@ namespace CalamityMod.NPCs.Perforator if (NPC.Distance(player.Center) > 1280f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChargeSpeed * 0.25f; - float minimalDamageVelocity = maxChargeSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -559,24 +547,20 @@ namespace CalamityMod.NPCs.Perforator if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer); for (int i = -1; i < 2; i++) //releases 3 Ichor Shots { int type2 = ModContent.ProjectileType(); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); int spread = Main.rand.Next(16, 36); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer); } } } - public override void BossLoot(ref string name, ref int potionType) - { - name = CalamityUtils.GetTextValue("NPCs.PerforatorMedium"); - potionType = ItemID.HealingPotion; - } + public override LocalizedText DeathMessage => CalamityUtils.GetText("NPCs.PerforatorMedium"); + public override void BossLoot(ref int potionType) => potionType = ItemID.HealingPotion; public override bool SpecialOnKill() { @@ -592,8 +576,7 @@ namespace CalamityMod.NPCs.Perforator { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 240); - target.AddBuff(BuffID.Ichor, 240); + target.AddBuff(BuffID.Ichor, 360); } } } diff --git a/NPCs/Perforator/PerforatorHeadSmall.cs b/NPCs/Perforator/PerforatorHeadSmall.cs index b0120e825c..69dee673c6 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 @@ -53,12 +54,12 @@ namespace CalamityMod.NPCs.Perforator { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 22; // 44 NPC.npcSlots = 5f; NPC.width = 42; NPC.height = 62; - NPC.LifeMaxNERB(1200, 1440, 50000); + NPC.LifeMaxNERB(960, 1152, 50000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -73,9 +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; @@ -85,10 +84,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -116,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--; @@ -130,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 @@ -454,19 +448,6 @@ namespace CalamityMod.NPCs.Perforator if (NPC.Distance(player.Center) > 1280f) NPC.velocity += (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = maxChargeSpeed * 0.25f; - float minimalDamageVelocity = maxChargeSpeed * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2((double)NPC.velocity.Y, (double)NPC.velocity.X) + MathHelper.PiOver2; if (shouldFly) @@ -557,11 +538,8 @@ namespace CalamityMod.NPCs.Perforator } } - public override void BossLoot(ref string name, ref int potionType) - { - name = CalamityUtils.GetTextValue("NPCs.PerforatorSmall"); - potionType = ItemID.HealingPotion; - } + public override LocalizedText DeathMessage => CalamityUtils.GetText("NPCs.PerforatorSmall"); + public override void BossLoot(ref int potionType) => potionType = ItemID.HealingPotion; public override bool SpecialOnKill() { diff --git a/NPCs/Perforator/PerforatorHive.cs b/NPCs/Perforator/PerforatorHive.cs index 144a0ed936..9b67caa5b7 100644 --- a/NPCs/Perforator/PerforatorHive.cs +++ b/NPCs/Perforator/PerforatorHive.cs @@ -18,6 +18,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.Items.Weapons.Ranged; using CalamityMod.Items.Weapons.Rogue; using CalamityMod.Items.Weapons.Summon; +using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -43,13 +44,24 @@ namespace CalamityMod.NPCs.Perforator public static readonly SoundStyle DeathSound = new("CalamityMod/Sounds/NPCKilled/PerfHiveDeath"); public static Asset GlowTexture; + // Squash n' stretch won't affect actual hitbox size + private const int Width = 110; + private const int Height = 100; + private int biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - private bool small = false; - private bool medium = false; - private bool large = false; + private bool smallSpawned = false; + private bool mediumSpawned = false; + private bool largeSpawned = false; private int wormsAlive = 0; + private float squash; + private float addedStretch; + private int squashTimer = 0; // Tracks current progress in scaling animation + private const int squashInterval = 24; + private const float maxSquash = 0.3f; // Upper intensity + private float wormSpawnStateTimer = 0f; // For managing worm spawn animation + public override void SetStaticDefaults() { Main.npcFrameCount[Type] = 10; @@ -63,19 +75,23 @@ namespace CalamityMod.NPCs.Perforator } } + public static int BloodGeyserDamage = 12; // 48 + public static int IchorShotDamage = 12; // 48 + public static int IchorBlobDamage = 12; // 48 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; NPC.npcSlots = 18f; - NPC.GetNPCDamage(); - NPC.width = 110; - NPC.height = 100; + NPC.damage = 30; // 48 (1.6x expert scaling) + NPC.width = Width; + NPC.height = Height; NPC.defense = 4; - NPC.LifeMaxNERB(6000, 7200, 270000); + NPC.LifeMaxNERB(4800, 5750, 270000); NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 8, 0, 0); + NPC.value = Item.buyPrice(gold: 5); NPC.boss = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -84,9 +100,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -111,20 +124,22 @@ namespace CalamityMod.NPCs.Perforator { writer.Write(biomeEnrageTimer); writer.Write(wormsAlive); - writer.Write(small); - writer.Write(medium); - writer.Write(large); + writer.Write(smallSpawned); + writer.Write(mediumSpawned); + writer.Write(largeSpawned); writer.Write(NPC.localAI[2]); + writer.Write(wormSpawnStateTimer); } public override void ReceiveExtraAI(BinaryReader reader) { biomeEnrageTimer = reader.ReadInt32(); wormsAlive = reader.ReadInt32(); - small = reader.ReadBoolean(); - medium = reader.ReadBoolean(); - large = reader.ReadBoolean(); + smallSpawned = reader.ReadBoolean(); + mediumSpawned = reader.ReadBoolean(); + largeSpawned = reader.ReadBoolean(); NPC.localAI[2] = reader.ReadSingle(); + wormSpawnStateTimer = reader.ReadSingle(); } public override void AI() @@ -139,13 +154,12 @@ namespace CalamityMod.NPCs.Perforator if (Vector2.Distance(Main.player[NPC.target].Center, NPC.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles) NPC.TargetClosest(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Variables for ichor blob phase - float blobPhaseGateValue = bossRush ? 450f : 600f; + float blobPhaseGateValue = 600f; bool floatAboveToFireBlobs = NPC.ai[2] >= blobPhaseGateValue - 120f; Player player = Main.player[NPC.target]; @@ -155,10 +169,13 @@ namespace CalamityMod.NPCs.Perforator // Phases based on life percentage bool phase2 = lifeRatio < 0.7f; - bool phase3 = medium && revenge; + + bool spawnSmall = CalamityWorld.LegendaryMode ? lifeRatio < 0.85f : lifeRatio < 0.75f; + bool spawnMedium = CalamityWorld.LegendaryMode ? lifeRatio < 0.60f : lifeRatio < 0.50f; + bool spawnLarge = CalamityWorld.LegendaryMode ? lifeRatio < 0.45f : lifeRatio < 0.25f; // 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--; @@ -166,17 +183,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; } @@ -200,6 +217,8 @@ namespace CalamityMod.NPCs.Perforator return; } } + + // Natural despawn prevention else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; @@ -208,7 +227,7 @@ namespace CalamityMod.NPCs.Perforator { // Leak projectiles everywhere and start healing int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = type == ModContent.ProjectileType() ? IchorShotDamage : BloodGeyserDamage; int spread = Main.rand.Next(-45, 46); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread)), type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); @@ -242,79 +261,141 @@ namespace CalamityMod.NPCs.Perforator else wormsAlive = 0; - // Do not spit from side mouth while the large worm is alive - // Death Mode ignores this - if (largeWormAlive && !death) - phase3 = false; - NPC.Calamity().DR = wormsAlive * 0.3f; - if (NPC.ai[3] == 0f && NPC.life > 0) - NPC.ai[3] = NPC.lifeMax; - - bool canSpawnWorms = !small || !medium || !large || Main.getGoodWorld; - if (NPC.life > 0 && canSpawnWorms) + if (Main.netMode != NetmodeID.MultiplayerClient && wormSpawnStateTimer == 0f) { - if (Main.netMode != NetmodeID.MultiplayerClient) + if ((!smallSpawned && spawnSmall) || + (!mediumSpawned && spawnMedium) || + (!largeSpawned && spawnLarge)) { - int wormSpawnGateValue = (int)(NPC.lifeMax * (Main.getGoodWorld ? 0.15 : 0.25)); - if ((NPC.life + wormSpawnGateValue) < NPC.ai[3]) + wormSpawnStateTimer = 1f; // Start slowing down to spawn a worm + NPC.netUpdate = true; + } + } + + if (wormSpawnStateTimer > 0f) + { + + NPC.velocity *= 0.94f; // Slow down + NPC.rotation = NPC.velocity.X * 0.04f; // Update rotation to match velocity + + NPC.damage = 0; + + wormSpawnStateTimer++; + + int slowDownDuration = 20; + int waitBeforeSpawnDuration = 40; + int totalStateDuration = slowDownDuration + waitBeforeSpawnDuration; + + if (wormSpawnStateTimer >= slowDownDuration && wormSpawnStateTimer < totalStateDuration) + { + if (Main.rand.NextBool(7)) { - NPC.ai[3] = NPC.life; - int wormType = ModContent.NPCType(); - if (!small) - { - small = true; - } - else if (!medium) - { - medium = true; - wormType = ModContent.NPCType(); - } - else if (!large) - { - large = true; - wormType = ModContent.NPCType(); - } + int bloodLifetime = Main.rand.Next(20, 45); + float bloodScale = Main.rand.NextFloat(0.5f, 1f); + Color bloodColor = Color.Lerp(Color.Yellow, Color.DarkRed, Main.rand.NextFloat(0.7f)); + float randomSpeedMultiplier = Main.rand.NextFloat(0.8f, 1.6f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit(5) * 1.5f * randomSpeedMultiplier; + bloodVelocity.Y -= 8f; - if (Main.getGoodWorld && lifeRatio < 0.5f) - { - if (lifeRatio > 0.35f) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); - else if (lifeRatio > 0.2f) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); - else if (lifeRatio > 0.05f) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); - } - else - { - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); + Vector2 randomOffset = Main.rand.NextVector2Unit() * Main.rand.NextFloat(25f, 50f); + Vector2 spawnPosition = NPC.Center + randomOffset; - // Spawn two small worms in Death - if (death) - { - if (wormType == ModContent.NPCType()) - NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); - } - } - - NPC.TargetClosest(); - - SoundEngine.PlaySound(WormSpawn, NPC.Center); - - for (int i = 0; i < 16; i++) - Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Ichor); - - for (int j = 0; j < 32; j++) - { - int bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood); - Main.dust[bloodDust].noGravity = true; - Main.dust[bloodDust].scale = 3f; - bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood); - Main.dust[bloodDust].scale = 2f; - } + BloodParticle blood = new BloodParticle(spawnPosition, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); } } + + else if (wormSpawnStateTimer >= totalStateDuration) + { + // Blood vars change based on worm spawned + Color bloodColor = Color.Lerp(Color.Crimson, Color.DarkRed, Main.rand.NextFloat(0.9f)); + int bloodAmt = 0; + float minScale = 1f; + float maxScale = 1.8f; + int wormType = -1; + + if (!smallSpawned) + { + + smallSpawned = true; + wormType = ModContent.NPCType(); + + bloodAmt = 12; + } + else if (!mediumSpawned && spawnMedium) + { + mediumSpawned = true; + wormType = ModContent.NPCType(); + + bloodColor = Color.Lerp(Color.Yellow, Color.Orange, Main.rand.NextFloat(0.9f)); + bloodAmt = 12; + minScale = 1.5f; + maxScale = 2.4f; + } + else if (!largeSpawned && spawnLarge) + { + largeSpawned = true; + wormType = ModContent.NPCType(); + + bloodAmt = 18; + minScale = 1.4f; + maxScale = 2.2f; + } + + for (int i = 0; i < bloodAmt; ++i) + { + int bloodLifetime = Main.rand.Next(80, 140); + float bloodScale = Main.rand.NextFloat(minScale, maxScale); + + float randomSpeedMultiplier = Main.rand.NextFloat(1.4f, 2.2f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * 4 * randomSpeedMultiplier; + bloodVelocity.Y -= 5f; + BloodParticle blood = new BloodParticle(NPC.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + + + if (CalamityWorld.LegendaryMode && lifeRatio < 0.5f) + { + if (lifeRatio > 0.35f) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); + else if (lifeRatio > 0.2f) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); + else if (lifeRatio > 0.05f) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), ModContent.NPCType(), 1); + } + if (wormType != -1) + { + squashTimer = squashInterval; // Start scaling animation + + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); + + // Spawn two small worms in Death + if (death) + { + if (wormType == ModContent.NPCType()) + NPC.NewNPC(NPC.GetSource_FromAI(), (int)NPC.Center.X + Main.rand.Next(-25, 26), (int)NPC.Center.Y + Main.rand.Next(-25, 26), wormType, 1); + } + } + + NPC.TargetClosest(); + SoundEngine.PlaySound(WormSpawn, NPC.Center); + wormSpawnStateTimer = 0f; // Resets for next time its called + NPC.netUpdate = true; + } + return; // Don't progress in the AI loop until a worm has finished spawning + } + + if (squashTimer > 0) + { + squashTimer--; + addedStretch = MathHelper.Lerp(0f, maxSquash, (float) squashTimer / squashInterval); + } + else + { + addedStretch = 0f; } if (Math.Abs(NPC.Center.X - player.Center.X) > 10f) @@ -329,7 +410,7 @@ namespace CalamityMod.NPCs.Perforator // Emit ichor blobs if (phase2) { - if (wormsAlive == 0 || large || bossRush || floatAboveToFireBlobs || (CalamityWorld.LegendaryMode && CalamityWorld.revenge)) + if (wormsAlive == 0 || largeSpawned || floatAboveToFireBlobs || CalamityWorld.LegendaryMode) { NPC.ai[2] += 1f; if (NPC.ai[2] >= blobPhaseGateValue) @@ -337,10 +418,30 @@ namespace CalamityMod.NPCs.Perforator if (NPC.ai[2] < blobPhaseGateValue + 300f) { if (NPC.velocity.Length() > 0.5f) - NPC.velocity *= bossRush ? 0.94f : 0.96f; + NPC.velocity *= 0.96f; else NPC.ai[2] = blobPhaseGateValue + 300f; + } + + if (NPC.ai[2] < blobPhaseGateValue + 180f) + { + if (Main.rand.NextBool(4)) + { + int bloodLifetime = Main.rand.Next(25, 35); + float bloodScale = Main.rand.NextFloat(0.6f, 0.95f); + Color bloodColor = Color.Lerp(Color.Yellow, Color.Orange, Main.rand.NextFloat(0.8f)); + float randomSpeedMultiplier = Main.rand.NextFloat(1.5f, 2.5f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit() * randomSpeedMultiplier; + + Vector2 spawnPosition = NPC.Center; + spawnPosition.Y += 42; + + BloodParticle blood = new BloodParticle(spawnPosition, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } + } + else { NPC.ai[2] = 0f; @@ -358,31 +459,28 @@ namespace CalamityMod.NPCs.Perforator Main.dust[ichorDust].scale = 0.5f; } - bool ichorBlobBigWormPhase = wormsAlive > 0 && large; + bool ichorBlobBigWormPhase = wormsAlive > 0 && largeSpawned; int numBlobs = expertMode ? (ichorBlobBigWormPhase ? 4 : 6) : (ichorBlobBigWormPhase ? 2 : 4); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numBlobs *= 2; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int blobSpread = expertMode ? (ichorBlobBigWormPhase ? 66 : 100) : (ichorBlobBigWormPhase ? 33 : 66); for (int i = 0; i < numBlobs; i++) { Vector2 blobVelocity = new Vector2(Main.rand.Next(-blobSpread, blobSpread + 1), Main.rand.Next(-blobSpread, blobSpread + 1)); blobVelocity.Normalize(); - blobVelocity *= Main.rand.Next(400, 801) * (bossRush ? 0.02f : 0.01f); + blobVelocity *= Main.rand.Next(400, 801) * 0.01f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) blobVelocity *= Main.rand.NextFloat() + 1f; float blobVelocityYAdd = Math.Abs(blobVelocity.Y) * 0.25f; if (blobVelocity.Y < 2f) blobVelocity.Y = 2f + blobVelocityYAdd; - // Fall a bit further or shorter depending on which blob it is - float fallFurtherDistance = 48f * (i - numBlobs / 2); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 50f, blobVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y + fallFurtherDistance); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 50f, blobVelocity, type, IchorBlobDamage, 0f, Main.myPlayer, 0f, player.Center.Y); } } @@ -408,64 +506,6 @@ namespace CalamityMod.NPCs.Perforator return; } - // Side mouth starts spitting when it opens - if (phase3) - { - NPC.localAI[2] += 1f; - if (NPC.frame.Y / (TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type]) == 5 && NPC.localAI[2] >= 0f) - { - // Ensure it only spits once - // Spits half as much while the medium worm is alive - NPC.localAI[2] = mediumWormAlive ? -70f : -10f; - - Vector2 centerOffset = new Vector2(NPC.direction == 1 ? 52f : -52f, -4f); - Vector2 mouthLocation = NPC.Center + centerOffset; - Vector2 spitVelocity = (mouthLocation + (Vector2.UnitX * 100f * NPC.direction) - mouthLocation).SafeNormalize(Vector2.UnitY) * 6f; - - SoundEngine.PlaySound(SoundID.Item17, mouthLocation); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int maxProjectiles = 3; - Vector2 dustSpawnBox = new Vector2(12f, 12f); - Vector2 dustSpawnOffset = dustSpawnBox * 0.5f; - for (int i = 0; i < maxProjectiles; i++) - { - bool ichor = Main.rand.NextBool(); - int type = ichor ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Vector2 randomizedProjectileSpawnLocation = mouthLocation + Main.rand.NextVector2CircularEdge(4f, 4f); - Vector2 randomizedProjectileVelocity = spitVelocity + Main.rand.NextVector2CircularEdge(1.5f, 1.5f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), randomizedProjectileSpawnLocation, randomizedProjectileVelocity, type, damage, 0f, Main.myPlayer, 0f, player.Center.Y); - - float dustSpeed = Main.rand.NextFloat(3.0f, 9.0f); - float angleRandom = 0.05f; - Vector2 dustVelocity = new Vector2(dustSpeed, 0.0f).RotatedBy(randomizedProjectileVelocity.ToRotation()); - dustVelocity = dustVelocity.RotatedBy(-angleRandom); - dustVelocity = dustVelocity.RotatedByRandom(2.0f * angleRandom); - - if (ichor) - { - for (int j = 0; j < 4; j++) - { - int ichorDust = Dust.NewDust(randomizedProjectileSpawnLocation - dustSpawnOffset, (int)dustSpawnBox.X, (int)dustSpawnBox.Y, DustID.Ichor); - Main.dust[ichorDust].velocity = dustVelocity; - } - } - else - { - for (int j = 0; j < 4; j++) - { - int bloodDust = Dust.NewDust(randomizedProjectileSpawnLocation - dustSpawnOffset, (int)dustSpawnBox.X, (int)dustSpawnBox.Y, DustID.Blood); - Main.dust[bloodDust].velocity = dustVelocity; - Main.dust[bloodDust].scale = 2f; - } - } - } - } - } - } - if (Main.netMode != NetmodeID.MultiplayerClient) { NPC.localAI[0] += 1f; @@ -474,24 +514,23 @@ namespace CalamityMod.NPCs.Perforator NPC.localAI[0] = 0f; SoundEngine.PlaySound(GeyserShoot, NPC.Center); - bool ichor = Main.rand.NextBool(); - int type = ichor ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int numProj = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; - if (phase3) - numProj = death ? 12 : revenge ? 10 : expertMode ? 8 : 6; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numProj *= 2; int spread = 75; float velocity = 8f; Vector2 destination = wormsAlive > 0 ? player.Center : NPC.Center - Vector2.UnitY * 100f; - Vector2 projectileVelocity = new Vector2(Vector2.Normalize(destination - NPC.Center).X * velocity, -velocity); + Vector2 projectileVelocity = new Vector2(Utils.DirectionTo(NPC.Center, destination).X * velocity, -velocity); float rotation = MathHelper.ToRadians(spread); Vector2 dustSpawnBox = new Vector2(12f, 12f); Vector2 dustSpawnOffset = dustSpawnBox * 0.5f; for (int i = 0; i < numProj; i++) { + bool ichor = Main.rand.NextBool(); + int type = ichor ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = ichor ? IchorShotDamage : BloodGeyserDamage; + Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); Vector2 randomVelocity = new Vector2(Main.rand.NextFloat() - 0.5f, Main.rand.NextFloat() - 0.5f); Vector2 projectileSpawnLocation = NPC.Center + Vector2.Normalize(perturbedSpeed) * 50f; @@ -535,11 +574,11 @@ namespace CalamityMod.NPCs.Perforator // Set damage NPC.damage = NPC.defDamage; - if (large || death) + if (largeSpawned || death) Movement(player, 13f + velocityEnrageIncrease, death ? 0.115f : 0.1f, 20f); - else if (medium) + else if (mediumSpawned) Movement(player, 12f + velocityEnrageIncrease, death ? 0.11f : 0.095f, 30f); - else if (small) + else if (smallSpawned) Movement(player, 11f + velocityEnrageIncrease, death ? 0.105f : 0.09f, 40f); else Movement(player, 10f + velocityEnrageIncrease, death ? 0.1f : 0.085f, 50f); @@ -600,22 +639,19 @@ namespace CalamityMod.NPCs.Perforator public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { - SpriteEffects spriteEffects = SpriteEffects.None; - if (NPC.spriteDirection == 1) - spriteEffects = SpriteEffects.FlipHorizontally; + SpriteEffects spriteEffects = NPC.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Texture2D texture = TextureAssets.Npc[Type].Value; + Color drawColorAlpha = NPC.GetAlpha(drawColor); - Texture2D texture2D15 = TextureAssets.Npc[Type].Value; - Vector2 halfSizeTexture = new Vector2((float)(TextureAssets.Npc[Type].Value.Width / 2), (float)(TextureAssets.Npc[Type].Value.Height / Main.npcFrameCount[Type] / 2)); + Vector2 scaleStretch = new Vector2(1f - addedStretch, 1f + addedStretch) * NPC.scale; + float yOffset = addedStretch * 0.5f * NPC.height; // offset from stretching - Vector2 drawLocation = NPC.Center - screenPos; - drawLocation -= new Vector2((float)texture2D15.Width, (float)(texture2D15.Height / Main.npcFrameCount[Type])) * NPC.scale / 2f; - drawLocation += halfSizeTexture * NPC.scale + new Vector2(0f, NPC.gfxOffY); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, NPC.GetAlpha(drawColor), NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); - - texture2D15 = GlowTexture.Value; + spriteBatch.Draw(texture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY - yOffset), NPC.frame, drawColorAlpha, NPC.rotation, NPC.frame.Size() * 0.5f, scaleStretch, spriteEffects, 0f); + texture = GlowTexture.Value; Color glowmaskColor = Color.Lerp(Color.White, Color.Yellow, 0.5f); - spriteBatch.Draw(texture2D15, drawLocation, NPC.frame, glowmaskColor, NPC.rotation, halfSizeTexture, NPC.scale, spriteEffects, 0f); + // done again to fix glowmask not matching sprite + spriteBatch.Draw(texture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY - yOffset), NPC.frame, glowmaskColor, NPC.rotation, NPC.frame.Size() * 0.5f, scaleStretch, spriteEffects, 0f); return false; } @@ -623,10 +659,10 @@ namespace CalamityMod.NPCs.Perforator public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); + NPC.damage = (int)(NPC.damage * 0.8f); } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.HealingPotion; } @@ -677,7 +713,6 @@ namespace CalamityMod.NPCs.Perforator normalOnly.Add(ItemID.CrimtaneBar, 1, 10, 15); normalOnly.Add(ItemID.Vertebrae, 1, 10, 15); normalOnly.Add(ItemID.CrimsonSeeds, 1, 10, 15); - normalOnly.Add(DropHelper.PerPlayer(ModContent.ItemType(), 1, 25, 30)); normalOnly.Add(ItemDropRule.ByCondition(DropHelper.Hardmode(), ItemID.Ichor, 1, 10, 20)); // Equipment @@ -702,15 +737,6 @@ namespace CalamityMod.NPCs.Perforator npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedPerforator, ModContent.ItemType(), desc: DropHelper.FirstKillText); } - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - { - target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(BuffID.Ichor, 300); - } - } - public override void HitEffect(NPC.HitInfo hit) { for (int k = 0; k < hit.Damage / NPC.lifeMax * 100.0; k++) @@ -732,7 +758,7 @@ namespace CalamityMod.NPCs.Perforator NPC.height = 100; NPC.position.X = NPC.position.X - (float)(NPC.width / 2); NPC.position.Y = NPC.position.Y - (float)(NPC.height / 2); - for (int i = 0; i < 40; i++) + for (int i = 0; i < 12; i++) { int ichorDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[ichorDust].velocity *= 3f; @@ -742,7 +768,7 @@ namespace CalamityMod.NPCs.Perforator Main.dust[ichorDust].fadeIn = 1f + (float)Main.rand.Next(10) * 0.1f; } } - for (int j = 0; j < 70; j++) + for (int j = 0; j < 20; j++) { int bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 3f); Main.dust[bloodDust].noGravity = true; @@ -750,6 +776,19 @@ namespace CalamityMod.NPCs.Perforator bloodDust = Dust.NewDust(NPC.position, NPC.width, NPC.height, DustID.Blood, 0f, 0f, 100, default, 2f); Main.dust[bloodDust].velocity *= 2f; } + // Blood burst + for (int i = 0; i < 24; ++i) + { + int bloodLifetime = Main.rand.Next(120, 200); + float bloodScale = Main.rand.NextFloat(1.3f, 2.6f); + Color bloodColor = Color.Lerp(Color.Crimson, Color.DarkRed, Main.rand.NextFloat(0.9f)); + float randomSpeedMultiplier = Main.rand.NextFloat(4.5f, 9f); + Vector2 bloodVelocity = Main.rand.NextVector2Unit(6) * 2.5f * randomSpeedMultiplier; + bloodVelocity.Y -= 14f; + + BloodParticle blood = new BloodParticle(NPC.Center, bloodVelocity, bloodLifetime, bloodScale, bloodColor); + GeneralParticleHandler.SpawnParticle(blood); + } } } } diff --git a/NPCs/Perforator/PerforatorTailLarge.cs b/NPCs/Perforator/PerforatorTailLarge.cs index 710b6bf4db..8259cead41 100644 --- a/NPCs/Perforator/PerforatorTailLarge.cs +++ b/NPCs/Perforator/PerforatorTailLarge.cs @@ -34,12 +34,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 16; // 32 NPC.width = 60; NPC.height = 78; NPC.defense = 12; - NPC.LifeMaxNERB(2700, 3240, 80000); + NPC.LifeMaxNERB(2160, 2600, 80000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -55,9 +55,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -143,21 +137,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.25f; - float minimalDamageVelocity = maxChaseSpeed * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -235,7 +214,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 120, true); + target.AddBuff(ModContent.BuffType(), 180, true); } } } diff --git a/NPCs/Perforator/PerforatorTailMedium.cs b/NPCs/Perforator/PerforatorTailMedium.cs index 1c83b3ec71..88fb7306fd 100644 --- a/NPCs/Perforator/PerforatorTailMedium.cs +++ b/NPCs/Perforator/PerforatorTailMedium.cs @@ -36,13 +36,13 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 12; // 24 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 50; NPC.defense = 10; - NPC.LifeMaxNERB(180, 216, 7000); + NPC.LifeMaxNERB(144, 172, 7000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -58,9 +58,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -72,16 +70,11 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; NPC.realLife = -1; @@ -102,8 +95,7 @@ namespace CalamityMod.NPCs.Perforator { spawnedBlob = true; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -117,8 +109,7 @@ namespace CalamityMod.NPCs.Perforator if (death && !spawnedBlob) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, damage, 0f, Main.myPlayer, 0f, NPC.Center.Y); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Main.rand.NextVector2CircularEdge(3f, 3f), type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer, 0f, NPC.Center.Y); } NPC.life = 0; @@ -168,22 +159,6 @@ namespace CalamityMod.NPCs.Perforator NPC.position.Y += targetY; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -267,15 +242,14 @@ namespace CalamityMod.NPCs.Perforator if (Main.netMode != NetmodeID.MultiplayerClient && Main.zenithWorld) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.UnitY, type, PerforatorHive.IchorBlobDamage, 0f, Main.myPlayer); for (int i = -1; i < 2; i++) //releases 3 Ichor Shots { int type2 = ModContent.ProjectileType(); Vector2 baseVelocity = Vector2.UnitY * Main.rand.NextFloat(-12.5f, -5f); int spread = Main.rand.Next(16, 36); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, baseVelocity.RotatedBy(MathHelper.ToRadians(spread * i)), type2, PerforatorHive.IchorShotDamage, 0f, Main.myPlayer); } } } @@ -284,8 +258,7 @@ namespace CalamityMod.NPCs.Perforator { if (hurtInfo.Damage > 0) { - target.AddBuff(ModContent.BuffType(), 60); - target.AddBuff(BuffID.Ichor, 60); + target.AddBuff(BuffID.Ichor, 240); } } } diff --git a/NPCs/Perforator/PerforatorTailSmall.cs b/NPCs/Perforator/PerforatorTailSmall.cs index 433f7586b5..5078662f3f 100644 --- a/NPCs/Perforator/PerforatorTailSmall.cs +++ b/NPCs/Perforator/PerforatorTailSmall.cs @@ -34,12 +34,12 @@ namespace CalamityMod.NPCs.Perforator public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 10; // 20 NPC.width = 40; NPC.height = 34; NPC.defense = 8; - NPC.LifeMaxNERB(1200, 1440, 50000); + NPC.LifeMaxNERB(960, 1152, 50000); if (Main.zenithWorld) NPC.lifeMax *= 4; @@ -55,9 +55,7 @@ namespace CalamityMod.NPCs.Perforator NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; @@ -67,10 +65,6 @@ namespace CalamityMod.NPCs.Perforator NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) @@ -143,22 +137,6 @@ namespace CalamityMod.NPCs.Perforator NPC.spriteDirection = -1; } - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float maxChaseSpeed = 16f; - float minimalContactDamageVelocity = maxChaseSpeed * 0.4f; - float minimalDamageVelocity = maxChaseSpeed * 0.8f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } - if (Main.npc[(int)NPC.ai[1]].alpha >= 85) { if (NPC.alpha > 0 && NPC.life > 0) @@ -235,7 +213,7 @@ namespace CalamityMod.NPCs.Perforator public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 60, true); + target.AddBuff(ModContent.BuffType(), 120, true); } } } diff --git a/NPCs/PlagueEnemies/Melter.cs b/NPCs/PlagueEnemies/Melter.cs index 065874a933..8b293fff79 100644 --- a/NPCs/PlagueEnemies/Melter.cs +++ b/NPCs/PlagueEnemies/Melter.cs @@ -31,20 +31,16 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 55; NPC.width = 38; NPC.height = 34; - NPC.defense = 15; - NPC.lifeMax = 630; + NPC.defense = 20; + NPC.lifeMax = 800; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PestilentSlime.cs b/NPCs/PlagueEnemies/PestilentSlime.cs index 72f79c03b4..404305cecf 100644 --- a/NPCs/PlagueEnemies/PestilentSlime.cs +++ b/NPCs/PlagueEnemies/PestilentSlime.cs @@ -31,11 +31,11 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 55; NPC.width = 40; NPC.height = 30; - NPC.defense = 12; - NPC.lifeMax = 440; + NPC.defense = 35; + NPC.lifeMax = 600; NPC.knockBackResist = 0.5f; AnimationType = NPCID.CorruptSlime; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.alpha = 60; NPC.lavaImmune = false; NPC.noGravity = false; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.PlagueEnemies BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PlagueCharger.cs b/NPCs/PlagueEnemies/PlagueCharger.cs index c7ae9751ce..03c4d3b92a 100644 --- a/NPCs/PlagueEnemies/PlagueCharger.cs +++ b/NPCs/PlagueEnemies/PlagueCharger.cs @@ -36,14 +36,14 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 37; NPC.width = 36; NPC.height = 30; - NPC.defense = 20; + NPC.defense = 32; NPC.scale *= 0.5f; - NPC.lifeMax = 250; + NPC.lifeMax = 720; NPC.aiStyle = NPCAIStyleID.Flying; AIType = NPCID.Bee; NPC.knockBackResist = 0.4f; AnimationType = NPCID.Bee; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit4; NPC.noGravity = true; NPC.noTileCollide = false; @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.PlagueEnemies BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PlagueChargerLarge.cs b/NPCs/PlagueEnemies/PlagueChargerLarge.cs index d3666be1d0..752dc4a30f 100644 --- a/NPCs/PlagueEnemies/PlagueChargerLarge.cs +++ b/NPCs/PlagueEnemies/PlagueChargerLarge.cs @@ -31,14 +31,14 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 45; NPC.width = 36; NPC.height = 30; - NPC.defense = 25; + NPC.defense = 36; NPC.scale *= 0.75f; - NPC.lifeMax = 380; + NPC.lifeMax = 840; NPC.aiStyle = NPCAIStyleID.Flying; AIType = NPCID.Bee; NPC.knockBackResist = 0.3f; AnimationType = NPCID.Bee; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit4; NPC.noGravity = true; NPC.noTileCollide = false; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.PlagueEnemies BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs index 0374f876c4..4a8bfcc316 100644 --- a/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs +++ b/NPCs/PlagueEnemies/PlaguebringerMiniboss.cs @@ -42,9 +42,8 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.width = 66; NPC.height = 66; NPC.defense = 24; - NPC.DR_NERD(0.2f); NPC.lifeMax = 8750; - NPC.value = Item.buyPrice(0, 1, 50, 0); + NPC.value = Item.buyPrice(gold: 1, silver: 50); NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; @@ -61,10 +60,6 @@ namespace CalamityMod.NPCs.PlagueEnemies { NPC.scale = 2f; } - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/Plagueshell.cs b/NPCs/PlagueEnemies/Plagueshell.cs index 55d9b3004b..4c728c12c0 100644 --- a/NPCs/PlagueEnemies/Plagueshell.cs +++ b/NPCs/PlagueEnemies/Plagueshell.cs @@ -27,11 +27,11 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.aiStyle = NPCAIStyleID.GiantTortoise; NPC.width = 46; NPC.height = 32; - NPC.defense = 32; - NPC.lifeMax = 1000; + NPC.defense = 50; + NPC.lifeMax = 1200; NPC.knockBackResist = 0.2f; AnimationType = NPCID.GiantTortoise; - NPC.value = Item.buyPrice(0, 0, 15, 0); + NPC.value = Item.buyPrice(silver: 15); NPC.HitSound = SoundID.NPCHit24; NPC.noGravity = false; Banner = NPC.type; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlagueEnemies/Viruling.cs b/NPCs/PlagueEnemies/Viruling.cs index d8e5832bbd..df650e78ee 100644 --- a/NPCs/PlagueEnemies/Viruling.cs +++ b/NPCs/PlagueEnemies/Viruling.cs @@ -30,20 +30,16 @@ namespace CalamityMod.NPCs.PlagueEnemies NPC.damage = 60; NPC.width = 58; NPC.height = 44; - NPC.defense = 18; - NPC.lifeMax = 500; + NPC.defense = 32; + NPC.lifeMax = 900; NPC.knockBackResist = 0.3f; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit22; Banner = NPC.type; BannerItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs index 7b264b2ddc..54e52eea8d 100644 --- a/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs +++ b/NPCs/PlaguebringerGoliath/PlagueHomingMissile.cs @@ -31,8 +31,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 70; // 140 NPC.width = 22; NPC.height = 22; NPC.defense = 20; @@ -46,18 +45,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.noTileCollide = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Lighting.AddLight(NPC.Center, 0.015f, 0.1f, 0f); @@ -112,7 +106,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { NPC.localAI[1] += 1f; float timeBeforeExploding = 480f + NPC.ai[3] * 2f; - float homingDuration = (bossRush ? 430f : death ? 340f : revenge ? 290f : expertMode ? 240f : 150f) + NPC.ai[3] * 2f; + float homingDuration = (death ? 340f : revenge ? 290f : expertMode ? 240f : 150f) + NPC.ai[3] * 2f; if (NPC.localAI[1] == timeBeforeExploding) { CheckDead(); @@ -134,7 +128,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath { NPC.noTileCollide = false; - if (NPC.velocity.Length() < (bossRush ? 25f : 20f)) + if (NPC.velocity.Length() < 20f) NPC.velocity *= 1.01f; if (Collision.SolidCollision(NPC.position, NPC.width, NPC.height)) @@ -266,7 +260,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath target.AddBuff(BuffID.Poisoned, 240); target.AddBuff(BuffID.Venom, 240); } - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 120); } } diff --git a/NPCs/PlaguebringerGoliath/PlagueMine.cs b/NPCs/PlaguebringerGoliath/PlagueMine.cs index 6146ad8433..eb7fb95f8f 100644 --- a/NPCs/PlaguebringerGoliath/PlagueMine.cs +++ b/NPCs/PlaguebringerGoliath/PlagueMine.cs @@ -30,7 +30,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 80; // 160 NPC.width = 42; NPC.height = 42; NPC.defense = 20; @@ -44,17 +44,12 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; Lighting.AddLight(NPC.Center, 0.03f, 0.2f, 0f); @@ -78,7 +73,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 vector = Main.player[NPC.target].Center - NPC.Center; float distanceRequiredForExplosion = 90f; - float timeBeforeExplosion = (bossRush ? 1000f : death ? 740f : revenge ? 520f : 400f) + NPC.ai[3] * 4f; + float timeBeforeExplosion = (death ? 740f : revenge ? 520f : 400f) + NPC.ai[3] * 4f; if (vector.Length() < distanceRequiredForExplosion || NPC.ai[0] >= timeBeforeExplosion) { CheckDead(); @@ -94,7 +89,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } NPC.TargetClosest(true); - float velocity = (bossRush ? 14f : death ? 12f : revenge ? 10f : 8f) + NPC.ai[3] * 0.04f; + float velocity = (death ? 12f : revenge ? 10f : 8f) + NPC.ai[3] * 0.04f; Vector2 npcDirection = new Vector2(NPC.Center.X + (float)(NPC.direction * 20), NPC.Center.Y + 6f); float targetX = player.position.X + (float)player.width * 0.5f - npcDirection.X; float targetY = player.Center.Y - npcDirection.Y; @@ -102,7 +97,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float npcSpeed = velocity / targetDistance; targetX *= npcSpeed; targetY *= npcSpeed; - float inertia = (bossRush ? 35f : death ? 40f : revenge ? 45f : 50f) - NPC.ai[3] * 0.25f; + float inertia = (death ? 40f : revenge ? 45f : 50f) - NPC.ai[3] * 0.25f; NPC.velocity.X = (NPC.velocity.X * inertia + targetX) / (inertia + 1f); NPC.velocity.Y = (NPC.velocity.Y * inertia + targetY) / (inertia + 1f); } @@ -156,7 +151,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath target.AddBuff(BuffID.Poisoned, 300); target.AddBuff(BuffID.Venom, 300); } - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs index 79c8333645..2e79fd0096 100644 --- a/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs +++ b/NPCs/PlaguebringerGoliath/PlaguebringerGoliath.cs @@ -84,10 +84,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } + public static int StingerDamage = 28; // 112 + public static int NukeDamage = 35; // 140; Also applies to GFB Peanuts and Gauss Nukes + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.npcSlots = 64f; NPC.width = 198; NPC.height = 198; @@ -98,16 +101,13 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.aiStyle = -1; AIType = -1; NPC.boss = true; - NPC.value = Item.buyPrice(0, 30, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.noGravity = true; NPC.noTileCollide = true; NPC.HitSound = SoundID.NPCHit4; NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -158,10 +158,9 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.height = (int)(NPC.frame.Height * (charging ? 1.5f : 1.8f)); // Mode variables - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -176,7 +175,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath float challengeAmt = (1f - lifeRatio) * 100f; float nukeBarrageChallengeAmt = (0.5f - lifeRatio) * 200f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { challengeAmt *= 1.5f; nukeBarrageChallengeAmt *= 1.5f; @@ -190,7 +189,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Light @@ -209,7 +207,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath // Missile countdown if (halfLife && MissileCountdown == 0) - MissileCountdown = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 300 : 600; + MissileCountdown = CalamityWorld.LegendaryMode ? 300 : 600; if (MissileCountdown > 1) MissileCountdown--; @@ -230,7 +228,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath Vector2 distFromPlayer = player.Center - NPC.Center; // Enrage - if (!player.ZoneJungle && !bossRush) + if (!player.ZoneJungle && !BossRushEvent.BossRushActive) { if (biomeEnrageTimer > 0) biomeEnrageTimer--; @@ -238,25 +236,22 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath else biomeEnrageTimer = CalamityGlobalNPC.biomeEnrageTimerMax; - bool biomeEnraged = biomeEnrageTimer <= 0 || bossRush; + bool biomeEnraged = biomeEnrageTimer <= 0; float enrageScale = death ? 0.5f : 0f; if (biomeEnraged) { - NPC.Calamity().CurrentlyEnraged = !bossRush; + NPC.Calamity().CurrentlyEnraged = true; enrageScale += 1.5f; } if (enrageScale > 1.5f) enrageScale = 1.5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrageScale += 0.5f; - if (bossRush) - enrageScale = 2f; - - bool diagonalDash = (revenge && phase2) || bossRush; + bool diagonalDash = (revenge && phase2); if (NPC.ai[0] != 0f && NPC.ai[0] != 4f) NPC.rotation = NPC.velocity.X * 0.02f; @@ -545,7 +540,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.velocity *= 1.01f; // Spawn honey in legendary rev+ - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge && calamityGlobalNPC.newAI[0] % 6f == 0f) + if (CalamityWorld.LegendaryMode && calamityGlobalNPC.newAI[0] % 6f == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -632,7 +627,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath calamityGlobalNPC.newAI[0] += 1f; if ((Vector2.Distance(NPC.Center, player.Center) < 640f && canHitTarget) || calamityGlobalNPC.newAI[0] >= 180f) { - NPC.ai[0] = (phase3 || bossRush) ? 5f : 1f; + NPC.ai[0] = phase3 ? 5f : 1f; NPC.ai[1] = 0f; calamityGlobalNPC.newAI[0] = 0f; @@ -803,7 +798,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath NPC.direction = playerLocation < 0 ? 1 : -1; NPC.spriteDirection = NPC.direction; - if (NPC.ai[2] > ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 3f : 5f)) + if (NPC.ai[2] > (CalamityWorld.LegendaryMode ? 3f : 5f)) { NPC.ai[0] = -1f; NPC.ai[1] = 2f; @@ -868,7 +863,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = type == ModContent.ProjectileType() ? NukeDamage : StingerDamage; Projectile.NewProjectile(NPC.GetSource_FromAI(), stingerSpawnPos.X, stingerSpawnPos.Y, projXDist, projYDist, type, damage, 0f, Main.myPlayer, challengeAmt, player.position.Y); NPC.netUpdate = true; } @@ -914,7 +909,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath missileVelocity += 2f * enrageScale; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = NukeDamage; int chargeDistanceX = 600; float chargeSpeed = revenge ? 28f : 26f; @@ -979,15 +974,14 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath baseVelocity *= 0.4f; } - int missiles = bossRush ? 16 : MissileProjectiles; - int spread = bossRush ? 18 : 24; + int spread = 24; if (!gaussMode) { - for (int i = 0; i < missiles; i++) + for (int i = 0; i < MissileProjectiles; i++) { - Vector2 spawn = NPC.Center; // Normal = 96, Boss Rush = 144 - spawn.X += i * (int)(spread * 1.125) - (missiles * (spread / 2)); // Normal = -96 to 93, Boss Rush = -144 to 156 - Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / missiles))); + Vector2 spawn = NPC.Center; + spawn.X += i * (int)(spread * 1.125) - (MissileProjectiles * (spread / 2)); + Vector2 velocity = baseVelocity.RotatedBy(MathHelper.ToRadians(-MissileAngleSpread / 2 + (MissileAngleSpread * i / MissileProjectiles))); Projectile.NewProjectile(NPC.GetSource_FromAI(), spawn, velocity, type, damage, 0f, Main.myPlayer, nukeBarrageChallengeAmt, player.position.Y); } } @@ -1315,7 +1309,7 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.GreaterHealingPotion; } @@ -1383,7 +1377,6 @@ namespace CalamityMod.NPCs.PlaguebringerGoliath public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/Polterghast/PhantomFuckYou.cs b/NPCs/Polterghast/PhantomFuckYou.cs index 5e0b097a77..25af8a694d 100644 --- a/NPCs/Polterghast/PhantomFuckYou.cs +++ b/NPCs/Polterghast/PhantomFuckYou.cs @@ -23,18 +23,19 @@ namespace CalamityMod.NPCs.Polterghast NPCID.Sets.TrailingMode[Type] = 1; } + public static int MineDamage = 75; // 300 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.aiStyle = -1; AIType = -1; NPC.width = 30; NPC.height = 30; NPC.defense = 45; - NPC.DR_NERD(0.1f); NPC.noGravity = true; NPC.noTileCollide = true; NPC.chaseable = false; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats NPC.lifeMax = 20000; NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; @@ -80,7 +81,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; bool chargePhase = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] >= chargePhaseGateValue - 60f; @@ -98,11 +99,11 @@ namespace CalamityMod.NPCs.Polterghast direction *= 0.5f; NPC.rotation = direction.ToRotation(); - if (!chargePhase || (CalamityWorld.LegendaryMode && CalamityWorld.revenge)) + if (!chargePhase || CalamityWorld.LegendaryMode) { NPC.ai[2] += 1f; float shootMineGateValue = 150f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) shootMineGateValue *= 0.5f; if (NPC.ai[2] >= shootMineGateValue) @@ -110,10 +111,9 @@ namespace CalamityMod.NPCs.Polterghast if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float maxVelocity = 8f * tileEnrageMult; float acceleration = 1.15f + (tileEnrageMult - 1f) * 0.15f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction, type, damage, 1f, NPC.target, maxVelocity, acceleration); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, direction, type, MineDamage, 1f, NPC.target, maxVelocity, acceleration); } NPC.ai[2] = 0f; } @@ -130,7 +130,7 @@ namespace CalamityMod.NPCs.Polterghast if (SPEEN < 0f) SPEEN = 0f; - NPC.ai[1] += (Main.getGoodWorld ? 1.5f : 0.5f) + SPEEN; + NPC.ai[1] += (CalamityWorld.LegendaryMode ? 1.5f : 0.5f) + SPEEN; } public override Color? GetAlpha(Color drawColor) => new Color(200, 200, 200, 0); diff --git a/NPCs/Polterghast/PolterPhantom.cs b/NPCs/Polterghast/PolterPhantom.cs index d5de2b05cd..de5e306d6a 100644 --- a/NPCs/Polterghast/PolterPhantom.cs +++ b/NPCs/Polterghast/PolterPhantom.cs @@ -38,13 +38,13 @@ namespace CalamityMod.NPCs.Polterghast { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 180; // 360 NPC.width = 90; NPC.height = 120; NPC.defense = 45; NPC.DR_NERD(0.1f); NPC.LifeMaxNERB(62500, 75000, 60000); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.lifeMax *= 4; NPC.knockBackResist = 0f; @@ -57,9 +57,6 @@ namespace CalamityMod.NPCs.Polterghast NPC.HitSound = SoundID.NPCHit36; NPC.DeathSound = SoundID.NPCDeath39; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void BossHeadRotation(ref float rotation) @@ -97,10 +94,9 @@ namespace CalamityMod.NPCs.Polterghast { CalamityGlobalNPC.ghostBossClone = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (CalamityGlobalNPC.ghostBoss < 0 || !Main.npc[CalamityGlobalNPC.ghostBoss].active) { @@ -121,7 +117,7 @@ namespace CalamityMod.NPCs.Polterghast Vector2 vector = NPC.Center; float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float colorChangeTime = 180f; @@ -142,7 +138,7 @@ namespace CalamityMod.NPCs.Polterghast float velocity = 3f; float acceleration = 0.03f; - if (!player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0) + if (!player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0) { despawnTimer--; if (despawnTimer <= 0) @@ -176,26 +172,21 @@ namespace CalamityMod.NPCs.Polterghast } // Predictiveness - Vector2 predictionVector = chargePhase && bossRush ? player.velocity * 20f : Vector2.Zero; - Vector2 lookAt = player.Center + predictionVector; + Vector2 lookAt = player.Center; Vector2 rotationVector = lookAt - vector; // Rotation if (NPC.Calamity().newAI[3] == 0f) { - float playerXDestination = player.Center.X + predictionVector.X - vector.X; - float playerYDestination = player.Center.Y + predictionVector.Y - vector.Y; + float playerXDestination = player.Center.X - vector.X; + float playerYDestination = player.Center.Y - vector.Y; NPC.rotation = (float)Math.Atan2(playerYDestination, playerXDestination) + MathHelper.PiOver2; } else NPC.rotation = NPC.velocity.ToRotation() + MathHelper.PiOver2; - int reducedSetDamage = (int)Math.Round(NPC.defDamage * 0.5); - if (!chargePhase) { - NPC.damage = reducedSetDamage; - // Set this here to avoid despawn issues reachedChargingPoint = false; @@ -232,7 +223,7 @@ namespace CalamityMod.NPCs.Polterghast float movementLimitedDistance = (float)Math.Sqrt(movementLimitedXDist * movementLimitedXDist + movementLimitedYDist * movementLimitedYDist); float maxDistanceFromHooks = expertMode ? 650f : 500f; - if (speedBoost || bossRush) + if (speedBoost) maxDistanceFromHooks += 250f; if (death) maxDistanceFromHooks += maxDistanceFromHooks * 0.1f * (1f - lifeRatio); @@ -311,23 +302,17 @@ namespace CalamityMod.NPCs.Polterghast if (NPC.Calamity().newAI[1] == 0f) { - NPC.damage = NPC.defDamage; - NPC.velocity = Vector2.Normalize(rotationVector) * chargeVelocity; NPC.Calamity().newAI[1] = 1f; } else { - NPC.damage = NPC.defDamage; - NPC.Calamity().newAI[2] += 1f; // Slow down for a few frames float totalChargeTime = chargeDistance * 4f / chargeVelocity; float slowDownTime = chargeVelocity; { - NPC.damage = reducedSetDamage; - if (NPC.Calamity().newAI[2] >= totalChargeTime - slowDownTime) NPC.velocity *= 0.9f; } @@ -352,9 +337,6 @@ namespace CalamityMod.NPCs.Polterghast } else { - // Do not deal damage during movement to avoid cheap bullshit hits - NPC.damage = 0; - // Random location choice if (NPC.ai[0] == 0f) { @@ -440,7 +422,7 @@ namespace CalamityMod.NPCs.Polterghast spriteEffects = SpriteEffects.FlipHorizontally; float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; @@ -544,7 +526,6 @@ namespace CalamityMod.NPCs.Polterghast public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Polterghast/Polterghast.cs b/NPCs/Polterghast/Polterghast.cs index 34c64b4665..cd6f59240f 100644 --- a/NPCs/Polterghast/Polterghast.cs +++ b/NPCs/Polterghast/Polterghast.cs @@ -65,27 +65,27 @@ namespace CalamityMod.NPCs.Polterghast public static List creepySounds = new List { - NPCs.DevourerofGods.DevourerofGodsHead.AttackSound, - NPCs.Providence.Providence.HolyRaySound, - NPCs.ExoMechs.Ares.AresBody.EnragedSound, - NPCs.ExoMechs.Ares.AresBody.LaserStartSound, - NPCs.ExoMechs.Thanatos.ThanatosHead.VentSound, - NPCs.SupremeCalamitas.SupremeCalamitas.SepulcherSummonSound, - NPCs.SupremeCalamitas.SupremeCalamitas.SpawnSound, - NPCs.Ravager.RavagerBody.LimbLossSound, - NPCs.HiveMind.HiveMind.RoarSound, - NPCs.Yharon.Yharon.RoarSound, - NPCs.DesertScourge.DesertScourgeHead.RoarSound, - NPCs.OldDuke.OldDuke.RoarSound, - NPCs.Abyss.ReaperShark.SearchRoarSound, - NPCs.Abyss.ReaperShark.EnragedRoarSound, - NPCs.Abyss.LuminousCorvina.ScreamSound, - NPCs.Abyss.DevilFish.MaskBreakSound, - NPCs.PrimordialWyrm.PrimordialWyrmHead.ChargeSound, - NPCs.GreatSandShark.GreatSandShark.RoarSound, - NPCs.AcidRain.Mauler.RoarSound, - NPCs.AstrumDeus.AstrumDeusHead.DeathSound, - NPCs.AstrumAureus.AstrumAureus.HitSound, + DevourerofGods.DevourerofGodsHead.AttackSound, + Providence.Providence.HolyRaySound, + ExoMechs.Ares.AresBody.EnragedSound, + ExoMechs.Ares.AresBody.LaserStartSound, + ExoMechs.Thanatos.ThanatosHead.VentSound, + SupremeCalamitas.SupremeCalamitas.SepulcherSummonSound, + SupremeCalamitas.SupremeCalamitas.SpawnSound, + Ravager.RavagerBody.LimbLossSound, + HiveMind.HiveMind.RoarSound, + Yharon.Yharon.RoarSound, + DesertScourge.DesertScourgeHead.RoarSound, + OldDuke.OldDuke.RoarSound, + ReaperShark.SearchRoarSound, + ReaperShark.EnragedRoarSound, + LuminousCorvina.ScreamSound, + DevilFish.MaskBreakSound, + PrimordialWyrm.PrimordialWyrmHead.ChargeSound, + GreatSandShark.GreatSandShark.RoarSound, + AcidRain.Mauler.RoarSound, + AstrumDeus.AstrumDeusHead.DeathSound, + AstrumAureus.AstrumAureus.HitSound, SoundID.ScaryScream, SoundID.DD2_KoboldFlyerHurt }; @@ -103,11 +103,18 @@ namespace CalamityMod.NPCs.Polterghast } } + public static float Phase2ContactDamageMult = 1.25f; // 300 + public static float Phase3ContactDamageMult = 1.5f; // 360 + public static int BlueShotDamage = 65; // 260 + public static int BlueBlastDamage = 70; // 280 + public static int RedShotDamage = 70; // 280 + public static int RedBlastDamage = 75; // 300 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 120; // 240 NPC.npcSlots = 50f; - NPC.GetNPCDamage(); NPC.width = 90; NPC.height = 120; NPC.defense = 90; @@ -116,7 +123,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(1, 50, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.boss = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -124,9 +131,6 @@ namespace CalamityMod.NPCs.Polterghast NPC.HitSound = HitSound; NPC.DeathSound = SoundID.NPCDeath39; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -203,12 +207,11 @@ namespace CalamityMod.NPCs.Polterghast // Variables Vector2 vector = NPC.Center; - bool bossRush = BossRushEvent.BossRushActive; bool speedBoost = false; bool despawnBoost = false; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Phases bool phase2 = lifeRatio < (death ? 0.9f : revenge ? 0.8f : expertMode ? 0.65f : 0.5f); @@ -222,7 +225,7 @@ namespace CalamityMod.NPCs.Polterghast // Velocity and acceleration calamityGlobalNPC.newAI[0] += 1f; float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; bool chargePhase = calamityGlobalNPC.newAI[0] >= chargePhaseGateValue; @@ -331,7 +334,7 @@ namespace CalamityMod.NPCs.Polterghast } } - bool despawn = !player.ZoneDungeon && !bossRush && player.position.Y < Main.worldSurface * 16.0; + bool despawn = !player.ZoneDungeon && !BossRushEvent.BossRushActive && player.position.Y < Main.worldSurface * 16.0; if (despawn) { despawnTimer--; @@ -416,26 +419,19 @@ namespace CalamityMod.NPCs.Polterghast float baseProjectileVelocity = speedBoost ? 9.375f : 7.5f; // Predictiveness - Vector2 predictionVector = chargePhase && bossRush ? player.velocity * 20f : Vector2.Zero; - Vector2 lookAt = player.Center + predictionVector; + Vector2 lookAt = player.Center; Vector2 rotationVector = lookAt - vector; // Rotation if (calamityGlobalNPC.newAI[3] == 0f) { - float playerXDestination = player.Center.X + predictionVector.X - vector.X; - float playerYDestination = player.Center.Y + predictionVector.Y - vector.Y; + float playerXDestination = player.Center.X - vector.X; + float playerYDestination = player.Center.Y - vector.Y; NPC.rotation = (float)Math.Atan2(playerYDestination, playerXDestination) + MathHelper.PiOver2; } else NPC.rotation = NPC.velocity.ToRotation() + MathHelper.PiOver2; - int phase1ReducedSetDamage = (int)Math.Round(NPC.defDamage * 0.5); - int phase2Damage = (int)Math.Round(NPC.defDamage * 1.2); - int phase2ReducedSetDamage = (int)Math.Round(phase2Damage * 0.5); - int phase3Damage = (int)Math.Round(NPC.defDamage * 1.4); - int phase3ReducedSetDamage = (int)Math.Round(phase3Damage * 0.5); - if (!chargePhase) { NPC.ai[2] += 1f; @@ -472,7 +468,7 @@ namespace CalamityMod.NPCs.Polterghast float movementLimitedDistance = (float)Math.Sqrt(movementLimitedXDist * movementLimitedXDist + movementLimitedYDist * movementLimitedYDist); float maxDistanceFromHooks = expertMode ? 650f : 500f; - if (speedBoost || bossRush) + if (speedBoost) maxDistanceFromHooks += 250f; if (death) maxDistanceFromHooks += maxDistanceFromHooks * 0.1f * (1f - lifeRatio); @@ -542,15 +538,11 @@ namespace CalamityMod.NPCs.Polterghast if (calamityGlobalNPC.newAI[1] == 0f) { - NPC.damage = phase3 ? phase3Damage : phase2 ? phase2Damage : NPC.defDamage; - NPC.velocity = Vector2.Normalize(rotationVector) * chargeVelocity; calamityGlobalNPC.newAI[1] = 1f; } else { - NPC.damage = phase3 ? phase3Damage : phase2 ? phase2Damage : NPC.defDamage; - calamityGlobalNPC.newAI[2] += 1f; // Slow down for a few frames @@ -558,8 +550,6 @@ namespace CalamityMod.NPCs.Polterghast float slowDownTime = chargeVelocity; if (calamityGlobalNPC.newAI[2] >= totalChargeTime - slowDownTime) { - NPC.damage = phase3 ? phase3ReducedSetDamage : phase2 ? phase2ReducedSetDamage : phase1ReducedSetDamage; - NPC.velocity *= 0.9f; } @@ -587,8 +577,6 @@ namespace CalamityMod.NPCs.Polterghast } else { - NPC.damage = phase3 ? phase3ReducedSetDamage : phase2 ? phase2ReducedSetDamage : phase1ReducedSetDamage; - // Pick a charging location // Set charge locations X if (vector.X >= player.Center.X) @@ -668,9 +656,7 @@ namespace CalamityMod.NPCs.Polterghast // Phase 1: "Polterghast" if (!phase2 && !phase3) { - if (!isInChargePhase) - NPC.damage = phase1ReducedSetDamage; - + NPC.damage = NPC.defDamage; NPC.defense = NPC.defDefense; if (Main.netMode != NetmodeID.MultiplayerClient && !isInChargePhase) @@ -693,13 +679,14 @@ namespace CalamityMod.NPCs.Polterghast if (notLiningUpCharge) { int type = ModContent.ProjectileType(); + int damage = BlueShotDamage; if (Main.rand.NextBool(3)) { NPC.localAI[1] = -30f; type = ModContent.ProjectileType(); + damage = BlueBlastDamage; } - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * baseProjectileVelocity; Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 6; i++) @@ -712,14 +699,13 @@ namespace CalamityMod.NPCs.Polterghast else { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (baseProjectileVelocity + 5f); Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 6; i++) { float offset = MathHelper.ToRadians(MathHelper.Lerp(-40f, 40f, i / 5f)); - Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, damage, 0f, Main.myPlayer); + Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, BlueBlastDamage, 0f, Main.myPlayer); shot.timeLeft = 450; } } @@ -773,9 +759,7 @@ namespace CalamityMod.NPCs.Polterghast } } - if (!isInChargePhase) - NPC.damage = phase2ReducedSetDamage; - + NPC.damage = (int)Math.Round(NPC.defDamage * Phase2ContactDamageMult); NPC.defense = (int)Math.Round(NPC.defDefense * 0.8); if (Main.netMode != NetmodeID.MultiplayerClient && !isInChargePhase) @@ -798,13 +782,14 @@ namespace CalamityMod.NPCs.Polterghast if (notLiningUpCharge) { int type = ModContent.ProjectileType(); + int damage = RedShotDamage; if (Main.rand.NextBool(3)) { NPC.localAI[1] = -30f; type = ModContent.ProjectileType(); + damage = RedBlastDamage; } - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (baseProjectileVelocity + 1f); Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 7; i++) @@ -817,13 +802,12 @@ namespace CalamityMod.NPCs.Polterghast else { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * (baseProjectileVelocity + 5f); Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < 7; i++) { float offset = MathHelper.ToRadians(MathHelper.Lerp(-50f, 50f, i / 6f)); - Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, damage, 0f, Main.myPlayer); + Projectile shot = Projectile.NewProjectileDirect(NPC.GetSource_FromAI(), firingPos, spreadVel.RotatedBy(offset), type, RedBlastDamage, 0f, Main.myPlayer); shot.timeLeft = 450; } } @@ -894,9 +878,7 @@ namespace CalamityMod.NPCs.Polterghast } } - if (!isInChargePhase) - NPC.damage = phase3ReducedSetDamage; - + NPC.damage = (int)Math.Round(NPC.defDamage * Phase3ContactDamageMult); NPC.defense = (int)Math.Round(NPC.defDefense * 0.5); NPC.localAI[1] += 1f; @@ -907,8 +889,9 @@ namespace CalamityMod.NPCs.Polterghast { int numProj = (getPissed ? 10 : 8); float maxSpread = getPissed ? 125 : 110; - int type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + bool red = Main.rand.NextBool(); + int type = red ? ModContent.ProjectileType() : ModContent.ProjectileType(); + int damage = red ? RedShotDamage : BlueShotDamage; Vector2 spreadVel = NPC.SafeDirectionTo(Main.player[NPC.target].Center) * baseProjectileVelocity; Vector2 firingPos = NPC.Center + spreadVel * 3f; for (int i = 0; i < numProj; i++) @@ -949,7 +932,7 @@ namespace CalamityMod.NPCs.Polterghast } } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1120,7 +1103,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; @@ -1226,7 +1209,6 @@ namespace CalamityMod.NPCs.Polterghast public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/Polterghast/PolterghastHook.cs b/NPCs/Polterghast/PolterghastHook.cs index a31142c7f1..44a72cfd55 100644 --- a/NPCs/Polterghast/PolterghastHook.cs +++ b/NPCs/Polterghast/PolterghastHook.cs @@ -32,11 +32,13 @@ namespace CalamityMod.NPCs.Polterghast } } + public static int ShotDamage = 60; // 240 + public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.aiStyle = -1; AIType = -1; - NPC.damage = 0; NPC.width = 40; NPC.height = 40; NPC.lifeMax = 50000; @@ -94,7 +96,7 @@ namespace CalamityMod.NPCs.Polterghast } float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; bool chargePhase = Main.npc[CalamityGlobalNPC.ghostBoss].Calamity().newAI[0] >= chargePhaseGateValue - 60f; @@ -150,7 +152,7 @@ namespace CalamityMod.NPCs.Polterghast NPC.ai[2] += 1f; if (NPC.ai[3] == 0f) { - if (NPC.ai[2] > ((CalamityWorld.LegendaryMode && revenge) ? 12f : 120f)) + if (NPC.ai[2] > ((CalamityWorld.LegendaryMode) ? 12f : 120f)) { NPC.ai[2] = 0f; NPC.ai[3] = 1f; @@ -166,11 +168,10 @@ namespace CalamityMod.NPCs.Polterghast { float shotSpeed = 10f * tileEnrageMult; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); targetDistance = shotSpeed / targetDistance; targetX *= targetDistance; targetY *= targetDistance; - Projectile.NewProjectile(NPC.GetSource_FromAI(), hookPosition.X, hookPosition.Y, targetX, targetY, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), hookPosition.X, hookPosition.Y, targetX, targetY, type, ShotDamage, 0f, Main.myPlayer, 0f, 0f); } } return; @@ -183,7 +184,7 @@ namespace CalamityMod.NPCs.Polterghast private void Movement(bool phase2, bool expertMode, bool revenge, bool death, bool speedBoost, bool despawnBoost, float lifeRatio, float tileEnrageMult, Player player) { float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float colorChangeTime = 180f; @@ -325,7 +326,7 @@ namespace CalamityMod.NPCs.Polterghast Color lightRed = new Color(255, 100, 100, 255); float chargePhaseGateValue = 480f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargePhaseGateValue *= 0.5f; float timeToReachFullColor = 120f; diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs index abbf84aaa3..3da6b9ad65 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBody.cs @@ -31,7 +31,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void SetDefaults() { - NPC.damage = 100; + NPC.damage = 0; // No contact damage NPC.width = 100; NPC.height = 88; NPC.defense = 0; @@ -65,8 +65,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void AI() { - NPC.damage = 0; - // Difficulty modes bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs index c89ee5b210..5a8d2566a7 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmBodyAlt.cs @@ -27,9 +27,11 @@ namespace CalamityMod.NPCs.PrimordialWyrm } } + public static int FireballDamage = 110; // 440 + public override void SetDefaults() { - NPC.damage = 100; + NPC.damage = 0; NPC.width = 110; NPC.height = 88; NPC.defense = 0; @@ -63,8 +65,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void AI() { - NPC.damage = 0; - // Difficulty modes bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; @@ -134,8 +134,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm Vector2 destination = Main.player[Main.npc[(int)NPC.ai[2]].target].Center - NPC.Center; Vector2 velocity = Vector2.Normalize(destination) * fireballVelocity; int type = ProjectileID.CultistBossFireBallClone; - int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, FireballDamage, 0f, Main.myPlayer); Main.projectile[proj].tileCollide = false; } } diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs index 81ecc448d3..d898aa06cd 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmHead.cs @@ -108,11 +108,18 @@ namespace CalamityMod.NPCs.PrimordialWyrm } } + public static int IceMistDamage = 110; // 440 + public static int LightningDamage = 140; // 560 + + // Reused Cultist projectiles + public static float LightDamageMult = 2.445f; // 440 + public static float DoomDamageMult = 2.445f; // 440 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 300; // 600 NPC.npcSlots = 50f; - NPC.GetNPCDamage(); NPC.width = 230; NPC.height = 138; NPC.LifeMaxNERB(2500000, 3000000); @@ -120,7 +127,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm AIType = -1; NPC.Opacity = 0f; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(5, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 5); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -212,7 +219,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm // Target variable Player player = Main.player[NPC.target]; - bool targetDownDeep = player.Calamity().ZoneAbyssLayer4 || BossRushEvent.BossRushActive; + bool targetDownDeep = player.Calamity().ZoneAbyssLayer4; bool targetOnMount = player.mount.Active; // Check whether enraged for the sake of the HP bar UI @@ -329,7 +336,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm float ancientDoomGateValue = death ? 95f : revenge ? 100f : expertMode ? 105f : 120f; float lightningChargePhaseGateValue = death ? 120f : revenge ? 135f : expertMode ? 150f : 180f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { lightningRainDuration *= 0.5f; eidolonWyrmPhaseDuration *= 0.25f; @@ -344,7 +351,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; NPC.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - NPC.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; NPC.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Adjust opacity @@ -448,7 +454,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm // Velocity and turn speed values float velocityScale = death ? 1.8f : revenge ? 1.5f : expertMode ? 1.2f : 0f; float baseVelocity = (targetDownDeep ? 10f : 15f) + (targetDownDeep ? velocityScale : velocityScale * 1.5f); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseVelocity *= 1.15f; float turnSpeed = baseVelocity * 0.015f; @@ -647,22 +653,21 @@ namespace CalamityMod.NPCs.PrimordialWyrm float ai = Main.rand.Next(100); Vector2 projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; int type = ProjectileID.CultistBossLightningOrbArc; - int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; // Opposite bolt projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; ai = Main.rand.Next(100); projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; - proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; // Normal bolt projectileDestination = targetCenterArray[i] - NPC.Center; ai = Main.rand.Next(100); projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * lightningVelocity; - proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; } } @@ -941,18 +946,17 @@ namespace CalamityMod.NPCs.PrimordialWyrm Vector2 projectileDestination = targetCenterArray[i] + Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; Vector2 projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; int type = ProjectileID.CultistBossIceMist; - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, IceMistDamage, 0f, Main.myPlayer, 0f, 1f); // Opposite mist projectileDestination = targetCenterArray[i] - Main.player[whoAmIArray[i]].velocity * predictionAmt - NPC.Center; projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, IceMistDamage, 0f, Main.myPlayer, 0f, 1f); // Normal bolt projectileDestination = targetCenterArray[i] - NPC.Center; projectileVelocity = Vector2.Normalize(projectileDestination) * iceMistVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, IceMistDamage, 0f, Main.myPlayer, 0f, 1f); } } @@ -1148,13 +1152,12 @@ namespace CalamityMod.NPCs.PrimordialWyrm if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.CultistBossLightningOrbArc; - int damage = NPC.GetProjectileDamage(type); for (int i = 0; i < numLightningBolts; i++) { Vector2 projectileDestination = player.Center - lightningSpawnLocation; Vector2 projectileVelocity = Vector2.Normalize(projectileDestination.RotatedByRandom(MathHelper.PiOver4)) * baseVelocity * 0.5f; float ai = Main.rand.Next(100); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), lightningSpawnLocation, projectileVelocity, type, damage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), lightningSpawnLocation, projectileVelocity, type, LightningDamage, 0f, Main.myPlayer, projectileDestination.ToRotation(), ai); Main.projectile[proj].tileCollide = false; lightningSpawnLocation.Y += distanceBetweenBolts; if (i == numLightningBolts / 2) @@ -1476,7 +1479,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -1525,7 +1528,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void ModifyTypeName(ref string typeName) diff --git a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs index cb7c3ff52e..1796a73b70 100644 --- a/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs +++ b/NPCs/PrimordialWyrm/PrimordialWyrmTail.cs @@ -28,7 +28,7 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void SetDefaults() { - NPC.damage = 100; + NPC.damage = 0; NPC.width = 100; NPC.height = 120; NPC.defense = 0; @@ -52,8 +52,6 @@ namespace CalamityMod.NPCs.PrimordialWyrm public override void AI() { - NPC.damage = 0; - // Difficulty modes bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs index 4afdca7d56..7080a84d05 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianCommander.cs @@ -65,12 +65,17 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } + public static int FireDamage = 42; // 168; HolyFire, HolyFire2 + public static int SpearDamage = 55; // 220; HolySpear, ProfanedSpear + public static int HolyBlastDamage = 64; // 256 + public static int RayDamage = 80; // 320 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 110; // 220 NPC.npcSlots = 20f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 228; NPC.height = 186; NPC.defense = 40; @@ -82,16 +87,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians AIType = -1; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.HitSound = SoundID.NPCHit52; NPC.DeathSound = SoundID.NPCDeath55; NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -153,10 +155,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Rotation NPC.rotation = NPC.velocity.X * 0.005f; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -359,7 +360,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians float goLowOrHighDistance = 540f; // Side swap variables for Phase 2 - float defenderCommanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float defenderCommanderGuardPhase2Duration = death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float moveToOtherSideInPhase2GateValue = defenderCommanderGuardPhase2Duration - 120f; float timeBeforeMoveToOtherSideInPhase2Reset = moveToOtherSideInPhase2GateValue * 2f; float totalGoLowDurationPhase2 = 210f; @@ -367,18 +368,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 32f : death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; - if (Main.getGoodWorld) + float maxChargeVelocity = death ? 28f : revenge ? 26f : expertMode ? 24f : 20f; + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 2f; - float inertia = bossRush ? 40f : death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; + float inertia = death ? 45f : revenge ? 47f : expertMode ? 50f : 55f; if (lifeRatio < 0.5f) inertia *= 0.8f; if (!phase1) inertia *= 0.75f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; bool speedUp = Vector2.Distance(NPC.Center, player.Center) > 960f; @@ -456,8 +457,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (!goLow && !goLowPhase2 && !goHigh) calamityGlobalNPC.newAI[0] = -NPC.direction; - float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (Main.getGoodWorld) + float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; if (healerAlive) velocity *= 0.8f; @@ -493,7 +494,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 targetVector = destination - NPC.Center; Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; - float phaseGateValue = bossRush ? 50f : death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; + float phaseGateValue = death ? 66f : revenge ? 75f : expertMode ? 83f : 100f; bool continueShootingProjectiles = phase1 || (NPC.ai[2] < (phaseGateValue * 5f)); if (continueShootingProjectiles) @@ -507,7 +508,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Alternate between firing profaned spears and holy fire // Shoot holy blasts in final phase NPC.ai[2] += 1f; - float projectileShootGateValue = bossRush ? 40f : death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; + float projectileShootGateValue = death ? 60f : revenge ? 90f : expertMode ? 100f : 150f; if (NPC.ai[2] % projectileShootGateValue == 0f) { if (phase1) @@ -521,10 +522,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool shootSpear = NPC.ai[2] % (projectileShootGateValue * 2f) == 0f; - float projectileVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float projectileVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; Vector2 finalProjectileVelocity = Vector2.Normalize(player.Center - shootFrom) * projectileVelocity; int type = shootSpear ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = shootSpear ? SpearDamage : FireDamage; if (type == ModContent.ProjectileType()) finalProjectileVelocity *= 0.5f; @@ -534,8 +535,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (fireExtraProjectiles && shootSpear) { - int baseProjectileAmt = bossRush ? 4 : 2; - int spread = bossRush ? 18 : 10; + int baseProjectileAmt = 2; + int spread = 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -554,18 +555,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians else { // Shoot holy blasts - float holyBlastVelocity = bossRush ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; + float holyBlastVelocity = death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; int projTimeLeft = (int)(2000f / holyBlastVelocity); Vector2 finalHolyBlastVelocity = Vector2.Normalize(player.Center - shootFrom) * holyBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, finalHolyBlastVelocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); - Main.projectile[proj].timeLeft = projTimeLeft; - } + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, finalHolyBlastVelocity, ModContent.ProjectileType(), HolyBlastDamage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); + Main.projectile[proj].timeLeft = projTimeLeft; } // Dust for blasting out the holy blasts @@ -667,7 +663,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = bossRush ? 90f : death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; + float phaseGateValue = death ? 100f : revenge ? 110f : expertMode ? 120f : 135f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -688,7 +684,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = bossRush ? 1.053333f : death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; + float velocityMult = death ? 1.05037f : revenge ? 1.047407f : expertMode ? 1.044444f : 1.04f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -732,10 +728,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int k = 0; k < totalDustPerProjectile; k++) Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, projectileVelocity.X, projectileVelocity.Y, 0, default, 1f); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, ModContent.ProjectileType(), FireDamage, 0f, Main.myPlayer); } } } @@ -791,8 +785,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians bool targetRanAwayAndWillNowBeFucked = NPC.ai[2] == 1f; bool boostVelocityToCatchUp = NPC.ai[1] == 0f || targetRanAwayAndWillNowBeFucked; - float velocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (Main.getGoodWorld) + float velocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; if (boostVelocityToCatchUp) velocity *= 2f; @@ -803,7 +797,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 desiredVelocity = targetVector.SafeNormalize(new Vector2(NPC.direction, 0f)) * velocity; float totalSpears = 12f; - float shootDuration = bossRush ? 240f : death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; + float shootDuration = death ? 280f : revenge ? 300f : expertMode ? 320f : 360f; float dontShootTime = shootDuration * 0.3f; float phaseGateValue = dontShootTime + shootDuration; @@ -848,16 +842,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians } else if (NPC.ai[1] % spearShootDivisor == 0f) { - float spearVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; - if (Main.getGoodWorld) + float spearVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + if (CalamityWorld.LegendaryMode) spearVelocity *= 1.25f; if (boostVelocityToCatchUp) spearVelocity *= 1.5f; Vector2 velocity2 = Vector2.Normalize(player.Center - shootFrom) * spearVelocity; Vector2 knockbackVelocity = velocity2 * 0.1f; - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); SoundEngine.PlaySound(SoundID.DD2_BetsyFireballShot, shootFrom); for (int k = 0; k < totalDustPerProjectile; k++) @@ -866,8 +858,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] % (spearShootDivisor * 3) == 0f || targetRanAwayAndWillNowBeFucked) { knockbackVelocity *= 2f; - int baseProjectileAmt = bossRush ? 8 : expertMode ? 6 : 4; - int spread = bossRush ? 60 : expertMode ? 50 : 40; + int baseProjectileAmt = expertMode ? 6 : 4; + int spread = expertMode ? 50 : 40; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < baseProjectileAmt; i++) { @@ -877,12 +869,12 @@ namespace CalamityMod.NPCs.ProfanedGuardians Dust.NewDust(shootFrom, 30, 30, (int)CalamityDusts.ProfanedFire, perturbedSpeed.X, perturbedSpeed.Y, 0, default, 1f); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, perturbedSpeed, type, damage, 0f, Main.myPlayer, targetRanAwayAndWillNowBeFucked ? -2f : -1f, -30f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, perturbedSpeed, ModContent.ProjectileType(), SpearDamage, 0f, Main.myPlayer, targetRanAwayAndWillNowBeFucked ? -2f : -1f, -30f); } } if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2 * 0.85f, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2 * 0.85f, ModContent.ProjectileType(), SpearDamage, 0f, Main.myPlayer, 1f, 0f); if (!targetRanAwayAndWillNowBeFucked) NPC.velocity = -knockbackVelocity; @@ -903,10 +895,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians } float laserGateValue = 120f; - float velocity = bossRush ? 4.5f : death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; + float velocity = death ? 4f : revenge ? 3.75f : expertMode ? 3.5f : 3f; if (NPC.ai[1] < laserGateValue) velocity *= 6f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; calamityGlobalNPC.newAI[0] = -NPC.direction; @@ -924,7 +916,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Limit Y velocity while firing laser if (NPC.ai[1] >= laserGateValue) { - float speedCap = Main.getGoodWorld ? 4f : 2f; + float speedCap = CalamityWorld.LegendaryMode ? 4f : 2f; if (NPC.velocity.Y > speedCap) NPC.velocity.Y = speedCap; if (NPC.velocity.Y < -speedCap) @@ -959,7 +951,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { if (NPC.ai[2] == laserGateValue) { - float rotation = bossRush ? 435f : death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; + float rotation = death ? 445f : revenge ? 450f : expertMode ? 455f : 465f; if (Main.LocalPlayer.active && !Main.LocalPlayer.dead && Vector2.Distance(Main.LocalPlayer.Center, NPC.Center) < 2800f) SoundEngine.PlaySound(HolyRaySound, Main.LocalPlayer.Center); @@ -973,23 +965,20 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (laserVelocity.X < 0f) beamDirection = 1f; - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - // 60 degrees offset laserVelocity = laserVelocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, type, damage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); // -60 degrees offset if (revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, type, damage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { rotation *= 0.33f; laserVelocity = laserVelocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, -laserVelocity, ModContent.ProjectileType(), RayDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI); } NPC.netUpdate = true; @@ -1206,7 +1195,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians return false; } - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.SuperHealingPotion; + public override void BossLoot(ref int potionType) => potionType = ItemID.SuperHealingPotion; public override void ModifyNPCLoot(NPCLoot npcLoot) { @@ -1273,13 +1262,12 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 300); + target.AddBuff(ModContent.BuffType(), 180); } public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs index 8c0774d5d3..f8fe31cd81 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianDefender.cs @@ -54,13 +54,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } + public static int FireDamage = 42; // 168; HolyFlare + public static int BlobDamage = 42; // 168 + public static int FireSentryDamage = 55; // 220; HolyBomb + public static int MoltenBlastDamage = 55; // 220 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 110; // 220 NPC.npcSlots = 3f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 228; NPC.height = 164; NPC.defense = 50; @@ -76,10 +81,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -242,17 +243,16 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Get the Guardian Commander's target Player player = Main.player[Main.npc[CalamityGlobalNPC.doughnutBoss].target]; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase1 = healerAlive; NPC.chaseable = !phase1; // Phase durations - float commanderGuardPhase2Duration = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float commanderGuardPhase2Duration = death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; float timeBeforeRocksRespawnInPhase2 = 90f; float throwRocksGateValue = 60f; @@ -261,8 +261,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Charge variables float chargeVelocityMult = 0.25f; - float maxChargeVelocity = bossRush ? 25f : death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; - if (Main.getGoodWorld) + float maxChargeVelocity = death ? 22f : revenge ? 20.5f : expertMode ? 19f : 16f; + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; // Whether the commander is calling all guardians together for the laser attack @@ -381,8 +381,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } - float moveVelocity = bossRush ? 24f : death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; - if (Main.getGoodWorld) + float moveVelocity = death ? 22f : revenge ? 21f : expertMode ? 20f : 18f; + if (CalamityWorld.LegendaryMode) moveVelocity *= 1.25f; if (healerAlive) moveVelocity *= 0.8f; @@ -431,7 +431,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Lay a holy bomb every once in a while in phase 1 and while not doing the laser attack if (!commanderUsingLaser) { - float projectileShootGateValue = bossRush ? 420f : death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; + float projectileShootGateValue = death ? 480f : revenge ? 510f : expertMode ? 540f : 600f; NPC.ai[1] += 1f; if (NPC.ai[1] >= projectileShootGateValue) { @@ -444,9 +444,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians projectileVelocityY += expertMode ? 4f : 3f; Vector2 projectileVelocity = new Vector2(NPC.velocity.X * 0.25f, projectileVelocityY); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, ModContent.ProjectileType(), FireSentryDamage, 0f, Main.myPlayer); } } } @@ -457,7 +455,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = (commanderUsingLaser || commanderGoingLowOrHighInPhase1) ? 10f : 15f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -489,7 +487,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[1] >= -throwRocksGateValue) { NPC.velocity *= 0.8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.velocity *= 0.5f; } @@ -501,18 +499,13 @@ namespace CalamityMod.NPCs.ProfanedGuardians float shootMoltenBlastsGateValue = commanderGuardPhase2Duration / moltenBlastsDivisor; if (NPC.ai[1] % shootMoltenBlastsGateValue == 0f && !commanderGoingLowOrHighInPhase2) { - float moltenBlastVelocity = bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float moltenBlastVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; int projTimeLeft = (int)(2400f / moltenBlastVelocity); Vector2 velocity = Vector2.Normalize(player.Center - shootFrom) * moltenBlastVelocity; if (Main.netMode != NetmodeID.MultiplayerClient) { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity, type, damage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); - Main.projectile[proj].timeLeft = projTimeLeft; - } + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity, ModContent.ProjectileType(), MoltenBlastDamage, 0f, Main.myPlayer, player.position.X, player.position.Y, 1f); + Main.projectile[proj].timeLeft = projTimeLeft; } // Dust for blasting out the molten blasts @@ -555,7 +548,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = commanderGoingLowOrHighInPhase2 ? 8f : 15f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -608,7 +601,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.spriteDirection = Math.Sign(NPC.velocity.X); NPC.ai[1] += 1f; - float phaseGateValue = bossRush ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; + float phaseGateValue = death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; if (NPC.ai[1] >= phaseGateValue) { NPC.ai[0] = 3f; @@ -629,7 +622,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = bossRush ? 1.04f : death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; + float velocityMult = death ? 1.036667f : revenge ? 1.035f : expertMode ? 1.033333f : 1.03f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -641,7 +634,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians else if (NPC.localAI[2] == 1f) { // Charge towards target - float inertia = bossRush ? 57f : death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; + float inertia = death ? 63f : revenge ? 66f : expertMode ? 69f : 75f; NPC.velocity = (NPC.velocity * (inertia - 1f) + targetVector * (NPC.velocity.Length() + (0.111111117f * inertia))) / inertia; // Stop charging towards the player when within a certain distance @@ -672,9 +665,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians projectileVelocityY += expertMode ? 4f : 3f; Vector2 projectileVelocity = new Vector2(NPC.velocity.X * 0.25f, projectileVelocityY); - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, ModContent.ProjectileType(), FireSentryDamage, 0f, Main.myPlayer); } } } @@ -947,7 +938,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyHitByProjectile(Projectile projectile, ref NPC.HitModifiers modifiers) diff --git a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs index 5a23446c69..fda7a1b29a 100644 --- a/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs +++ b/NPCs/ProfanedGuardians/ProfanedGuardianHealer.cs @@ -67,13 +67,18 @@ namespace CalamityMod.NPCs.ProfanedGuardians } } + public static int CrystalDamage = 55; // 220 + public static int StarDamage = 55; // 220; HolyBurnOrb + + public static int StarHeal = Main.expertMode ? 50 : 35; // HolyLight + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 100; // 200 NPC.npcSlots = 3f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 228; NPC.height = 164; NPC.defense = 30; @@ -89,10 +94,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -108,7 +109,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians }); } - public float GetStarShootSlowDownGateValue() => BossRushEvent.BossRushActive ? 180f : CalamityWorld.death ? 210f : CalamityWorld.revenge ? 225f : Main.expertMode ? 240f : 270f; + public float GetStarShootSlowDownGateValue() => CalamityWorld.death ? 210f : CalamityWorld.revenge ? 225f : Main.expertMode ? 240f : 270f; public float GetStarShootGateValue() => GetStarShootSlowDownGateValue() + 60f; @@ -164,10 +165,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Get the Guardian Commander's target Player player = Main.player[Main.npc[CalamityGlobalNPC.doughnutBoss].target]; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -193,7 +193,6 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (NPC.ai[2] >= 45f) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int totalProjectiles = 10; float radians = MathHelper.TwoPi / totalProjectiles; float projectileVelocity = 8f; @@ -201,7 +200,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2, type, 0, 0f, Main.myPlayer, 0f, damage); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, velocity2, type, 0, 0f, Main.myPlayer, 0f, StarHeal); } NPC.ai[2] = 0f; } @@ -216,8 +215,8 @@ namespace CalamityMod.NPCs.ProfanedGuardians } bool useCrystalShards = AIState == (float)Phase.CrystalShards; - float velocity = useCrystalShards ? (bossRush ? 18f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); - if (Main.getGoodWorld) + float velocity = useCrystalShards ? (death ? 16f : revenge ? 15f : expertMode ? 14f : 12f) : (Main.npc[CalamityGlobalNPC.doughnutBoss].velocity.Length() + 5f); + if (CalamityWorld.LegendaryMode) velocity *= 1.25f; float idealDistanceFromDestination = useCrystalShards ? 80f : 160f; @@ -251,7 +250,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (distanceFromDestination.Length() > 40f) { float inertia = 10f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; @@ -267,7 +266,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { // Increment timer AITimer += 1f; - float crystalShootGateValue = bossRush ? 140f : death ? 180f : revenge ? 200f : expertMode ? 220f : 260f; + float crystalShootGateValue = death ? 180f : revenge ? 200f : expertMode ? 220f : 260f; float crystalShootPhaseDuration = crystalShootGateValue + crystalShootGateValue * 0.25f; // Generate dust that scales with how close the crystals are to firing @@ -303,8 +302,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = bossRush ? 18 : death ? 16 : revenge ? 14 : expertMode ? 12 : 10; + int totalProjectiles = death ? 16 : revenge ? 14 : expertMode ? 12 : 10; float speedX = -12f; float speedAdjustment = Math.Abs(speedX * 2f / (totalProjectiles - 1)); float speedY = -4f; @@ -320,7 +318,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians randomizedVelocity = revenge ? (new Vector2(randomFloatX, randomFloatY) * randomVelocityMult) : Vector2.Zero; } Vector2 projectileVelocity = new Vector2(speedX + speedAdjustment * i + distanceFromDestination.SafeNormalize(Vector2.Zero).X * Math.Abs(player.velocity.X), speedY) + randomizedVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, damage, 0f, Main.myPlayer, x4); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, projectileVelocity, type, CrystalDamage, 0f, Main.myPlayer, x4); } } } @@ -343,7 +341,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact, shootFrom); - int totalFlameProjectiles = bossRush ? 20 : 16; + int totalFlameProjectiles = 16; int totalRings = revenge ? 3 : 2; int healingStarChance = revenge ? 8 : expertMode ? 6 : 4; double radians = MathHelper.TwoPi / totalFlameProjectiles; @@ -360,16 +358,14 @@ namespace CalamityMod.NPCs.ProfanedGuardians Vector2 vector2 = spinningPoint.RotatedBy(radians * j); int type = ModContent.ProjectileType(); - int dmgAmt = NPC.GetProjectileDamage(type); if (Main.rand.NextBool(healingStarChance) && !death) { type = ModContent.ProjectileType(); - dmgAmt = NPC.GetProjectileDamageNoScaling(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, 0, 0f, Main.myPlayer, 0f, StarHeal); } else if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom, vector2, type, StarDamage, 0f, Main.myPlayer); Color dustColor = Main.hslToRgb(Main.rgbToHsl(type == ModContent.ProjectileType() ? Color.Orange : Color.Green).X, 1f, 0.5f); dustColor.A = 255; @@ -404,10 +400,10 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Move towards a location above the player if (distanceFromDestination.Length() > idealDistanceFromDestination) { - float inertia = bossRush ? 28f : death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; + float inertia = death ? 32f : revenge ? 34f : expertMode ? 36f : 40f; if (lifeRatio < 0.5f) inertia *= 0.8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; NPC.velocity = (NPC.velocity * (inertia - 1) + desiredVelocity) / inertia; diff --git a/NPCs/ProfanedGuardians/ProfanedRocks.cs b/NPCs/ProfanedGuardians/ProfanedRocks.cs index 64ea8d4e8b..234672c46b 100644 --- a/NPCs/ProfanedGuardians/ProfanedRocks.cs +++ b/NPCs/ProfanedGuardians/ProfanedRocks.cs @@ -43,9 +43,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 100; // 200 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.dontTakeDamage = true; NPC.width = 50; NPC.height = 50; @@ -142,10 +142,9 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.timeLeft = 1800; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Spin and fly at the target if ((Main.npc[CalamityGlobalNPC.doughnutBossDefender].ai[0] != 0f && Main.npc[CalamityGlobalNPC.doughnutBossDefender].ai[1] >= -60f) || NPC.Calamity().newAI[0] < 0f) @@ -159,7 +158,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Distance the rock travels before it starts to fall down float maxChargeDistance = 4800f; - float chargeSpeed = bossRush ? 20f : death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; + float chargeSpeed = death ? 18f : revenge ? 17f : expertMode ? 16f : 14f; float fallDownGateValue = maxChargeDistance / chargeSpeed; // Fall down after some time and blow up if inside tiles @@ -209,7 +208,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Start off slow Vector2 finalVelocity = NPC.SafeDirectionTo(player.Center, -Vector2.UnitY) * chargeSpeed; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) finalVelocity *= Main.rand.NextFloat(1f, 1.7f); NPC.Calamity().newAI[2] = finalVelocity.X; @@ -229,7 +228,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Push away from each other in Death and Boss Rush if (death) { - float pushVelocity = bossRush ? 0.2f : 0.15f; + float pushVelocity = 0.15f; foreach (NPC n in Main.ActiveNPCs) { if (n.whoAmI != NPC.whoAmI && n.type == NPC.type) @@ -257,7 +256,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians // Rotate faster and charge NPC.Calamity().newAI[1] += 1f; - float chargeGateValue = bossRush ? 60f : death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; + float chargeGateValue = death ? 80f : revenge ? 90f : expertMode ? 100f : 120f; chargeGateValue += chargeGateValue * 0.5f * NPC.ai[1]; float anglularSpeed = NPC.Calamity().newAI[1] / chargeGateValue; anglularSpeed = 0.05f + anglularSpeed * 0.2f; @@ -279,7 +278,7 @@ namespace CalamityMod.NPCs.ProfanedGuardians NPC.damage = 0; // Distance from Defender Guardian - double maxDistance = bossRush ? 360D : death ? 340D : revenge ? 330D : expertMode ? 320D : MinMaxDistance; + double maxDistance = death ? 340D : revenge ? 330D : expertMode ? 320D : MinMaxDistance; double rateOfChangeIncrease = (maxDistance / MinMaxDistance) - 1D; double rateOfChange = (NPC.ai[1] * 0.5f) + 2D + rateOfChangeIncrease; if (NPC.Calamity().newAI[0] == 0f) diff --git a/NPCs/Providence/ProvSpawnDefense.cs b/NPCs/Providence/ProvSpawnDefense.cs index ee8f6aa180..eb17e4fab3 100644 --- a/NPCs/Providence/ProvSpawnDefense.cs +++ b/NPCs/Providence/ProvSpawnDefense.cs @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Providence/ProvSpawnHealer.cs b/NPCs/Providence/ProvSpawnHealer.cs index a89548e32b..349951bee9 100644 --- a/NPCs/Providence/ProvSpawnHealer.cs +++ b/NPCs/Providence/ProvSpawnHealer.cs @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Providence/ProvSpawnOffense.cs b/NPCs/Providence/ProvSpawnOffense.cs index e9295deaa6..79901f95c9 100644 --- a/NPCs/Providence/ProvSpawnOffense.cs +++ b/NPCs/Providence/ProvSpawnOffense.cs @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) diff --git a/NPCs/Providence/Providence.cs b/NPCs/Providence/Providence.cs index 7a97449c25..3ba404d415 100644 --- a/NPCs/Providence/Providence.cs +++ b/NPCs/Providence/Providence.cs @@ -237,10 +237,22 @@ namespace CalamityMod.NPCs.Providence base.ModifyHoverBoundingBox(ref boundingBox); } + public static int FireDamage = 42; // 168; HolyFire, HolyFire2, HolyFlare + public static int BlobDamage = 42; // 168 + public static int FireSentryDamage = 55; // 220; HolyBomb + public static int MoltenBlastDamage = 55; // 220 + public static int StarDamage = 55; // 220; HolyBurnOrb + public static int SpearDamage = 55; // 220 + public static int CrystalDamage = 55; // 220 + public static int HolyBlastDamage = 64; // 256 + public static int RayDamage = 100; // 400 + + public static int StarHeal = Main.expertMode ? 50 : 35; // HolyLight + public override void SetDefaults() { NPC.npcSlots = 36f; - NPC.damage = 100; + NPC.damage = 0; // No contact damage NPC.width = 600; NPC.height = 450; NPC.defense = 50; @@ -249,7 +261,7 @@ namespace CalamityMod.NPCs.Providence NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(1, 50, 0, 0); + NPC.value = Item.buyPrice(platinum: 1, gold: 50); NPC.boss = true; NPC.Opacity = 0f; NPC.noGravity = true; @@ -261,11 +273,8 @@ namespace CalamityMod.NPCs.Providence NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.25f; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -358,12 +367,10 @@ namespace CalamityMod.NPCs.Providence Player player = Main.player[NPC.target]; // Enraged bool and Color shifting - bool bossRush = BossRushEvent.BossRushActive; - bool getFuckedAI = Main.zenithWorld; if (getFuckedAI) NPC.localAI[1] = (float)BossMode.Rainbow; - else if (hasBeenGivenFullPower || bossRush) // Enraged behavior + else if (hasBeenGivenFullPower) // Enraged behavior NPC.localAI[1] = (float)BossMode.Enraged; else NPC.localAI[1] = (float)BossMode.Normal; @@ -414,24 +421,7 @@ namespace CalamityMod.NPCs.Providence NPC.ForceNetUpdate(false); } - // Increase all projectile damage while enraged, but reduce to 0 for Zenith - int projectileDamageMult = 1; - if (getFuckedAI) - projectileDamageMult = 0; - else if (fullPowerAI) - projectileDamageMult = 2; - - NPC.Calamity().CurrentlyEnraged = !bossRush && fullPowerAI; - - // Projectile damage values - int holyLaserDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int crystalDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holySpearDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyBombDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int moltenBlastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyFireDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyBlastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; - int holyStarDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()) * projectileDamageMult; + NPC.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && fullPowerAI; // Change dust type while enraged int dustType = ProvUtils.GetDustID(); @@ -450,13 +440,9 @@ namespace CalamityMod.NPCs.Providence // Spear phase float spearRateIncrease = 1f - lifeRatio; - float bossRushSpearRateIncrease = 0.25f; float baseSpearRate = 18f; float spearRate = 1f + spearRateIncrease; - if (bossRush) - spearRate += bossRushSpearRateIncrease; - // Projectile fire rate multiplier double attackRateMult = 1D; @@ -654,20 +640,6 @@ namespace CalamityMod.NPCs.Providence return; } - // Damage - if (attackerAlive) - { - double damageMult = 1.25; - holyLaserDamage = (int)(holyLaserDamage * damageMult); - crystalDamage = (int)(crystalDamage * damageMult); - holySpearDamage = (int)(holySpearDamage * damageMult); - holyBombDamage = (int)(holyBombDamage * damageMult); - moltenBlastDamage = (int)(moltenBlastDamage * damageMult); - holyFireDamage = (int)(holyFireDamage * damageMult); - holyBlastDamage = (int)(holyBlastDamage * damageMult); - holyStarDamage = (int)(holyStarDamage * damageMult); - } - // Defense if (defenderAlive) NPC.defense = NPC.defDefense * 2; @@ -860,7 +832,7 @@ namespace CalamityMod.NPCs.Providence // Velocity and acceleration float speedIncreaseTimer = fullPowerAI ? 75f : death ? 120f : 150f; - bool increaseSpeed = calamityGlobalNPC.newAI[0] > speedIncreaseTimer || bossRush; + bool increaseSpeed = calamityGlobalNPC.newAI[0] > speedIncreaseTimer; float accelerationBoost = death ? 0.3f * (1f - lifeRatio) : 0.2f * (1f - lifeRatio); float velocityBoost = death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); float acceleration = (expertMode ? 1.1f : 1.05f) + accelerationBoost; @@ -878,13 +850,11 @@ namespace CalamityMod.NPCs.Providence else if (increaseSpeed) { velocity += (calamityGlobalNPC.newAI[0] - speedIncreaseTimer) * 0.04f; - if (velocity > 30f || bossRush) + if (velocity > 30f) velocity = 30f; - if (bossRush) - acceleration = 2f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.2f; acceleration *= 1.2f; @@ -900,12 +870,12 @@ namespace CalamityMod.NPCs.Providence float moveUpThreshold = player.position.Y - (NPC.position.Y + NPC.height); if (moveUpThreshold < (laserPhaseSlow ? 150f : 200f)) // 150 - NPC.velocity.Y -= Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y -= CalamityWorld.LegendaryMode ? 0.4f : 0.2f; if (moveUpThreshold > (laserPhaseSlow ? 200f : 250f)) // 200 - NPC.velocity.Y += Main.getGoodWorld ? 0.4f : 0.2f; + NPC.velocity.Y += CalamityWorld.LegendaryMode ? 0.4f : 0.2f; float speedCap = laserPhaseSlow ? 2f : 6f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) speedCap *= 1.5f; if (NPC.velocity.Y > speedCap) @@ -928,8 +898,8 @@ namespace CalamityMod.NPCs.Providence int phase = 0; // Holy ray in hallow, Crystal in hell - bool useLaser = (phase2 && biomeType == 1) || bossRush; - bool useCrystal = (phase2 && biomeType == 2) || bossRush; + bool useLaser = (phase2 && biomeType == 1) || BossRushEvent.BossRushActive; + bool useCrystal = (phase2 && biomeType == 2) || BossRushEvent.BossRushActive; // Unique pattern for Death Mode and Boss Rush if (death) @@ -1161,7 +1131,7 @@ namespace CalamityMod.NPCs.Providence NPC.ai[3] += 1f; int shootBoost = death ? (int)Math.Round(5f * (1f - lifeRatio)) : (int)Math.Round(4f * (1f - lifeRatio)); - int projectileShootGateValue = (bossRush ? 18 : expertMode ? 24 : 26) - shootBoost; + int projectileShootGateValue = (expertMode ? 24 : 26) - shootBoost; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1176,7 +1146,7 @@ namespace CalamityMod.NPCs.Providence Vector2 predictionAmount = player.velocity * 100f; Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), holyBlastDamage, 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), HolyBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); } } else if (NPC.ai[3] < 0f) @@ -1206,8 +1176,6 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? (int)Math.Round(6f * (1f - lifeRatio)) : (int)Math.Round(5f * (1f - lifeRatio)); int projectileShootGateValue = (expertMode ? 36 : 39) - shootBoost; - if (bossRush) - projectileShootGateValue = 27; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1226,7 +1194,7 @@ namespace CalamityMod.NPCs.Providence if (fullPowerAI) projectileVelocityY *= 2f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), holyFireDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), FireDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1255,7 +1223,7 @@ namespace CalamityMod.NPCs.Providence } float divisor = (expertMode ? 2f : 3f) + (float)Math.Floor(3f * lifeRatio) + (attackRateMult > 1D ? (float)Math.Ceiling(attackRateMult * 1.6) : 0f); - int totalFlameProjectiles = bossRush ? 45 : 36; + int totalFlameProjectiles = 36; int chains = 4; float interval = totalFlameProjectiles / chains * divisor; double patternInterval = Math.Floor(NPC.ai[3] / interval); @@ -1276,17 +1244,13 @@ namespace CalamityMod.NPCs.Providence { Vector2 vector2 = spinningPoint.RotatedBy(radians * i + MathHelper.ToRadians(NPC.ai[2])); - int projectileType = ModContent.ProjectileType(); - int dmgAmt = holyStarDamage; if (Main.rand.NextBool(healingStarChance) && !death) { - projectileType = ModContent.ProjectileType(); - dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, StarHeal); } else if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), StarDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } // Radial offset @@ -1299,7 +1263,7 @@ namespace CalamityMod.NPCs.Providence { NPC.ai[2] = 0f; - totalFlameProjectiles = bossRush ? 20 : 16; + totalFlameProjectiles = 16; if (NPC.ai[3] % (divisor * totalFlameProjectiles) == 0f) { calamityGlobalNPC.newAI[1] += 1f; @@ -1313,17 +1277,13 @@ namespace CalamityMod.NPCs.Providence { Vector2 vector2 = spinningPoint.RotatedBy(radians * i); - int projectileType = ModContent.ProjectileType(); - int dmgAmt = holyStarDamage; if (Main.rand.NextBool(healingStarChance) && !death) { - projectileType = ModContent.ProjectileType(); - dmgAmt = NPC.GetProjectileDamageNoScaling(projectileType); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, 0, 0f, Main.myPlayer, 0f, dmgAmt); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, StarHeal); } else if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, vector2, ModContent.ProjectileType(), StarDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } } @@ -1343,9 +1303,8 @@ namespace CalamityMod.NPCs.Providence foreach (int t in targets) { Vector2 velocity2 = Vector2.Normalize(Main.player[t].Center - fireSparklesFrom) * cocoonProjVelocity * 1.5f; - int type = ModContent.ProjectileType(); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, velocity2, type, holyStarDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireSparklesFrom, velocity2, ModContent.ProjectileType(), StarDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); Color dustColor = Main.hslToRgb(Main.rgbToHsl(fullPowerAI ? new Color(100, 200, 250) : Color.Orange).X, 1f, 0.5f); dustColor.A = 255; @@ -1388,7 +1347,7 @@ namespace CalamityMod.NPCs.Providence if (!Main.dedServ) { Player player2 = Main.LocalPlayer; - bool inLiquid = (player2.wet || player2.honeyWet) && !player2.lavaWet; + bool inLiquid = player2.Calamity().countsAsAnyWet && !player2.lavaWet; if (!player2.dead && player2.active && Vector2.Distance(player2.Center, NPC.Center) < 2800f && !inLiquid) { @@ -1445,8 +1404,6 @@ namespace CalamityMod.NPCs.Providence int shootBoost = death ? (int)Math.Round(5f * (1f - lifeRatio)) : (int)Math.Round(4f * (1f - lifeRatio)); int projectileShootGateValue = (expertMode ? 24 : 26) - shootBoost; - if (bossRush) - projectileShootGateValue = 18; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1461,7 +1418,7 @@ namespace CalamityMod.NPCs.Providence Vector2 predictionAmount = player.velocity * 100f; Vector2 projectileVelocity = (player.Center + (predictiveShots ? predictionAmount : Vector2.Zero) - projectileFirePosition).SafeNormalize(Vector2.UnitY) * projSpeed * 0.1f; Vector2 explodePosition = predictiveShots ? (player.position + predictionAmount) : player.position; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), moltenBlastDamage, 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileFirePosition, projectileVelocity, ModContent.ProjectileType(), MoltenBlastDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, explodePosition.X, explodePosition.Y); } } else if (NPC.ai[3] < 0f) @@ -1490,7 +1447,7 @@ namespace CalamityMod.NPCs.Providence NPC.ai[3] += 1f; int shootBoost = death ? (int)Math.Round(12f * (1f - lifeRatio)) : (int)Math.Round(10f * (1f - lifeRatio)); - int projectileShootGateValue = (bossRush ? 54 : expertMode ? 73 : 77) - shootBoost; + int projectileShootGateValue = (expertMode ? 73 : 77) - shootBoost; projectileShootGateValue = (int)(projectileShootGateValue * attackRateMult); @@ -1506,7 +1463,7 @@ namespace CalamityMod.NPCs.Providence projectileVelocityY += expertMode ? 4f : 3f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), holyBombDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFrom.X, shootFrom.Y, NPC.velocity.X * 0.25f, projectileVelocityY, ModContent.ProjectileType(), FireSentryDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1549,7 +1506,7 @@ namespace CalamityMod.NPCs.Providence if (calamityGlobalNPC.newAI[2] % 2f == 0f) { - int totalSpearProjectiles = bossRush ? 15 : 12; + int totalSpearProjectiles = 12; double radians = MathHelper.TwoPi / totalSpearProjectiles; Vector2 spinningPoint = Vector2.Normalize(new Vector2(-calamityGlobalNPC.newAI[1], -cocoonProjVelocity)); @@ -1565,10 +1522,10 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, holySpearDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); - if (CalamityWorld.LegendaryMode && revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, holySpearDamage, 0f, Main.myPlayer); + if (CalamityWorld.LegendaryMode) + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -vector2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer); } } @@ -1592,10 +1549,10 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); - if (CalamityWorld.LegendaryMode && revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, holySpearDamage, 0f, Main.myPlayer, 1f, 0f); + if (CalamityWorld.LegendaryMode) + Projectile.NewProjectile(NPC.GetSource_FromAI(), fireFrom, -velocity2, projectileType, SpearDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, 1f, 0f); } } @@ -1684,7 +1641,7 @@ namespace CalamityMod.NPCs.Providence if (Main.netMode != NetmodeID.MultiplayerClient) { float timeLeft = fullPowerAI ? (float)(getFuckedAI ? gfbCrystalTime : enragedCrystalTime) : 0f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), crystalDamage, 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); + Projectile.NewProjectile(NPC.GetSource_FromAI(), crystalSpawnPos, Vector2.Zero, ModContent.ProjectileType(), CrystalDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, lifeRatio, 0f, timeLeft); } } @@ -1746,20 +1703,20 @@ namespace CalamityMod.NPCs.Providence // 60 degrees offset velocity = velocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); // -60 degrees offset if (revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); if (fullPowerAI && lifeRatio < 0.5f) { rotation *= 0.33f; velocity = velocity.RotatedBy(-(double)beamDirection * MathHelper.TwoPi / 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, velocity.X, velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); if (revenge) - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), holyLaserDamage, 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center.X, NPC.Center.Y + 64f * NPC.scale, -velocity.X, -velocity.Y, ModContent.ProjectileType(), RayDamage.CalculateProvidenceDamage(), 0f, Main.myPlayer, -beamDirection * MathHelper.TwoPi / rotation, NPC.whoAmI, ai2: 2f); } NPC.ForceNetUpdate(false); @@ -1955,8 +1912,6 @@ namespace CalamityMod.NPCs.Providence } } - public override bool CanHitPlayer(Player target, ref int cooldownSlot) => false; - public override bool CheckDead() { NPC.life = 1; @@ -2099,7 +2054,7 @@ namespace CalamityMod.NPCs.Providence npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedProvidence, ModContent.ItemType(), desc: DropHelper.FirstKillText); } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -2543,7 +2498,6 @@ namespace CalamityMod.NPCs.Providence public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * 0.8f); } public override void OnHitByProjectile(Projectile projectile, NPC.HitInfo hit, int damageDone) @@ -2765,7 +2719,29 @@ namespace CalamityMod.NPCs.Providence // These will be used for almost every single one of her projectiles, so it's useful to have. public static class ProvUtils { - public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld && !BossRushEvent.BossRushActive; + public static bool StandardAI() => (CalamityGlobalNPC.holyBoss == -1 || !Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) && !Main.zenithWorld; + + public static int CalculateProvidenceDamage(this int damage) + { + // GFB replaces conventional damage with negative healing + if (Main.zenithWorld) + return 0; + + // Enrage + if (CalamityGlobalNPC.holyBoss != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBoss].Calamity().CurrentlyEnraged) + damage *= 2; + } + + // Offense Guardian + if (CalamityGlobalNPC.holyBossAttacker != -1) + { + if (Main.npc[CalamityGlobalNPC.holyBossAttacker].active) + damage = (int)(damage * 1.25f); + } + return damage; + } // Simplified to day/night only. For PSC public static Color GetColorBasedOnEnrage(int Alpha, bool Outline = false) => GetColorBasedOnEnrage(!Main.IsItDay() && !Main.remixWorld, Alpha, Outline); diff --git a/NPCs/Ravager/FlamePillar.cs b/NPCs/Ravager/FlamePillar.cs index 78144eff7a..69962e5cf5 100644 --- a/NPCs/Ravager/FlamePillar.cs +++ b/NPCs/Ravager/FlamePillar.cs @@ -27,9 +27,12 @@ namespace CalamityMod.NPCs.Ravager } } + public static int FlameDamage = 30; // 120 + public static int PostProviFlameBuff = 20; // +80 = 200 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 75; // 150 NPC.width = 40; NPC.height = 150; NPC.defense = 35; @@ -44,10 +47,6 @@ namespace CalamityMod.NPCs.Ravager NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void FindFrame(int frameHeight) @@ -122,8 +121,7 @@ namespace CalamityMod.NPCs.Ravager } Vector2 velocity = new Vector2(speedX, speedY); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, FlameDamage + (provy ? PostProviFlameBuff : 0), 0f, Main.myPlayer, 0f, 0f); } NPC.ai[2] += 1f; @@ -138,6 +136,7 @@ namespace CalamityMod.NPCs.Ravager } } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { diff --git a/NPCs/Ravager/RavagerBody.cs b/NPCs/Ravager/RavagerBody.cs index 1003555aee..589c2fea98 100644 --- a/NPCs/Ravager/RavagerBody.cs +++ b/NPCs/Ravager/RavagerBody.cs @@ -69,18 +69,24 @@ namespace CalamityMod.NPCs.Ravager } } + // GFB exclusive + public static int BlasterDamage = 92; // 368 + + // Legendary exclusive + public static int RockDamage = 60; // 240 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 90; // 180 NPC.lavaImmune = true; NPC.noGravity = true; NPC.npcSlots = 20f; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 332; NPC.height = 214; NPC.defense = 55; - NPC.value = Item.buyPrice(0, 30, 0, 0); + NPC.value = Item.buyPrice(gold: 25); NPC.DR_NERD(0.35f); NPC.LifeMaxNERB(45000, 54000, 460000); if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) @@ -88,7 +94,7 @@ namespace CalamityMod.NPCs.Ravager NPC.damage = (int)(NPC.damage * 1.5); NPC.defense *= 2; NPC.lifeMax *= 4; - NPC.value *= 3f; + NPC.value *= 4f; } NPC.knockBackResist = 0f; AIType = -1; @@ -100,9 +106,6 @@ namespace CalamityMod.NPCs.Ravager NPC.DeathSound = DeathSound; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -149,10 +152,9 @@ namespace CalamityMod.NPCs.Ravager { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -227,22 +229,14 @@ namespace CalamityMod.NPCs.Ravager if (immunePhase) { NPC.dontTakeDamage = true; - if (bossRush) - { - if (!Main.dedServ) - { - if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && revenge) - Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); - } - } } else { NPC.dontTakeDamage = false; - if (!Main.dedServ) + foreach (Player p in Main.ActivePlayers) { - if (!Main.LocalPlayer.dead && Main.LocalPlayer.active && revenge) - Main.LocalPlayer.AddBuff(ModContent.BuffType(), 2); + if (!p.dead && revenge) + p.AddBuff(ModContent.BuffType(), 2); } } @@ -253,7 +247,7 @@ namespace CalamityMod.NPCs.Ravager Vector2 Pos = player.Center; //Spawn projectiles based on player's center. Having it be based on the boss turned out weird. (Except for final) int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = BlasterDamage; if (finalStand) //Circle { Vector2 circleOffset = Pos + (Vector2.UnitY * 640f).RotatedBy(MathHelper.ToRadians(NPC.localAI[1] * 3f)); @@ -497,7 +491,7 @@ namespace CalamityMod.NPCs.Ravager NPC.ai[1] += 1f; } - float jumpGateValue = Main.getGoodWorld ? 0f : 180f; + float jumpGateValue = CalamityWorld.LegendaryMode ? 0f : 180f; if (NPC.ai[1] >= jumpGateValue) { NPC.ai[1] = -20f; @@ -526,11 +520,11 @@ namespace CalamityMod.NPCs.Ravager if (revenge) { - float multiplier = bossRush ? 0.003f : 0.0015f; + float multiplier = 0.0015f; if (distanceBelowTarget > 0f) calamityGlobalNPC.newAI[1] += 1f + distanceBelowTarget * multiplier; - float speedMultLimit = bossRush ? 3f : 2f; + float speedMultLimit = 2f; if (calamityGlobalNPC.newAI[1] > speedMultLimit) calamityGlobalNPC.newAI[1] = speedMultLimit; @@ -594,7 +588,7 @@ namespace CalamityMod.NPCs.Ravager bool anyRockPillars = NPC.AnyNPCs(ModContent.NPCType()); bool anyFlamePillars = NPC.AnyNPCs(ModContent.NPCType()); - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) { if (!expertMode || anyRockPillars || anyFlamePillars) SoundEngine.PlaySound(PillarSound, NPC.Center); @@ -613,7 +607,7 @@ namespace CalamityMod.NPCs.Ravager if (i < 4 || i > 6) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f * NPC.scale + Vector2.Normalize(perturbedSpeed) * 30f * NPC.scale, perturbedSpeed, type, 60, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + Vector2.UnitY * 30f * NPC.scale + Vector2.Normalize(perturbedSpeed) * 30f * NPC.scale, perturbedSpeed, type, RockDamage, 0f, Main.myPlayer); } } } @@ -636,12 +630,12 @@ namespace CalamityMod.NPCs.Ravager { SoundEngine.PlaySound(PillarSound, NPC.Center); } - if (!anyRockPillars || Main.getGoodWorld) + if (!anyRockPillars || CalamityWorld.LegendaryMode) { NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X - spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); NPC.NewNPC(NPC.GetSource_FromAI(), (int)(player.Center.X + spawnDistance * 1.25f), (int)player.Center.Y - 100, ModContent.NPCType()); } - else if (!anyFlamePillars || Main.getGoodWorld) + else if (!anyFlamePillars || CalamityWorld.LegendaryMode) { float distanceMultiplier = finalPhase ? 2.5f : 2f; NPC.NewNPC(NPC.GetSource_FromAI(), (int)player.Center.X - (int)(spawnDistance * distanceMultiplier), (int)player.Center.Y - 100, ModContent.NPCType()); @@ -721,7 +715,7 @@ namespace CalamityMod.NPCs.Ravager { if (phase2) { - float stopBeforeFallTime = bossRush ? 25f : 30f; + float stopBeforeFallTime = 30f; if (!anyHeadActive) stopBeforeFallTime -= 15f; else if (expertMode) @@ -738,7 +732,7 @@ namespace CalamityMod.NPCs.Ravager NPC.damage = NPC.defDamage; float fallSpeedBoost = !anyHeadActive ? 1.8f : death ? 1.8f * (1f - lifeRatio) : 1.2f * (1f - lifeRatio); - float fallSpeed = (bossRush ? 1.8f : 1.2f) + fallSpeedBoost; + float fallSpeed = 1.2f + fallSpeedBoost; if (calamityGlobalNPC.newAI[1] > 1f) fallSpeed *= calamityGlobalNPC.newAI[1]; @@ -755,7 +749,7 @@ namespace CalamityMod.NPCs.Ravager if (NPC.Bottom.Y < player.position.Y) { float fallSpeedBoost = !anyHeadActive ? 0.9f : death ? 0.9f * (1f - lifeRatio) : 0.6f * (1f - lifeRatio); - float fallSpeed = (bossRush ? 0.9f : 0.6f) + fallSpeedBoost; + float fallSpeed = 0.6f + fallSpeedBoost; if (calamityGlobalNPC.newAI[1] > 1f) fallSpeed *= calamityGlobalNPC.newAI[1]; @@ -766,7 +760,7 @@ namespace CalamityMod.NPCs.Ravager } else { - float velocityMult = bossRush ? 2f : 1.8f; + float velocityMult = 1.8f; float velocityXChange = 0.2f + Math.Abs(NPC.Center.X - player.Center.X) * 0.001f; float velocityXBoost = !anyHeadActive ? 6f : death ? 6f * (1f - lifeRatio) : 4f * (1f - lifeRatio); @@ -815,11 +809,6 @@ namespace CalamityMod.NPCs.Ravager { float gravity = phase2 ? 0f : 0.45f; float maxFallSpeed = reduceFallSpeed ? 12f : phase2 ? 24f : 15f; - if (bossRush && !reduceFallSpeed) - { - gravity *= 1.25f; - maxFallSpeed *= 1.25f; - } if (calamityGlobalNPC.newAI[1] > 1f && !reduceFallSpeed) maxFallSpeed *= calamityGlobalNPC.newAI[1]; @@ -836,7 +825,7 @@ namespace CalamityMod.NPCs.Ravager player = Main.player[NPC.target]; } - int distanceFromTarget = player.dead ? 1600 : bossRush ? 8400 : 5600; + int distanceFromTarget = player.dead ? 1600 : 5600; if (Vector2.Distance(NPC.Center, player.Center) > distanceFromTarget) { NPC.TargetClosest(); @@ -849,6 +838,7 @@ namespace CalamityMod.NPCs.Ravager } } } + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) { @@ -908,7 +898,6 @@ namespace CalamityMod.NPCs.Ravager public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) @@ -1009,7 +998,7 @@ namespace CalamityMod.NPCs.Ravager target.AddBuff(ModContent.BuffType(), 480); } - public override void BossLoot(ref string name, ref int potionType) => potionType = ItemID.GreaterHealingPotion; + public override void BossLoot(ref int potionType) => potionType = ItemID.GreaterHealingPotion; public override void OnKill() { diff --git a/NPCs/Ravager/RavagerClawLeft.cs b/NPCs/Ravager/RavagerClawLeft.cs index 84cda3e20c..3b6dcc5f2d 100644 --- a/NPCs/Ravager/RavagerClawLeft.cs +++ b/NPCs/Ravager/RavagerClawLeft.cs @@ -25,9 +25,9 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 75; // 150 NPC.lavaImmune = true; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 80; NPC.height = 40; NPC.defense = 40; @@ -52,10 +52,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Ravager/RavagerClawRight.cs b/NPCs/Ravager/RavagerClawRight.cs index b8855ebe09..21ec899f26 100644 --- a/NPCs/Ravager/RavagerClawRight.cs +++ b/NPCs/Ravager/RavagerClawRight.cs @@ -25,9 +25,9 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 75; // 150 NPC.lavaImmune = true; NPC.aiStyle = -1; - NPC.GetNPCDamage(); NPC.width = 80; NPC.height = 40; NPC.defense = 40; @@ -52,15 +52,10 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() { - //Main.NewText(NPC.ai[0]); if (CalamityGlobalNPC.scavenger < 0 || !Main.npc[CalamityGlobalNPC.scavenger].active) { if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/Ravager/RavagerHead.cs b/NPCs/Ravager/RavagerHead.cs index 30bb9c4e1e..b4cac0f67b 100644 --- a/NPCs/Ravager/RavagerHead.cs +++ b/NPCs/Ravager/RavagerHead.cs @@ -21,10 +21,13 @@ namespace CalamityMod.NPCs.Ravager NPCID.Sets.NeedsExpertScaling[Type] = true; } + public static int NukeDamage = 35; // 140 + public static int PostProviNukeBuff = 25; // +100 = 240 + public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 80; NPC.height = 80; NPC.defense = 40; @@ -49,10 +52,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -95,12 +94,11 @@ namespace CalamityMod.NPCs.Ravager NPC.ai[1] = 0f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { Vector2 shootFromVector = new Vector2(NPC.Center.X, NPC.Center.Y - 20f); Vector2 velocity = new Vector2(0f, -15f); - int nuke = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFromVector, velocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, NPC.target, 0f); + int nuke = Projectile.NewProjectile(NPC.GetSource_FromAI(), shootFromVector, velocity, type, NukeDamage + (provy ? PostProviNukeBuff : 0), 0f, Main.myPlayer, NPC.target, 0f); Main.projectile[nuke].velocity.Y = -15f; } } diff --git a/NPCs/Ravager/RavagerHead2.cs b/NPCs/Ravager/RavagerHead2.cs index 0fa43d2d62..b7c57c63bf 100644 --- a/NPCs/Ravager/RavagerHead2.cs +++ b/NPCs/Ravager/RavagerHead2.cs @@ -20,15 +20,18 @@ namespace CalamityMod.NPCs.Ravager NPCID.Sets.NeedsExpertScaling[Type] = true; } + public static int HomingDartDamage = 30; // 120 + public static int PostProviDartBuff = 20; // +80 == 200 + public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.width = 80; NPC.height = 80; NPC.defense = 40; NPC.DR_NERD(0.15f); - NPC.lifeMax = 10000; + NPC.lifeMax = 20000; NPC.knockBackResist = 0f; AIType = -1; NPC.netAlways = true; @@ -39,7 +42,7 @@ namespace CalamityMod.NPCs.Ravager if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) { NPC.defense *= 2; - NPC.lifeMax *= 4; + NPC.lifeMax *= 3; } if (BossRushEvent.BossRushActive) { @@ -47,10 +50,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -65,9 +64,8 @@ namespace CalamityMod.NPCs.Ravager Player player = Main.player[Main.npc[CalamityGlobalNPC.scavenger].target]; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool provy = DownedBossSystem.downedProvidence && !bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool provy = DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive; if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; @@ -107,11 +105,10 @@ namespace CalamityMod.NPCs.Ravager NPC.rotation = headRotation; NPC.ai[1] += 1f; - bool fireProjectiles = NPC.ai[1] >= (bossRush ? 240f : 480f); + bool fireProjectiles = NPC.ai[1] >= 480f; if (fireProjectiles && Vector2.Distance(NPC.Center, player.Center) > 80f) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float projectileVelocity = death ? 8f : 6f; if (NPC.ai[1] >= 600f) @@ -123,8 +120,7 @@ namespace CalamityMod.NPCs.Ravager { SoundEngine.PlaySound(RavagerHead.MissileSound, NPC.Center); type = ModContent.ProjectileType(); - damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity * 0.25f, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.scavenger].target, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity * 0.25f, type, RavagerHead.NukeDamage + (provy ? RavagerHead.PostProviNukeBuff : 0), 0f, Main.myPlayer, Main.npc[CalamityGlobalNPC.scavenger].target, 0f); } } else @@ -134,7 +130,7 @@ namespace CalamityMod.NPCs.Ravager if (Main.netMode != NetmodeID.MultiplayerClient) { SoundEngine.PlaySound(SoundID.Item33, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, damage + (provy ? 30 : 0), 0f, Main.myPlayer, 0f, -1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity, type, HomingDartDamage + (provy ? PostProviDartBuff : 0), 0f, Main.myPlayer, 0f, -1f); } } } diff --git a/NPCs/Ravager/RavagerLegLeft.cs b/NPCs/Ravager/RavagerLegLeft.cs index 6c55b7750e..95d7ec3d32 100644 --- a/NPCs/Ravager/RavagerLegLeft.cs +++ b/NPCs/Ravager/RavagerLegLeft.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; + NPC.damage = 0; // No contact damage NPC.width = 60; NPC.height = 60; NPC.defense = 40; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Ravager/RavagerLegRight.cs b/NPCs/Ravager/RavagerLegRight.cs index 41f8232445..bcb5cf0a7f 100644 --- a/NPCs/Ravager/RavagerLegRight.cs +++ b/NPCs/Ravager/RavagerLegRight.cs @@ -20,7 +20,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.aiStyle = -1; - NPC.damage = 0; + NPC.damage = 0; // No contact damage NPC.width = 60; NPC.height = 60; NPC.defense = 40; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.Ravager } NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/Ravager/RockPillar.cs b/NPCs/Ravager/RockPillar.cs index ff8adfd193..bf01bf7c0d 100644 --- a/NPCs/Ravager/RockPillar.cs +++ b/NPCs/Ravager/RockPillar.cs @@ -21,7 +21,7 @@ namespace CalamityMod.NPCs.Ravager public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.width = 60; NPC.height = 300; NPC.defense = 50; @@ -36,10 +36,6 @@ namespace CalamityMod.NPCs.Ravager NPC.DeathSound = SoundID.NPCDeath14; NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToWater = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -57,18 +53,25 @@ namespace CalamityMod.NPCs.Ravager if (NPC.alpha > 0) { + // Avoid cheap bullshit + NPC.damage = 0; + NPC.alpha -= 10; if (NPC.alpha < 0) NPC.alpha = 0; } + else + { + if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) + NPC.damage = (int)(NPC.defDamage * 1.5); + else + NPC.damage = NPC.defDamage; + } if (NPC.ai[0] == 0f) { if (NPC.velocity.Y == 0f) { - // Avoid cheap bullshit - NPC.damage = 0; - if (NPC.ai[1] == -1f) { SoundEngine.PlaySound(SoundID.Item62, NPC.Center); @@ -92,14 +95,8 @@ namespace CalamityMod.NPCs.Ravager Main.dust[rockDust2].velocity *= 2f; } - // Set damage - if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) - NPC.damage = (int)Math.Round(NPC.defDamage * 1.5); - else - NPC.damage = NPC.defDamage; - 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; @@ -108,12 +105,6 @@ namespace CalamityMod.NPCs.Ravager } else { - // Set damage - if (DownedBossSystem.downedProvidence && !BossRushEvent.BossRushActive) - NPC.damage = (int)Math.Round(NPC.defDamage * 1.5); - else - NPC.damage = NPC.defDamage; - if (NPC.velocity.Y == 0f || Vector2.Distance(NPC.Center, Main.npc[CalamityGlobalNPC.scavenger].Center) > 2800f) { SoundEngine.PlaySound(SoundID.Item14, NPC.Center); @@ -133,7 +124,7 @@ namespace CalamityMod.NPCs.Ravager } } } - + public override bool? CanFallThroughPlatforms() => NPC.target >= 0 && Main.player[NPC.target].position.Y > NPC.position.Y + NPC.height; public override bool CheckActive() => false; public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) diff --git a/NPCs/Signus/CosmicLantern.cs b/NPCs/Signus/CosmicLantern.cs index dc5150c594..6f96dd535a 100644 --- a/NPCs/Signus/CosmicLantern.cs +++ b/NPCs/Signus/CosmicLantern.cs @@ -1,7 +1,7 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -30,9 +30,9 @@ namespace CalamityMod.NPCs.Signus public override void SetDefaults() { + NPC.damage = 120; // 240 NPC.aiStyle = -1; AIType = -1; - NPC.GetNPCDamage(); NPC.width = 25; NPC.height = 25; NPC.defense = 50; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.Signus NPC.HitSound = SoundID.NPCHit53; NPC.DeathSound = SoundID.NPCDeath44; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -117,8 +113,6 @@ namespace CalamityMod.NPCs.Signus bool revenge = CalamityWorld.revenge; float playerDistNormMult = revenge ? 24f : 22f; - if (BossRushEvent.BossRushActive) - playerDistNormMult = 30f; CalamityRegularEnemyAI.DungeonSpiritAI(NPC, Mod, playerDistNormMult, 0f, true); } diff --git a/NPCs/Signus/CosmicMine.cs b/NPCs/Signus/CosmicMine.cs index 69af4f8c13..8a2a83f901 100644 --- a/NPCs/Signus/CosmicMine.cs +++ b/NPCs/Signus/CosmicMine.cs @@ -24,7 +24,7 @@ namespace CalamityMod.NPCs.Signus public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 140; // 280 NPC.width = 30; NPC.height = 30; NPC.lifeMax = 4800; @@ -38,10 +38,6 @@ namespace CalamityMod.NPCs.Signus NPC.HitSound = SoundID.NPCHit53; NPC.DeathSound = SoundID.NPCDeath44; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/Signus/Signus.cs b/NPCs/Signus/Signus.cs index eb3761f198..cceffde46d 100644 --- a/NPCs/Signus/Signus.cs +++ b/NPCs/Signus/Signus.cs @@ -69,16 +69,22 @@ namespace CalamityMod.NPCs.Signus } } + public static int ScytheDamage = 60; // 240 + public static int DustDamage = 60; // 240; Also applies to Legendary Mode Peanuts + + // GFB exclusive + public static int StealthStrikeMult = 2; // 480 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 160; // 320 NPC.npcSlots = 32f; - NPC.GetNPCDamage(); NPC.width = 130; NPC.height = 130; NPC.defense = 60; NPC.LifeMaxNERB(320000, 375000, 380000); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; @@ -89,9 +95,6 @@ namespace CalamityMod.NPCs.Signus NPC.HitSound = SoundID.NPCHit49; NPC.DeathSound = SoundID.NPCDeath51; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -129,21 +132,20 @@ namespace CalamityMod.NPCs.Signus CalamityGlobalNPC.signus = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Vector2 vectorCenter = NPC.Center; double lifeRatio = NPC.life / (double)NPC.lifeMax; - lifeToAlpha = (int)((Main.getGoodWorld ? 200D : 100D) * (1D - lifeRatio)); + lifeToAlpha = (int)((CalamityWorld.LegendaryMode ? 200D : 100D) * (1D - lifeRatio)); int maxCharges = death ? 1 : revenge ? 2 : expertMode ? 3 : 4; int maxTeleports = (death && lifeRatio < 0.9) ? 1 : revenge ? 2 : expertMode ? 3 : 4; - float inertia = bossRush ? 9f : death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; - float chargeVelocity = bossRush ? 16f : death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; - if (Main.getGoodWorld) + float inertia = death ? 10f : revenge ? 11f : expertMode ? 12f : 14f; + float chargeVelocity = death ? 14f : revenge ? 13f : expertMode ? 12f : 10f; + if (CalamityWorld.LegendaryMode) { inertia *= 0.5f; chargeVelocity *= 1.15f; @@ -197,7 +199,7 @@ namespace CalamityMod.NPCs.Signus else if (NPC.timeLeft < 1800) NPC.timeLeft = 1800; - if (lifeToAlpha < (Main.getGoodWorld ? 100 : 50) && NPC.ai[0] != 1f) + if (lifeToAlpha < (CalamityWorld.LegendaryMode ? 100 : 50) && NPC.ai[0] != 1f) { for (int i = 0; i < 2; i++) { @@ -237,9 +239,6 @@ namespace CalamityMod.NPCs.Signus if (NPC.ai[0] <= 2f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.rotation = NPC.velocity.X * 0.04f; float playerLocation = vectorCenter.X - player.Center.X; NPC.direction = playerLocation < 0f ? 1 : -1; @@ -251,7 +250,7 @@ namespace CalamityMod.NPCs.Signus if (phase3 || revenge) NPC.knockBackResist = 0f; - float speed = bossRush ? 20f : revenge ? 15f : expertMode ? 14f : 12f; + float speed = revenge ? 15f : expertMode ? 14f : 12f; if (expertMode) speed += death ? 6f * (float)(1D - lifeRatio) : 4f * (float)(1D - lifeRatio); @@ -263,7 +262,7 @@ namespace CalamityMod.NPCs.Signus playerYDist *= playerDistance; float inertia2 = 50f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia2 *= 0.5f; NPC.velocity.X = (NPC.velocity.X * inertia2 + playerXDist) / (inertia2 + 1f); @@ -288,17 +287,14 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 0f) { - // Avoid cheap bullshit - NPC.damage = 0; - if (Main.netMode != NetmodeID.MultiplayerClient) { - NPC.localAI[1] += bossRush ? 1.5f : 1f; + NPC.localAI[1] += 1f; if (expertMode) NPC.localAI[1] += death ? 3f * (float)(1D - lifeRatio) : 2f * (float)(1D - lifeRatio); - if (NPC.localAI[1] >= (Main.getGoodWorld ? 0f : 120f)) + if (NPC.localAI[1] >= (CalamityWorld.LegendaryMode ? 0f : 120f)) { NPC.localAI[1] = 0f; @@ -345,7 +341,7 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 1f) { - // Avoid cheap bullshit + // Disable contact damage for some time while fading away NPC.damage = 0; Vector2 position = new Vector2(NPC.ai[1] * 16f - (NPC.width / 2), NPC.ai[2] * 16f - (NPC.height / 2)); @@ -356,7 +352,7 @@ namespace CalamityMod.NPCs.Signus Main.dust[dust].fadeIn = 1f; } - NPC.alpha += bossRush ? 3 : 2; + NPC.alpha += 2; if (expertMode) NPC.alpha += death ? (int)Math.Round(4.5D * (1D - lifeRatio)) : (int)Math.Round(3D * (1D - lifeRatio)); @@ -381,12 +377,11 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 2f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.alpha -= 50; if (NPC.alpha <= lifeToAlpha) { + // Restore contact damage once returned to proper opacity + NPC.damage = NPC.defDamage; if (Main.netMode != NetmodeID.MultiplayerClient && revenge) { SoundEngine.PlaySound(SoundID.Item122, NPC.Center); @@ -465,15 +460,12 @@ namespace CalamityMod.NPCs.Signus } else if (NPC.ai[0] == 3f) { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.rotation = NPC.velocity.X * 0.04f; float playerLocation = vectorCenter.X - player.Center.X; NPC.direction = playerLocation < 0f ? 1 : -1; NPC.spriteDirection = NPC.direction; - float divisor = expertMode ? (bossRush ? 10f : death ? 12f : revenge ? 15f : 20f) - (float)Math.Ceiling(5D * (1D - lifeRatio)) : 20f; + float divisor = expertMode ? (death ? 12f : revenge ? 15f : 20f) - (float)Math.Ceiling(5D * (1D - lifeRatio)) : 20f; float scytheBarrageTime = divisor * 3f; float scytheBarrageCooldown = divisor * 3f; @@ -496,16 +488,14 @@ namespace CalamityMod.NPCs.Signus scytheXDist *= scytheDistance; scytheYDist *= scytheDistance; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist, scytheYDist, type, damage, 0f, Main.myPlayer, 0f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist, scytheYDist, type, ScytheDamage, 0f, Main.myPlayer, 0f, NPC.target + 1); if (stealthTimer >= maxStealth) { - damage *= 2; SoundEngine.PlaySound(RaidersTalisman.StealthHitSound, NPC.Center); for (int i = 0; i < 4; i++) { Vector2 offset = new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)); - Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist + offset.X, scytheYDist + offset.Y, type, damage, 0f, Main.myPlayer, 0f, NPC.target + 1); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter.X, vectorCenter.Y, scytheXDist + offset.X, scytheYDist + offset.Y, type, ScytheDamage * StealthStrikeMult, 0f, Main.myPlayer, 0f, NPC.target + 1); } stealthTimer = 0; } @@ -513,8 +503,8 @@ namespace CalamityMod.NPCs.Signus } } - float maxVelocityY = bossRush ? 1.5f : death ? 2.5f : 3f; - float maxVelocityX = bossRush ? 5f : death ? 7f : 8f; + float maxVelocityY = death ? 2.5f : 3f; + float maxVelocityX = death ? 7f : 8f; if (NPC.position.Y > player.position.Y - 250f) { @@ -573,7 +563,7 @@ namespace CalamityMod.NPCs.Signus { if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalLamps = (Main.getGoodWorld && !Main.zenithWorld) ? 10 : 5; + int totalLamps = (CalamityWorld.LegendaryMode && !Main.zenithWorld) ? 10 : 5; if (NPC.CountNPCS(ModContent.NPCType()) < totalLamps) { bool buffed = false; @@ -632,10 +622,7 @@ namespace CalamityMod.NPCs.Signus if (calamityGlobalNPC.newAI[0] == 0f) // Line up the charge { - // Avoid cheap bullshit - NPC.damage = 0; - - float velocity = bossRush ? 18f : revenge ? 16f : expertMode ? 15f : 14f; + float velocity = revenge ? 16f : expertMode ? 15f : 14f; if (expertMode) velocity += death ? 6f * (float)(1D - lifeRatio) : 4f * (float)(1D - lifeRatio); @@ -670,17 +657,11 @@ namespace CalamityMod.NPCs.Signus } else if (calamityGlobalNPC.newAI[0] == 1f) // Pause before charge { - // Avoid cheap bullshit - NPC.damage = 0; - NPC.velocity *= 0.8f; NPC.ai[1] += 1f; if (NPC.ai[1] >= 5f) { - // Set damage - NPC.damage = NPC.defDamage; - calamityGlobalNPC.newAI[0] = 2f; NPC.netUpdate = true; @@ -697,9 +678,6 @@ namespace CalamityMod.NPCs.Signus } else if (calamityGlobalNPC.newAI[0] == 2f) // Charging { - // Set damage - NPC.damage = NPC.defDamage; - if (Main.netMode != NetmodeID.MultiplayerClient) { bool buffed = false; @@ -712,15 +690,14 @@ namespace CalamityMod.NPCs.Signus if ((phase2 || buffed) && NPC.ai[2] % 3f == 0f) { SoundEngine.PlaySound(SoundID.Item73, NPC.Center); - int type = (CalamityWorld.LegendaryMode && revenge) ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = (CalamityWorld.LegendaryMode && revenge) ? 60 : NPC.GetProjectileDamage(type); + int type = (CalamityWorld.LegendaryMode) ? ModContent.ProjectileType() : ModContent.ProjectileType(); Vector2 velocity = Main.zenithWorld ? new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)) : Vector2.Zero; - if (Main.getGoodWorld && !Main.zenithWorld) + if (CalamityWorld.LegendaryMode && !Main.zenithWorld) { velocity = new Vector2(Main.rand.Next(-5, 6), Main.rand.Next(-5, 6)); } int ai = buffed ? 69 : 0; - Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, velocity, type, damage, 0f, Main.myPlayer, ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), vectorCenter, velocity, type, DustDamage, 0f, Main.myPlayer, ai); } } @@ -750,9 +727,6 @@ namespace CalamityMod.NPCs.Signus } else if (calamityGlobalNPC.newAI[0] == 3f) // Slow down after charging and reset { - // Avoid cheap bullshit - NPC.damage = 0; - if (stealthTimer >= maxStealth) { stealthTimer = 0; @@ -916,7 +890,7 @@ namespace CalamityMod.NPCs.Signus return false; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -984,7 +958,6 @@ namespace CalamityMod.NPCs.Signus public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn.cs b/NPCs/SlimeGod/CorruptSlimeSpawn.cs index 9d19bc6ba6..ab8ea6601f 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn.cs @@ -20,17 +20,20 @@ namespace CalamityMod.NPCs.SlimeGod NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; } + // GFB exclusive + public static int ShaderainDamage = 12; // 48 + public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Bat; - NPC.GetNPCDamage(); + NPC.damage = 28; // 56 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 360 : 180; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 360 : 180; NPC.knockBackResist = 0.7f; AnimationType = NPCID.Slimer; NPC.lavaImmune = false; @@ -40,10 +43,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -84,8 +83,7 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.zenithWorld && Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, ShaderainDamage, 0f, Main.myPlayer); } } diff --git a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs index e8df94c69d..35eb93535f 100644 --- a/NPCs/SlimeGod/CorruptSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CorruptSlimeSpawn2.cs @@ -23,14 +23,14 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Slime; - NPC.GetNPCDamage(); + NPC.damage = 20; // 40 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 180 : 90; + NPC.lifeMax = BossRushEvent.BossRushActive ? 5000 : CalamityWorld.LegendaryMode ? 180 : 90; NPC.knockBackResist = 0.9f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; @@ -40,10 +40,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() @@ -85,14 +81,13 @@ namespace CalamityMod.NPCs.SlimeGod double deltaAngleBoom = spreadBoom / 8f; double offsetAngleBoom; int iBoom; - int damageBoom = 30; for (iBoom = 0; iBoom < 5; iBoom++) { int projectileType = ModContent.ProjectileType(); offsetAngleBoom = startAngleBoom + deltaAngleBoom * (iBoom + iBoom * iBoom) / 2f + 32f * iBoom; float velocityfactor = 0.3f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * velocityfactor), (float)(Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * velocityfactor), (float)(-Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, damageBoom, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(Math.Sin(offsetAngleBoom) * velocityfactor), (float)(Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), valueBoom.X, valueBoom.Y, (float)(-Math.Sin(offsetAngleBoom) * velocityfactor), (float)(-Math.Cos(offsetAngleBoom) * velocityfactor), projectileType, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 0f, 0f); } } } diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs index 4cb9744c71..70d731eb17 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn.cs @@ -22,14 +22,14 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Slime; - NPC.GetNPCDamage(); + NPC.damage = 20; // 40 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 4; - NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 220 : 110; + NPC.lifeMax = BossRushEvent.BossRushActive ? 10000 : CalamityWorld.LegendaryMode ? 220 : 110; NPC.knockBackResist = 0.8f; AnimationType = NPCID.CorruptSlime; NPC.lavaImmune = false; @@ -39,10 +39,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs index 9f321b1817..635c400287 100644 --- a/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs +++ b/NPCs/SlimeGod/CrimsonSlimeSpawn2.cs @@ -26,17 +26,19 @@ namespace CalamityMod.NPCs.SlimeGod NPCID.Sets.BossBestiaryPriority.Add(Type); } + public static int SmallSpikeDamage = 11; // 44 + public override void SetDefaults() { NPC.aiStyle = NPCAIStyleID.Slime; - NPC.GetNPCDamage(); + NPC.damage = 28; // 56 NPC.width = 40; NPC.height = 30; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 6; - NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 260 : 130; + NPC.lifeMax = BossRushEvent.BossRushActive ? 12000 : CalamityWorld.LegendaryMode ? 260 : 130; NPC.knockBackResist = 0.7f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -101,7 +103,7 @@ namespace CalamityMod.NPCs.SlimeGod spikeTimer -= 1f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); + int damage = SmallSpikeDamage; if (Main.zenithWorld) type = Main.rand.NextBool() ? ModContent.ProjectileType() : ModContent.ProjectileType(); diff --git a/NPCs/SlimeGod/CrimulanPaladin.cs b/NPCs/SlimeGod/CrimulanPaladin.cs index 07b540a747..92b31f87e7 100644 --- a/NPCs/SlimeGod/CrimulanPaladin.cs +++ b/NPCs/SlimeGod/CrimulanPaladin.cs @@ -28,17 +28,18 @@ namespace CalamityMod.NPCs.SlimeGod this.HideFromBestiary(); } + public static int BigSpikeDamage = 15; // 60 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 42; // 84 NPC.width = Width; NPC.height = Height; NPC.defense = 12; NPC.LifeMaxNERB(7500, 9000, 160000); NPC.BossBar = Main.BigBossProgressBar.NeverValid; NPC.knockBackResist = 0f; - NPC.value = 0f; NPC.Opacity = 1f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -49,9 +50,6 @@ namespace CalamityMod.NPCs.SlimeGod AIType = -1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -82,10 +80,9 @@ namespace CalamityMod.NPCs.SlimeGod CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); CalamityGlobalNPC.slimeGodRed = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -97,7 +94,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 24; - setDamage += 25; + setDamage += SlimeGodCore.PossessionDamageBoost; } // Used for landing squash and stretch @@ -112,10 +109,10 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; // How fast the slime slams down - float slamVelocity = bossRush ? 20f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; // Used for how fast the slime animates NPC.aiAction = 0; @@ -155,7 +152,7 @@ namespace CalamityMod.NPCs.SlimeGod if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { // Spread of random globs in meme mode - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) @@ -188,7 +185,6 @@ namespace CalamityMod.NPCs.SlimeGod // Spread of spikes float projectileVelocity = 2f; int type2 = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type2); Vector2 spawnLocation = new Vector2(NPC.Center.X, NPC.Center.Y + 50f * NPC.scale); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; @@ -223,7 +219,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, damage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, BigSpikeDamage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); } // Die @@ -241,9 +237,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - enraged = true; - if (NPC.localAI[1] != 1f) { if (enraged) @@ -342,7 +335,7 @@ namespace CalamityMod.NPCs.SlimeGod } } - float distanceSpeedBoost = NPC.Distance(player.Center) * (bossRush ? 0.008f : 0.005f); + float distanceSpeedBoost = NPC.Distance(player.Center) * 0.005f; if (NPC.ai[0] == 0f) { @@ -569,7 +562,6 @@ namespace CalamityMod.NPCs.SlimeGod // Spread of spikes float projectileVelocity = 2f; int type2 = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type2); Vector2 spawnLocation = new Vector2(NPC.Center.X, NPC.Center.Y + 50f * NPC.scale); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; @@ -604,7 +596,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, damage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type2, BigSpikeDamage, 0f, Main.myPlayer, maxVelocity, acceleration, spikeType); } } @@ -719,7 +711,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -752,7 +744,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/SlimeGod/EbonianPaladin.cs b/NPCs/SlimeGod/EbonianPaladin.cs index c366736034..c45b32cdef 100644 --- a/NPCs/SlimeGod/EbonianPaladin.cs +++ b/NPCs/SlimeGod/EbonianPaladin.cs @@ -38,7 +38,7 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 80 NPC.width = Width; NPC.height = Height; NPC.defense = 10; @@ -49,15 +49,11 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = 0f; NPC.Opacity = 1f; NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -86,10 +82,9 @@ namespace CalamityMod.NPCs.SlimeGod CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); CalamityGlobalNPC.slimeGodPurple = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -98,10 +93,10 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 20; - setDamage += 22; + setDamage += SlimeGodCore.PossessionDamageBoost; } - float scale = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; NPC.aiAction = 0; // Get a target @@ -131,7 +126,7 @@ namespace CalamityMod.NPCs.SlimeGod if (lifeRatio <= 0.5f && Main.netMode != NetmodeID.MultiplayerClient && expertMode) { - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { int type = ModContent.ProjectileType(); for (int i = 0; i < 30; i++) @@ -160,12 +155,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - { - enraged = true; - hyperMode = true; - } - // For animating the wings NPC.localAI[0] += 1f; @@ -272,7 +261,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.timeLeft > 10) { NPC.ai[1] += 1f; - int idleTime = bossRush ? 30 : death ? 75 : revenge ? 90 : 120; + int idleTime = death ? 75 : revenge ? 90 : 120; if (NPC.ai[1] >= idleTime) { NPC.ai[1] = 0f; @@ -319,10 +308,9 @@ namespace CalamityMod.NPCs.SlimeGod { if (Main.netMode != NetmodeID.MultiplayerClient) { - int numProjectiles = Main.getGoodWorld ? 12 : death ? 6 : 4; + int numProjectiles = CalamityWorld.LegendaryMode ? 12 : death ? 6 : 4; float projectileVelocity = death ? 8f : 6f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y + 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; float rotation = MathHelper.ToRadians(80); @@ -353,7 +341,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } // Fire slime balls directly at players with a max of 2 @@ -387,7 +375,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } @@ -436,14 +424,13 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.ai[1] == 1f) { NPC.ai[3] += 1f; - float slimeDropGateValue = bossRush ? 10f : death ? 20f : revenge ? 25f : expertMode ? 30f : 40f; + float slimeDropGateValue = death ? 20f : revenge ? 25f : expertMode ? 30f : 40f; if (NPC.ai[3] % slimeDropGateValue == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { float projectileVelocity = 3f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y + 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int dustType = DustID.TintableDust; @@ -467,7 +454,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, destination, type, damage, 0f, Main.myPlayer, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, destination, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 1f); } SoundEngine.PlaySound(SlimeGodCore.ShotSound, NPC.Center); @@ -498,16 +485,16 @@ namespace CalamityMod.NPCs.SlimeGod // Charge variables float chargeVelocityMult = 0.1f; - float maxChargeVelocity = (bossRush || enraged) ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; - if (Main.getGoodWorld) + float maxChargeVelocity = enraged ? 12f : death ? 10f : revenge ? 9f : expertMode ? 8f : 6f; + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 1.15f; - if (CalamityWorld.LegendaryMode && revenge) + if (CalamityWorld.LegendaryMode) maxChargeVelocity *= 2f; - float inertia = (bossRush || enraged) ? 100f : death ? 110f : revenge ? 114f : expertMode ? 120f : 130f; + float inertia = death ? 110f : revenge ? 114f : expertMode ? 120f : 130f; if (lifeRatio < 0.75f) inertia *= 0.8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) inertia *= 0.8f; // Start charge @@ -544,7 +531,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = setDamage; NPC.ai[2] += 1f; - float phaseGateValue = (bossRush || enraged) ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; + float phaseGateValue = enraged ? 120f : death ? 140f : revenge ? 150f : expertMode ? 160f : 180f; if (NPC.ai[2] >= phaseGateValue) { NPC.ai[1] = 2f; @@ -562,7 +549,7 @@ namespace CalamityMod.NPCs.SlimeGod // Accelerate if (NPC.velocity.Length() < maxChargeVelocity) { - float velocityMult = (bossRush || enraged) ? 1.15f : death ? 1.13f : revenge ? 1.12f : expertMode ? 1.11f : 1.1f; + float velocityMult = enraged ? 1.15f : death ? 1.13f : revenge ? 1.12f : expertMode ? 1.11f : 1.1f; NPC.velocity = targetVector * (NPC.velocity.Length() * velocityMult); if (NPC.velocity.Length() > maxChargeVelocity) { @@ -651,7 +638,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -684,7 +671,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -763,13 +750,12 @@ namespace CalamityMod.NPCs.SlimeGod public static void FlyMovement(NPC npc, bool slimeBombardment = false) { // Difficulty bools - bool bossRush = BossRushEvent.BossRushActive; bool death = CalamityWorld.death; bool revenge = CalamityWorld.revenge; bool ableToDropSlime = npc.ai[1] == 1f; - float flyVelocity = bossRush ? 20f : death ? 15f : revenge ? 12.5f : 10f; - float flyAcceleration = bossRush ? 0.24f : death ? 0.18f : revenge ? 0.15f : 0.12f; + float flyVelocity = death ? 15f : revenge ? 12.5f : 10f; + float flyAcceleration = death ? 0.18f : revenge ? 0.15f : 0.12f; if (slimeBombardment) { diff --git a/NPCs/SlimeGod/SlimeGodCore.cs b/NPCs/SlimeGod/SlimeGodCore.cs index b6fe65cfe7..df352658d5 100644 --- a/NPCs/SlimeGod/SlimeGodCore.cs +++ b/NPCs/SlimeGod/SlimeGodCore.cs @@ -60,7 +60,6 @@ namespace CalamityMod.NPCs.SlimeGod public static readonly SoundStyle ShotSound = new("CalamityMod/Sounds/Custom/SlimeGodShot", 2); public static readonly SoundStyle BigShotSound = new("CalamityMod/Sounds/Custom/SlimeGodBigShot", 2); - public static Asset ZenithSeedEyeTexture; public static Asset EyeTexture; public static Asset OverlayTexture; @@ -73,35 +72,26 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetStaticDefaults() { NPCID.Sets.BossBestiaryPriority.Add(Type); - NPCID.Sets.NPCBestiaryDrawModifiers value = new NPCID.Sets.NPCBestiaryDrawModifiers() - { - Scale = 0.5f, - PortraitScale = 0.6f, - CustomTexturePath = "CalamityMod/ExtraTextures/Bestiary/SlimeGod_Bestiary", - PortraitPositionXOverride = 40, - PortraitPositionYOverride = 40 - }; - value.Position.X += 65; - value.Position.Y += 35; - NPCID.Sets.NPCBestiaryDrawOffset[Type] = value; NPCID.Sets.MPAllowedEnemies[Type] = true; if (!Main.dedServ) { - ZenithSeedEyeTexture = ModContent.Request("CalamityMod/NPCs/SlimeGod/SlimeGodEyes", AssetRequestMode.AsyncLoad); EyeTexture = ModContent.Request("CalamityMod/NPCs/SlimeGod/ExtraTextures/SlimeGodCoreEye", AssetRequestMode.AsyncLoad); OverlayTexture = ModContent.Request("CalamityMod/NPCs/SlimeGod/ExtraTextures/SlimeGodCoreOverlay", AssetRequestMode.AsyncLoad); } } + public static int GlobDamage = 15; // 60 + public static int PossessionDamageBoost = 10; // +20 flat contact damage + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 40; // 80 NPC.npcSlots = 10f; NPC.width = 96; NPC.height = 98; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) NPC.scale = 2f; NPC.defense = 6; @@ -111,7 +101,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 12, 0, 0); + NPC.value = Item.buyPrice(gold: 8); NPC.Opacity = 0.8f; NPC.boss = true; NPC.BossBar = ModContent.GetInstance(); @@ -122,9 +112,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -212,13 +199,11 @@ namespace CalamityMod.NPCs.SlimeGod Lighting.AddLight(NPC.Center, light.X, light.Y, light.Z); CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - CalamityGlobalNPC.slimeGod = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // For animating the eye NPC.localAI[0] += 1f; @@ -504,7 +489,7 @@ namespace CalamityMod.NPCs.SlimeGod if (expertMode && aggressionLevel >= (int)AggressionLevel.FireProjectiles) { - float divisor = bossRush ? 50f : death ? 90f : revenge ? 120f : 150f; + float divisor = death ? 90f : revenge ? 120f : 150f; divisor -= (aggressionLevel - 1) * 10f; if (aggressionLevel == (int)AggressionLevel.DoEverythingMoreOften) divisor *= 0.5f; @@ -518,17 +503,15 @@ namespace CalamityMod.NPCs.SlimeGod { float projectileVelocity = 4f + (aggressionLevel - 1) * 2f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 velocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, GlobDamage, 0f, Main.myPlayer); } else { float projectileVelocity = 8f + (aggressionLevel - 1) * 2f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 velocity = (player.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * projectileVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocity, type, GlobDamage, 0f, Main.myPlayer); } } } @@ -546,9 +529,7 @@ namespace CalamityMod.NPCs.SlimeGod flySpeed += 3f; if (phase2) flySpeed *= 1.1f; - if (bossRush) - flySpeed *= 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) flySpeed *= 1.3f; Vector2 flyDestination = aggressionLevel >= (int)AggressionLevel.ChargeAtPlayer ? player.Center : player.Center - Vector2.UnitY * 320f; @@ -590,9 +571,9 @@ namespace CalamityMod.NPCs.SlimeGod float maxInertiaDistance = 600f; float totalInertiaAdjustmentDistance = maxInertiaDistance - minInertiaDistance; float distanceFromInertiaAdjustmentCutoff = distanceFromFlyDestination - minInertiaDistance; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) maxInertia *= 0.8f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) maxInertia *= Main.rand.NextFloat(0.2f, 1f); float inertia = distanceFromFlyDestination >= maxInertiaDistance ? maxInertia : @@ -636,10 +617,9 @@ namespace CalamityMod.NPCs.SlimeGod Texture2D texture = TextureAssets.Npc[Type].Value; Texture2D eyeTexture = EyeTexture.Value; Texture2D overlayTexture = OverlayTexture.Value; - Texture2D pog = ZenithSeedEyeTexture.Value; // Used for animating the eye - if (NPC.localAI[0] % 6f == 0f) + if (NPC.localAI[0] % 6f == 0f && !NPC.IsABestiaryIconDummy) { eyeFrameDrawn++; if (eyeFrameX == 0) @@ -703,9 +683,6 @@ namespace CalamityMod.NPCs.SlimeGod // Draw the overlay spriteBatch.Draw(overlayTexture, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, drawColorAlpha, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - if (Main.zenithWorld) - spriteBatch.Draw(pog, NPC.Center - screenPos + new Vector2(0f, NPC.gfxOffY), NPC.frame, drawColorAlpha, NPC.rotation, origin, NPC.scale, spriteEffects, 0f); - return false; } @@ -730,7 +707,7 @@ namespace CalamityMod.NPCs.SlimeGod return minDist <= 40f * NPC.scale; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ItemID.HealingPotion; } diff --git a/NPCs/SlimeGod/SlimeGodEyes.png b/NPCs/SlimeGod/SlimeGodEyes.png deleted file mode 100644 index dda0f23656..0000000000 Binary files a/NPCs/SlimeGod/SlimeGodEyes.png and /dev/null differ diff --git a/NPCs/SlimeGod/SplitCrimulanPaladin.cs b/NPCs/SlimeGod/SplitCrimulanPaladin.cs index dfd3f73e7d..985b530688 100644 --- a/NPCs/SlimeGod/SplitCrimulanPaladin.cs +++ b/NPCs/SlimeGod/SplitCrimulanPaladin.cs @@ -40,14 +40,13 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 36; // 72 NPC.LifeMaxNERB(1875, 2250, 80000); NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.GetNPCDamage(); NPC.width = Width; NPC.height = Height; NPC.defense = 10; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 1, 0, 0); NPC.Opacity = 1f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -58,9 +57,6 @@ namespace CalamityMod.NPCs.SlimeGod AIType = -1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -97,10 +93,9 @@ namespace CalamityMod.NPCs.SlimeGod if (CalamityGlobalNPC.slimeGodRed < 0 || !Main.npc[CalamityGlobalNPC.slimeGodRed].active) CalamityGlobalNPC.slimeGodRed = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -112,7 +107,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 20; - setDamage += 22; + setDamage += SlimeGodCore.PossessionDamageBoost; } // Used for landing squash and stretch @@ -127,10 +122,10 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; // Used for teleporting - float scale = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; // How fast the slime slams down - float slamVelocity = bossRush ? 22.25f : death ? 18.25f : revenge ? 16.5f : expertMode ? 15.5f : 13.5f; + float slamVelocity = death ? 18.25f : revenge ? 16.5f : expertMode ? 15.5f : 13.5f; // Used for how fast the slime animates NPC.aiAction = 0; @@ -172,9 +167,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - enraged = true; - if (NPC.localAI[1] != 1f) { if (enraged) @@ -274,7 +266,7 @@ namespace CalamityMod.NPCs.SlimeGod } } - float distanceSpeedBoost = NPC.Distance(player.Center) * (bossRush ? 0.008f : 0.005f); + float distanceSpeedBoost = NPC.Distance(player.Center) * 0.005f; if (NPC.ai[0] == 0f) { @@ -481,7 +473,6 @@ namespace CalamityMod.NPCs.SlimeGod // Eruption of slime balls that fall down float projectileVelocity = 8f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int numProj = 3; @@ -510,7 +501,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed * 1.5f, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed * 1.5f, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer, 1f, 0f); } // Fire slime balls directly at players with a max of 2 @@ -544,7 +535,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } @@ -658,7 +649,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -691,7 +682,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/SlimeGod/SplitEbonianPaladin.cs b/NPCs/SlimeGod/SplitEbonianPaladin.cs index bbbd3c5e50..b827299dcf 100644 --- a/NPCs/SlimeGod/SplitEbonianPaladin.cs +++ b/NPCs/SlimeGod/SplitEbonianPaladin.cs @@ -40,16 +40,15 @@ namespace CalamityMod.NPCs.SlimeGod public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 36; // 72 NPC.LifeMaxNERB(2000, 2400, 110000); NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.GetNPCDamage(); NPC.width = Width; NPC.height = Height; NPC.defense = 8; NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 1, 0, 0); NPC.Opacity = 1f; NPC.lavaImmune = false; NPC.noGravity = false; @@ -58,9 +57,6 @@ namespace CalamityMod.NPCs.SlimeGod NPC.DeathSound = SoundID.NPCDeath1; NPC.Calamity().VulnerableToHeat = true; NPC.Calamity().VulnerableToSickness = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -97,10 +93,9 @@ namespace CalamityMod.NPCs.SlimeGod if (CalamityGlobalNPC.slimeGodPurple < 0 || !Main.npc[CalamityGlobalNPC.slimeGodPurple].active) CalamityGlobalNPC.slimeGodPurple = NPC.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || NPC.localAI[1] == 1f || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || NPC.localAI[1] == 1f || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -109,7 +104,7 @@ namespace CalamityMod.NPCs.SlimeGod if (NPC.localAI[1] == 1f) { NPC.defense = NPC.defDefense + 16; - setDamage += 20; + setDamage += SlimeGodCore.PossessionDamageBoost; } // Used for landing squash and stretch @@ -123,10 +118,10 @@ namespace CalamityMod.NPCs.SlimeGod addedStretch = -landingRecoil; - float scale = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.6f : Main.getGoodWorld ? 0.8f : 1f; + float scale = CalamityWorld.LegendaryMode ? 0.6f : 1f; // How fast the slime slams down - float slamVelocity = bossRush ? 20f : death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; + float slamVelocity = death ? 16f : revenge ? 15f : expertMode ? 14f : 12f; NPC.aiAction = 0; NPC.noTileCollide = false; @@ -165,12 +160,6 @@ namespace CalamityMod.NPCs.SlimeGod enraged = false; } - if (bossRush) - { - enraged = true; - hyperMode = true; - } - // Slow down dramatically while teleporting if (NPC.ai[0] == 5f || NPC.ai[0] == 6f) { @@ -264,7 +253,7 @@ namespace CalamityMod.NPCs.SlimeGod } } - float distanceSpeedBoost = NPC.Distance(player.Center) * (bossRush ? 0.008f : 0.005f); + float distanceSpeedBoost = NPC.Distance(player.Center) * 0.005f; if (NPC.ai[0] == 0f) { @@ -415,7 +404,6 @@ namespace CalamityMod.NPCs.SlimeGod if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); int numProj = death ? 5 : 3; int spread = death ? 12 : 8; float rotation = MathHelper.ToRadians(spread); @@ -423,7 +411,7 @@ namespace CalamityMod.NPCs.SlimeGod { Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(3f, 3f); Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))) + randomVelocity; - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 45f * NPC.scale, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 45f * NPC.scale, perturbedSpeed, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } @@ -509,7 +497,6 @@ namespace CalamityMod.NPCs.SlimeGod // Eruption of slime balls float projectileVelocity = 4f; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); Vector2 destination = (new Vector2(NPC.Center.X, NPC.Center.Y - 100f) - NPC.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int numProj = 9; @@ -541,7 +528,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, perturbedSpeed, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } @@ -576,7 +563,7 @@ namespace CalamityMod.NPCs.SlimeGod Main.dust[slimeDust].noGravity = true; } - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileLocation, projFireDirection, type, SlimeGodCore.GlobDamage, 0f, Main.myPlayer); } } } @@ -688,7 +675,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.aiAction = 1; NPC.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; scale = MathHelper.Clamp((teleportTime - NPC.ai[1]) / teleportTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -721,7 +708,7 @@ namespace CalamityMod.NPCs.SlimeGod NPC.damage = 0; NPC.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; scale = MathHelper.Clamp(NPC.ai[1] / teleportEndTime, 0f, 1f); scale = 0.5f + scale * 0.5f; if (NPC.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/StormWeaver/StormWeaverBody.cs b/NPCs/StormWeaver/StormWeaverBody.cs index 0519194931..ec54f5f5de 100644 --- a/NPCs/StormWeaver/StormWeaverBody.cs +++ b/NPCs/StormWeaver/StormWeaverBody.cs @@ -32,9 +32,11 @@ namespace CalamityMod.NPCs.StormWeaver } } + public static int LaserDamage = 55; // 220 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 90; // 180 NPC.npcSlots = 5f; NPC.width = 40; NPC.height = 40; @@ -60,22 +62,17 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -101,10 +98,9 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life > Main.npc[(int)NPC.ai[1]].life) NPC.life = Main.npc[(int)NPC.ai[1]].life; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Shed armor bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; @@ -146,7 +142,7 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire a barrage of lasers every 5 seconds - float laserBarrageGateValue = bossRush ? 200f : 300f; + float laserBarrageGateValue = 300f; if (Main.npc[(int)NPC.ai[2]].localAI[0] % laserBarrageGateValue == 0f) { float bodySegmentDivisor = death ? 6 : revenge ? 5 : expertMode ? 4 : 3; @@ -156,8 +152,7 @@ namespace CalamityMod.NPCs.StormWeaver float projectileVelocity = death ? 6.25f : revenge ? 5.75f : expertMode ? 5.5f : 5f; Vector2 velocityVector = Vector2.Normalize(player.Center - NPC.Center) * projectileVelocity; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocityVector, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, velocityVector, type, LaserDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 900; } } @@ -236,21 +231,6 @@ namespace CalamityMod.NPCs.StormWeaver else if (targetX > 0f) NPC.spriteDirection = 1; } - - // Calculate contact damage based on velocity - float velocity = (phase2 ? 12f : 10f) + (bossRush ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); - float minimalContactDamageVelocity = velocity * 0.25f; - float minimalDamageVelocity = velocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -262,10 +242,9 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -273,7 +252,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -299,17 +278,16 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -369,7 +347,6 @@ namespace CalamityMod.NPCs.StormWeaver public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } diff --git a/NPCs/StormWeaver/StormWeaverHead.cs b/NPCs/StormWeaver/StormWeaverHead.cs index e2488b3a43..0992006f02 100644 --- a/NPCs/StormWeaver/StormWeaverHead.cs +++ b/NPCs/StormWeaver/StormWeaverHead.cs @@ -83,16 +83,20 @@ namespace CalamityMod.NPCs.StormWeaver } } + public static int LightningDamage = 64; // 256 + public static int FrostWaveDamage = 64; // 256 + public static int TornadoDamage = 66; // 264 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 180; // 360 NPC.npcSlots = 5f; NPC.width = 74; NPC.height = 74; NPC.lifeMax = 825000; NPC.LifeMaxNERB(NPC.lifeMax, NPC.lifeMax, 500000); - NPC.value = Item.buyPrice(1, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 1); // Phase one settings CalamityGlobalNPC global = NPC.Calamity(); @@ -112,22 +116,17 @@ namespace CalamityMod.NPCs.StormWeaver NPC.noTileCollide = true; NPC.netAlways = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -171,14 +170,13 @@ namespace CalamityMod.NPCs.StormWeaver { CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (CalamityServerConfig.Instance.BossesStopWeather) CalamityWorld.StopRain(); - else if (!Main.raining && !bossRush) + else if (!Main.raining && !BossRushEvent.BossRushActive) CalamityWorld.StartRain(); float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -193,7 +191,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase4 = lifeRatio < 0.3f; // Update armored settings to naked settings - if (phase2 && (!CalamityWorld.LegendaryMode || !revenge)) + if (phase2 && !CalamityWorld.LegendaryMode) { // Spawn armor gore, roar and set other crucial variables if (!NPC.chaseable) @@ -280,7 +278,7 @@ namespace CalamityMod.NPCs.StormWeaver } // Used for body and tail projectile firing timings in phase 1 - if (!phase2 || (CalamityWorld.LegendaryMode && revenge)) + if (!phase2 || CalamityWorld.LegendaryMode) NPC.localAI[0] += 1f; } @@ -333,8 +331,8 @@ namespace CalamityMod.NPCs.StormWeaver Vector2 npcCenter = NPC.Center; float targetCenterX = Main.player[NPC.target].Center.X; float targetCenterY = Main.player[NPC.target].Center.Y; - float velocity = (phase2 ? 12f : 10f) + (bossRush ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); - float acceleration = (phase2 ? 0.24f : 0.2f) + (bossRush ? 0.12f : revenge ? 0.08f : expertMode ? 0.04f : 0f); + float velocity = (phase2 ? 12f : 10f) + (revenge ? 1.5f : expertMode ? 1f : 0f); + float acceleration = (phase2 ? 0.24f : 0.2f) + (revenge ? 0.08f : expertMode ? 0.04f : 0f); // Start charging at the player when in phase 2 if (phase2) @@ -358,7 +356,7 @@ namespace CalamityMod.NPCs.StormWeaver bool useTornadoes = calamityGlobalNPC.newAI[3] % 2f != 0f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; if (phase4 && expertMode) @@ -468,7 +466,6 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.FrostWave; - int waveDamage = NPC.GetProjectileDamage(type); int totalWaves = death ? (phase4 ? 27 : 25) : (phase4 ? 25 : 23); int shotSpacing = death ? (phase4 ? 185 : 200) : (phase4 ? 200 : 215); float projectileSpawnX = Main.player[NPC.target].Center.X - totalWaves * shotSpacing * 0.5f; @@ -520,7 +517,7 @@ namespace CalamityMod.NPCs.StormWeaver // Frost Waves start moving after 30 frames // Frost Waves take 30 frames to reach full velocity Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.5f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer, 0f, velocityY); - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.1f, type, waveDamage, 0f, Main.myPlayer, delayBeforeFiring, velocityY); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawnX, Main.player[NPC.target].Center.Y - 1600f, 0f, velocityY * 0.1f, type, FrostWaveDamage, 0f, Main.myPlayer, delayBeforeFiring, velocityY); projectileSpawnX += shotSpacing; } } @@ -540,13 +537,12 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ModContent.ProjectileType(); - int tornadoDamage = NPC.GetProjectileDamage(projectileType); int totalTornadoes = revenge ? 7 : expertMode ? 5 : 3; float spawnDistance = revenge ? 750f : expertMode ? 900f : 1050f; for (int i = 0; i < totalTornadoes; i++) { Vector2 spawnPosition = Main.player[NPC.target].Center + Vector2.UnitX * spawnDistance * (i - totalTornadoes / 2); - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer, tornadoDamage, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnPosition, Vector2.Zero, projectileType, 0, 0f, Main.myPlayer, TornadoDamage, 1f); } } } @@ -621,7 +617,7 @@ namespace CalamityMod.NPCs.StormWeaver } } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.4f; acceleration *= 1.4f; @@ -676,8 +672,7 @@ namespace CalamityMod.NPCs.StormWeaver Vector2 aimDirection = Main.player[NPC.target].Center - source; float ai = Main.rand.Next(100); int type = ProjectileID.CultistBossLightningOrbArc; - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), source, boltVelocity, type, damage, 0f, Main.myPlayer, aimDirection.ToRotation(), ai); + Projectile.NewProjectile(NPC.GetSource_FromAI(), source, boltVelocity, type, LightningDamage, 0f, Main.myPlayer, aimDirection.ToRotation(), ai); } } } @@ -780,19 +775,6 @@ namespace CalamityMod.NPCs.StormWeaver } } - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = velocity * 0.25f; - float minimalDamageVelocity = velocity * 0.5f; - if (NPC.velocity.Length() <= minimalContactDamageVelocity) - { - NPC.damage = (int)Math.Round(NPC.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((NPC.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp((float)Math.Round(NPC.defDamage * 0.5), NPC.defDamage, velocityDamageScalar); - } - NPC.rotation = (float)Math.Atan2(NPC.velocity.Y, NPC.velocity.X) + MathHelper.PiOver2; if (phase4) @@ -818,7 +800,7 @@ namespace CalamityMod.NPCs.StormWeaver SoundEngine.PlaySound(SoundID.Thunder, NPC.Center); // Start a storm when in third phase. Don't do this during Boss Rush - if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu) || calamityGlobalNPC.newAI[1] > 0f || bossRush) + if (Main.netMode == NetmodeID.MultiplayerClient || (Main.netMode == NetmodeID.SinglePlayer && Main.gameMenu) || calamityGlobalNPC.newAI[1] > 0f || BossRushEvent.BossRushActive) return; CalamityWorld.StartRain(true, true); @@ -840,18 +822,17 @@ namespace CalamityMod.NPCs.StormWeaver CalamityGlobalNPC calamityGlobalNPC = NPC.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; - bool phase2 = lifeRatio < 0.8f && (!CalamityWorld.LegendaryMode || !revenge); + bool phase2 = lifeRatio < 0.8f && !CalamityWorld.LegendaryMode; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -877,21 +858,20 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 480 : 240; + int buffDuration = NPC.Calamity().newAI[0] >= chargePhaseGateValue ? 360 : 240; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration); } @@ -954,7 +934,7 @@ namespace CalamityMod.NPCs.StormWeaver return true; } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } diff --git a/NPCs/StormWeaver/StormWeaverTail.cs b/NPCs/StormWeaver/StormWeaverTail.cs index 4fb551873c..f4a1862d72 100644 --- a/NPCs/StormWeaver/StormWeaverTail.cs +++ b/NPCs/StormWeaver/StormWeaverTail.cs @@ -35,9 +35,11 @@ namespace CalamityMod.NPCs.StormWeaver } } + public static int LightningOrbDamage = 64; // 256 + public override void SetDefaults() { - NPC.GetNPCDamage(); + NPC.damage = 80; // 160 NPC.npcSlots = 5f; NPC.width = 48; NPC.height = 80; @@ -59,22 +61,17 @@ namespace CalamityMod.NPCs.StormWeaver NPC.netAlways = true; NPC.dontCountMe = true; - if (BossRushEvent.BossRushActive) - NPC.scale *= 1.25f; - else if (CalamityWorld.death) + if (CalamityWorld.death || BossRushEvent.BossRushActive) NPC.scale *= 1.2f; else if (CalamityWorld.revenge) NPC.scale *= 1.15f; else if (Main.expertMode) NPC.scale *= 1.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.scale *= 0.7f; NPC.Calamity().VulnerableToElectricity = false; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SendExtraAI(BinaryWriter writer) @@ -114,9 +111,8 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.life > Main.npc[(int)NPC.ai[1]].life) NPC.life = Main.npc[(int)NPC.ai[1]].life; - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; // Shed armor bool phase2 = NPC.life / (float)NPC.lifeMax < 0.8f; @@ -150,12 +146,11 @@ namespace CalamityMod.NPCs.StormWeaver if (Main.netMode != NetmodeID.MultiplayerClient) { // Fire a lightning orb every 5 seconds - float spawnOrbGateValue = bossRush ? 200f : 300f; + float spawnOrbGateValue = 300f; if (Main.npc[(int)NPC.ai[2]].localAI[0] % spawnOrbGateValue == 0f) { int type = ProjectileID.CultistBossLightningOrb; - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, LightningOrbDamage, 0f, Main.myPlayer); } } } @@ -232,21 +227,6 @@ namespace CalamityMod.NPCs.StormWeaver else if (targetX > 0f) NPC.spriteDirection = 1; } - - // Calculate contact damage based on velocity - float velocity = (phase2 ? 12f : 10f) + (bossRush ? 3f : revenge ? 1.5f : expertMode ? 1f : 0f); - float minimalContactDamageVelocity = velocity * 0.25f; - float minimalDamageVelocity = velocity * 0.5f; - float bodyAndTailVelocity = (NPC.position - NPC.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - NPC.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - NPC.damage = (int)MathHelper.Lerp(0f, NPC.defDamage, velocityDamageScalar); - } } public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor) @@ -258,10 +238,9 @@ namespace CalamityMod.NPCs.StormWeaver if (NPC.spriteDirection == 1) spriteEffects = SpriteEffects.FlipHorizontally; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; @@ -269,7 +248,7 @@ namespace CalamityMod.NPCs.StormWeaver bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; @@ -303,21 +282,20 @@ namespace CalamityMod.NPCs.StormWeaver public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; float lifeRatio = NPC.life / (float)NPC.lifeMax; bool phase3 = lifeRatio < 0.55f; // Gate value that decides when Storm Weaver will charge - float chargePhaseGateValue = bossRush ? 280f : death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; + float chargePhaseGateValue = death ? 320f : revenge ? 340f : expertMode ? 360f : 400f; if (!phase3) chargePhaseGateValue *= 0.5f; - int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 120 : 60; + int buffDuration = Main.npc[(int)NPC.ai[2]].Calamity().newAI[0] >= chargePhaseGateValue ? 240 : 120; if (hurtInfo.Damage > 0) target.AddBuff(BuffID.Electrified, buffDuration); } @@ -372,7 +350,6 @@ namespace CalamityMod.NPCs.StormWeaver public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } } } diff --git a/NPCs/SulphurousSea/AnthozoanCrab.cs b/NPCs/SulphurousSea/AnthozoanCrab.cs index 2c4804bbdd..dc21b19b4f 100644 --- a/NPCs/SulphurousSea/AnthozoanCrab.cs +++ b/NPCs/SulphurousSea/AnthozoanCrab.cs @@ -38,9 +38,9 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 56; NPC.height = 42; NPC.defense = 22; - NPC.lifeMax = 1130; + NPC.lifeMax = 900; NPC.aiStyle = AIType = -1; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.HitSound = SoundID.NPCHit38; NPC.DeathSound = SoundID.NPCDeath46; NPC.knockBackResist = 0.04f; @@ -51,10 +51,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/AquaticUrchin.cs b/NPCs/SulphurousSea/AquaticUrchin.cs index bdcea410e6..f794e7757a 100644 --- a/NPCs/SulphurousSea/AquaticUrchin.cs +++ b/NPCs/SulphurousSea/AquaticUrchin.cs @@ -29,9 +29,9 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 20; NPC.height = 20; NPC.defense = 10; - NPC.lifeMax = Main.hardMode ? 380 : 70; + NPC.lifeMax = Main.hardMode ? 300 : 100; NPC.knockBackResist = 0.8f; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath15; NPC.behindTiles = true; @@ -46,10 +46,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/BelchingCoral.cs b/NPCs/SulphurousSea/BelchingCoral.cs index 4034dc9a41..597eded883 100644 --- a/NPCs/SulphurousSea/BelchingCoral.cs +++ b/NPCs/SulphurousSea/BelchingCoral.cs @@ -36,9 +36,9 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 54; NPC.height = 42; NPC.defense = 25; - NPC.lifeMax = 1250; + NPC.lifeMax = 1000; NPC.aiStyle = AIType = -1; - NPC.value = Item.buyPrice(0, 0, 8, 0); + NPC.value = Item.buyPrice(silver: 8); NPC.HitSound = SoundID.NPCHit42; NPC.DeathSound = SoundID.NPCDeath5; NPC.knockBackResist = 0f; @@ -49,10 +49,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Gnasher.cs b/NPCs/SulphurousSea/Gnasher.cs index 3a06c588b5..893ea62786 100644 --- a/NPCs/SulphurousSea/Gnasher.cs +++ b/NPCs/SulphurousSea/Gnasher.cs @@ -3,7 +3,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Weapons.Rogue; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using CalamityMod.World; using Microsoft.Xna.Framework; using Terraria; @@ -32,12 +32,11 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 50; NPC.height = 36; NPC.defense = 30; - NPC.DR_NERD(0.15f); NPC.lifeMax = 50; NPC.knockBackResist = 0.25f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 60); + NPC.value = Item.buyPrice(copper: 60); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = SoundID.NPCDeath54; NPC.chaseable = false; @@ -48,10 +47,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Sulflounder.cs b/NPCs/SulphurousSea/Sulflounder.cs index fcf3f4e3d8..602c085d80 100644 --- a/NPCs/SulphurousSea/Sulflounder.cs +++ b/NPCs/SulphurousSea/Sulflounder.cs @@ -2,7 +2,7 @@ using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; using CalamityMod.Items.Potions; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -30,10 +30,10 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 42; NPC.height = 32; NPC.defense = 15; - NPC.lifeMax = 50; + NPC.lifeMax = 60; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 0, 80); + NPC.value = Item.buyPrice(copper: 80); NPC.HitSound = SoundID.NPCHit50; NPC.DeathSound = SoundID.NPCDeath53; NPC.knockBackResist = 0.35f; @@ -45,10 +45,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Toxicatfish.cs b/NPCs/SulphurousSea/Toxicatfish.cs index 70e1136ec5..ac3bda6439 100644 --- a/NPCs/SulphurousSea/Toxicatfish.cs +++ b/NPCs/SulphurousSea/Toxicatfish.cs @@ -2,7 +2,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using Terraria; using Terraria.GameContent.Bestiary; using Terraria.ID; @@ -28,10 +28,10 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.width = 98; NPC.height = 40; NPC.defense = 12; - NPC.lifeMax = 150; + NPC.lifeMax = 120; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath40; NPC.knockBackResist = 0.8f; @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[2] { ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SulphurousSea/Trasher.cs b/NPCs/SulphurousSea/Trasher.cs index eb6d2b20c1..0d74458909 100644 --- a/NPCs/SulphurousSea/Trasher.cs +++ b/NPCs/SulphurousSea/Trasher.cs @@ -32,16 +32,15 @@ namespace CalamityMod.NPCs.SulphurousSea public override void SetDefaults() { - NPC.Calamity().canBreakPlayerDefense = true; NPC.noGravity = true; NPC.damage = 50; NPC.width = 150; NPC.height = 40; NPC.defense = 22; - NPC.lifeMax = 250; + NPC.lifeMax = 200; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 3, 0); + NPC.value = Item.buyPrice(silver: 3); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath5; NPC.knockBackResist = 0.15f; @@ -52,10 +51,6 @@ namespace CalamityMod.NPCs.SulphurousSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/AlphaSeaMinnow.cs b/NPCs/SunkenSea/AlphaSeaMinnow.cs index 6bc7d9c2be..189335adb2 100644 --- a/NPCs/SunkenSea/AlphaSeaMinnow.cs +++ b/NPCs/SunkenSea/AlphaSeaMinnow.cs @@ -8,7 +8,6 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.DataStructures; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.Enums; using System.Collections.Generic; using Steamworks; @@ -286,7 +285,6 @@ namespace CalamityMod.NPCs.SunkenSea base.SetDefaults(); NPC.rarity = 3; NPC.catchItem = ModContent.ItemType(); - NPC.value = 100000; } public override float SpawnChance(NPCSpawnInfo spawnInfo) diff --git a/NPCs/SunkenSea/BabyGhostBell.cs b/NPCs/SunkenSea/BabyGhostBell.cs index 1281c34049..bf1ea170d6 100644 --- a/NPCs/SunkenSea/BabyGhostBell.cs +++ b/NPCs/SunkenSea/BabyGhostBell.cs @@ -148,14 +148,12 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.catchItem = ModContent.ItemType(); NPC.rarity = 3; - NPC.value = 100000; } break; case (int)JellyColor.Gold: { NPC.catchItem = ModContent.ItemType(); NPC.rarity = 3; - NPC.value = 100000; } break; case (int)JellyColor.Voltaic: @@ -286,11 +284,6 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.ProduceGoldCritterDust(); } - if (Variant == (int)JellyColor.Radiant || Variant == (int)JellyColor.Gold) - { - NPC.rarity = 3; - NPC.value = 100000; - } } public override void ModifyTypeName(ref string typeName) diff --git a/NPCs/SunkenSea/CarrionSwallower.cs b/NPCs/SunkenSea/CarrionSwallower.cs index 82f8a7ca67..0d092cd892 100644 --- a/NPCs/SunkenSea/CarrionSwallower.cs +++ b/NPCs/SunkenSea/CarrionSwallower.cs @@ -43,10 +43,6 @@ namespace CalamityMod.NPCs.SunkenSea SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; //Banner = NPC.type; //BannerItem = ModContent.ItemType(); - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/Clam.cs b/NPCs/SunkenSea/Clam.cs index f822cd01b0..d7dd89529c 100644 --- a/NPCs/SunkenSea/Clam.cs +++ b/NPCs/SunkenSea/Clam.cs @@ -47,6 +47,8 @@ namespace CalamityMod.NPCs.SunkenSea public ref float ShellRotation => ref NPC.localAI[0]; + public int originalDamage; + #region Textures public static Asset bottomJawTex; @@ -84,11 +86,10 @@ namespace CalamityMod.NPCs.SunkenSea public override void SetDefaults() { - NPC.damage = Main.hardMode ? 60 : 30; + originalDamage = NPC.damage = Main.hardMode ? 60 : 30; NPC.width = 50; NPC.height = 30; NPC.defense = 9999; - NPC.DR_NERD(0.25f); NPC.lifeMax = Main.hardMode ? 300 : 150; if (Main.expertMode) { @@ -96,7 +97,7 @@ namespace CalamityMod.NPCs.SunkenSea } NPC.aiStyle = -1; AIType = -1; - NPC.value = Main.hardMode ? Item.buyPrice(0, 0, 5, 0) : Item.buyPrice(0, 0, 1, 0); + NPC.value = Main.hardMode ? Item.buyPrice(silver: 5) : Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit4; NPC.knockBackResist = 0; Banner = NPC.type; @@ -107,10 +108,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[3] { ModContent.GetInstance().Type, ModContent.GetInstance().Type, ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -164,6 +161,7 @@ namespace CalamityMod.NPCs.SunkenSea { case (int)PhaseType.Idle: { + NPC.damage = 0; NPC.chaseable = false; NPC.velocity.X *= 0.9f; if (ShellRotation > 0) @@ -211,6 +209,7 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Attacking: { + NPC.damage = 0; NPC.knockBackResist = 0.05f; NPC.defense = Main.hardMode ? 15 : 6; NPC.chaseable = true; @@ -229,6 +228,8 @@ namespace CalamityMod.NPCs.SunkenSea } else { + NPC.damage = originalDamage; + if (NPC.velocity.Y < 0) { ShellRotation += 0.065f; @@ -256,6 +257,7 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Squirt: { + NPC.damage = 0; NPC.chaseable = true; // Slow down. Once the clam is rested, start incrementing Timer if (NPC.velocity.Y == 0) @@ -298,6 +300,7 @@ namespace CalamityMod.NPCs.SunkenSea // Fire the projectile if (Timer == (endClose - 5)) { + NPC.damage = originalDamage; Vector2 velocity = NPC.SafeDirectionTo(Target.Center, Vector2.UnitY) * 5; // If the player is on the other side of the clam, flip the jet so that it doesn't fire backwards @@ -306,7 +309,7 @@ namespace CalamityMod.NPCs.SunkenSea if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, velocity, ModContent.ProjectileType(), NPC.damage / 2, 1); + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, velocity, ModContent.ProjectileType(), Main.hardMode ? 30 : 15, 1); } for (int i = 0; i < 9; i++) { @@ -328,6 +331,8 @@ namespace CalamityMod.NPCs.SunkenSea break; case (int)PhaseType.Pod: { + NPC.damage = 0; + NPC.chaseable = true; NPC pod = Main.npc[(int)NPC.localAI[2] - 1]; // If the Pearlpod is invalid, go back to idling diff --git a/NPCs/SunkenSea/EutrophicRay.cs b/NPCs/SunkenSea/EutrophicRay.cs index ce3fe26a48..e0ee8289b4 100644 --- a/NPCs/SunkenSea/EutrophicRay.cs +++ b/NPCs/SunkenSea/EutrophicRay.cs @@ -75,13 +75,12 @@ namespace CalamityMod.NPCs.SunkenSea NPC.height = 68; NPC.damage = 20; NPC.defense = 5; - NPC.DR_NERD(0.05f); NPC.lifeMax = 200; NPC.scale = 0.85f; NPC.noGravity = true; NPC.noTileCollide = false; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath55; NPC.knockBackResist = 0.5f; @@ -92,10 +91,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/GhostBell.cs b/NPCs/SunkenSea/GhostBell.cs index 5c7057d29f..fc7a89e6ff 100644 --- a/NPCs/SunkenSea/GhostBell.cs +++ b/NPCs/SunkenSea/GhostBell.cs @@ -95,7 +95,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 120; NPC.knockBackResist = 0f; NPC.alpha = 100; - NPC.value = Item.buyPrice(0, 0, 1, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = SoundID.NPCHit25; NPC.DeathSound = SoundID.NPCDeath28; Banner = NPC.type; @@ -104,10 +104,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = false; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -243,7 +239,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(NPC.damage * 0.5f), 0, ai1: NPC.whoAmI + 1); + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center, Vector2.Zero, ModContent.ProjectileType(), 12, 0, ai1: NPC.whoAmI + 1); } } // Reset diff --git a/NPCs/SunkenSea/GiantClam.cs b/NPCs/SunkenSea/GiantClam.cs index 67822c3cf0..366696548a 100644 --- a/NPCs/SunkenSea/GiantClam.cs +++ b/NPCs/SunkenSea/GiantClam.cs @@ -66,11 +66,10 @@ namespace CalamityMod.NPCs.SunkenSea NPC.width = 160; NPC.height = 120; NPC.defense = 9999; - NPC.DR_NERD(0.3f); NPC.lifeMax = Main.hardMode ? 7500 : 1250; NPC.aiStyle = -1; AIType = -1; - NPC.value = Main.hardMode ? Item.buyPrice(0, 5, 0, 0) : Item.buyPrice(0, 1, 0, 0); + NPC.value = Main.hardMode ? Item.buyPrice(gold: 5) : Item.buyPrice(gold: 1); NPC.HitSound = SoundID.NPCHit4; NPC.knockBackResist = 0f; NPC.rarity = 2; @@ -79,10 +78,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -132,6 +127,12 @@ namespace CalamityMod.NPCs.SunkenSea hasBeenHit = true; } + if (!hasBeenHit) + { + // No contact damage while chillaxing + NPC.damage = 0; + } + NPC.chaseable = hasBeenHit; if (hitAmount == 5) diff --git a/NPCs/SunkenSea/HauntedChum.cs b/NPCs/SunkenSea/HauntedChum.cs index b065138b84..a0b1ebf8d9 100644 --- a/NPCs/SunkenSea/HauntedChum.cs +++ b/NPCs/SunkenSea/HauntedChum.cs @@ -44,9 +44,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.noGravity = true; NPC.noTileCollide = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void AI() diff --git a/NPCs/SunkenSea/Jellyghoul.cs b/NPCs/SunkenSea/Jellyghoul.cs index 22d502e83c..d9d6a532e0 100644 --- a/NPCs/SunkenSea/Jellyghoul.cs +++ b/NPCs/SunkenSea/Jellyghoul.cs @@ -68,10 +68,6 @@ namespace CalamityMod.NPCs.SunkenSea // Banner = NPC.type; //BannerItem = ModContent.ItemType(); SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/KelpieSeadragon.cs b/NPCs/SunkenSea/KelpieSeadragon.cs index 74c29cbde3..e131646269 100644 --- a/NPCs/SunkenSea/KelpieSeadragon.cs +++ b/NPCs/SunkenSea/KelpieSeadragon.cs @@ -69,7 +69,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 150; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.15f; @@ -80,9 +80,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -202,7 +199,7 @@ namespace CalamityMod.NPCs.SunkenSea { Vector2 spawnPos = new Vector2(NPC.Center.X + NPC.direction * 18, NPC.position.Y + 22); Vector2 projSpeed = spawnPos.DirectionTo(currentTarget.Center).SafeNormalize(Vector2.Zero) * 6; - Projectile.NewProjectile(NPC.GetSource_FromThis(), spawnPos, projSpeed, ModContent.ProjectileType(), NPC.damage, 0f); + Projectile.NewProjectile(NPC.GetSource_FromThis(), spawnPos, projSpeed, ModContent.ProjectileType(), 10, 0f); } } // Squash and stretch diff --git a/NPCs/SunkenSea/LazarusLampfish.cs b/NPCs/SunkenSea/LazarusLampfish.cs index 7106f1ef69..0ea2671558 100644 --- a/NPCs/SunkenSea/LazarusLampfish.cs +++ b/NPCs/SunkenSea/LazarusLampfish.cs @@ -91,7 +91,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 400; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 10, 0); + NPC.value = Item.buyPrice(silver: 10); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.1f; @@ -102,9 +102,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -231,7 +228,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + (NPC.rotation - (NPC.spriteDirection == 1 ? 0 : MathHelper.Pi)).ToRotationVector2() * 40, Vector2.Zero, ModContent.ProjectileType(), (int)(NPC.damage * 0.5f), 1); + Projectile.NewProjectile(NPC.GetSource_FromThis(), NPC.Center + (NPC.rotation - (NPC.spriteDirection == 1 ? 0 : MathHelper.Pi)).ToRotationVector2() * 40, Vector2.Zero, ModContent.ProjectileType(), 20, 1); } SoundEngine.PlaySound(SoundID.NPCDeath7 with { Pitch = 0.4f }, NPC.Center); } diff --git a/NPCs/SunkenSea/Leerslug.cs b/NPCs/SunkenSea/Leerslug.cs index d95830fd0d..9e0692ce65 100644 --- a/NPCs/SunkenSea/Leerslug.cs +++ b/NPCs/SunkenSea/Leerslug.cs @@ -54,7 +54,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 3; NPC.lifeMax = 200; NPC.knockBackResist = 0.2f; - NPC.value = Item.buyPrice(0, 0, 0, 0); + NPC.value = Item.buyPrice(silver: 1); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; @@ -67,10 +67,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToWater = true; SpawnModBiomes = new int[1] { ModContent.GetInstance().Type }; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void ReceiveExtraAI(BinaryReader reader) diff --git a/NPCs/SunkenSea/LostShoal.cs b/NPCs/SunkenSea/LostShoal.cs index 007a96a9bd..19d401715f 100644 --- a/NPCs/SunkenSea/LostShoal.cs +++ b/NPCs/SunkenSea/LostShoal.cs @@ -87,7 +87,6 @@ namespace CalamityMod.NPCs.SunkenSea { Variant = (int)ShoalColor.Gold; NPC.catchItem = ItemID.GoldCoin; - NPC.value = 10000; } RandomOpacityOffset = Main.rand.NextFloat(MathHelper.TwoPi); diff --git a/NPCs/SunkenSea/Pearlpod.cs b/NPCs/SunkenSea/Pearlpod.cs index 0bad944772..85d2f0e357 100644 --- a/NPCs/SunkenSea/Pearlpod.cs +++ b/NPCs/SunkenSea/Pearlpod.cs @@ -57,7 +57,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 20; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; diff --git a/NPCs/SunkenSea/PodobooKoi.cs b/NPCs/SunkenSea/PodobooKoi.cs index a390f864b8..22b3f9f7c3 100644 --- a/NPCs/SunkenSea/PodobooKoi.cs +++ b/NPCs/SunkenSea/PodobooKoi.cs @@ -8,7 +8,6 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ModLoader.Utilities; using Terraria.DataStructures; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; using CalamityMod.Enums; using System.Collections.Generic; using Steamworks; @@ -103,10 +102,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToWater = true; //Banner = NPC.type; //BannerItem = ModContent.ItemType(); - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/PolypPanasea.cs b/NPCs/SunkenSea/PolypPanasea.cs index e4a4fa9c1c..027c5905b4 100644 --- a/NPCs/SunkenSea/PolypPanasea.cs +++ b/NPCs/SunkenSea/PolypPanasea.cs @@ -232,11 +232,6 @@ namespace CalamityMod.NPCs.SunkenSea { NPC.ProduceGoldCritterDust(); } - if (Variant == (int)FishColor.Gold || Variant == (int)FishColor.Radiant) - { - NPC.rarity = 3; - NPC.value = 100000; - } } public void IdleBehavior() diff --git a/NPCs/SunkenSea/Polyperil.cs b/NPCs/SunkenSea/Polyperil.cs index dd6144516b..b2019f9781 100644 --- a/NPCs/SunkenSea/Polyperil.cs +++ b/NPCs/SunkenSea/Polyperil.cs @@ -67,7 +67,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); // Banner = NPC.type; // BannerItem = ModContent.ItemType(); @@ -75,9 +75,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = false; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/PolyperilTentacle.cs b/NPCs/SunkenSea/PolyperilTentacle.cs index 5c3be05d15..f7bd01e49f 100644 --- a/NPCs/SunkenSea/PolyperilTentacle.cs +++ b/NPCs/SunkenSea/PolyperilTentacle.cs @@ -62,12 +62,8 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = 0; // Banner = NPC.type; // BannerItem = ModContent.ItemType(); - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SendExtraAI(BinaryWriter writer) diff --git a/NPCs/SunkenSea/PrismBack.cs b/NPCs/SunkenSea/PrismBack.cs index 3b23f038bb..ad485a77d8 100644 --- a/NPCs/SunkenSea/PrismBack.cs +++ b/NPCs/SunkenSea/PrismBack.cs @@ -65,11 +65,10 @@ namespace CalamityMod.NPCs.SunkenSea NPC.width = 88; NPC.height = 66; NPC.defense = 15; - NPC.DR_NERD(0.25f); NPC.lifeMax = 500; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 2, 0); + NPC.value = Item.buyPrice(silver: 2); NPC.HitSound = SoundID.NPCHit24; NPC.DeathSound = SoundID.NPCDeath27; NPC.knockBackResist = 0.15f; @@ -80,10 +79,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/PrismaticGuppy.cs b/NPCs/SunkenSea/PrismaticGuppy.cs index 79e948cf17..78b9265cf9 100644 --- a/NPCs/SunkenSea/PrismaticGuppy.cs +++ b/NPCs/SunkenSea/PrismaticGuppy.cs @@ -218,7 +218,6 @@ namespace CalamityMod.NPCs.SunkenSea { CurrentColor = Main.rand.Next(3, 5); NPC.rarity = 3; - NPC.value = 100000; } // Decide item.......................... switch (CurrentColor) @@ -580,15 +579,8 @@ namespace CalamityMod.NPCs.SunkenSea if (CurrentColor == (int)FishColor.Gold) { - NPC.rarity = 3; - NPC.value = 100000; NPC.ProduceGoldCritterDust(); } - if (CurrentColor == (int)FishColor.Radiant) - { - NPC.rarity = 3; - NPC.value = 100000; - } } protected override void OnPredatorDetection(NPC predator) diff --git a/NPCs/SunkenSea/Probesnout.cs b/NPCs/SunkenSea/Probesnout.cs index f65242bb4b..48c6d7c384 100644 --- a/NPCs/SunkenSea/Probesnout.cs +++ b/NPCs/SunkenSea/Probesnout.cs @@ -424,7 +424,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.catchItem = ModContent.ItemType(); NPC.Calamity().VulnerableToHeat = false; @@ -475,7 +474,6 @@ namespace CalamityMod.NPCs.SunkenSea base.SetDefaults(); NPC.rarity = 3; NPC.catchItem = ItemType(); - NPC.value = 100000; } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/SandProwler.cs b/NPCs/SunkenSea/SandProwler.cs index 8864d2a5f5..b734bfcad1 100644 --- a/NPCs/SunkenSea/SandProwler.cs +++ b/NPCs/SunkenSea/SandProwler.cs @@ -102,7 +102,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -118,10 +118,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToWater = false; NPC.waterMovementSpeed = 1; NPC.GravityIgnoresLiquid = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) diff --git a/NPCs/SunkenSea/SandProwlerNested.cs b/NPCs/SunkenSea/SandProwlerNested.cs index 421bb088f3..980e5e4919 100644 --- a/NPCs/SunkenSea/SandProwlerNested.cs +++ b/NPCs/SunkenSea/SandProwlerNested.cs @@ -88,7 +88,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.aiStyle = -1; AIType = -1; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.behindTiles = true; NPC.noGravity = true; NPC.noTileCollide = true; @@ -103,10 +103,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); - NPC.waterMovementSpeed = 1f; } diff --git a/NPCs/SunkenSea/Scavenger.cs b/NPCs/SunkenSea/Scavenger.cs index b021457490..4973c58db8 100644 --- a/NPCs/SunkenSea/Scavenger.cs +++ b/NPCs/SunkenSea/Scavenger.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Critters; using CalamityMod.Items.Fishing.SunkenSeaCatches; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using CalamityMod.Items.Weapons.Magic; using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs.NormalNPCs; @@ -282,7 +283,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.lifeMax = 350; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.HitSound = SoundID.NPCHit38; NPC.DeathSound = SoundID.NPCDeath1; NPC.knockBackResist = 0.15f; diff --git a/NPCs/SunkenSea/SeaFloaty.cs b/NPCs/SunkenSea/SeaFloaty.cs index e1cdc54587..a414ec9999 100644 --- a/NPCs/SunkenSea/SeaFloaty.cs +++ b/NPCs/SunkenSea/SeaFloaty.cs @@ -53,7 +53,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 5; NPC.knockBackResist = 0.5f; - NPC.value = Item.buyPrice(0, 0, 0, 50); NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; NPC.chaseable = false; diff --git a/NPCs/SunkenSea/SeaMinnow.cs b/NPCs/SunkenSea/SeaMinnow.cs index 7c841a74a1..abddd9f9d4 100644 --- a/NPCs/SunkenSea/SeaMinnow.cs +++ b/NPCs/SunkenSea/SeaMinnow.cs @@ -5,7 +5,7 @@ using CalamityMod.BiomeManagers; using CalamityMod.Enums; using CalamityMod.Items.Critters; using CalamityMod.Items.Placeables.Banners; -using CalamityMod.NPCs.CalamityAIs.CalamityRegularEnemyAIs; +using CalamityMod.NPCs.NormalNPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; @@ -420,7 +420,6 @@ namespace CalamityMod.NPCs.SunkenSea base.SetDefaults(); NPC.catchItem = (short)ModContent.ItemType(); NPC.rarity = 3; - NPC.value = 100000; } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/Searslug.cs b/NPCs/SunkenSea/Searslug.cs index e734174565..a09f1258e6 100644 --- a/NPCs/SunkenSea/Searslug.cs +++ b/NPCs/SunkenSea/Searslug.cs @@ -54,7 +54,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 20; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 10, 0); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; @@ -193,7 +192,7 @@ namespace CalamityMod.NPCs.SunkenSea // Wear protection! if (failed) { - player.AddBuff(BuffID.OnFire3, CalamityUtils.SecondsToFrames(5)); + player.AddBuff(BuffID.OnFire, CalamityUtils.SecondsToFrames(5)); } } } diff --git a/NPCs/SunkenSea/Sharkoon.cs b/NPCs/SunkenSea/Sharkoon.cs index 7b967eb4e4..a695aaf629 100644 --- a/NPCs/SunkenSea/Sharkoon.cs +++ b/NPCs/SunkenSea/Sharkoon.cs @@ -193,16 +193,12 @@ namespace CalamityMod.NPCs.SunkenSea NPC.HitSound = SoundID.NPCHit1; NPC.DeathSound = SoundID.NPCDeath1; - NPC.value = Item.buyPrice(0, 0, 5, 0); + NPC.value = Item.buyPrice(silver: 5); NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToSickness = true; NPC.Calamity().VulnerableToElectricity = true; NPC.Calamity().VulnerableToWater = false; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } #endregion diff --git a/NPCs/SunkenSea/Slugbun.cs b/NPCs/SunkenSea/Slugbun.cs index ace12fc895..7d55b2776d 100644 --- a/NPCs/SunkenSea/Slugbun.cs +++ b/NPCs/SunkenSea/Slugbun.cs @@ -70,7 +70,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 0; NPC.lifeMax = 20; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 5, 0); NPC.lavaImmune = false; NPC.noGravity = false; NPC.noTileCollide = false; @@ -135,7 +134,6 @@ namespace CalamityMod.NPCs.SunkenSea { CurrentSkin = (int)SlugSkin.Radiant; NPC.rarity = 3; - NPC.value = 100000; } // Decide item.......................... switch (CurrentSkin) @@ -192,11 +190,6 @@ namespace CalamityMod.NPCs.SunkenSea } } } - if (CurrentSkin == (int)SlugSkin.Radiant) - { - NPC.rarity = 3; - NPC.value = 100000; - } } public override void FindFrame(int frameHeight) diff --git a/NPCs/SunkenSea/Steampod.cs b/NPCs/SunkenSea/Steampod.cs index 64e154dd6f..606ff7c184 100644 --- a/NPCs/SunkenSea/Steampod.cs +++ b/NPCs/SunkenSea/Steampod.cs @@ -79,7 +79,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.defense = 10; NPC.lifeMax = 200; NPC.knockBackResist = 0f; - NPC.value = Item.buyPrice(0, 0, 20, 0); + NPC.value = Item.buyPrice(silver: 20); NPC.lavaImmune = true; NPC.noGravity = false; NPC.noTileCollide = false; @@ -91,10 +91,6 @@ namespace CalamityMod.NPCs.SunkenSea NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToWater = true; NPC.Calamity().VulnerableToCold = true; - - // Scale stats in Expert and Master - CalamityGlobalNPC.AdjustExpertModeStatScaling(NPC); - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC); } public override void ReceiveExtraAI(BinaryReader reader) @@ -483,7 +479,7 @@ namespace CalamityMod.NPCs.SunkenSea { if (hurtInfo.Damage <= 0) return; - target.AddBuff(BuffID.OnFire3, 120); + target.AddBuff(BuffID.OnFire, 120); } public override void HitEffect(NPC.HitInfo hit) diff --git a/NPCs/SunkenSea/StormlionSentry.cs b/NPCs/SunkenSea/StormlionSentry.cs index d99d6832ea..7cadfdffe3 100644 --- a/NPCs/SunkenSea/StormlionSentry.cs +++ b/NPCs/SunkenSea/StormlionSentry.cs @@ -76,6 +76,7 @@ namespace CalamityMod.NPCs.SunkenSea NPC.damage = 15; NPC.defense = 3; NPC.knockBackResist = 0f; + NPC.value = Item.buyPrice(silver: 1); NPC.HitSound = Effects.StormlionEffects.Hit; NPC.DeathSound = Effects.StormlionEffects.Killed; NPC.noGravity = true; @@ -172,7 +173,7 @@ namespace CalamityMod.NPCs.SunkenSea { SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 1f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 12), ModContent.ProjectileType(), NPC.damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 12), ModContent.ProjectileType(), 15, 0f, Main.myPlayer); for (int i = 0; i <= 12; i++) { float variance = Main.rand.NextFloat(-0.6f, 0.6f); @@ -231,7 +232,7 @@ namespace CalamityMod.NPCs.SunkenSea if (time % 2 == 0) { SoundEngine.PlaySound(Effects.StormlionEffects.Attack with { Volume = 0.2f, Pitch = 0.4f * sine, MaxInstances = 30 }, NPC.Center); - Projectile proj = Projectile.NewProjectileDirect(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 6), ModContent.ProjectileType(), NPC.damage * target.statLifeMax2, 0f, Main.myPlayer); + Projectile proj = Projectile.NewProjectileDirect(NPC.GetSource_FromThis(), attackPosition, (headRot.ToRotationVector2() * 6), ModContent.ProjectileType(), 15 * target.statLifeMax2, 0f, Main.myPlayer); proj.friendly = true; proj.hostile = false; } diff --git a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs index 32fd48411e..21313f7e11 100644 --- a/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs +++ b/NPCs/SupremeCalamitas/SepulcherBodyEnergyBall.cs @@ -104,31 +104,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas else NPC.alpha = HeadSegment.alpha; - /*AttackTimer += BossRushEvent.BossRushActive ? 1.5f : 1f; - float attackgate = !HeadSegment.Calamity().unbreakableDR && Main.zenithWorld ? 450f : 900f; - if (AttackTimer >= attackgate && NoStartAttack <= 0) - { - AttackTimer = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - int totalProjectiles = 4; - float radians = MathHelper.TwoPi / totalProjectiles; - float velocity = 1f; - float projectileVelocityToPass = 15f; - - Vector2 spinningPoint = Vector2.Normalize(new Vector2(-velocity, -velocity)); - for (int k = 0; k < totalProjectiles; k++) - { - Vector2 projectileVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 0f, projectileVelocityToPass); - } - NPC.netUpdate = true; - } - SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound, NPC.Center); - }*/ - if (Main.npc.IndexInRange((int)NPC.ai[1])) { Vector2 offsetToAheadSegment = AheadSegment.Center - NPC.Center; diff --git a/NPCs/SupremeCalamitas/SepulcherHead.cs b/NPCs/SupremeCalamitas/SepulcherHead.cs index 244db411f1..1e171f6b9c 100644 --- a/NPCs/SupremeCalamitas/SepulcherHead.cs +++ b/NPCs/SupremeCalamitas/SepulcherHead.cs @@ -201,8 +201,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 segmentLocation = NPC.Center; float targetX = CalamityGlobalNPC.SCal < 0 ? 0 : Main.npc[CalamityGlobalNPC.SCal].position.X + (Main.player[NPC.target].width / 2); float targetY = CalamityGlobalNPC.SCal < 0 ? 0 : Main.npc[CalamityGlobalNPC.SCal].position.Y + (Main.player[NPC.target].height / 2); - float sepMaxSpeed = BossRushEvent.BossRushActive ? 22.5f : 20f; - float sepAcceleration = (BossRushEvent.BossRushActive ? 0.2f : 0.175f) + (0.37f - AttackCooldown * 0.0015f); + float sepMaxSpeed = 20f; + float sepAcceleration = 0.175f + (0.37f - AttackCooldown * 0.0015f); float fasterMaxSpeed = sepMaxSpeed * 1.3f; float slowerMaxSpeed = sepMaxSpeed * 0.7f; @@ -336,7 +336,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = (int)(NPC.GetProjectileDamage(type) * 0.5f); int totalProjectiles = 30; float radians = MathHelper.TwoPi / totalProjectiles; float velocity = 1f; @@ -345,7 +344,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas for (int k = 0; k < totalProjectiles; k++) { Vector2 projectileVelocity = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, projectileVelocity, type, SupremeCalamitas.DartDamage, 0f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); } NPC.netUpdate = true; } diff --git a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs index ce3a029a3b..7d8bdd188c 100644 --- a/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs +++ b/NPCs/SupremeCalamitas/SoulSeekerSupreme.cs @@ -57,13 +57,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void SetDefaults() { + NPC.damage = 0; // No contact damage NPC.aiStyle = -1; AIType = -1; NPC.width = 40; NPC.height = 40; NPC.noGravity = true; NPC.noTileCollide = true; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats NPC.defense = 60; NPC.DR_NERD(NormalDR); NPC.lifeMax = 28000; @@ -144,7 +144,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.spriteDirection = (Target.Center.X < NPC.Center.X).ToDirectionInt(); timer++; - int shootRate = BossRushEvent.BossRushActive ? 120 : 180; + int shootRate = 180; if (timer > shootRate) { foreach (NPC seeker in Main.ActiveNPCs) @@ -162,10 +162,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float targetDist = Vector2.Distance(Target.Center, NPC.Center); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (BossRushEvent.BossRushActive) - damage /= 2; - float velocity = 5f; float projectileVelocityToPass = velocity * 3f; Vector2 shootVelocity = (Target.Center - NPC.Center).SafeNormalize(Vector2.UnitY) * velocity; @@ -181,7 +177,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, shootVelocity * 0.5f, type, damage, 1f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, shootVelocity * 0.5f, type, SupremeCalamitas.DartDamage, 1f, Main.myPlayer, 0f, 3f, projectileVelocityToPass); for (int i = 0; i < 5; i++) { Dust ShotDust = Dust.NewDustPerfect(NPC.Center, Main.rand.NextBool(3) ? 60 : 114); @@ -210,7 +206,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(spark2); } - float distanceFromSCal = Main.getGoodWorld ? 300f : 225f; + float distanceFromSCal = CalamityWorld.LegendaryMode ? 300f : 225f; NPC.position = SCal.Center - MathHelper.ToRadians(RotationalDegreeOffset).ToRotationVector2() * distanceFromSCal - NPC.Size * 0.5f; NPC.velocity = Vector2.Zero; RotationalDegreeOffset += 0.5f; diff --git a/NPCs/SupremeCalamitas/SupremeCalamitas.cs b/NPCs/SupremeCalamitas/SupremeCalamitas.cs index bf97d47107..f6ca1f32fc 100644 --- a/NPCs/SupremeCalamitas/SupremeCalamitas.cs +++ b/NPCs/SupremeCalamitas/SupremeCalamitas.cs @@ -253,15 +253,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } + public static int DartDamage = 85; // 340 + public static int SkullDamage = 90; // 360 + public static int HellblastDamage = 100; // 400 + public static int FireblastDamage = 100; // 400 + public static int GigablastDamage = 110; // 440 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; - NPC.GetNPCDamage(); + NPC.damage = 220; // 440 NPC.npcSlots = 50f; NPC.width = NPC.height = 44; NPC.defense = 100; NPC.DR_NERD(normalDR); - NPC.value = Item.buyPrice(3, 0, 0, 0); + NPC.value = Item.buyPrice(platinum: 3); NPC.LifeMaxNERB(960000, 1150000, 900000); NPC.aiStyle = -1; AIType = -1; @@ -274,9 +280,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -445,39 +448,19 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (CalamityServerConfig.Instance.BossesStopWeather) CalamityWorld.StopRain(); - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Used for Scal's teleport at the start of brothers phase bool teleport = false; // permafrost and zenith scal are mutually exclusive unless it's legendary - bool zenithAI = Main.zenithWorld && (!permafrost || (CalamityWorld.LegendaryMode && revenge && permafrost)); + bool zenithAI = Main.zenithWorld && (!permafrost || (CalamityWorld.LegendaryMode && permafrost)); // Percent life remaining float lifeRatio = NPC.life / (float)NPC.lifeMax; - // Projectile damage values - int bulletHellblastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int barrageDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int fireblastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int gigablastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int monsterDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int waveDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - int hellblastDamage = NPC.GetProjectileDamage(ModContent.ProjectileType()); - if (bossRush) - { - bulletHellblastDamage /= 2; - barrageDamage /= 2; - fireblastDamage /= 2; - gigablastDamage /= 2; - monsterDamage /= 2; - waveDamage /= 2; - hellblastDamage /= 2; - } - int bulletHellblast = zenithAI ? ModContent.ProjectileType() : ModContent.ProjectileType(); int barrage = ModContent.ProjectileType(); int gigablast = zenithAI ? ModContent.ProjectileType() : ModContent.ProjectileType(); @@ -489,7 +472,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas int bodyHeight = 42; int baseBulletHellProjectileGateValue = revenge ? 8 : expertMode ? 9 : 10; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) baseBulletHellProjectileGateValue -= 2; Vector2 vectorCenter = NPC.Center; @@ -506,7 +489,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!startText) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalSummonText"; if (permafrost) @@ -684,13 +667,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #endregion #region Enrage and DR - if ((spawnArena && !player.Hitbox.Intersects(safeBox)) || bossRush) + if (spawnArena && !player.Hitbox.Intersects(safeBox)) { - float projectileVelocityMultCap = (!player.Hitbox.Intersects(safeBox) && spawnArena) ? 2f : 1.35f; + float projectileVelocityMultCap = 2f; uDieLul = MathHelper.Clamp(uDieLul * 1.01f, 1f, projectileVelocityMultCap); - protectionBoost = !bossRush; - if (!player.Hitbox.Intersects(safeBox)) - protectionBoost = true; + protectionBoost = true; } else { @@ -777,7 +758,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas forcefieldOpacity = Utils.GetLerpValue(0.1f, 0.6f, NPC.Opacity, true); if (NPC.alpha >= 230) { - if (DownedBossSystem.downedCalamitas && !bossRush) + if (DownedBossSystem.downedCalamitas && !BossRushEvent.BossRushActive) { // Create a teleport line effect Dust.QuickDustLine(NPC.Center, initialRitualPosition, 500f, permafrost ? Color.Cyan : Color.Red); @@ -863,24 +844,24 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 300 && !Main.zenithWorld) // Blasts from above { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 600) // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from above, left, and right { if (!Main.zenithWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -967,17 +948,17 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (bulletHellCounter2 < 1200) { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 1500 && bulletHellCounter2 > 1200) { if (bulletHellCounter2 % 180 == 0) // Blasts from right - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -5f * uDieLul, 0f, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 > 1500) { if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); } bulletHellCounter++; @@ -988,21 +969,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 1200 && !Main.zenithWorld) // Blasts from below { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 1500) // Blasts from left { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1026,7 +1007,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH2Text"; if (permafrost) @@ -1100,10 +1081,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.One, ModContent.ProjectileType(), PermafrostAbsoluteZeroDamage, 0f, Main.myPlayer, 0f, 0f, NPC.whoAmI); if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 240 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); bulletHellCounter++; if (bulletHellCounter >= baseBulletHellProjectileGateValue + 4) @@ -1113,21 +1094,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 2100 && !Main.zenithWorld) // Blasts from above { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 2400) // Blasts from right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1151,7 +1132,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH3Text"; if (permafrost) @@ -1272,10 +1253,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (bulletHellCounter2 % 180 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 240 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); int divisor = revenge ? 225 : expertMode ? 450 : 675; @@ -1307,7 +1288,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas GeneralParticleHandler.SpawnParticle(orb); } - Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), monsterDamage, 0f, Main.myPlayer, 0f); + // Whispering Maelstrom passes through normal CanHitPlayer hooks then overrides them. This needs it to have contact damage but the number itself doesn't matter. + Projectile.NewProjectile(NPC.GetSource_FromAI(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), 100, 0f, Main.myPlayer, 0f); } bulletHellCounter++; @@ -1318,21 +1300,21 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 3000 && !Main.zenithWorld) // Blasts from below { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y + 1000f, 0f, -4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 3300) // Blasts from left { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1356,7 +1338,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalBH4Text"; if (permafrost) @@ -1441,16 +1423,16 @@ namespace CalamityMod.NPCs.SupremeCalamitas } if (bulletHellCounter2 % 240 == 0) // Blasts from top - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 5f * uDieLul, fireblast, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 360 == 0) // Fireblasts from above - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 10f * uDieLul, gigablast, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); if (bulletHellCounter2 % 30 == 0) // Projectiles that move in wave pattern { int random = Main.rand.Next(-500, 501); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, wave, waveDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, wave, waveDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + random, -5f * uDieLul, 0f, wave, SkullDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y - random, 5f * uDieLul, 0f, wave, SkullDamage, 0f, Main.myPlayer, 0f, 2f); } bulletHellCounter++; @@ -1461,25 +1443,25 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float distance = Main.rand.NextBool() ? -1000f : 1000f; float velocity = (distance == -1000f ? 4f : -4f) * uDieLul; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + distance, player.position.Y, velocity, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } if (bulletHellCounter2 < 3900 && !Main.zenithWorld) // Blasts from above { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 4f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else if (bulletHellCounter2 < 4200) // Blasts from left and right { - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3.5f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } else // Blasts from above, left, and right { if (!Main.zenithWorld) - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + Main.rand.Next(-1000, 1001), player.position.Y - 1000f, 0f, 3f * uDieLul, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, bulletHellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X + 1000f, player.position.Y + Main.rand.Next(-1000, 1001), -3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.position.X - 1000f, player.position.Y + Main.rand.Next(-1000, 1001), 3f * uDieLul, 0f, bulletHellblast, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -1507,7 +1489,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (permafrost) key = "Mods.CalamityMod.Status.Boss.PermafrostBH5Text"; - if (!bossRush) + if (!BossRushEvent.BossRushActive) { if (DownedBossSystem.downedCalamitas && !permafrost) key += "Rematch"; @@ -1618,7 +1600,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); @@ -1708,7 +1690,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else { - if (bossRush) + if (BossRushEvent.BossRushActive) NPC.Center = initialRitualPosition + new Vector2(0, -30); if (NPC.velocity.Y < 8f) @@ -1716,11 +1698,11 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (!canDespawn) NPC.velocity.X *= 0.965f; - if (DownedBossSystem.downedCalamitas || bossRush) + if (DownedBossSystem.downedCalamitas || BossRushEvent.BossRushActive) { if (giveUpCounter == 720) { - if (bossRush) + if (BossRushEvent.BossRushActive) { NPC.chaseable = true; NPC.dontTakeDamage = false; @@ -1742,15 +1724,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.NPCLoot(); } } - else if (giveUpCounter == 900 && !bossRush) + else if (giveUpCounter == 900 && !BossRushEvent.BossRushActive) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText1", textColor); } - else if (giveUpCounter == 600 && !bossRush) + else if (giveUpCounter == 600 && !BossRushEvent.BossRushActive) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText2", textColor); } - else if (giveUpCounter == 300 && !bossRush) + else if (giveUpCounter == 300 && !BossRushEvent.BossRushActive) { CalamityUtils.DisplayLocalizedText("Mods.CalamityMod.Status.Boss.SCalAcceptanceText3", textColor); } @@ -1810,7 +1792,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText4"; if (permafrost) @@ -1826,7 +1808,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired4 && lifeRatio <= 0.02f) { - if (!bossRush && !permafrost) + if (!BossRushEvent.BossRushActive && !permafrost) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText3"; if (DownedBossSystem.downedCalamitas) @@ -1840,7 +1822,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired3 && lifeRatio <= 0.04f) { - if (!bossRush && !permafrost) + if (!BossRushEvent.BossRushActive && !permafrost) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText2"; if (DownedBossSystem.downedCalamitas) @@ -1854,7 +1836,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } else if (!gettingTired2 && lifeRatio <= 0.06f) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalDesparationText1"; if (permafrost) @@ -1925,7 +1907,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas #region TransformSeekerandBrotherTriggers if (!halfLife && lifeRatio <= 0.45f && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalPhase2Text"; if (permafrost) @@ -1943,7 +1925,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (!secondStage) { - if (!bossRush) + if (!BossRushEvent.BossRushActive) { string key = "Mods.CalamityMod.Status.Boss.SCalSeekerRingText"; if (permafrost) @@ -1970,9 +1952,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { SoundEngine.PlaySound(SoundID.Item74, NPC.Center); - int totalSeekers = Main.getGoodWorld ? 20 : 10; + int totalSeekers = CalamityWorld.LegendaryMode ? 20 : 10; int degreesBetweenEachSeeker = 360 / totalSeekers; - int distanceFromSCal = Main.getGoodWorld ? 300 : 225; + int distanceFromSCal = CalamityWorld.LegendaryMode ? 300 : 225; for (int i = 0; i < totalSeekers; i++) { int FireEye = NPC.NewNPC(NPC.GetSource_FromAI(), (int)(vectorCenter.X + (Math.Sin(i * degreesBetweenEachSeeker) * distanceFromSCal)), (int)(vectorCenter.Y + (Math.Cos(i * degreesBetweenEachSeeker) * distanceFromSCal)), ModContent.NPCType(), NPC.whoAmI, 0, 0, 0, -1); @@ -2063,6 +2045,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.dontTakeDamage = true; NPC.chaseable = false; NPC.damage = 0; + attackPause = 5; if (!canDespawn) NPC.velocity *= 0.95f; @@ -2182,7 +2165,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2236,7 +2219,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient && attackPause == 0) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2255,7 +2238,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient && attackPause == 0) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2279,7 +2262,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float projectileVelocityToPass = projectileVelocity.Length() * 1.3f; Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, barrageDamage, 0f, Main.myPlayer, 0, 4f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, DartDamage, 0f, Main.myPlayer, 0, 4f, projectileVelocityToPass); NPC.netUpdate = true; } } @@ -2296,7 +2279,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2398,7 +2381,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2455,7 +2438,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas projectileVelocity *= 10f * uDieLul; int projectileType = hellblast; if (attackPause == 0) - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -2477,7 +2460,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2525,7 +2508,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas Vector2 projectileSpawn = NPC.Center + projectileVelocity * 8f; projectileVelocity *= 5f * uDieLul; int projectileType = gigablast; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + if (attackPause == 0) + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); } } @@ -2539,7 +2523,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } - // Previously the 0.4% health threshold transition + // Previously the 40% health threshold transition if (lifeRatio <= 0.45f && hasSummonedBrothers && (permafrost ? NPC.AnyNPCs(ModContent.NPCType()) : (NPC.AnyNPCs(ModContent.NPCType()) || NPC.AnyNPCs(ModContent.NPCType()))) == false) { NPC.ai[0] = 1f; @@ -2748,7 +2732,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 12f; float acceleration = 0.12f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2800,7 +2784,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2818,7 +2802,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, fireblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, randomShot, FireblastDamage, 0f, Main.myPlayer, 0f, 2f); NPC.netUpdate = true; } } @@ -2842,7 +2826,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { float projectileVelocityToPass = projectileVelocity.Length() * 1.3f; Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))); - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, barrageDamage, 0f, Main.myPlayer, 0f, 4f, projectileVelocityToPass); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, perturbedSpeed, randomShot, DartDamage, 0f, Main.myPlayer, 0f, 4f, projectileVelocityToPass); NPC.netUpdate = true; } } @@ -2857,7 +2841,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float chargeVelocity = (wormAlive ? 26f : 30f) + (1f - lifeRatio) * 8f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; if (!canDespawn) @@ -2931,7 +2915,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -2988,7 +2972,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas projectileVelocity *= 10f * uDieLul; int projectileType = hellblast; if (attackPause == 0) - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, hellblastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, HellblastDamage, 0f, Main.myPlayer, 0f, 2f); } } } @@ -3015,7 +2999,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas float velocity = 32f; float acceleration = 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -3065,7 +3049,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas SoundEngine.PlaySound(BrimstoneBigShotSound, NPC.Center); projectileVelocity *= 5f * uDieLul; int projectileType = gigablast; - Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, gigablastDamage, 0f, Main.myPlayer, 0f, 2f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, GigablastDamage, 0f, Main.myPlayer, 0f, 2f); } } @@ -3180,10 +3164,10 @@ namespace CalamityMod.NPCs.SupremeCalamitas { for (int x = 0; x < 5; x++) { - NPC.NewNPC(NPC.GetSource_FromAI(), spawnX + 50, tempSpawnY, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), spawnX + 50, tempSpawnY, ModContent.NPCType()); spawnX += spawnXAdd; - NPC.NewNPC(NPC.GetSource_FromAI(), spawnX2 - 50, tempSpawnY, ModContent.NPCType()); + NPC.NewNPC(NPC.GetSource_FromAI(), spawnX2 - 50, tempSpawnY, ModContent.NPCType()); spawnX2 -= spawnXAdd; tempSpawnY += spawnYAdd; } @@ -3397,7 +3381,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas } #region Loot - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -3787,15 +3771,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - { - target.AddBuff(ModContent.BuffType(), 600); - } } } } diff --git a/NPCs/SupremeCalamitas/SupremeCataclysm.cs b/NPCs/SupremeCalamitas/SupremeCataclysm.cs index f20fb06bb9..dc946029a9 100644 --- a/NPCs/SupremeCalamitas/SupremeCataclysm.cs +++ b/NPCs/SupremeCalamitas/SupremeCataclysm.cs @@ -74,10 +74,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } + public static int FistDamage = 105; // 420 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -94,9 +96,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.localAI[1] = 500; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -181,13 +180,12 @@ namespace CalamityMod.NPCs.SupremeCalamitas } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Increase DR if the target leaves SCal's arena. - NPC.Calamity().DR = SupremeCataclysm.NormalBrothersDR; + NPC.Calamity().DR = NormalBrothersDR; if (Main.npc[CalamityGlobalNPC.SCal].ModNPC().IsTargetOutsideOfArena) NPC.Calamity().DR = SupremeCalamitas.enragedDR; @@ -326,7 +324,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else if (BigAttackTimer > PreBigAttackPause) { // Shoot fists. - float fireRate = BossRushEvent.BossRushActive ? 2f : MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (broIsAlive == false ? death ? 1.32f : 1.1f : 1); + float fireRate = MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (!broIsAlive ? death ? 1.32f : 1.1f : 1); PunchCounter += fireRate; if (PunchCounter >= PunchCounterLimit) @@ -339,9 +337,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + int damage = Main.zenithWorld ? SupremeCatastrophe.SlashDamage : FistDamage; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -391,9 +387,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { // Shoot fists. - float fireRate = BossRushEvent.BossRushActive ? 2.8f : MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio); + float fireRate = MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio); if (broIsAlive == false) - fireRate = BossRushEvent.BossRushActive ? 3.5f + (29 - BigAttackLimit) * 0.45f : MathHelper.Lerp(3f, (4f + (29 - BigAttackLimit) * 0.45f), 1f - totalLifeRatio) * 1.2f; + fireRate = MathHelper.Lerp(3f, (4f + (29 - BigAttackLimit) * 0.45f), 1f - totalLifeRatio) * 1.2f; if (Phase2 && BigAttackLimit == 0) fireRate = 1; @@ -407,9 +403,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + int damage = Main.zenithWorld ? SupremeCatastrophe.SlashDamage : FistDamage; Vector2 fistSpawnPosition = NPC.Center + Vector2.UnitX * 74f * NPC.direction; if ((broIsAlive == false ? BigAttackLimit <= 3 && BigAttackLimit > 0 : BigAttackLimit == 1) && death) @@ -423,7 +417,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas { if (Main.netMode != NetmodeID.MultiplayerClient) { - Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, NPC.DirectionTo(Target.Center) * 9.5f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt(), 3); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fistSpawnPosition, NPC.DirectionTo(Target.Center) * 9.5f, ModContent.ProjectileType(), FistDamage, 0f, Main.myPlayer, 0f, PunchingFromRight.ToInt(), 3); } SoundEngine.PlaySound(SupremeCalamitas.BrimstoneShotSound with { Volume = 1.8f, Pitch = 0.5f }, NPC.Center); SoundStyle charge = new("CalamityMod/Sounds/Item/ScorchedEarthShot", 3); diff --git a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs index 596c9706a8..a86a36d1ec 100644 --- a/NPCs/SupremeCalamitas/SupremeCatastrophe.cs +++ b/NPCs/SupremeCalamitas/SupremeCatastrophe.cs @@ -67,10 +67,13 @@ namespace CalamityMod.NPCs.SupremeCalamitas } } + public static int SlashDamage = 105; // 420 + public static int TrailedSlashDamage = 120; // 480 + public override void SetDefaults() { NPC.BossBar = Main.BigBossProgressBar.NeverValid; - NPC.damage = 0; // 0 contact damage, projectile damage is pulled from NPCStats + NPC.damage = 0; // No contact damage NPC.npcSlots = 5f; NPC.width = 120; NPC.height = 120; @@ -87,9 +90,6 @@ namespace CalamityMod.NPCs.SupremeCalamitas NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.localAI[1] = 500; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -175,10 +175,9 @@ namespace CalamityMod.NPCs.SupremeCalamitas } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Increase DR if the target leaves SCal's arena. NPC.Calamity().DR = SupremeCataclysm.NormalBrothersDR; @@ -274,11 +273,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas dashAttackTimer--; int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; - - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, NPC.velocity.SafeNormalize(Vector2.UnitY) * 0.1f, type, damage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt(), 4 + dashes); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, NPC.velocity.SafeNormalize(Vector2.UnitY) * 0.1f, type, TrailedSlashDamage, 0f, Main.myPlayer, 0f, SlashingFromRight.ToInt(), 4 + dashes); dashes++; if (dashes == 30 && broIsAlive == false) { @@ -308,8 +303,8 @@ namespace CalamityMod.NPCs.SupremeCalamitas { SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = -0.3f }, NPC.Center); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 90f, type, damage, 0f, Main.myPlayer, 0f, 0, 50); - Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 90f, type, damage, 0f, Main.myPlayer, 0f, 0, 50); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(0.34f) * 90f, type, TrailedSlashDamage, 0f, Main.myPlayer, 0f, 0, 50); + Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center + NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 130, NPC.DirectionTo(Target.Center).RotatedBy(-0.34f) * 90f, type, TrailedSlashDamage, 0f, Main.myPlayer, 0f, 0, 50); for (int i = 0; i < 30; i++) { Vector2 vel = new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 2.5f); @@ -373,7 +368,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else if (BigAttackTimer > PreBigAttackPause) { // Shoot sword slashes. - float fireRate = BossRushEvent.BossRushActive ? 2f : MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (broIsAlive == false ? death ? 1.25f : 1.05f : 1); + float fireRate = MathHelper.Lerp(1.5f, 2f, 1f - totalLifeRatio) * (!broIsAlive ? death ? 1.25f : 1.05f : 1); SlashCounter += fireRate; if (SlashCounter >= SlashCounterLimit) { @@ -385,9 +380,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + int damage = Main.zenithWorld ? SupremeCataclysm.FistDamage : SlashDamage; Vector2 slashSpawnPosition = NPC.Center + Vector2.UnitX * 125f * NPC.direction; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -439,7 +432,7 @@ namespace CalamityMod.NPCs.SupremeCalamitas else { // Shoot sword slashes. - float fireRate = BossRushEvent.BossRushActive ? 2.8f : MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio) * (broIsAlive == false ? 1.35f : 1); + float fireRate = MathHelper.Lerp(2.5f, 3f, 1f - totalLifeRatio) * (!broIsAlive ? 1.35f : 1); if (Phase2 && BigAttackLimit == 0) fireRate = 1; SlashCounter += fireRate; @@ -452,14 +445,15 @@ namespace CalamityMod.NPCs.SupremeCalamitas if (Main.zenithWorld) type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - if (bossRush) - damage /= 2; + int damage = Main.zenithWorld ? SupremeCataclysm.FistDamage : SlashDamage; Vector2 slashSpawnPosition = NPC.Center; Vector2 firingVelocity = (broIsAlive == false ? (NPC.DirectionTo(Target.Center) + Target.velocity * 0.032f).SafeNormalize(Vector2.UnitY) : NPC.DirectionTo(Target.Center)); if ((broIsAlive == false ? BigAttackLimit <= 3 && BigAttackLimit > 0 : BigAttackLimit == 1) && death) { + if (!Main.zenithWorld) + damage = TrailedSlashDamage; + Projectile.NewProjectile(NPC.GetSource_FromAI(), slashSpawnPosition + firingVelocity * 130, (Phase2 ? NPC.DirectionTo(Target.Center) : firingVelocity) * 90f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 5, 50); SoundStyle slash = new("CalamityMod/Sounds/Item/MurasamaBigSwing"); SoundEngine.PlaySound(slash with { Volume = 0.55f, Pitch = -0.3f - BigAttackLimit * 0.1f }, NPC.Center); diff --git a/NPCs/TownNPCs/Archmage.cs b/NPCs/TownNPCs/Archmage.cs index de022694e1..9d51ae5deb 100644 --- a/NPCs/TownNPCs/Archmage.cs +++ b/NPCs/TownNPCs/Archmage.cs @@ -170,7 +170,6 @@ namespace CalamityMod.NPCs.TownNPCs .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(5)) .Add(ModContent.ItemType()) .Add(ModContent.ItemType(), Condition.PlayerCarriesItem(ModContent.ItemType())) - .Add(ItemID.IceCream, Condition.HappyEnoughToSellPylons, Condition.InSnow) .Register(); } diff --git a/NPCs/TownNPCs/Bandit.cs b/NPCs/TownNPCs/Bandit.cs index f843890b83..b0eb9f89bf 100644 --- a/NPCs/TownNPCs/Bandit.cs +++ b/NPCs/TownNPCs/Bandit.cs @@ -105,7 +105,7 @@ namespace CalamityMod.NPCs.TownNPCs public override List SetNPCNameList() => new List() { - // Patron names + // Dedicated names "Xplizzy", // <@!98826096237109248> (whitegiraffe) "Freakish", // <@!750363283520749598> (freak5650) "Calder", // <@!601897959176798228> (hardlightcaster) @@ -116,6 +116,7 @@ namespace CalamityMod.NPCs.TownNPCs "Jackie", // <@!353241811717718016> (jackalchan) "Ishmael", // <@!840416568000381046> (vanillaoyster) "Ariallis", // <@!518231218806980609> (ariallis) + "Shade", // <@!613133259563466755> (shade__storm) // Original names this.GetLocalizedValue("Name.Laura"), diff --git a/NPCs/TownNPCs/SeaKing.cs b/NPCs/TownNPCs/SeaKing.cs index 3c39586f46..4ff9da3fd5 100644 --- a/NPCs/TownNPCs/SeaKing.cs +++ b/NPCs/TownNPCs/SeaKing.cs @@ -206,8 +206,6 @@ namespace CalamityMod.NPCs.TownNPCs .Add(ModContent.ItemType()) .AddWithCustomValue(ItemID.TruffleWorm, Item.buyPrice(gold: 20), Condition.Hardmode) .AddWithCustomValue(ModContent.ItemType(), Item.buyPrice(gold: 40), downedOldDuke) - .AddWithCustomValue(ItemID.ShrimpPoBoy, Item.buyPrice(gold: 2, silver: 50), Condition.HappyEnoughToSellPylons, Condition.InBeach) - .AddWithCustomValue(ItemID.Fries, Item.buyPrice(gold: 2), Condition.HappyEnoughToSellPylons, Condition.InBeach, Condition.DownedEyeOfCthulhu) .Register(); } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs index 7847c6a171..8d979d3d03 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/BrainOfCthulhuAI.cs @@ -16,13 +16,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses private const float SpinVelocity = 12f; private const int SpinRadius = 45; + // Rev+ exclusive + public static int BloodShotDamage = 11; // 44 + public static bool BuffedBrainofCthulhuAI(NPC npc, Mod mod) { // whoAmI variable NPC.crimsonBoss = npc.whoAmI; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -34,28 +36,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - bool enrage = true; - int targetTileX = (int)Main.player[npc.target].Center.X / 16; - int targetTileY = (int)Main.player[npc.target].Center.Y / 16; - - Tile tile = Framing.GetTileSafely(targetTileX, targetTileY); - if (tile.WallType == WallID.CrimstoneUnsafe) - enrage = false; - - float enrageScale = bossRush ? 1.5f : death ? 0.5f : 0f; - if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 0.5f; - } - if (!Main.player[npc.target].ZoneCrimson || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - // Despawn check - bool despawn = Main.player[npc.target].dead && !bossRush; + bool despawn = (Main.player[npc.target].dead || !Main.player[npc.target].ZoneCrimson) && !BossRushEvent.BossRushActive; // Despawn if (despawn) @@ -69,9 +51,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.localAI[3] > 0f) npc.localAI[3] -= 1f; - // Extra distance for teleports if enraged - int teleportDistanceIncrease = (int)Math.Round(enrageScale * 3); - // Spawn Creepers if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 0f) { @@ -107,7 +86,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 2 if (npc.ai[0] < 0f) { - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) NPC.brainOfGravity = npc.whoAmI; // Spawn gore @@ -205,7 +184,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Charge variables - float chargeVelocity = (death ? 18f : 15f) + 3f * enrageScale; + float chargeVelocity = death ? 19.5f : 15f; if (phase7) chargeVelocity *= 1.2f; @@ -236,15 +215,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float velocityScale = death ? 6f : 4.5f; float velocityBoost = velocityScale * (1f - lifeRatio); - float nonChargeSpeed = (death ? 24f : 18f) + velocityBoost + 3f * enrageScale; - if (Main.getGoodWorld) + float nonChargeSpeed = (death ? 25.5f : 18f) + velocityBoost; + if (CalamityWorld.LegendaryMode) nonChargeSpeed *= 1.15f; float minInertia = death ? 50f : 75f; float maxInertia = death ? 70f : 100f; float inertia = MathHelper.Lerp(minInertia, maxInertia, lifeRatio); - Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero); + Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 10f : Vector2.Zero); Vector2 idealVelocity = (destination - npc.Center).SafeNormalize(Vector2.UnitY) * nonChargeSpeed; npc.velocity = (npc.velocity * (inertia - 1f) + idealVelocity) / inertia; } @@ -290,8 +269,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.ForceRoarPitched, npc.Center); // Velocity - npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f * enrageScale : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; - if (Main.getGoodWorld) + npc.velocity = (Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 10f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; + if (CalamityWorld.LegendaryMode) npc.velocity *= 1.15f; } } @@ -333,10 +312,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Vector2.Distance(Main.player[npc.target].Center, npc.Center) < minChargeDistance) { npc.ai[2] -= 1f; - npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (-chargeVelocity - 2f * enrageScale); + npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * -chargeVelocity; if (death) npc.velocity *= 1.5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.velocity *= 1.15f; } } @@ -345,7 +324,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] >= timer) { // Shoot projectiles from 4 directions, alternating between diagonal and cardinal - float bloodShotVelocity = (death ? 7.5f : 6f) + enrageScale; + float bloodShotVelocity = death ? 8f : 6f; // Scale projectile velocity float phase7ProjectileVelocityMult = 1.2f; @@ -423,7 +402,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.BloodShot; - int damage = npc.GetProjectileDamage(type); int numProj = death ? 9 : 4; int spread = death ? 32 : 15; if (phase7) @@ -441,7 +419,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int j = 0; j < numProj; j++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), position + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), position + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; if (!canHit) Main.projectile[proj].tileCollide = false; @@ -456,7 +434,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.BloodNautilusShot; - int damage = npc.GetProjectileDamage(type); int numProj = death ? 13 : 7; int spread = death ? 60 : 40; if (phase7) @@ -479,7 +456,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity2.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; if (!canHit2) Main.projectile[proj].tileCollide = false; @@ -527,7 +504,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!despawn) npc.localAI[1] += 1f; - float teleportGateValue = npc.ai[0] == -6f ? 300f : 210f; + float teleportGateValue = npc.ai[0] == -6f ? 270f : 210f; if (npc.localAI[1] >= teleportGateValue) { npc.localAI[1] = 0f; @@ -571,8 +548,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - int teleportX = Main.rand.Next(minX, maxX + 1) + teleportDistanceIncrease; - int teleportY = Main.rand.Next(minY, maxY + 1) + teleportDistanceIncrease; + int teleportX = Main.rand.Next(minX, maxX + 1); + int teleportY = Main.rand.Next(minY, maxY + 1); if (Main.rand.NextBool()) teleportX *= -1; @@ -699,7 +676,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses creeperCount = GetBrainOfCthuluCreepersCountRevDeath(); float creeperRatio = creeperCount / (float)GetBrainOfCthuluCreepersCountRevDeath(); - float velocityScale = MathHelper.Lerp(0f, 2f, 1f - creeperRatio) + enrageScale; + float velocityScale = MathHelper.Lerp(0f, 2f, 1f - creeperRatio) + (death ? 0.5f : 0f); // Check for phase 2 bool phase2 = creeperCount <= 0; @@ -728,7 +705,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float targetYDistPhase1 = Main.player[npc.target].Center.Y - brainCenterPhase1.Y; float targetDistancePhase1 = (float)Math.Sqrt(targetXDistPhase1 * targetXDistPhase1 + targetYDistPhase1 * targetYDistPhase1); float maxMoveVelocity = (death ? 4f : 1.5f) + velocityScale; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) maxMoveVelocity *= 2f; if (targetDistancePhase1 < maxMoveVelocity) @@ -772,8 +749,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses phase1TeleportTileX = (int)Main.player[npc.target].Center.X / 16; phase1TeleportTileY = (int)Main.player[npc.target].Center.Y / 16; - int min = 28 + teleportDistanceIncrease; - int max = 30 + teleportDistanceIncrease; + int min = 28; + int max = 30; if (Main.rand.NextBool()) phase1TeleportTileX += Main.rand.Next(min, max); @@ -859,23 +836,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) CalamityUtils.CalamityTargeting(npc, default); - float enrageScaleMax = 2f; - float enrageScale = bossRush ? enrageScaleMax : death ? 0.5f : 0f; - if ((npc.position.Y / 16f) < Main.worldSurface) - enrageScale += 0.5f; - if (!Main.player[npc.target].ZoneCrimson) - enrageScale += 1f; - - if (enrageScale > enrageScaleMax) - enrageScale = enrageScaleMax; - bool brainIsNotTeleportingOrCharging = Main.npc[NPC.crimsonBoss].ai[0] == 0f || Main.npc[NPC.crimsonBoss].ai[0] == -1f || Main.npc[NPC.crimsonBoss].ai[0] == -6f; bool brainIsInPhase2 = Main.npc[NPC.crimsonBoss].ai[0] < 0f; @@ -884,7 +850,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (creeperCount > GetBrainOfCthuluCreepersCountRevDeath()) creeperCount = GetBrainOfCthuluCreepersCountRevDeath(); - float creeperRatio = 1f; + float creeperRatio; if (death && brainIsInPhase2) { bool brainIsInPhase3 = Main.npc[NPC.crimsonBoss].localAI[0] == 2f; @@ -898,10 +864,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Scale the aggressiveness of the charges with amount of Creepers remaining float chargeAggressionScale = creeperRatio <= 0.1f ? 1.75f : creeperRatio <= 0.2f ? 1.25f : creeperRatio <= 0.4f ? 0.875f : creeperRatio <= 0.6f ? 0.5f : creeperRatio <= 0.8f ? 0.25f : 0f; - if (enrageScale > 0f) - chargeAggressionScale *= 1f + enrageScale; if (death) - chargeAggressionScale *= 1.25f; + chargeAggressionScale *= 1.875f; // Give off blood dust before charging float beginTelegraphGateValue = TimeBeforeCreeperAttack - CreeperTelegraphTime; @@ -930,8 +894,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float brainXDist = Main.npc[NPC.crimsonBoss].Center.X - creeperCenter.X; float brainYDist = Main.npc[NPC.crimsonBoss].Center.Y - creeperCenter.Y; float brainDistance = (float)Math.Sqrt(brainXDist * brainXDist + brainYDist * brainYDist); - float velocity = (death ? 16f : 8f) + chargeAggressionScale; - velocity += 2f * enrageScale; + float velocity = (death ? 17f : 8f) + chargeAggressionScale; if (brainIsInPhase2) { float velocityFloor = Main.npc[NPC.crimsonBoss].velocity.Length() + velocity * 0.5f; @@ -986,8 +949,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Always fully visible while charging npc.alpha = 0; - float chargeVelocity = (death ? 12f : 6f) + chargeAggressionScale; - chargeVelocity += 2f * enrageScale; + float chargeVelocity = (death ? 13f : 6f) + chargeAggressionScale; float returnToBrainGateValue = 1f; if (!brainIsInPhase2) { @@ -997,7 +959,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 destination = Main.player[npc.target].Center + (death ? Main.player[npc.target].velocity * 20f : Vector2.Zero); Vector2 targetDirection = destination - npc.Center; targetDirection = targetDirection.SafeNormalize(Vector2.UnitY); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { targetDirection *= chargeVelocity + 6f; npc.velocity = (npc.velocity * 49f + targetDirection) / 50f; @@ -1028,8 +990,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ProjectileID.BloodShot; - int damage = npc.GetProjectileDamage(projectileType); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, projectileVelocity, projectileType, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, projectileVelocity, projectileType, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; if (!canHit) Main.projectile[proj].tileCollide = false; @@ -1052,7 +1013,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static int GetBrainOfCthuluCreepersCountRevDeath() { - return CalamityWorld.LegendaryMode ? 40 : Main.getGoodWorld ? 35 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 20; + return CalamityWorld.LegendaryMode ? 40 : (CalamityWorld.death || BossRushEvent.BossRushActive) ? 30 : 20; } private static float GetCrimsonBossKnockBack(NPC npc, int numPlayers, float lifeScale, float baseKnockBackResist) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs index 4f716d58db..404908d767 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/CultistAI.cs @@ -13,6 +13,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class CultistAI { + // Vanilla values + public static int CloneFireballDamage = 18; // 72 + public static int FireballDamage = 20; // 80 + public static int IceMistDamage = 25; // 100 + public static int LightningDamage = 30; // 120 + public static int DoomDamage = 45; // 180 (Also fixes Master Mode scaling) + public static bool BuffedCultistAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -35,8 +42,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Phases - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase2 = lifeRatio < 0.85f || death; bool phase3 = lifeRatio < 0.7f || death; bool phase4 = lifeRatio < (death ? 0.8f : 0.55f); @@ -53,9 +59,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float distanceAboveTarget = -240f; float moveSpeed = death ? 300f : 75f; - int iceMistDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossIceMist) : 0; - int fireballDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossFireBall) : npc.GetProjectileDamage(ProjectileID.CultistBossFireBallClone); - int lightningDamage = isCultist ? npc.GetProjectileDamage(ProjectileID.CultistBossLightningOrb) : 0; + int iceMistDamage = isCultist ? IceMistDamage : 0; + int fireballDamage = isCultist ? FireballDamage : CloneFireballDamage; + int lightningDamage = isCultist ? LightningDamage : 0; int iceMistFireRate = phase2 ? 50 : 60; float iceMistSpeed = (phase6 ? 12f : 10f) + (death ? (1f - lifeRatio) : 0f); @@ -70,24 +76,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int idleTime = phase8 ? 20 : phase7 ? 30 : phase3 ? 35 : 40; float timeToFinishRitual = phase8 ? 180f : phase7 ? 240f : phase5 ? 300f : 360f; - if (bossRush) + if (CalamityWorld.LegendaryMode) { iceMistFireRate = 40; - iceMistSpeed = 14f; - iceMistAmt = 3; - fireballFireRate = 8; - fireballSpeed *= 1.2f; - lightningOrbPhaseTime = 90; - ancientLightSpawnRate = 20; - ancientLightAmt = 4; - idleTime = 20; - } - - if (Main.getGoodWorld) - { - iceMistFireRate = 30; iceMistSpeed = 15f; - fireballFireRate = 6; + fireballFireRate = 8; fireballSpeed *= 1.25f; lightningOrbPhaseTime = 60; ancientLightSpawnRate = 10; @@ -108,7 +101,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Enrage - if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height) || CalamityWorld.LegendaryMode) + if (!Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { calamityGlobalNPC.newAI[0] += 1f; if (calamityGlobalNPC.newAI[0] >= 120f) @@ -157,13 +150,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); npc.netUpdate = true; - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - if (!NPC.AnyNPCs(NPCID.AncientCultistSquidhead)) - NPC.NewNPC(npc.GetSource_FromAI(), (int)Main.projectile[(int)npc.ai[2]].Center.X, (int)Main.projectile[(int)npc.ai[2]].Center.Y, NPCID.AncientCultistSquidhead); - } - Main.projectile[(int)npc.ai[2]].ai[1] = -1f; Main.projectile[(int)npc.ai[2]].netUpdate = true; } @@ -537,7 +523,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 shadowFireballDirection = center4 + new Vector2(npc.direction * 30, 12f); Vector2 shadowFireballVelocity = playerDirection * (fireballSpeed + (float)Main.rand.NextDouble()); shadowFireballVelocity = shadowFireballVelocity.RotatedByRandom(Math.PI / 6D); - Projectile.NewProjectile(npc.GetSource_FromAI(), shadowFireballDirection, shadowFireballVelocity, ProjectileID.CultistBossFireBallClone, fireballDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), shadowFireballDirection, shadowFireballVelocity, ProjectileID.CultistBossFireBallClone, CloneFireballDamage, 0f, Main.myPlayer); } } } @@ -1072,7 +1058,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (CalamityGlobalNPC.adultEidolonWyrmHead != -1) { if (Main.npc[CalamityGlobalNPC.adultEidolonWyrmHead].active) - npc.damage *= 3; + npc.damage = (int)Math.Round(npc.defDamage * PrimordialWyrmHead.LightDamageMult); } } @@ -1101,8 +1087,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedAncientDoomAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; npc.damage = npc.defDamage = 0; float duration = 420f; float spawnAnimTime = 120f; @@ -1201,11 +1186,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] >= duration) { int type = ProjectileID.AncientDoomProjectile; - int damage = npc.GetProjectileDamage(type); + int damage = DoomDamage; - // Triple damage if the Primordial Wyrm is alive + // Increase damage if the Primordial Wyrm is alive if (Main.npc[(int)npc.ai[0]].type == ModContent.NPCType()) - damage *= 3; + damage = (int)Math.Round(damage * PrimordialWyrmHead.DoomDamageMult); kill = true; if (Main.netMode != NetmodeID.MultiplayerClient) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs index ddaa634383..389bca8d8b 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DeerclopsAI.cs @@ -24,6 +24,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static float borderScalar = 0f; public static Vector2 lastDeerclopsPosition; + // Vanilla values + public static int IceSpikeDamage = 13; // 52 + public static int DebrisDamage = 18; // 72 + public static int HandDamage = 10; // 40 + public static bool BuffedDeerclopsAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -34,16 +39,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = (float)npc.life / (float)npc.lifeMax; // Difficulty bools - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Projectile types and damage int rubble = ProjectileID.DeerclopsRangedProjectile; - int rubbleDamage = npc.GetProjectileDamage(rubble); int iceSpike = ProjectileID.DeerclopsIceSpike; - int iceSpikeDamage = npc.GetProjectileDamage(iceSpike); int shadowHand = ProjectileID.InsanityShadowHostile; - int shadowHandDamage = npc.GetProjectileDamage(shadowHand); if (npc.target.WithinBounds(Main.player.Length) && Main.player[npc.target].dead) { @@ -64,7 +65,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float resistDamageAmount = MathHelper.Clamp((distanceFromTarget - IncreaseDRTriggerDistance) / (MaxDRIncreaseDistance - IncreaseDRTriggerDistance), 0f, 1f); npc.localAI[3] = MathHelper.Lerp(0f, 30f, resistDamageAmount); float dustAndDRScalar = Utils.Remap(npc.localAI[3], 0f, 30f, 0f, 1f); - calamityGlobalNPC.DR = MathHelper.Lerp(0.05f, 0.9f, dustAndDRScalar); + calamityGlobalNPC.DR = MathHelper.Lerp(0f, 0.9f, dustAndDRScalar); if (borderDelay > 0f) borderDelay -= 1f; @@ -129,7 +130,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn Shadow Hands if the player enters the shadows if (Main.netMode != NetmodeID.MultiplayerClient && hasTargetBeenInRange) - SpawnBorderShadowHands(npc, lifeRatio, shadowHand, shadowHandDamage, death); + SpawnBorderShadowHands(npc, lifeRatio, shadowHand, HandDamage, death); // AI states switch ((int)npc.ai[0]) @@ -171,14 +172,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool useFrontIceSpikeAttack = Math.Abs(distanceFromTarget2.X) >= Math.Abs(distanceFromTarget2.Y) * distanceCheckMultiplier || distanceFromTarget2.Length() < 48f; bool useEitherIceSpikeAttack = distanceFromTarget2.Y <= (float)(100 + targetData.Height) && distanceFromTarget2.Y >= -200f; - // Can only use ice spikes a maximum of twice in a row before doing something else - float iceSpikeAttackLimit = 2f; + // Can only use ice spikes a maximum of three times in a row before doing something else + float iceSpikeAttackLimit = 3f; bool doNotUseIceSpikes = calamityGlobalNPC.newAI[1] >= iceSpikeAttackLimit; if (!doNotUseIceSpikes) { // Deerclops must be this close to its target on the X axis to do the ice spike attack // This distance increases at lower HP because the ice spikes get bigger - float iceSpikesDistanceGateValue = 120f + MathHelper.Lerp(0f, 120f, 1f - lifeRatio); + float iceSpikesDistanceGateValue = 120f + MathHelper.Lerp(0f, 60f, 1f - lifeRatio); if (Math.Abs(distanceFromTarget2.X) < iceSpikesDistanceGateValue && useEitherIceSpikeAttack && npc.velocity.Y == 0f && npc.localAI[1] >= 2f) { npc.velocity.X = 0f; @@ -206,9 +207,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - // Can only use rubble a maximum of thrice in a row before doing something else - // This also takes into account the ice spike limit - float rubbleAttackLimit = 3f; + // Can only use rubble and ice spikes a maximum of four times in a row before doing something else + float rubbleAttackLimit = 4f; bool doNotUseRubble = calamityGlobalNPC.newAI[1] >= rubbleAttackLimit; float rubbleGateValue = death ? 160f : 200f; if (!doNotUseRubble) @@ -272,7 +272,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; haltMovement = true; - MakeSpikesForward(npc, 1, targetData, iceSpike, iceSpikeDamage, lifeRatio, death); + MakeSpikesForward(npc, 1, targetData, iceSpike, IceSpikeDamage, lifeRatio, death); float iceSpikePhaseGateValue = 80f; if (npc.ai[1] >= iceSpikePhaseGateValue) @@ -316,7 +316,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses rubbleLimit = rubbleStart; for (int rubbleIndex = rubbleStart; rubbleIndex < rubbleLimit && rubbleIndex < numRubble; rubbleIndex++) - ShootRubbleUp(npc, ref sourceTileCoords, numRubble, distancedByThisManyTiles, rubbleIndex, rubble, rubbleDamage, lifeRatio, death); + ShootRubbleUp(npc, ref sourceTileCoords, numRubble, distancedByThisManyTiles, rubbleIndex, rubble, DebrisDamage, lifeRatio, death); } if (npc.ai[1] >= 60f) @@ -357,7 +357,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 actualVelocity = spinningPoint.RotatedBy(radians * k); float velocityMultiplier = 1f - k * velocityMultIncrement; - Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, shadowHandDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, HandDamage, 0f, Main.myPlayer); } } } @@ -377,7 +377,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; haltMovement = true; npc.TargetClosest(); - MakeSpikesBothSides(npc, 1, targetData, iceSpike, iceSpikeDamage, lifeRatio, death); + MakeSpikesBothSides(npc, 1, targetData, iceSpike, IceSpikeDamage, lifeRatio, death); float doubleIceSpikePhaseGateValue = 90f; if (npc.ai[1] >= doubleIceSpikePhaseGateValue) @@ -408,17 +408,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.TargetClosest(); if (Main.netMode != NetmodeID.MultiplayerClient) { - int totalProjectiles = (death ? 11 : 9) + (int)MathHelper.Lerp(0f, 7f, 1f - lifeRatio); + int totalProjectiles = (death ? 20 : 16) + (int)MathHelper.Lerp(0f, 7f, 1f - lifeRatio); float velocityMultIncrement = ((totalProjectiles + 1) / (float)totalProjectiles) - 1f; - float randomRadialOffset = MathHelper.ToRadians(MathHelper.Lerp(0f, death ? 360f : 270f, 1f - lifeRatio)); + float randomRadialOffset = Main.rand.NextFloat(MathHelper.ToRadians(MathHelper.Lerp(0f, death ? 360f : 270f, 1f - lifeRatio))); float radians = MathHelper.TwoPi / totalProjectiles + randomRadialOffset; - float velocity = (death ? 10.5f : 8f) + MathHelper.Lerp(0f, 4f, 1f - lifeRatio); + float velocity = 12f + MathHelper.Lerp(0f, 4f, 1f - lifeRatio); Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { Vector2 actualVelocity = spinningPoint.RotatedBy(radians * k); - float velocityMultiplier = 1f - k * velocityMultIncrement; - Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, shadowHandDamage, 0f, Main.myPlayer); + float velocityMultiplier = 1f - (k * velocityMultIncrement * 0.5f); + Projectile.NewProjectile(npc.GetSource_FromAI(), Main.player[npc.target].Center + Vector2.Normalize(actualVelocity) * 550f, actualVelocity * velocityMultiplier * -1f, shadowHand, HandDamage, 0f, Main.myPlayer); } } } @@ -580,7 +580,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - private static void SpawnBorderShadowHands(NPC npc, float lifeRatio, int shadowHand, int shadowHandDamage, bool death) + private static void SpawnBorderShadowHands(NPC npc, float lifeRatio, int shadowHand, int HandDamage, bool death) { int shadowHandSpawnRate = death ? 15 : 20; npc.localAI[2] += 1f; @@ -603,12 +603,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 spawnPosition = npc.Center + (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * (playerDistanceFromDeerclops + minShadowHandSpawnDistanceFromPlayer); float shadowHandVelocity = death ? 6f : 5f; Vector2 spawnVelocity = (player.Center - spawnPosition).SafeNormalize(Vector2.UnitY) * shadowHandVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition, spawnVelocity, shadowHand, shadowHandDamage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnPosition, spawnVelocity, shadowHand, HandDamage, 0f, Main.myPlayer); } } } - private static void ShootRubbleUp(NPC npc, ref Point sourceTileCoords, int howMany, int distancedByThisManyTiles, int whichOne, int rubble, int rubbleDamage, float lifeRatio, bool death) + private static void ShootRubbleUp(NPC npc, ref Point sourceTileCoords, int howMany, int distancedByThisManyTiles, int whichOne, int rubble, int DebrisDamage, float lifeRatio, bool death) { // Loop to spawn rubble // The rubble attempts are used to offset the Y coordinates of the rubble spawns to make sure they can spawn in non-solid tiles @@ -620,13 +620,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int posY = sourceTileCoords.Y + rubbleSpawnAttempts; if (WorldGen.ActiveAndWalkableTile(posX, posY)) { - SpawnRubble(npc, posX, posY, howMany, whichOne, rubble, rubbleDamage, lifeRatio, death); + SpawnRubble(npc, posX, posY, howMany, whichOne, rubble, DebrisDamage, lifeRatio, death); break; } } } - private static void SpawnRubble(NPC npc, int posX, int posY, int howMany, int whichOne, int rubble, int rubbleDamage, float lifeRatio, bool death) + private static void SpawnRubble(NPC npc, int posX, int posY, int howMany, int whichOne, int rubble, int DebrisDamage, float lifeRatio, bool death) { Vector2 rubbleVelocity = new Vector2(0f, -1f).RotatedBy((float)(whichOne * npc.direction) * 0.7f * ((float)Math.PI / 4f / (float)howMany)); int ai1_FrameToUse = Main.rand.Next(Main.projFrames[rubble] * 4); @@ -634,10 +634,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float delay = death ? 24f : 30f; float ai2_DelayBeforeGoingUp = (whichOne + 1) * delay; float velocityMultiplier = MathHelper.Lerp(0.01f, 0.015f, 1f - lifeRatio); - Projectile.NewProjectile(npc.GetSource_FromAI(), new Vector2(posX * 16 + 8, posY * 16 - 8), rubbleVelocity * velocityMultiplier, rubble, rubbleDamage, 0f, Main.myPlayer, 0f, ai1_FrameToUse, ai2_DelayBeforeGoingUp); + Projectile.NewProjectile(npc.GetSource_FromAI(), new Vector2(posX * 16 + 8, posY * 16 - 8), rubbleVelocity * velocityMultiplier, rubble, DebrisDamage, 0f, Main.myPlayer, 0f, ai1_FrameToUse, ai2_DelayBeforeGoingUp); } - private static void MakeSpikesForward(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int iceSpikeDamage, float lifeRatio, bool death) + private static void MakeSpikesForward(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int IceSpikeDamage, float lifeRatio, bool death) { if (Main.netMode == NetmodeID.MultiplayerClient) return; @@ -666,12 +666,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = iceSpikeStart; i < iceSpikeLimit && i < numIceSpikes; i++) { int xOffset = (int)Math.Round(i * xOffsetMult * iceSpikeScaleIncrease); - TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, i, xOffset, iceSpike, iceSpikeDamage, lifeRatio, death); + TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, i, xOffset, iceSpike, IceSpikeDamage, lifeRatio, death); } } } - private static void MakeSpikesBothSides(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int iceSpikeDamage, float lifeRatio, bool death) + private static void MakeSpikesBothSides(NPC npc, int AISLOT_PhaseCounter, NPCAimedTarget targetData, int iceSpike, int IceSpikeDamage, float lifeRatio, bool death) { if (Main.netMode == NetmodeID.MultiplayerClient) return; @@ -699,13 +699,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int iceSpikeIndex = iceSpikeStart; iceSpikeIndex >= 0 && iceSpikeIndex < iceSpikeLimit && iceSpikeIndex < numIceSpikes; iceSpikeIndex++) { int xOffset = (int)Math.Round(iceSpikeIndex * xOffsetMult * iceSpikeScaleIncrease); - TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, iceSpikeDamage, lifeRatio, death); - TryMakingSpike(npc, ref sourceTileCoords, -npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, iceSpikeDamage, lifeRatio, death); + TryMakingSpike(npc, ref sourceTileCoords, npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, IceSpikeDamage, lifeRatio, death); + TryMakingSpike(npc, ref sourceTileCoords, -npc.direction, numIceSpikes, -iceSpikeIndex, xOffset, iceSpike, IceSpikeDamage, lifeRatio, death); } } } - private static void TryMakingSpike(NPC npc, ref Point sourceTileCoords, int dir, int howMany, int whichOne, int xOffset, int iceSpike, int iceSpikeDamage, float lifeRatio, bool death) + private static void TryMakingSpike(NPC npc, ref Point sourceTileCoords, int dir, int howMany, int whichOne, int xOffset, int iceSpike, int IceSpikeDamage, float lifeRatio, bool death) { int posX = sourceTileCoords.X + xOffset * dir; int posY = FindBestY(npc, ref sourceTileCoords, posX); @@ -714,7 +714,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 iceSpikeSpawnPos = new Vector2(posX * 16 + 8, posY * 16 - 8); Vector2 iceSpikeVelocity = new Vector2(0f, -1f).RotatedBy((float)(whichOne * dir) * 0.7f * ((float)Math.PI / 4f / (float)howMany)); float iceSpikeScale = 0.1f + Main.rand.NextFloat() * 0.1f + (float)xOffset * 1.1f / (float)howMany; - Projectile.NewProjectile(npc.GetSource_FromAI(), iceSpikeSpawnPos, iceSpikeVelocity, iceSpike, iceSpikeDamage, 0f, Main.myPlayer, 0f, iceSpikeScale); + Projectile.NewProjectile(npc.GetSource_FromAI(), iceSpikeSpawnPos, iceSpikeVelocity, iceSpike, IceSpikeDamage, 0f, Main.myPlayer, 0f, iceSpikeScale); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs index 2a3aaf073a..5bb3ee3d51 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DestroyerAI.cs @@ -27,14 +27,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float PhaseTransitionTelegraphTime = 180f; public const float GroundTelegraphStartGateValue = FlightPhaseResetGateValue - PhaseTransitionTelegraphTime; public const float FlightTelegraphStartGateValue = FlightPhaseGateValue - PhaseTransitionTelegraphTime; - private const int OneInXChanceToFireLaser = 200; public const float ProbeLaserGateValue_Mechdusa = 360f; public const float ProbeLaserGateValue_Rev = 240f; - public const float ProbeLaserGateValue_BossRush = 150f; public const float ProbeLaserGateValue = 120f; public const float ProbeLaserTelegraphTime = 60f; + // Vanilla values + public static int ProbeLaserDamage = 22; // 88 + + // Rev+ exclusive + public static int LaserDamage = 25; // 100 (buffed); Applies to all Rev+ lasers + public static bool BuffedDestroyerAI(NPC npc, Mod mod) { int mechdusaCurvedSpineSegmentIndex = 0; @@ -67,8 +71,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = calamityGlobalNPC.newAI[1] < DRIncreaseTime; @@ -122,13 +125,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool increaseSpeed = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance200Tiles; bool increaseSpeedMore = Vector2.Distance(player.Center, npc.Center) > CalamityGlobalNPC.CatchUpDistance350Tiles; - float enrageScale = bossRush ? 1f : 0f; - if (Main.IsItDay() || bossRush) - { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - // Phase for flying at the player bool flyAtTarget = (calamityGlobalNPC.newAI[3] >= FlightPhaseGateValue && startFlightPhase) || hasSpawnDR; @@ -151,8 +147,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Check if other segments are still alive, if not, die - // Check for Oblivion too, since having a max power Destroyer during that fight would be turbo cancer - bool oblivionAlive = false; if (npc.type > NPCID.TheDestroyer) { bool shouldDespawn = true; @@ -179,27 +173,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.active = false; } } - else - { - if (death && !bossRush && npc.localAI[3] == 1f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - { - oblivionAlive = true; - break; - } - } - } - } // Total segment variable - int totalSegments = Main.getGoodWorld ? 100 : 80; + int totalSegments = CalamityWorld.LegendaryMode ? 100 : 80; // Calculate aggression based on how many broken segments there are float brokenSegmentAggressionMultiplier = 1f; - if (npc.type == NPCID.TheDestroyer && !oblivionAlive) + if (npc.type == NPCID.TheDestroyer) { int numProbeSegments = 0; for (int i = 0; i < Main.maxNPCs; i++) @@ -225,71 +205,42 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Increase velocity based on distance float velocityMultiplier = increaseSpeedMore ? 2f : increaseSpeed ? 1.5f : 1f; + noFlyZoneBoxHeight -= death ? 400 : (int)(400f * (1f - lifeRatio)); - // If Oblivion is alive, don't fly, don't spit laser spreads, use the default vanilla no fly zone, reduce segment count to 60, use base speed and use base turn speed - if (oblivionAlive) + float segmentVelocityBoost = death ? (flyAtTarget ? 4.5f : 6f) * (1f - lifeRatio) : (flyAtTarget ? 3f : 4f) * (1f - lifeRatio); + float speedBoost = death ? (flyAtTarget ? 0.1125f : 0.15f) * (1f - lifeRatio) : (flyAtTarget ? 0.075f : 0.1f) * (1f - lifeRatio); + float turnSpeedBoost = death ? 0.18f * (1f - lifeRatio) : 0.12f * (1f - lifeRatio); + + segmentVelocity += segmentVelocityBoost; + speed += speedBoost; + turnSpeed += turnSpeedBoost; + + if (flyAtTarget) { - calamityGlobalNPC.newAI[3] = 0f; - totalSegments = Main.getGoodWorld ? 75 : 60; - spitLaserSpreads = false; - noFlyZoneBoxHeight = 2000; + float speedMultiplier = phase5 ? 1.8f : phase4 ? 1.65f : 1.5f; + speed *= speedMultiplier; } - else + + segmentVelocity *= velocityMultiplier; + speed *= velocityMultiplier; + turnSpeed *= velocityMultiplier; + + segmentVelocity *= brokenSegmentAggressionMultiplier; + speed *= brokenSegmentAggressionMultiplier; + turnSpeed *= brokenSegmentAggressionMultiplier; + + if (CalamityWorld.LegendaryMode) { - noFlyZoneBoxHeight -= death ? 400 : (int)(400f * (1f - lifeRatio)); - - float segmentVelocityBoost = death ? (flyAtTarget ? 4.5f : 6f) * (1f - lifeRatio) : (flyAtTarget ? 3f : 4f) * (1f - lifeRatio); - float speedBoost = death ? (flyAtTarget ? 0.1125f : 0.15f) * (1f - lifeRatio) : (flyAtTarget ? 0.075f : 0.1f) * (1f - lifeRatio); - float turnSpeedBoost = death ? 0.18f * (1f - lifeRatio) : 0.12f * (1f - lifeRatio); - - segmentVelocity += segmentVelocityBoost; - speed += speedBoost; - turnSpeed += turnSpeedBoost; - - segmentVelocity += 5f * enrageScale; - speed += 0.05f * enrageScale; - turnSpeed += 0.075f * enrageScale; - - if (flyAtTarget) - { - float speedMultiplier = phase5 ? 1.8f : phase4 ? 1.65f : 1.5f; - speed *= speedMultiplier; - } - - segmentVelocity *= velocityMultiplier; - speed *= velocityMultiplier; - turnSpeed *= velocityMultiplier; - - segmentVelocity *= brokenSegmentAggressionMultiplier; - speed *= brokenSegmentAggressionMultiplier; - turnSpeed *= brokenSegmentAggressionMultiplier; - - if (Main.getGoodWorld) - { - segmentVelocity *= 1.2f; - speed *= 1.2f; - turnSpeed *= 1.2f; - } + segmentVelocity *= 1.2f; + speed *= 1.2f; + turnSpeed *= 1.2f; } bool probeLaunched = npc.ai[2] == 1f; if (npc.type == NPCID.TheDestroyerBody) { - // Enrage, fire more cyan lasers - if (enrageScale > 0f && !bossRush) - { - if (calamityGlobalNPC.newAI[2] < 480f) - calamityGlobalNPC.newAI[2] += 1f; - } - else - { - if (calamityGlobalNPC.newAI[2] > 0f) - calamityGlobalNPC.newAI[2] -= 1f; - } - - // Regenerate Probes in Master Mode if the number of Probes is less than 40 and the number of living NPCs is less than the segment count + 40 (this limit is here just in case) - // This doesn't happen if Oblivion is alive - if (death && probeLaunched && !oblivionAlive) + // Regenerate Probes in Death Mode if the number of Probes is less than 40 and the number of living NPCs is less than the segment count + 40 (this limit is here just in case) + if (death && probeLaunched) { npc.localAI[2] += 1f; if (npc.localAI[2] >= 600f) @@ -340,13 +291,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (j == totalSegments) type = NPCID.TheDestroyerTail; - int segment = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X), (int)(npc.position.Y + npc.height), type, npc.whoAmI); - Main.npc[segment].ai[3] = npc.whoAmI; - Main.npc[segment].realLife = npc.whoAmI; - Main.npc[segment].ai[1] = index; - Main.npc[index].ai[0] = segment; - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segment); - index = segment; + int segment = NPC.NewNPC(npc.GetSource_FromAI(), (int)(npc.Center.X), (int)(npc.position.Y + npc.height), type, npc.whoAmI); + Main.npc[segment].ai[3] = npc.whoAmI; + Main.npc[segment].realLife = npc.whoAmI; + Main.npc[segment].ai[1] = index; + Main.npc[index].ai[0] = segment; + Main.npc[index].Calamity().newAI[0] = -90f - Main.npc[index].ai[0] * (death ? 8f : 3f); // This controls the delay between laser shots + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segment); + index = segment; } } @@ -377,7 +329,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (calamityGlobalNPC.newAI[0] % 30f == 0f) { - float velocity = bossRush ? 6f : death ? 5.333f : 5f; + float velocity = death ? 5.333f : 5f; int type = ProjectileID.DeathLaser; switch (calamityGlobalNPC.destroyerLaserColor) { @@ -393,18 +345,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses type = ModContent.ProjectileType(); break; } - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -415,7 +355,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 100f, perturbedSpeed, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 100f, perturbedSpeed, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 1200; } } @@ -441,28 +381,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set laser color and type if (calamityGlobalNPC.destroyerLaserColor == -1 && !probeLaunched) { - if (Main.rand.NextBool(death ? OneInXChanceToFireLaser / (phase5 ? 4 : phase4 ? 3 : 2) : OneInXChanceToFireLaser)) + int random = phase3 ? 4 : phase2 ? 3 : 2; + switch (Main.rand.Next(random)) { - int random = phase3 ? 4 : phase2 ? 3 : 2; - switch (Main.rand.Next(random)) - { - case 0: - case 1: - calamityGlobalNPC.destroyerLaserColor = 0; - break; - case 2: - calamityGlobalNPC.destroyerLaserColor = 1; - break; - case 3: - calamityGlobalNPC.destroyerLaserColor = 2; - break; - } - - if (calamityGlobalNPC.newAI[2] > 0f || bossRush) + case 0: + case 1: + calamityGlobalNPC.destroyerLaserColor = 0; + break; + case 2: + calamityGlobalNPC.destroyerLaserColor = 1; + break; + case 3: calamityGlobalNPC.destroyerLaserColor = 2; - - npc.SyncDestroyerLaserColor(); + break; } + + npc.SyncDestroyerLaserColor(); } if (probeLaunched && ableToFireLaser) @@ -472,12 +406,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Laser rate of fire - float shootProjectileTime = death ? (phase5 ? 120f : phase4 ? 150f : 180f) : 450f; - float bodySegmentTime = npc.ai[0] * (death ? 20f : 30f); - float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; - float laserTimerIncrement = (calamityGlobalNPC.newAI[0] > shootProjectileGateValue - LaserTelegraphTime) ? 1f : 2f; + float shootProjectileTime = death ? (phase5 ? 180f : phase4 ? 270f : 360f) : 450f; if (ableToFireLaser) - calamityGlobalNPC.newAI[0] += laserTimerIncrement; + calamityGlobalNPC.newAI[0] += 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -500,7 +431,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - if (calamityGlobalNPC.newAI[0] == shootProjectileGateValue - LaserTelegraphTime) + if (calamityGlobalNPC.newAI[0] == shootProjectileTime - LaserTelegraphTime) { Particle telegraph = new DestroyerReticleTelegraph( npc, @@ -511,7 +442,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses GeneralParticleHandler.SpawnParticle(telegraph); } - if (calamityGlobalNPC.newAI[0] == shootProjectileGateValue - SparkTelegraphTime) + if (calamityGlobalNPC.newAI[0] == shootProjectileTime - SparkTelegraphTime) { Particle spark = new DestroyerSparkTelegraph( npc, @@ -525,43 +456,40 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Shoot lasers // Shoot nothing if probe has been launched - if (calamityGlobalNPC.newAI[0] >= shootProjectileGateValue && ableToFireLaser) + if (calamityGlobalNPC.newAI[0] >= shootProjectileTime && ableToFireLaser) { + int numProbeSegments = 0; + for (int i = 0; i < Main.maxNPCs; i++) + { + if (Main.npc[i].active && Main.npc[i].type == npc.type && Main.npc[i].ai[2] == 0f) + numProbeSegments++; + } + float lerpAmount = MathHelper.Clamp(numProbeSegments / (float)totalSegments, 0f, 1f); + float laserShootTimeBonus = (int)MathHelper.Lerp(0f, shootProjectileTime - LaserTelegraphTime, 1f - lerpAmount); + // Controls the fire rate getting slower as health lowers if (!death) { - int numProbeSegments = 0; - for (int i = 0; i < Main.maxNPCs; i++) + if (npc.localAI[3] == 0f && phase3) { - if (Main.npc[i].active && Main.npc[i].type == npc.type && Main.npc[i].ai[2] == 0f) - numProbeSegments++; + npc.localAI[3] = 1f; + npc.SyncVanillaLocalAI(); + laserShootTimeBonus -= npc.ai[0] * 2f; + } + else if (npc.localAI[3] == 1f && startFlightPhase) + { + npc.localAI[3] = 2f; + npc.SyncVanillaLocalAI(); + laserShootTimeBonus -= npc.ai[0] * 2f; } - float lerpAmount = MathHelper.Clamp(numProbeSegments / (float)totalSegments, 0f, 1f); - float laserShootTimeBonus = (int)MathHelper.Lerp(0f, (shootProjectileTime + bodySegmentTime * lerpAmount) - LaserTelegraphTime, 1f - lerpAmount); - calamityGlobalNPC.newAI[0] = laserShootTimeBonus; - npc.SyncExtraAI(); - CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); } + calamityGlobalNPC.newAI[0] = laserShootTimeBonus; + npc.SyncExtraAI(); + CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); if (Collision.CanHit(npc.position, npc.width, npc.height, player.position, player.width, player.height)) { - if (death) - { - int numProbeSegments = 0; - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && Main.npc[i].type == npc.type && Main.npc[i].ai[2] == 0f) - numProbeSegments++; - } - float lerpAmount = MathHelper.Clamp(numProbeSegments / (float)totalSegments, 0f, 1f); - float laserShootTimeBonus = (int)MathHelper.Lerp(0f, (shootProjectileTime + bodySegmentTime * lerpAmount) - LaserTelegraphTime, 1f - lerpAmount); - calamityGlobalNPC.newAI[0] = laserShootTimeBonus; - npc.SyncExtraAI(); - CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); - } - // Laser speed - float projectileSpeed = (death ? 4.5f : 3.5f) + Main.rand.NextFloat() * 1.5f; - projectileSpeed += enrageScale; + float projectileSpeed = death ? 5f : 4f; // Set projectile damage and type int projectileType = ProjectileID.DeathLaser; @@ -584,23 +512,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 projectileVelocity = (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 100f; - // Shoot projectile - int damage = npc.GetProjectileDamage(projectileType); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - if (Main.netMode != NetmodeID.MultiplayerClient) { - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 1200; } @@ -742,9 +656,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.type == NPCID.TheDestroyerBody) { float shootProjectileTime = (CalamityWorld.death || BossRushEvent.BossRushActive) ? 270f : 450f; - float bodySegmentTime = npc.ai[0] * 30f; - float shootProjectileGateValue = bodySegmentTime + shootProjectileTime; - float telegraphGateValue = shootProjectileGateValue - LaserTelegraphTime; + float telegraphGateValue = shootProjectileTime - LaserTelegraphTime; if (calamityGlobalNPC.newAI[0] > telegraphGateValue) { switch (calamityGlobalNPC.destroyerLaserColor) @@ -770,8 +682,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Despawn - bool oblivionFightDespawn = (oblivionAlive && lifeRatio < 0.8f) && npc.localAI[3] == 1f; - if (player.dead || oblivionFightDespawn) + if ((player.dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { shouldFly = false; npc.velocity.Y += 2f; @@ -1034,12 +945,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - // Force the fucker to turn around in ground phase in Master - // Turns slower if Oblivion is alive, for fairness + // Force the fucker to turn around in ground phase in Death if (npc.type == NPCID.TheDestroyer && death && !flyAtTarget) { if (npc.Distance(player.Center) > 2000f) - npc.velocity += (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? speed : turnSpeed); + npc.velocity += (player.Center - npc.Center).SafeNormalize(Vector2.UnitY) * turnSpeed; } if (NPC.IsMechQueenUp && npc.type == NPCID.TheDestroyer) @@ -1060,43 +970,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (calamityGlobalNPC.newAI[1] < DRIncreaseTime && ((npc.position - npc.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 0f)) calamityGlobalNPC.newAI[1] += 1f; - // Calculate contact damage based on velocity - float minimalContactDamageVelocity = segmentVelocity * 0.25f; - float minimalDamageVelocity = segmentVelocity * 0.5f; - if (npc.type == NPCID.TheDestroyer) - { - if (npc.velocity.Length() <= minimalContactDamageVelocity) - { - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((npc.velocity.Length() - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp((float)Math.Round(npc.defDamage * 0.5), npc.defDamage, velocityDamageScalar); - } - } - else - { - float bodyAndTailVelocity = (npc.position - npc.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageVelocity) - { - npc.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageVelocity) / minimalDamageVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp(0f, npc.defDamage, velocityDamageScalar); - } - } - return false; } public static bool BuffedProbeAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool oblivionAlive = npc.ai[1] == 1f; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1107,8 +986,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (targetData.Type == NPCTargetType.Player) targetDead = Main.player[npc.target].dead; - float velocity = bossRush ? 12f : death ? 8.4f : 7.2f; - float acceleration = bossRush ? 0.1f : death ? 0.07f : 0.06f; + float velocity = death ? 8.4f : 7.2f; + float acceleration = death ? 0.07f : 0.06f; float deceleration = 1f - acceleration; if (targetDead) @@ -1138,12 +1017,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < Main.maxNPCs; i++) { - if (death && !bossRush && npc.ai[1] == 0f) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - npc.ai[1] = 1f; - } - if (i != npc.whoAmI && Main.npc[i].active && Main.npc[i].type == npc.type) { Vector2 otherProbeDist = Main.npc[i].Center - npc.Center; @@ -1216,27 +1089,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((npc.justHit && !death) || targetDead) npc.localAI[0] = 0f; - float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : bossRush ? ProbeLaserGateValue_BossRush : ProbeLaserGateValue_Rev; + float laserGateValue = NPC.IsMechQueenUp ? ProbeLaserGateValue_Mechdusa : ProbeLaserGateValue_Rev; if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] >= laserGateValue) { npc.localAI[0] = 0f; if (targetData.Type != 0 && Collision.CanHit(npc.position, npc.width, npc.height, targetData.Position, targetData.Width, targetData.Height)) { int type = ProjectileID.PinkLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - int totalProjectiles = oblivionAlive ? 2 : death ? 3 : 1; + int totalProjectiles = death ? 3 : 1; Vector2 projectileVelocity = (targetData.Center - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; if (NPC.IsMechQueenUp) { @@ -1258,7 +1118,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } Vector2 laserVelocity = projectileVelocity * velocityMultiplier; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 50f, laserVelocity, type, ProbeLaserDamage.CalculateMechDamage(), 0f, Main.myPlayer); } npc.netUpdate = true; @@ -1272,12 +1132,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (targetData.Center.X - npc.Center.X > 0f) { - npc.spriteDirection = -1; + npc.spriteDirection = 1; npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X); } else { - npc.spriteDirection = 1; + npc.spriteDirection = -1; npc.rotation = (float)Math.Atan2(targetData.Center.Y - npc.Center.Y, targetData.Center.X - npc.Center.X) + MathHelper.Pi; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs index 05ba82522b..a717274bf3 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/DukeFishronAI.cs @@ -11,6 +11,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class DukeFishronAI { + // Vanilla values + public static float Phase2ContactDamageMult = 1.436f; // 201 + public static float Phase3ContactDamageMult = 1.315f; // 184 + public static bool BuffedDukeFishronAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -19,8 +23,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Variables - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool deathModeSurprise = lifeRatio >= 0.9f && death; bool phase2 = lifeRatio < (death ? 0.6f : 0.7f); bool phase3 = lifeRatio < (death ? 0.3f : 0.4f); @@ -30,15 +33,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool charging = npc.ai[3] < 10f; // Adjust stats - int setDamage = npc.defDamage; + npc.damage = npc.defDamage; if (phase3AI) { - setDamage = (int)Math.Round(setDamage * 1.32); + npc.damage = (int)Math.Round(npc.defDamage * Phase3ContactDamageMult); npc.defense = 0; } else if (phase2AI) { - setDamage = (int)Math.Round(setDamage * 1.44); + npc.damage = (int)Math.Round(npc.defDamage * Phase2ContactDamageMult); npc.defense = (int)Math.Round(npc.defDefense * 0.8); } else @@ -58,7 +61,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses idlePhaseVelocity = 10f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { idlePhaseAcceleration *= 1.15f; idlePhaseVelocity *= 1.15f; @@ -86,7 +89,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeVelocity *= 1.13f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeVelocity *= 1.15f; int bubbleBelchPhaseTimer = death ? 60 : 80; @@ -94,7 +97,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float bubbleBelchPhaseAcceleration = death ? 0.35f : 0.3f; float bubbleBelchPhaseVelocity = death ? 5.5f : 5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { bubbleBelchPhaseAcceleration *= 1.5f; bubbleBelchPhaseVelocity *= 1.5f; @@ -106,13 +109,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int teleportPhaseTimer = 30; - int bubbleSpinPhaseTimer = bossRush ? 45 : death ? 90 : 120; + int bubbleSpinPhaseTimer = death ? 90 : 120; int bubbleSpinPhaseDivisor = death ? 3 : 4; float bubbleSpinBubbleVelocity = death ? 8f : 7f; float bubbleSpinPhaseVelocity = 20f; float bubbleSpinPhaseRotation = MathHelper.TwoPi / (bubbleSpinPhaseTimer / 2); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) bubbleSpinBubbleVelocity *= 1.5f; int spawnEffectPhaseTimer = 75; @@ -144,21 +147,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Enrage variable - bool enrage = !bossRush && + bool enrage = !BossRushEvent.BossRushActive && (player.position.Y < 800f || player.position.Y > Main.worldSurface * 16.0 || (player.position.X > 6400f && player.position.X < (Main.maxTilesX * 16 - 6400))); - calamityGlobalNPC.CurrentlyEnraged = !bossRush && enrage; + calamityGlobalNPC.CurrentlyEnraged = enrage; // Make him always able to take damage npc.dontTakeDamage = false; // Increased DR during phase transitions - calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? (bossRush ? 0.99f : 0.625f) : 0.15f; + calamityGlobalNPC.DR = (npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f) ? 0.625f : 0.15f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = npc.ai[0] == -1f || npc.ai[0] == 4f || npc.ai[0] == 9f; // Enrage - if (enrage || bossRush) + if (enrage) { bubbleBelchPhaseTimer = 20; bubbleBelchPhaseDivisor = 1; @@ -172,11 +175,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bubbleSpinPhaseDivisor = 1; bubbleSpinBubbleVelocity = 15f; - if (!bossRush) - { - setDamage *= 2; - npc.defense = npc.defDefense * 3; - } + npc.damage *= 2; + npc.defense = npc.defDefense * 3; } if (death) @@ -192,7 +192,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeTime += Main.rand.Next(5, 66); // Spawn cthulhunadoes in phase 3 - if (phase3AI && ((!phase4 && !deathModeSurprise) || Main.getGoodWorld)) + if (phase3AI && ((!phase4 && !deathModeSurprise) || CalamityWorld.LegendaryMode)) { calamityGlobalNPC.newAI[0] += 1f; float timeGateValue = 600f; @@ -228,15 +228,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses rateOfRotation = 0.01f; Vector2 rotationVector = player.Center - npc.Center; - if (!player.dead && bossRush && phase4) - { - // Rotate to show direction of predictive charge - if (npc.ai[0] == 10f) - { - rateOfRotation = 0.1f; - rotationVector = Vector2.Normalize(player.Center + player.velocity * 20f - npc.Center) * chargeVelocity; - } - } float rotationSpeed = (float)Math.Atan2(rotationVector.Y, rotationVector.X); if (npc.spriteDirection == 1) @@ -268,7 +259,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn effects if (npc.ai[0] == -1f) { - // Avoid cheap bullshit + // Disable contact damage while spawning npc.damage = 0; // Velocity @@ -326,9 +317,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 1 else if (npc.ai[0] == 0f && !player.dead) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity if (npc.ai[1] == 0f) npc.ai[1] = 300 * Math.Sign((npc.Center - player.Center).X); @@ -444,9 +432,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[0] == 1f) { - // Set damage - npc.damage = setDamage; - // Accelerate npc.velocity *= 1.01f; @@ -477,9 +462,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Bubble belch else if (npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity if (npc.ai[1] == 0f) npc.ai[1] = 300 * Math.Sign((npc.Center - player.Center).X); @@ -525,9 +507,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Sharknado spawn else if (npc.ai[0] == 3f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); @@ -564,9 +543,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Transition to phase 2 else if (npc.ai[0] == 4f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); @@ -589,9 +565,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 2 else if (npc.ai[0] == 5f && !player.dead) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity if (npc.ai[1] == 0f) npc.ai[1] = 300 * Math.Sign((npc.Center - player.Center).X); @@ -714,9 +687,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[0] == 6f) { - // Set damage - npc.damage = setDamage; - // Accelerate npc.velocity *= 1.01f; @@ -747,9 +717,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Bubble spin else if (npc.ai[0] == 7f) { - // Set damage - npc.damage = 0; - // Play sounds and spawn bubbles if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.Zombie20, npc.Center); @@ -792,9 +759,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn cthulhunado else if (npc.ai[0] == 8f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity npc.velocity *= 0.98f; npc.velocity.Y = MathHelper.Lerp(npc.velocity.Y, 0f, 0.02f); @@ -819,9 +783,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Transition to phase 3 else if (npc.ai[0] == 9f) { - // Avoid cheap bullshit - npc.damage = 0; - // Alpha adjustments if (npc.ai[2] < phaseTransitionTimer - 90) { @@ -864,9 +825,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase 3 else if (npc.ai[0] == 10f && !player.dead) { - // Avoid cheap bullshit - npc.damage = 0; - // Alpha if (npc.alpha < 255) { @@ -960,7 +918,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; // Velocity and rotation - npc.velocity = Vector2.Normalize(player.Center + (bossRush && phase4 ? player.velocity * 20f : Vector2.Zero) - npc.Center) * chargeVelocity; + npc.velocity = Vector2.Normalize(player.Center - npc.Center) * chargeVelocity; npc.rotation = (float)Math.Atan2(npc.velocity.Y, npc.velocity.X); // Direction @@ -998,9 +956,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[0] == 11f) { - // Set damage - npc.damage = setDamage; - // Accelerate npc.velocity *= 1.01f; @@ -1054,7 +1009,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Pause before teleport else if (npc.ai[0] == 12f) { - // Avoid cheap bullshit + // Disable contact damage during the teleporting phase npc.damage = 0; // Alpha @@ -1147,7 +1102,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 velocityVector = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); float inertia = 30f; - float velocity = 23f; + float velocity = 20f; npc.velocity = (npc.velocity * inertia + velocityVector * velocity) / (inertia + 1f); npc.scale = npc.ai[3]; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs index 50a819dfd8..f2d3702a09 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EaterOfWorldsAI.cs @@ -17,12 +17,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses private const int TotalDeathModeWorms = 4; public const float DRIncreaseTime = 600f; + // Rev+ exclusive + public static int FireballDamage = 12; // 48; Applies to both Cursed Flames and (Death) Shadowflame fireballs + public static bool BuffedEaterofWorldsAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Causes it to split far more in death mode if ((((npc.ai[2] % 2f == 0f && npc.type == NPCID.EaterofWorldsBody) || npc.type == NPCID.EaterofWorldsHead) && death) || CalamityWorld.LegendaryMode) @@ -38,26 +40,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); - bool enrage = true; - int targetTileX = (int)Main.player[npc.target].Center.X / 16; - int targetTileY = (int)Main.player[npc.target].Center.Y / 16; - - Tile tile = Framing.GetTileSafely(targetTileX, targetTileY); - if (tile.WallType == WallID.EbonstoneUnsafe) - enrage = false; - - float enrageScale = 0f; - if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush) - { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; - enrageScale += 0.5f; - } - if (!Main.player[npc.target].ZoneCorrupt || bossRush) - { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - // Total body segments float totalSegments = GetEaterOfWorldsSegmentsCountRevDeath(); @@ -78,7 +60,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Boost velocity by 50% phase bool phase4 = lifeRatio < (death ? 0.5f : 0.2f); - // Go fucking crazy in Master Mode + // Go fucking crazy in Death Mode bool phase5 = lifeRatio < 0.1f && death; bool phase6 = lifeRatio < 0.05f && death; @@ -94,7 +76,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] -= 1f; int vileSpitGateValue = (int)MathHelper.Lerp(death ? 45f : 90f, 900f, lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) vileSpitGateValue = (int)(vileSpitGateValue * 0.5f); Vector2 vileSpitShootLocation = npc.Center + npc.velocity; @@ -111,7 +93,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] > vileSpitGateValue - ProjectileTelegraphDuration) { Vector2 dustCenter = vileSpitShootLocation + Main.rand.NextVector2CircularEdge(5f, 5f); - Dust dust = Dust.NewDustDirect(dustCenter, 1, 1, 18, npc.velocity.X * 0.1f, npc.velocity.Y * 0.1f, 80, default, 2f); + Dust dust = Dust.NewDustDirect(dustCenter, 1, 1, DustID.CorruptGibs, npc.velocity.X * 0.1f, npc.velocity.Y * 0.1f, 80, default, 2f); dust.noGravity = true; dust.velocity *= 0.3f; } @@ -122,13 +104,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (phase2) { - float timer = enrageScale > 0f ? 90f : 120f; + float timer = 120f; float shootBoost = lifeRatio * 90f; timer += shootBoost; - if (enrageScale >= 2f) - timer = 60f; - float showTelegraphGateValue = timer - ProjectileTelegraphDuration; if (Collision.CanHitLine(npc.Center, 1, 1, Main.player[npc.target].Center, 1, 1)) @@ -151,21 +130,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY).ToRotation().AngleTowards(npc.velocity.ToRotation(), MathHelper.PiOver4) == npc.velocity.ToRotation()) { calamityGlobalNPC.newAI[0] = 0f; - Vector2 cursedFlameDirection = npc.Center; - float targetXDirection = Main.player[npc.target].Center.X - cursedFlameDirection.X; - float targetYDirection = Main.player[npc.target].Center.Y - cursedFlameDirection.Y; - float projSpeed = 7f + enrageScale * 2f; - float flameTargetDistance = (float)Math.Sqrt(targetXDirection * targetXDirection + targetYDirection * targetYDirection); - flameTargetDistance = projSpeed / flameTargetDistance; - targetXDirection *= flameTargetDistance; - targetYDirection *= flameTargetDistance; - targetYDirection += npc.velocity.Y * 0.5f; - targetXDirection += npc.velocity.X * 0.5f; - cursedFlameDirection.X -= targetXDirection; - cursedFlameDirection.Y -= targetYDirection; - + Vector2 cursedFlameDirection = Utils.DirectionTo(npc.Center, Main.player[npc.target].Center) * 7f + (npc.velocity * 0.5f); int type = (death && phase3) ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; - Projectile.NewProjectile(npc.GetSource_FromAI(), cursedFlameDirection.X, cursedFlameDirection.Y, targetXDirection, targetYDirection, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + npc.velocity, cursedFlameDirection, type, FireballDamage, 0f, Main.myPlayer); } } @@ -356,10 +323,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!inTiles && npc.type == NPCID.EaterofWorldsHead) { Rectangle rectangle = new Rectangle((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height); - int noFlyZone = death ? (800 - (phase5 ? 400 : 200)) : 900; - noFlyZone -= (int)(enrageScale * 200f); - if (noFlyZone < 100) - noFlyZone = 100; + int noFlyZone = death ? (phase5 ? 400 : 600) : 900; bool freeMoveAnyway = true; for (int k = 0; k < Main.maxPlayers; k++) @@ -380,32 +344,32 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Velocity and acceleration - float velocityScale = (death ? 4.8f : 2.4f) * enrageScale; + float velocityScale = death ? 4.8f : 2.4f; float velocityBoost = velocityScale * (1f - lifeRatio); - float accelerationScale = (death ? 0.06f : 0.03f) * enrageScale; + float accelerationScale = death ? 0.06f : 0.03f; float accelerationBoost = accelerationScale * (1f - lifeRatio); float segmentVelocity = 12f + velocityBoost; float segmentAcceleration = 0.15f + accelerationBoost; if (phase6) { - segmentVelocity += 2.4f * (enrageScale + 1f); - segmentAcceleration += 0.12f * (enrageScale + 1f); + segmentVelocity += 2.4f; + segmentAcceleration += 0.12f; } else if (phase5) { - segmentVelocity += 1.8f * (enrageScale + 1f); - segmentAcceleration += 0.09f * (enrageScale + 1f); + segmentVelocity += 1.8f; + segmentAcceleration += 0.09f; } else if (phase4) { - segmentVelocity += 1.2f * (enrageScale + 1f); - segmentAcceleration += 0.06f * (enrageScale + 1f); + segmentVelocity += 1.2f; + segmentAcceleration += 0.06f; } else if (phase3) { - segmentVelocity += 0.6f * (enrageScale + 1f); - segmentAcceleration += 0.03f * (enrageScale + 1f); + segmentVelocity += 0.6f; + segmentAcceleration += 0.03f; } if (death) @@ -414,7 +378,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses segmentAcceleration += (npc.justHit ? 0.16f : 0.04f); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { segmentVelocity += 4f; segmentAcceleration += 0.05f; @@ -451,7 +415,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int npcWidth = npc.width; npcWidth = (int)(npcWidth * npc.scale); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npcWidth = 62; targetDistance = (targetDistance - npcWidth) / targetDistance; @@ -542,13 +506,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses targetPosY *= timeToReachTarget; // Despawn - bool shouldDespawn = npc.type == NPCID.EaterofWorldsHead && Main.player[npc.target].dead; - if (shouldDespawn && !bossRush) + bool shouldDespawn = npc.type == NPCID.EaterofWorldsHead && (Main.player[npc.target].dead || !Main.player[npc.target].ZoneCorrupt || !Main.player[npc.target].ZoneCrimson) && !BossRushEvent.BossRushActive; + if (shouldDespawn) { bool everyoneDead = true; - for (int i = 0; i < Main.maxPlayers; i++) + foreach (Player p in Main.ActivePlayers) { - if (Main.player[i].active && !Main.player[i].dead) + if (!p.dead && p.ZoneCorrupt) { everyoneDead = false; break; @@ -569,13 +533,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.life = 0; if (Main.dedServ) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segmentAmt, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, segmentAmt); segmentAmt = attachedSegments; } if (Main.dedServ) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI, 0f, 0f, 0f, 0, 0, 0); + NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, npc.whoAmI); } targetPosX = 0f; targetPosY = segmentVelocity; @@ -654,7 +618,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float pushDistanceLowerLimit = 14f - numHeads; float pushDistanceUpperLimit = 140f - numHeads * 10f; float pushDistance = MathHelper.Lerp(pushDistanceLowerLimit, pushDistanceUpperLimit, 1f - lifeRatio) * npc.scale; - float pushVelocity = 0.25f + enrageScale * 0.125f; + float pushVelocity = 0.25f; for (int i = 0; i < Main.maxNPCs; i++) { if (Main.npc[i].active) @@ -706,38 +670,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (calamityGlobalNPC.newAI[1] < DRIncreaseTime && ((npc.position - npc.oldPosition).Length() > 2f || calamityGlobalNPC.newAI[1] > 0f)) calamityGlobalNPC.newAI[1] += 1f; - // Calculate contact damage based on velocity - // This worm requires more velocity to deal damage with the body because it doesn't have spikes or metal bits or etc. - float minimalContactDamageHeadVelocity = segmentVelocity * 0.25f; - float minimalDamageHeadVelocity = segmentVelocity * 0.5f; - float minimalContactDamageBodyVelocity = segmentVelocity * 0.4f; - float minimalDamageBodyVelocity = segmentVelocity * 0.8f; - if (npc.type == NPCID.EaterofWorldsHead) - { - if (npc.velocity.Length() <= minimalContactDamageHeadVelocity) - { - npc.damage = (int)Math.Round(npc.defDamage * 0.5); - } - else - { - float velocityDamageScalar = MathHelper.Clamp((npc.velocity.Length() - minimalContactDamageHeadVelocity) / minimalDamageHeadVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp((float)Math.Round(npc.defDamage * 0.5), npc.defDamage, velocityDamageScalar); - } - } - else - { - float bodyAndTailVelocity = (npc.position - npc.oldPosition).Length(); - if (bodyAndTailVelocity <= minimalContactDamageBodyVelocity) - { - npc.damage = 0; - } - else - { - float velocityDamageScalar = MathHelper.Clamp((bodyAndTailVelocity - minimalContactDamageBodyVelocity) / minimalDamageBodyVelocity, 0f, 1f); - npc.damage = (int)MathHelper.Lerp(0f, npc.defDamage, velocityDamageScalar); - } - } - if (npc.type == NPCID.EaterofWorldsHead || (npc.type != NPCID.EaterofWorldsHead && Main.npc[(int)npc.ai[1]].alpha >= 85)) { if (npc.alpha > 0 && npc.life > 0) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs index 96ddd8c381..b4672ca23f 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EmpressofLightAI.cs @@ -12,13 +12,33 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class EmpressofLightAI { + // NOTE: This is applied to all difficulties, in CalamityPlayerHitHurt + public static float EverlastingRainbowTrailDamageMult = 0.75f; + + // Vanilla values + public static float DashDamageMult = 1.5f; // 165 + public static int PrismaticBoltDamage = 30; // 120 + public static int EverlastingRainbowDamage = 30; // 120 + public static int EtherealLanceDamage = 30; // 120 + public static int SunDanceDamage = 35; // 140 + public static int Phase2PrismaticBoltDamage = 35; // 140 + public static int Phase2EverlastingRainbowDamage = 35; // 140 + public static int Phase2EtherealLanceDamage = 35; // 140 + public static int Phase2SunDanceDamage = 40; // 160 + + // Vanilla sets her defDamage to 184 (80 * 2 * 1.15) in Expert Mode + // However, some weird contraption in her Expert AI that knocks her base contact damage to the intended value of 110 + // This hasn't been found anywhere so our solution for now is avoid using defDamage altogether + public static int ContactDamageCorrection = Main.masterMode ? 248 : 110; + + public static int CalculateDamageForEnrage(this int damage) => NPC.ShouldEmpressBeEnraged() ? damage * 2 : damage; + public static bool BuffedEmpressofLightAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); // Difficulty bools. - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Rotation npc.rotation = npc.velocity.X * 0.005f; @@ -34,6 +54,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool phase2 = npc.AI_120_HallowBoss_IsInPhase2(); bool phase3 = lifeRatio <= phase3LifeRatio; + int boltDamage = (phase2 ? Phase2PrismaticBoltDamage : PrismaticBoltDamage).CalculateDamageForEnrage(); + int rainbowDamage = (phase2 ? Phase2EverlastingRainbowDamage : EverlastingRainbowDamage).CalculateDamageForEnrage(); + int lanceDamage = (phase2 ? Phase2EtherealLanceDamage : EtherealLanceDamage).CalculateDamageForEnrage(); + int sunDanceDamage = (phase2 ? Phase2SunDanceDamage : SunDanceDamage).CalculateDamageForEnrage(); + bool shouldBeInPhase2ButIsStillInPhase1 = lifeRatio <= phase2LifeRatio && !phase2; if (shouldBeInPhase2ButIsStillInPhase1) calamityGlobalNPC.DR = 0.99f; @@ -44,9 +69,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.life == npc.lifeMax && dayTimeEnrage && !npc.AI_120_HallowBoss_IsGenuinelyEnraged()) npc.ai[3] += 2f; - npc.Calamity().CurrentlyEnraged = !bossRush && dayTimeEnrage; - - int projectileDamageMultiplier = dayTimeEnrage ? 2 : 1; + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && dayTimeEnrage; Vector2 rainbowStreakDistance = new Vector2(-250f, -350f); Vector2 everlastingRainbowDistance = new Vector2(0f, -450f); @@ -73,7 +96,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool visible = true; bool takeDamage = true; float lessTimeSpentPerPhaseMultiplier = phase2 ? (death ? 0.375f : 0.5f) : (death ? 0.75f : 1f); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) lessTimeSpentPerPhaseMultiplier *= 0.2f; float extraPhaseTime; @@ -151,7 +174,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; float idleTimer = phase2 ? (death ? 10f : 15f) : (death ? 20f : 30f); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) idleTimer *= 0.5f; if (idleTimer < 10f) idleTimer = 10f; @@ -354,7 +377,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); NPCAimedTarget targetData5 = npc.GetTargetData(); bool despawnFlag = false; - if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !bossRush) + if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !BossRushEvent.BossRushActive) { if (!Main.dayTime) despawnFlag = true; @@ -406,7 +429,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((int)npc.ai[1] % streakSpawnFrequency == 0 && npc.ai[1] < 60f) { int projectileType = ProjectileID.HallowBossRainbowStreak; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = boltDamage; float ai3 = npc.ai[1] / 60f; Vector2 rainbowStreakVelocity = new Vector2(0f, death ? -10f : -8f).RotatedBy(MathHelper.PiOver2 * Main.rand.NextFloatDirection()); @@ -540,7 +563,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int projectileType = ProjectileID.FairyQueenLance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = lanceDamage; Vector2 v3 = targetHoverPos - spawnLocation; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -620,9 +643,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (float i = 0f; i < 1f; i += 1f / totalProjectiles) { int projectileType = ProjectileID.HallowBossLastingRainbow; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = rainbowDamage; int projectileType2 = ProjectileID.HallowBossRainbowStreak; - int projectileDamage2 = npc.GetProjectileDamage(projectileType2) * projectileDamageMultiplier; + int projectileDamage2 = boltDamage; float projRotationMultiplier = i; Vector2 spinningpoint = Vector2.UnitY.RotatedBy(MathHelper.PiOver2 + MathHelper.TwoPi * projRotationMultiplier + projRotation); @@ -676,7 +699,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.damage = 0; // Increase durability. - calamityGlobalNPC.DR = shouldBeInPhase2ButIsStillInPhase1 ? 0.99f : (bossRush ? 0.99f : 0.575f); + calamityGlobalNPC.DR = shouldBeInPhase2ButIsStillInPhase1 ? 0.99f : 0.575f; int totalSunDances = phase2 ? 2 : 3; float sunDanceGateValue = dayTimeEnrage ? 35f : death ? 40f : 50f; @@ -693,7 +716,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] % sunDanceGateValue == 0f && npc.ai[1] < totalSunDancePhaseTime) { int projectileType = ProjectileID.FairyQueenSunDance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = sunDanceDamage; int sunDanceExtension = (int)(npc.ai[1] / sunDanceGateValue); int targetFloatDirection = (targetData2.Center.X > npc.Center.X) ? 1 : 0; @@ -813,7 +836,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int projectileType = ProjectileID.FairyQueenLance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = lanceDamage; for (float i = 0f; i <= 1f; i += 1f / totalProjectiles) { @@ -895,7 +918,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((npc.ai[1] - 1f) % rainbowStreakGateValue == 0f) { int projectileType = ProjectileID.HallowBossRainbowStreak; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = boltDamage; float ai3 = (npc.ai[1] - chargeGateValue - 1f) / chargeDuration; Vector2 rainbowStreakVelocity = new Vector2(0f, death ? -5f : -4f).RotatedBy(MathHelper.PiOver2 * Main.rand.NextFloatDirection()); @@ -936,7 +959,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == chargeGateValue + chargeDuration) npc.velocity *= 0.45f; - npc.damage = (int)Math.Round(npc.defDamage * (dayTimeEnrage ? 3D : 1.5)); + // Unlike other temporary damage boosts from bosses, vanilla Empress AI increases damage as defDamage while dashing, so we don't need to account for it + npc.damage = (int)Math.Round(ContactDamageCorrection.CalculateDamageForEnrage() * DashDamageMult); } else { @@ -1065,7 +1089,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } int projectileType = ProjectileID.FairyQueenLance; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = lanceDamage; Vector2 v = straightLanceSpawnPredict - straightLanceSpawnDirection; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -1142,7 +1166,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if ((int)npc.ai[1] % stationaryStreakSpawnFrequency == 0 && shouldSpawnStreaks) { int projectileType = ProjectileID.HallowBossRainbowStreak; - int projectileDamage = npc.GetProjectileDamage(projectileType) * projectileDamageMultiplier; + int projectileDamage = boltDamage; Vector2 vector = new Vector2(0f, (death ? -24f : -22f) - (phase3 ? ((death ? 6f : 4f) * streakHomeTime) : 0f)).RotatedBy(MathHelper.TwoPi * streakHomeTime); if (Main.netMode != NetmodeID.MultiplayerClient) @@ -1211,7 +1235,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shouldDespawn = false; if (!trueDespawnFlag) { - if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !bossRush) + if (npc.AI_120_HallowBoss_IsGenuinelyEnraged() && !BossRushEvent.BossRushActive) { if (!Main.dayTime) shouldDespawn = true; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs index 81121e90df..d948eacfd0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/EyeOfCthulhuAI.cs @@ -14,6 +14,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { private const float ProjectileOffset = 50f; + // Vanilla values + public static float Phase2ContactDamageMult = 1.2f; // 36 + public static float Phase3ContactDamageMult = 1.333f; // 40 + public static int BloodShotDamage = 8; // 32 + public static bool BuffedEyeofCthulhuAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -23,8 +28,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Phases float phase2LifeRatio = death ? 0.75f : 0.6f; @@ -42,14 +46,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Servant and projectile velocity, the projectile velocity is multiplied by 2 float servantAndProjectileVelocity = death ? 10f : 6f; - - float enrageScale = bossRush ? 2.25f : death ? 0.5f : 0f; - if (Main.IsItDay()) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 2f; - } - npc.reflectsProjectiles = false; // Get a target @@ -118,33 +114,23 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool charge = Vector2.Distance(Main.player[npc.target].Center, npc.Center) >= 320f; // 20 tile distance - if (dead) + if ((dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) npc.timeLeft = 10; + return false; } else if (npc.ai[0] == 0f) { if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; + float hoverSpeed = death ? 9.5f + 7f * (1f - lifeRatio) : 7f; + float hoverAcceleration = death ? 0.2f + 0.15f * (1f - lifeRatio) : 0.15f; - float hoverSpeed = 7f; - float hoverAcceleration = 0.15f; - hoverSpeed += 5f * enrageScale; - hoverAcceleration += 0.1f * enrageScale; - - if (death) - { - hoverSpeed += 7f * (1f - lifeRatio); - hoverAcceleration += 0.15f * (1f - lifeRatio); - } - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { hoverSpeed += 3f; hoverAcceleration += 0.08f; @@ -173,7 +159,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; float servantSpawnGateValue = death ? 10f : 40f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) servantSpawnGateValue *= 0.8f; if (npc.ai[3] >= servantSpawnGateValue && shootProjectile) @@ -192,7 +178,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (spawnServant) { - int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu, 0, 0f, 0f, enrageScale); + int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu); Main.npc[eye].velocity = servantSpawnVelocity; if (Main.dedServ && eye < Main.maxNPCs) @@ -201,8 +187,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { int projType = ProjectileID.BloodNautilusShot; - int projDamage = npc.GetProjectileDamage(projType); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, projDamage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; } } @@ -217,16 +202,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - npc.rotation = eyeRotation; float additionalVelocityPerCharge = 2f; - float chargeSpeed = 8f + npc.ai[3] * additionalVelocityPerCharge; - chargeSpeed += 5f * enrageScale; + float chargeSpeed = (death ? 10.5f : 8f) + npc.ai[3] * additionalVelocityPerCharge; if (death) chargeSpeed += 10f * (1f - lifeRatio); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed += 4f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -236,11 +217,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = npc.defDamage; - int chargeDelay = death ? (75 - (int)Math.Round(30f * (1f - lifeRatio))) : 95; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeDelay -= 30; float slowDownGateValue = chargeDelay * (death ? 0.85f : 0.65f); @@ -248,15 +226,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; if (npc.ai[2] >= slowDownGateValue) { - // Avoid cheap bullshit - npc.damage = 0; - float decelerationScalar = death ? ((lifeRatio - phase2LifeRatio) / (1f - phase2LifeRatio)) : 1f; if (decelerationScalar < 0f) decelerationScalar = 0f; npc.velocity *= (MathHelper.Lerp(death ? 0.76f : 0.92f, death ? 0.88f : 0.96f, decelerationScalar)); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.velocity *= 0.99f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) @@ -276,9 +251,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float numCharges = death ? 4f : 3f; if (npc.ai[3] >= numCharges) { - // Avoid cheap bullshit - npc.damage = 0; - npc.ai[1] = 0f; npc.ai[3] = 0f; } @@ -289,9 +261,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase2) { - // Avoid cheap bullshit - npc.damage = 0; - npc.ai[0] = 1f; npc.ai[1] = 0f; npc.ai[2] = 0f; @@ -304,10 +273,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.reflectsProjectiles = true; if (npc.ai[0] == 1f) @@ -326,28 +292,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation += npc.ai[2]; float phaseChangeRate = death ? 2f : 1f; - float servantSpawnGateValue = Main.getGoodWorld ? 4f : 20f; + float servantSpawnGateValue = CalamityWorld.LegendaryMode ? 4f : 20f; npc.ai[1] += phaseChangeRate; if (npc.ai[1] % servantSpawnGateValue == 0f) { float servantVelocity = death ? 11.3f : 5.65f; Vector2 servantSpawnVelocity = Main.rand.NextVector2CircularEdge(servantVelocity, servantVelocity); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) servantSpawnVelocity *= 3f; Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset; if (Main.netMode != NetmodeID.MultiplayerClient) { - int spawnType = NPCID.ServantofCthulhu; - if (death) - { - int maxBloodServants = 2; - bool spawnBloodServant = NPC.CountNPCS(ModContent.NPCType()) < maxBloodServants; - if (spawnBloodServant) - spawnType = ModContent.NPCType(); - } - - int servantSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, spawnType, 0, 0f, 0f, enrageScale); + int servantSpawn = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu); Main.npc[servantSpawn].velocity.X = servantSpawnVelocity.X; Main.npc[servantSpawn].velocity.Y = servantSpawnVelocity.Y; @@ -416,27 +373,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else { npc.defense = 0; - int setDamage = (int)Math.Round(npc.defDamage * (phase3 ? 1.4 : 1.2)); - int reducedSetDamage = (int)Math.Round(setDamage * 0.5); + npc.damage = (int)Math.Round(npc.defDamage * (phase3 ? Phase3ContactDamageMult : Phase2ContactDamageMult)); if (npc.ai[1] == 0f & phase3) npc.ai[1] = 5f; if (npc.ai[1] == 0f) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - - float hoverSpeed = 5.5f + 3f * (phase2LifeRatio - lifeRatio); - float hoverAcceleration = 0.06f + 0.02f * (phase2LifeRatio - lifeRatio); - hoverSpeed += 4f * enrageScale; - hoverAcceleration += 0.04f * enrageScale; - - if (death) - { - hoverSpeed += 5.5f * (phase2LifeRatio - lifeRatio); - hoverAcceleration += 0.06f * (phase2LifeRatio - lifeRatio); - } + float hoverSpeed = (death ? 7.5f : 5.5f) + (death ? 8.5f : 3f) * (phase2LifeRatio - lifeRatio); + float hoverAcceleration = (death ? 0.08f : 0.06f) + (death ? 0.08f : 0.02f) * (phase2LifeRatio - lifeRatio); Vector2 hoverDestination = Main.player[npc.target].Center - Vector2.UnitY * 400f; float distanceFromHoverDestination = npc.Distance(hoverDestination); @@ -457,7 +402,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { hoverSpeed += 1f; hoverAcceleration += 0.1f; @@ -480,14 +425,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.BloodNautilusShot; - int damage = npc.GetProjectileDamage(type); int numProj = 3; int spread = 10; float rotation = MathHelper.ToRadians(spread); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, damage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * ProjectileOffset, perturbedSpeed, type, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; } } @@ -505,22 +449,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = setDamage; - SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); npc.rotation = eyeRotation; float additionalVelocityPerCharge = 3f; - float chargeSpeed = 10f + (3.5f * (phase2LifeRatio - lifeRatio)) + npc.ai[3] * additionalVelocityPerCharge; - chargeSpeed += 4f * enrageScale; - if (death) - chargeSpeed += 6.5f * (phase2LifeRatio - lifeRatio); + float chargeSpeed = (death ? 12f : 10f) + ((death ? 10f : 3.5f) * (phase2LifeRatio - lifeRatio)) + npc.ai[3] * additionalVelocityPerCharge; if (npc.ai[3] == 1f) chargeSpeed *= 1.15f; if (npc.ai[3] == 2f) chargeSpeed *= 1.3f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed *= 1.2f; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; @@ -530,9 +468,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = setDamage; - int phase2ChargeDelay = death ? (70 - (int)Math.Round(25f * (phase2LifeRatio - lifeRatio))) : 85; float slowDownGateValue = phase2ChargeDelay * (death ? 0.9f : 0.75f); @@ -540,9 +475,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; if (npc.ai[2] >= slowDownGateValue) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - float decelerationScalar = death ? ((lifeRatio - phase3LifeRatio) / (phase2LifeRatio - phase3LifeRatio)) : 1f; if (decelerationScalar < 0f) decelerationScalar = 0f; @@ -565,9 +497,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float numCharges = death ? 4f : 3f; if (npc.ai[3] >= numCharges) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.ai[1] = 0f; npc.ai[3] = 0f; npc.ForceNetUpdate(false); @@ -581,9 +510,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if ((npc.ai[3] == 4f & phase3) && npc.Center.Y > Main.player[npc.target].Center.Y) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.ai[1] = 0f; npc.ai[2] = 0f; npc.ai[3] = 0f; @@ -591,12 +517,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (Main.netMode != NetmodeID.MultiplayerClient) { - // Set damage - npc.damage = setDamage; - float speedBoost = death ? 10f * (phase3LifeRatio - lifeRatio) : 7f * (phase3LifeRatio - lifeRatio); - float finalChargeSpeed = 18f + speedBoost; - finalChargeSpeed += 10f * enrageScale; + float finalChargeSpeed = (death ? 23f : 18f) + speedBoost; Vector2 eyeChargeDirection = npc.Center; float targetX = Main.player[npc.target].Center.X - eyeChargeDirection.X; @@ -662,9 +584,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 4f) { - // Set damage - npc.damage = setDamage; - if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.ForceRoarPitched, npc.Center); @@ -676,9 +595,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] >= lineUpDistControl) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.velocity *= 0.95f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -699,9 +615,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxCharges = death ? (finalPhaseDeath ? 0f : penultimatePhaseDeath ? 1f : 2f) : finalPhaseRev ? 2f : 3f; if (npc.ai[3] >= maxCharges) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.ai[1] = 0f; npc.ai[3] = 0f; } @@ -712,14 +625,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 5f) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - float offset = death ? 540f : 600f; float speedBoost = death ? 15f * (phase3LifeRatio - lifeRatio) : 5f * (phase3LifeRatio - lifeRatio); float accelerationBoost = death ? 0.425f * (phase3LifeRatio - lifeRatio) : 0.125f * (phase3LifeRatio - lifeRatio); - float hoverSpeed = 8f + speedBoost; - float hoverAcceleration = 0.25f + accelerationBoost; + float hoverSpeed = (death ? 10f : 8f) + speedBoost; + float hoverAcceleration = (death ? 0.3125f : 0.25f) + accelerationBoost; bool horizontalCharge = calamityGlobalNPC.newAI[0] == 1f || calamityGlobalNPC.newAI[0] == 3f; float timeGateValue = horizontalCharge ? (110f - (death ? 60f * (phase3LifeRatio - lifeRatio) : 0f)) : (95f - (death ? 55f * (phase3LifeRatio - lifeRatio) : 0f)); @@ -730,9 +640,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses hoverAcceleration += velocityScalar * 0.0025f; } - hoverSpeed += enrageScale * 4f; - hoverAcceleration += enrageScale * 0.125f; - Vector2 eyeLineUpChargeDirection = npc.Center; float lineUpChargeTargetX = Main.player[npc.target].Center.X - eyeLineUpChargeDirection.X; float lineUpChargeTargetY = Main.player[npc.target].Center.Y + offset - eyeLineUpChargeDirection.Y; @@ -759,39 +666,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 servantSpawnVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * servantAndProjectileVelocity; Vector2 servantSpawnCenter = npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset; - int spawnType = NPCID.ServantofCthulhu; - bool spawnServant = false; - float enrageScaleToPass = enrageScale; - if (death) - { - int maxBloodServants = 2; - bool spawnBloodServant = NPC.CountNPCS(ModContent.NPCType()) < maxBloodServants; - if (spawnBloodServant) - { - spawnType = ModContent.NPCType(); - spawnServant = true; - enrageScaleToPass += 0.5f; - } - else - { - int maxServants = death ? 1 : 2; - spawnServant = (penultimatePhaseDeath || finalPhaseRev) ? false : NPC.CountNPCS(NPCID.ServantofCthulhu) < maxServants; - } - } - else - { - int maxServants = death ? (finalPhaseDeath ? 1 : penultimatePhaseDeath ? 2 : 3) : (finalPhaseRev ? 2 : 4); - spawnServant = NPC.CountNPCS(NPCID.ServantofCthulhu) < maxServants; - } + int maxServants = death ? (finalPhaseDeath ? 1 : penultimatePhaseDeath ? 2 : 3) : (finalPhaseRev ? 2 : 4); + bool spawnServant = NPC.CountNPCS(NPCID.ServantofCthulhu) < maxServants; if (spawnServant) + { SoundEngine.PlaySound(SoundID.NPCDeath13, servantSpawnCenter); + for (int m = 0; m < 10; m++) + Dust.NewDust(servantSpawnCenter, 20, 20, DustID.Blood, servantSpawnVelocity.X * 0.4f, servantSpawnVelocity.Y * 0.4f, 0, default, 1f); + } + if (Main.netMode != NetmodeID.MultiplayerClient) { if (spawnServant) { - int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, spawnType, 0, 0f, 0f, enrageScaleToPass); + int eye = NPC.NewNPC(npc.GetSource_FromAI(), (int)servantSpawnCenter.X, (int)servantSpawnCenter.Y, NPCID.ServantofCthulhu); Main.npc[eye].velocity.X = servantSpawnVelocity.X; Main.npc[eye].velocity.Y = servantSpawnVelocity.Y; @@ -801,8 +691,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (!CalamityWorld.LegendaryMode) { int projType = ProjectileID.BloodNautilusShot; - int projDamage = npc.GetProjectileDamage(projType); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, projDamage, 0f, Main.myPlayer); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + servantSpawnVelocity.SafeNormalize(Vector2.UnitY) * ProjectileOffset, servantSpawnVelocity * 2f, projType, BloodShotDamage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = 600; } @@ -821,12 +710,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } } - - if (spawnServant) - { - for (int m = 0; m < 10; m++) - Dust.NewDust(servantSpawnCenter, 20, 20, DustID.Blood, servantSpawnVelocity.X * 0.4f, servantSpawnVelocity.Y * 0.4f, 0, default, 1f); - } } float requiredDistanceForHorizontalCharge = 160f; @@ -871,14 +754,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 6f) { - // Set damage - npc.damage = setDamage; - if (Main.netMode != NetmodeID.MultiplayerClient) { float speedBoost = death ? 15f * (phase3LifeRatio - lifeRatio) : 5f * (phase3LifeRatio - lifeRatio); - float chargeSpeed = 18f + speedBoost; - chargeSpeed += 10f * enrageScale; + float chargeSpeed = (death ? 23f : 18f) + speedBoost; npc.velocity = npc.SafeDirectionTo(Main.player[npc.target].Center) * chargeSpeed; npc.ai[1] = 7f; @@ -888,9 +767,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 7f) { - // Set damage - npc.damage = setDamage; - if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); @@ -902,9 +778,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] >= lineUpDistControl) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; - npc.velocity *= 0.95f; if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; @@ -917,8 +790,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lineUpDistNetUpdate = lineUpDistControl + 13f; if (npc.ai[2] >= lineUpDistNetUpdate) { - // Deal less damage overall while not charging - npc.damage = reducedSetDamage; npc.ForceNetUpdate(false); npc.ai[2] = 0f; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs index b7bc32aaa0..5d04005446 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/GolemAI.cs @@ -11,6 +11,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class GolemAI { + // Rev+ exclusive + public static int FireballDamage = 24; // 96 (modified to be always at maximum Expert damage and does not scale) + public static int LaserDamage = 29; // 116 (modified to be always at maximum Expert damage and does not scale) + public static int InfernoBoltDamage = 35; // 140 + public static bool BuffedGolemAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -22,8 +27,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float lifeRatio = npc.life / (float)npc.lifeMax; // Phases - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; bool phase2 = lifeRatio < 0.75f; bool phase3 = lifeRatio < 0.5f; bool phase4 = lifeRatio < 0.25f; @@ -32,13 +36,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[0] = 1f; - int numFists = death ? 2 : 1; - for (int i = 0; i < numFists; i++) - { - float fistPunchTimeOffset = i * 30f; - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft, 0, 0f, fistPunchTimeOffset); - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight, 0, 0f, fistPunchTimeOffset); - } + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 84, (int)npc.Center.Y - 9, NPCID.GolemFistLeft, 0); + NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X + 78, (int)npc.Center.Y - 9, NPCID.GolemFistRight, 0); NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X - 3, (int)npc.Center.Y - 57, NPCID.GolemHead); } @@ -51,8 +50,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Enrage if the target isn't inside the temple - // Turbo enrage if target isn't inside the temple and it's Boss Rush or For the Worthy - bool enrage = true; + // Turbo enrage if target isn't inside the temple and it's For the Worthy + bool enrage = !BossRushEvent.BossRushActive; bool turboEnrage = false; if (Main.player[npc.target].Center.Y > Main.worldSurface * 16.0) { @@ -63,15 +62,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrage = true; - npc.Calamity().CurrentlyEnraged = !bossRush && (enrage || turboEnrage); + npc.Calamity().CurrentlyEnraged = !BossRushEvent.BossRushActive && (enrage || turboEnrage); bool reduceFallSpeed = npc.velocity.Y > 0f && Collision.SolidCollision(npc.position + Vector2.UnitY * 1.1f * npc.velocity.Y, npc.width, npc.height); @@ -98,7 +97,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int despawnDistance = turboEnrage ? 7500 : enrage ? 6000 : 4500; // Deactivate torches - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.velocity.Y > 0f) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.velocity.Y > 0f) { for (int j = (int)(npc.position.X / 16f); (float)j < (npc.position.X + (float)npc.width) / 16f; j++) { @@ -115,7 +114,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Spawn arm dust - if (!Main.getGoodWorld) + if (!CalamityWorld.LegendaryMode) { if (!leftFistAlive) { @@ -190,7 +189,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (enrage) divisor = 5f; - if (turboEnrage && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) divisor = 2f; Vector2 projectileFirePos = new Vector2(npc.Center.X, npc.Center.Y - 60f); @@ -207,12 +206,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 laserVelocity = new Vector2(laserTargetXDist, laserTargetYDist); int type = ProjectileID.EyeBeam; - int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { - int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, type, damage, 0f, Main.myPlayer); + int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, type, LaserDamage, 0f, Main.myPlayer); Main.projectile[bodyLaser].timeLeft = enrage ? 720 : 360; - if (turboEnrage && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[bodyLaser].extraUpdates += 1; } } @@ -231,7 +229,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] > 0f) { npc.ai[1] += (death ? 2f : 1f); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.ai[1] += 100f; if (enrage || death) @@ -518,29 +516,29 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Main.dust[fiery2].velocity.X *= 2f; } - float projectileVelocity = death ? 11.25f : 7.5f; + float projectileVelocity = death ? 7.5f : 4.75f; if (enrage) projectileVelocity *= 1.5f; if (turboEnrage) projectileVelocity *= 1.25f; int type = ProjectileID.Fireball; - int damage = npc.GetProjectileDamage(type); + int damage = FireballDamage; Vector2 destination = new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center; destination.Normalize(); destination *= projectileVelocity; int totalFireballsPerSide = 3; - int totalIterations = (turboEnrage && Main.getGoodWorld) ? 11 : death ? 25 : 35; + int totalIterations = (turboEnrage && CalamityWorld.LegendaryMode) ? 11 : death ? 40 : 60; float rotation = MathHelper.ToRadians(90); for (int i = 0; i < totalIterations; i++) { - // Spawn projectiles 0, 1, 2, 22, 23, and 24 (in non-master) + // Spawn projectiles 0, 1, 2, 22, 23, and 24 if (i < totalFireballsPerSide || i >= totalIterations - totalFireballsPerSide) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(totalIterations - 1))); int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.UnitY * (npc.height / 2 * 0.8f) * npc.scale + Vector2.Normalize(perturbedSpeed) * (npc.width / 3) * npc.scale, perturbedSpeed, type, damage, 0f, Main.myPlayer); Main.projectile[proj].timeLeft = enrage ? 480 : 240; - if (turboEnrage && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[proj].extraUpdates += 1; } } @@ -567,7 +565,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 fireFrom = new Vector2(npc.Center.X, npc.Center.Y - 60f); int projectileAmt = 2; int type = ProjectileID.EyeBeam; - int damage = npc.GetProjectileDamage(type); + int damage = LaserDamage; Vector2 laserVelocity = Vector2.UnitY * npc.velocity.Y * (turboEnrage ? 2f : enrage ? 1f : 0.5f); for (int i = 0; i < projectileAmt; i++) { @@ -578,7 +576,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 projVelocity = laserVelocity.RotatedBy(radians * j + MathHelper.PiOver2); int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer); Main.projectile[bodyLaser].timeLeft = enrage ? 720 : 360; - if (turboEnrage && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[bodyLaser].extraUpdates += 1; } } @@ -643,8 +641,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses void CustomGravity(bool isSlamming) { - float gravity = turboEnrage ? (Main.getGoodWorld ? 1.15f : 0.85f) : enrage ? 0.75f : (!leftFistAlive && !rightFistAlive) ? 0.45f : 0.3f; - float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? (Main.getGoodWorld ? 40f : 30f) : enrage ? 25f : (!leftFistAlive && !rightFistAlive) ? 15f : 10f; + float gravity = turboEnrage ? (CalamityWorld.LegendaryMode ? 1.15f : 0.85f) : enrage ? 0.75f : (!leftFistAlive && !rightFistAlive) ? 0.45f : 0.3f; + float maxFallSpeed = reduceFallSpeed ? 12f : turboEnrage ? (CalamityWorld.LegendaryMode ? 40f : 30f) : enrage ? 25f : (!leftFistAlive && !rightFistAlive) ? 15f : 10f; if (isSlamming && !reduceFallSpeed) { gravity *= 4f; @@ -699,14 +697,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses NPC golem = Main.npc[NPC.golemBoss]; Player player = Main.player[npc.target]; - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Enrage if the target isn't inside the temple - // Turbo enrage if target isn't inside the temple and it's Boss Rush or For the Worthy - bool enrage = true; + // Turbo enrage if target isn't inside the temple and it's For the Worthy + bool enrage = !BossRushEvent.BossRushActive; bool turboEnrage = false; - if (player.Center.Y > Main.worldSurface * 16.0) + if (player.Center.Y > Main.worldSurface * 16.0 && !BossRushEvent.BossRushActive) { int targetTilePosX = (int)player.Center.X / 16; int targetTilePosY = (int)player.Center.Y / 16; @@ -715,15 +712,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrage = true; - float aggression = turboEnrage ? (Main.getGoodWorld ? 4f : 3f) : enrage ? 2f : death ? 1.7f : 1f; + float aggression = turboEnrage ? (CalamityWorld.LegendaryMode ? 4f : 3f) : enrage ? 2f : death ? 1.7f : 1f; Vector2 fistCenter = golem.Center + golem.velocity + new Vector2(0f, -9f * npc.scale); fistCenter.X += (float)((npc.type == NPCID.GolemFistLeft) ? -84 : 78) * npc.scale; @@ -805,7 +802,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Dust dust = Dust.NewDustPerfect(npc.Center + largeRandDustRecoil + largeRandDustRadius + smallRandDustRadius, 228, largeRandDustRecoil); dust.fadeIn = 1.5f; dust.scale = 0.5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) dust.noLight = true; dust.noGravity = true; @@ -846,7 +843,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) { for (int j = (int)(npc.position.X / 16f) - 1; (float)j < (npc.position.X + (float)npc.width) / 16f + 1f; j++) { @@ -891,54 +888,20 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } float maxPunchDistance = 700f; - int explosionLimit = 2; if (death) { if (npc.life < npc.lifeMax / 2) - { maxPunchDistance += MathHelper.Lerp(-175f, 75f, Main.rand.NextFloat()); - explosionLimit++; - } if (npc.life < npc.lifeMax / 4) - { maxPunchDistance += MathHelper.Lerp(-175f, 75f, Main.rand.NextFloat()); - explosionLimit++; - } } if (distanceFromRestPosition > maxPunchDistance || npc.collideX || npc.collideY) { // Avoid cheap bullshit npc.damage = 0; - npc.noTileCollide = true; npc.ai[0] = 0f; - - if (death) - { - int type = ProjectileID.InfernoHostileBlast; - bool shootExplosion = true; - int numExplosions = 0; - for (int i = 0; i < Main.maxProjectiles; i++) - { - if (Main.projectile[i].active && Main.projectile[i].type == type) - { - numExplosions++; - if (numExplosions >= explosionLimit) - { - shootExplosion = false; - break; - } - } - } - - if (shootExplosion) - { - int damage = npc.GetProjectileDamage(type); - if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 0f, 0f, 1f); - } - } } } else @@ -1019,8 +982,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); @@ -1031,9 +993,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; @@ -1042,12 +1004,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrage = true; // Alpha @@ -1086,7 +1048,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headFireballTargetY *= headFireballTargetDist; int type = ProjectileID.Fireball; - int damage = npc.GetProjectileDamage(type); + int damage = FireballDamage; int fireballAmount = death ? 2 : 1; Vector2 fireballVelocity = new Vector2(headFireballTargetX, headFireballTargetY); @@ -1138,7 +1100,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses fireballFistsDedTargetY *= fireballFistsDedTargetDist; int type = ProjectileID.Fireball; - int damage = npc.GetProjectileDamage(type); + int damage = FireballDamage; int fireballAmount = death ? 3 : 1; Vector2 fireballVelocity = new Vector2(fireballFistsDedTargetX, fireballFistsDedTargetY); @@ -1162,7 +1124,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; int projType = ProjectileID.EyeBeam; - int dmg = npc.GetProjectileDamage(projType); + int dmg = LaserDamage; if (npc.localAI[1] == 0f) { @@ -1188,7 +1150,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int bodyLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, projType, dmg, 0f, Main.myPlayer); Main.projectile[bodyLaser].timeLeft = enrage ? 600 : 300; - if (turboEnrage && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[bodyLaser].extraUpdates += 1; npc.netUpdate = true; @@ -1217,7 +1179,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { int extraLasers = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileFirePos + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, projType, dmg, 0f, Main.myPlayer); Main.projectile[extraLasers].timeLeft = enrage ? 600 : 300; - if (turboEnrage && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[extraLasers].extraUpdates += 1; npc.netUpdate = true; @@ -1268,16 +1230,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; @@ -1286,12 +1247,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (tile.WallType == WallID.LihzahrdBrickUnsafe) enrage = false; else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; } else - turboEnrage = bossRush || Main.getGoodWorld; + turboEnrage = CalamityWorld.LegendaryMode; - if (bossRush || Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) enrage = true; if (turboEnrage) @@ -1455,7 +1416,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses freeHeadTargetY *= freeHeadTargetDist; int projectileType = (phase3 || death) ? ProjectileID.InfernoHostileBolt : ProjectileID.Fireball; - int damage = npc.GetProjectileDamage(projectileType); + int damage = projectileType == ProjectileID.InfernoHostileBolt ? InfernoBoltDamage : FireballDamage; float ai0 = projectileType == ProjectileID.InfernoHostileBolt ? Main.player[npc.target].Center.X : 0f; float ai1 = projectileType == ProjectileID.InfernoHostileBolt ? Main.player[npc.target].Center.Y : 0f; float ai2 = projectileType == ProjectileID.InfernoHostileBolt ? 1f : 0f; @@ -1519,15 +1480,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 laserVelocity = new Vector2(freeHeadProjTargetX, freeHeadProjTargetY); int type = ProjectileID.EyeBeam; - int damage = npc.GetProjectileDamage(type); + int damage = LaserDamage; int freeHeadLaser = Projectile.NewProjectile(npc.GetSource_FromAI(), freeHeadProjSpawn + laserVelocity.SafeNormalize(Vector2.UnitY) * 40f, laserVelocity, type, damage, 0f, Main.myPlayer); Main.projectile[freeHeadLaser].timeLeft = enrage ? 600 : 300; - if (turboEnrage && Main.getGoodWorld) + if (turboEnrage && CalamityWorld.LegendaryMode) Main.projectile[freeHeadLaser].extraUpdates += 1; } } - if (!Main.getGoodWorld) + if (!CalamityWorld.LegendaryMode) { npc.position += npc.netOffset; int randDustOffset = Main.rand.Next(2) * 2 - 1; diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs index b3fa63a8d6..83b4b1c189 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/KingSlimeAI.cs @@ -15,6 +15,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static readonly SoundStyle SpawnCrystalSound = new SoundStyle("CalamityMod/Sounds/Custom/KingSlimeJewelSpawn"); + // Death exclusive + public static float SapphireJewelContactDamageMult = 1.5f; // 144 + public static bool BuffedKingSlimeAI(NPC npc, Mod mod) { // Percent life remaining @@ -27,14 +30,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool teleported = false; npc.aiAction = 0; float teleportScaleSpeed = 2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { teleportScaleSpeed -= 1f - lifeRatio; teleportScale *= teleportScaleSpeed; } - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Phases based on life percentage @@ -75,7 +77,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.defense = npc.defDefense; if (blueCrystalAlive) { - setDamage = (int)Math.Round(setDamage * 1.5); + setDamage = (int)Math.Round(setDamage * SapphireJewelContactDamageMult); npc.defense *= 2; } @@ -241,7 +243,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Faster fall if (npc.velocity.Y > 0f) { - float fallSpeedBonus = (bossRush ? 0.2f : death ? 0.15f : 0f) + (!redCrystalAlive ? 0.1f : 0f); + float fallSpeedBonus = (death ? 0.15f : 0f) + (!redCrystalAlive ? 0.1f : 0f); npc.velocity.Y += fallSpeedBonus; } @@ -317,7 +319,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp((60f - npc.ai[0]) / 60f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 60f) @@ -399,7 +401,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[0] += teleportRate; teleportScale = MathHelper.Clamp(npc.ai[0] / 30f, 0f, 1f); teleportScale = 0.5f + teleportScale * 0.5f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) teleportScale *= teleportScaleSpeed; if (npc.ai[0] >= 30f && Main.netMode != NetmodeID.MultiplayerClient) @@ -441,7 +443,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!teleporting) { - npc.ai[0] += (bossRush ? 15f : MathHelper.Lerp(1f, 8f, 1f - lifeRatio)); + npc.ai[0] += MathHelper.Lerp(1f, 8f, 1f - lifeRatio); if (npc.ai[0] >= 0f) { // Set damage @@ -463,8 +465,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (deathModeRapidHops) npc.ai[1] = 2f; - float bossRushJumpSpeedMult = 1.5f; - // Jump type if (npc.ai[1] == 3f) { @@ -500,9 +500,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) npc.velocity.X *= 1.4f; - if (bossRush) - npc.velocity.X *= bossRushJumpSpeedMult; - npc.noTileCollide = true; } else if (npc.ai[0] >= -30f) @@ -516,20 +513,20 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float jumpVelocityLimit = redCrystalAlive ? 3f : 4.5f; if (death) jumpVelocityLimit += 3f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) jumpVelocityLimit = 8f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocityLimit) || (npc.direction == -1 && npc.velocity.X > -jumpVelocityLimit)) { if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) { - npc.velocity.X += (bossRush ? 0.4f : death ? 0.25f : 0.2f) * npc.direction; + npc.velocity.X += (death ? 0.25f : 0.2f) * npc.direction; if (death) npc.velocity.X += 0.3f * npc.direction; } else { - npc.velocity.X *= bossRush ? 0.9f : death ? 0.92f : 0.93f; + npc.velocity.X *= death ? 0.92f : 0.93f; if (death) npc.velocity.X *= 0.9f; } @@ -554,12 +551,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; // Adjust size based on HP - float maxScale = death ? (Main.getGoodWorld ? 6f : 2.5f) : (Main.getGoodWorld ? 3f : 1.5f); + float maxScale = CalamityWorld.LegendaryMode ? 3f : death ? 2.5f : 1.5f; float minScale = death ? 0.5f : 0.75f; float maxScaledValue = maxScale - minScale; // Inversed scale in FTW - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) lifeRatio = (maxScaledValue - lifeRatio * maxScaledValue) + minScale; else lifeRatio = lifeRatio * maxScaledValue + minScale; @@ -620,7 +617,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; } - if (((Main.raining && Main.hardMode) || bossRush) && Main.rand.NextBool(50)) + if ((Main.raining && Main.hardMode) && Main.rand.NextBool(50)) npcType = NPCID.RainbowSlime; if (death) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs index 15a895165c..98757d7b09 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/MoonLordAI.cs @@ -17,12 +17,25 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static readonly SoundStyle DeathrayChargeSound = new("CalamityMod/Sounds/Custom/MoonLordLaserCharge"); + // Vanilla values + public static int BoltDamage = 30; // 120 + public static int EyeDamage = 30; // 120 + public static int SphereDamage = 40; // 160 + public static int DeathrayDamage = 75; // 300 + + public static int TrueEyeBoltDamage = 35; // 140 + public static int TrueEyeEyeDamage = 35; // 140 + public static int TrueEyeDeathrayDamage = 50; // 200 + public static int TrueEyeSphereDamage = 55; // 220 + + // Vanilla values (GFB) + public static int MoonBoulderDamage = 70; // 280 + public static bool BuffedMoonLordAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; int aggressionLevel = 4; if (npc.type == NPCID.MoonLordCore || npc.type == NPCID.MoonLordHand || npc.type == NPCID.MoonLordHead) @@ -45,10 +58,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (bossRush) - aggressionLevel = 5; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) aggressionLevel = 6; if (npc.type == NPCID.MoonLordCore) @@ -773,7 +783,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (attackTimer == 180f && Main.netMode != NetmodeID.MultiplayerClient) { int projectileType = ProjectileID.PhantasmalDeathray; - int damage = npc.GetProjectileDamage(projectileType); npc.TargetClosest(false); Vector2 deathrayRotationSpeed = Main.player[npc.target].Center - npc.Center; @@ -784,7 +793,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deathrayRotationDirection = 1f; deathrayRotationSpeed = deathrayRotationSpeed.RotatedBy(-(double)deathrayRotationDirection * MathHelper.TwoPi / 6f); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayRotationSpeed.X, deathrayRotationSpeed.Y, projectileType, damage, 0f, Main.myPlayer, deathrayRotationDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayRotationSpeed.X, deathrayRotationSpeed.Y, projectileType, DeathrayDamage, 0f, Main.myPlayer, deathrayRotationDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); npc.ai[2] = (deathrayRotationSpeed.ToRotation() + MathHelper.Pi + MathHelper.TwoPi) * deathrayRotationDirection; npc.netUpdate = true; } @@ -811,7 +820,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[1] < 0f) { npc.localAI[1] = 0f; - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && Main.remixWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && Main.remixWorld) { for (int k = 0; k < 30; k++) { @@ -933,8 +942,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 boltVelocity = Vector2.Normalize(v4) * velocity; int type = ProjectileID.PhantasmalBolt; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltDirection.X, npc.Center.Y + boltDirection.Y, boltVelocity.X, boltVelocity.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltDirection.X, npc.Center.Y + boltDirection.Y, boltVelocity.X, boltVelocity.Y, type, BoltDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1166,10 +1174,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 handAttackDirection = Vector2.Normalize(handAttackRotation) * velocity; float ai = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * handFaceDirection; int type = ProjectileID.PhantasmalEye; - int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), handAttackMovement, handAttackDirection, type, damage, 0f, Main.myPlayer, 0f, ai); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), handAttackMovement, handAttackDirection, type, EyeDamage, 0f, Main.myPlayer, 0f, ai); Main.projectile[proj].timeLeft = 1200; - Main.projectile[proj].Calamity().lineColor = bossRush ? 1 : aggressionLevel; + Main.projectile[proj].Calamity().lineColor = aggressionLevel; } } else @@ -1291,8 +1298,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sphereFireDirection.Y += (finalSphereHandSpeed - 4.5f) * 1f; sphereFireDirection *= 1.2f; int type = ProjectileID.PhantasmalSphere; - int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, sphereFireDirection.X, sphereFireDirection.Y, type, damage, 1f, Main.myPlayer, 0f, npc.whoAmI); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, sphereFireDirection.X, sphereFireDirection.Y, type, SphereDamage, 1f, Main.myPlayer, 0f, npc.whoAmI); Main.projectile[proj].timeLeft = 1200; } @@ -1533,8 +1539,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 boltShootSpeed = Vector2.Normalize(v) * velocity; int type = ProjectileID.PhantasmalBolt; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltShootDirection.X, npc.Center.Y + boltShootDirection.Y, boltShootSpeed.X, boltShootSpeed.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + boltShootDirection.X, npc.Center.Y + boltShootDirection.Y, boltShootSpeed.X, boltShootSpeed.Y, type, BoltDamage, 0f, Main.myPlayer, 0f, 0f); } } @@ -1779,14 +1784,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocity = death ? 9f : 8f; Vector2 freeEyeBoltVel = Vector2.Normalize(v8) * velocity; int type = ProjectileID.PhantasmalBolt; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + freeEyeBoltDirection.X, npc.Center.Y + freeEyeBoltDirection.Y, freeEyeBoltVel.X, freeEyeBoltVel.Y, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + freeEyeBoltDirection.X, npc.Center.Y + freeEyeBoltDirection.Y, freeEyeBoltVel.X, freeEyeBoltVel.Y, type, TrueEyeBoltDamage, 0f, Main.myPlayer, 0f, 0f); } } else if (npc.ai[0] == 2f || npc.ai[0] == 4f) { int type = ProjectileID.PhantasmalSphere; - int damage = npc.GetProjectileDamage(type); if (secondAttackTimer < 15f) { @@ -1866,7 +1869,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int k = 0; k < 3; k++) { if (!WorldGen.SolidTile((int)(npc.Center.X / 16f), (int)(npc.Center.Y / 16f))) - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, (float)Main.rand.Next(-1599, 1600) * 0.01f, (float)Main.rand.Next(-1599, 1) * 0.01f, ProjectileID.MoonBoulder, 70, 10f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, (float)Main.rand.Next(-1599, 1600) * 0.01f, (float)Main.rand.Next(-1599, 1) * 0.01f, ProjectileID.MoonBoulder, MoonBoulderDamage, 10f); } } } @@ -1922,7 +1925,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (trueEyeSphereProj.type == type && trueEyeSphereProj.ai[1] == npc.whoAmI && trueEyeSphereProj.ai[0] != -1f) { trueEyeSphereProj.ai[0] = -1f; - trueEyeSphereProj.damage = damage; + trueEyeSphereProj.damage = TrueEyeSphereDamage; trueEyeSphereProj.velocity = trueEyeSphereVelocity; trueEyeSphereProj.netUpdate = true; } @@ -2001,8 +2004,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 trueEyeEyeSpeed = Vector2.Normalize(trueEyeDirection) * velocity; float ai3 = (MathHelper.TwoPi * (float)Main.rand.NextDouble() - MathHelper.Pi) / 30f + 0.0174532924f * npc.ai[2]; int type = ProjectileID.PhantasmalEye; - int damage = npc.GetProjectileDamage(type); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), trueEyeEyeDirection, trueEyeEyeSpeed, type, damage, 0f, Main.myPlayer, 0f, ai3); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), trueEyeEyeDirection, trueEyeEyeSpeed, type, TrueEyeEyeDamage, 0f, Main.myPlayer, 0f, ai3); Main.projectile[proj].timeLeft = 1200; } } @@ -2074,8 +2076,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deathrayTargetDist = deathrayTargetDist.RotatedBy(-(double)deathraySweepDirection * MathHelper.TwoPi / 6f); int type = ProjectileID.PhantasmalDeathray; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayTargetDist.X, deathrayTargetDist.Y, type, damage, 0f, Main.myPlayer, deathraySweepDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X, npc.Center.Y, deathrayTargetDist.X, deathrayTargetDist.Y, type, TrueEyeDeathrayDamage, 0f, Main.myPlayer, deathraySweepDirection * MathHelper.TwoPi / calamityGlobalNPC.newAI[1], npc.whoAmI); npc.ai[2] = (deathrayTargetDist.ToRotation() + MathHelper.Pi + MathHelper.TwoPi) * deathraySweepDirection; npc.netUpdate = true; } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs index d6af968e23..196ddcf11e 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/PlanteraAI.cs @@ -27,12 +27,27 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float StopChargeGateValue = BeginChargeSlowDownGateValue - 30f; public const float MovementVelocityMultiplierForSlowAttacks = 0.5f; + // Vanilla values + public static float Phase2ContactDamageMult = 1.4f; // 140 + public static int PinkSeedDamage = 19; // 76 + public static int PoisonSeedDamage = 24; // 96 + public static int ThornBallDamage = 27; // 108 + + // Expert AI has uses a magic number which we have to correct for + public static int ContactDamageCorrection = 100; + + // Rev+ exclusive + public static int ThornBallSpikeDamage = 22; // 88 + public static int GasBulbDamage = 27; // 108 + public static int PinkCloudDamage = 22; // 88 + public static int GreenCloudDamage = 24; // 96 + public static float DashDamageMult = 1.25f; // 175 + public static bool BuffedPlanteraAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -51,16 +66,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool vomitFreeTentacles = lifeRatio < 0.25f && death; bool phase4 = lifeRatio < 0.2f; - // Contact damage values for phase 2 - int setDamage = (int)Math.Round(npc.defDamage * 1.4); - int reducedSetDamage = (int)Math.Round(setDamage * 0.5); + npc.damage = (int)Math.Round(ContactDamageCorrection * (phase2 ? Phase2ContactDamageMult : 1f)); // Variables and target - bool enrage = bossRush; + bool enrage = false; bool despawn = false; // Check for Jungle - bool surface = !bossRush && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; + bool surface = !BossRushEvent.BossRushActive && Main.player[npc.target].position.Y < Main.worldSurface * 16.0; // Tentacle limits int maxTentaclesAfterFirstTentaclePhase = death ? 4 : 2; @@ -121,22 +134,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses hookPositionY /= numHooksSpawned; // Velocity and acceleration - float velocity = bossRush ? 12f : phase4 ? 7f : phase3 ? 6.5f : phase2 ? 6f : 4f; - float acceleration = bossRush ? 0.12f : phase3 ? 0.06f : 0.04f; - float chargeLineUpVelocity = bossRush ? 20f : phase4 ? 12f : phase3 ? 10f : 8f; - float chargeLineUpAcceleration = bossRush ? 0.8f : phase4 ? 0.6f : phase3 ? 0.5f : 0.4f; - float chargeVelocity = bossRush ? 30f : phase4 ? 22f : phase3 ? 20f : 18f; - float chargeDeceleration = bossRush ? 0.85f : phase4 ? 0.92f : phase3 ? 0.95f : 0.96f; + float velocity = phase4 ? 7f : phase3 ? 6.5f : phase2 ? 6f : 4f; + float acceleration = phase3 ? 0.06f : 0.04f; + float chargeLineUpVelocity = phase4 ? 12f : phase3 ? 10f : 8f; + float chargeLineUpAcceleration = phase4 ? 0.6f : phase3 ? 0.5f : 0.4f; + float chargeVelocity = phase4 ? 22f : phase3 ? 20f : 18f; + float chargeDeceleration = phase4 ? 0.92f : phase3 ? 0.95f : 0.96f; // Enrage if target is on the surface - if (!bossRush && (surface || Main.player[npc.target].position.Y > Main.UnderworldLayer * 16)) + if (!BossRushEvent.BossRushActive && (surface || Main.player[npc.target].position.Y > Main.UnderworldLayer * 16)) { enrage = true; velocity += 8f; acceleration = 0.15f; } - npc.Calamity().CurrentlyEnraged = !bossRush && enrage; + npc.Calamity().CurrentlyEnraged = enrage; // Movement relative to the target and hook positions Vector2 npcCenterAccountingForHooks = new Vector2(hookPositionX, hookPositionY); @@ -173,7 +186,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocity *= 1.15f; acceleration *= 1.15f; @@ -214,7 +227,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shootPoisonSeed = npc.ai[1] % 9f == 0f && !shootThornBall; float projectileSpeed = 14f; int projectileType = shootThornBall ? ProjectileID.ThornBall : shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera; - int damage = npc.GetProjectileDamage(projectileType); + int damage = shootThornBall ? ThornBallDamage : shootPoisonSeed ? PoisonSeedDamage : PinkSeedDamage; Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); Vector2 spawnOffset = npc.Center + projectileVelocity * 70f; @@ -302,7 +315,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = death ? 36 : 30; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); float velocity2 = CalamityWorld.LegendaryMode ? 10f : 5f; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) @@ -321,7 +333,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float ai0 = Main.rand.Next(3); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * randomSpeed, type, damage, 0f, Main.myPlayer, ai0); + Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * randomSpeed, type, GreenCloudDamage, 0f, Main.myPlayer, ai0); } } @@ -368,7 +380,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileSpeed = 9f; int projectileType = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(projectileType); Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); Vector2 spawnOffset = npc.Center + projectileVelocity * 70f; @@ -382,7 +393,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * projectileSpeed, projectileType, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), adjustProjectileShootLocation ? npc.Center : spawnOffset, projectileVelocity * projectileSpeed, projectileType, GasBulbDamage, 0f, Main.myPlayer); } } @@ -391,11 +402,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Slow down and return to normal behavior if (npc.ai[3] <= BeginChargeSlowDownGateValue) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - npc.velocity *= chargeDeceleration; - float timeToDecelerateDecrement = bossRush ? 2f : phase4 ? 1.5f : 1f; + float timeToDecelerateDecrement = phase4 ? 1.5f : 1f; npc.ai[3] -= timeToDecelerateDecrement; if (npc.ai[3] <= StopChargeGateValue) { @@ -428,14 +436,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Emit spore gas in phase 3 else if (npc.ai[3] <= BeginChargeGateValue) { - // Set damage - npc.damage = setDamage; - + npc.damage = (int)Math.Round(ContactDamageCorrection * Phase2ContactDamageMult * DashDamageMult); float sporeGasDashGateValue = death ? 6f : 9f; if (phase3 && npc.ai[3] % sporeGasDashGateValue == 0f) { int projectileType = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(projectileType); float randomVelocityMultiplier = secondCharge ? 0.05f : death ? 0.3f : 0.2f; Vector2 projectileVelocity = npc.velocity * Main.rand.NextVector2CircularEdge(randomVelocityMultiplier, randomVelocityMultiplier); Vector2 spawnOffset = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 30f; @@ -450,7 +455,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float ai0 = Main.rand.Next(3); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, ai0); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity, projectileType, GasBulbDamage, 0f, Main.myPlayer, ai0); } npc.ai[3] -= 1f; @@ -461,9 +466,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Move a specified distance away from the target and charge once that distance is reached else { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - // Line up before charging if (npc.Calamity().newAI[0] == 0f) { @@ -503,9 +505,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] -= timeToLineUpChargeDecrement; if (npc.ai[3] <= BeginChargeGateValue) { - // Set damage - npc.damage = setDamage; - // Charge npc.ai[3] = BeginChargeGateValue; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * chargeVelocity; @@ -523,7 +522,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int totalProjectiles = secondCharge ? 6 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); float velocity2 = CalamityWorld.LegendaryMode ? 10f : 5f; Vector2 spinningPoint = new Vector2(0f, -velocity2); for (int k = 0; k < totalProjectiles; k++) @@ -542,7 +540,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float ai0 = Main.rand.Next(3); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity * randomSpeed, type, damage, 0f, Main.myPlayer, ai0); + Projectile.NewProjectile(npc.GetSource_FromAI(), spawnOffset, projectileVelocity * randomSpeed, type, GasBulbDamage, 0f, Main.myPlayer, ai0); } } @@ -554,9 +552,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - // Avoid cheap bullshit - npc.damage = phase2 ? reducedSetDamage : 0; - // Velocity ranges from 4 to 7.2, Acceleration ranges from 0.04 to 0.072, non-enraged phase 1 // Velocity ranges from 7 to 12.6, Acceleration ranges from 0.07 to 0.126, non-enraged phase 2 // Velocity ranges from 9 to 16.2, Acceleration ranges from 0.07 to 0.126, non-enraged phase 3 @@ -649,7 +644,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (enrage) npc.localAI[1] += 2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.localAI[1] += 1f; float shootProjectileGateValue = death ? 30f : 60f; @@ -679,7 +674,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool shootPoisonSeed = (CalamityWorld.LegendaryMode || Main.rand.NextBool(death ? 2 : 4)) && !shootThornBall; int projectileType = shootThornBall ? ProjectileID.ThornBall : shootPoisonSeed ? ProjectileID.PoisonSeedPlantera : ProjectileID.SeedPlantera; float projectileSpeed = death ? 16f : 14f; - int damage = npc.GetProjectileDamage(projectileType); + int damage = shootThornBall ? ThornBallDamage : shootPoisonSeed ? PoisonSeedDamage : PinkSeedDamage; Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); Vector2 spawnOffset = npc.Center + projectileVelocity * 70f; @@ -729,7 +724,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[0] = 2f; int totalTentacles = death ? 12 : 8; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) totalTentacles += 6; if (CalamityWorld.LegendaryMode) totalTentacles *= 2; @@ -737,7 +732,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < totalTentacles; i++) NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PlanterasTentacle, npc.whoAmI); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { foreach (NPC n in Main.ActiveNPCs) { @@ -793,8 +788,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[3] >= shootProjectileGateValue) { float projectileSpeed = 14f; - if (bossRush) - projectileSpeed += 4f; Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY); @@ -806,7 +799,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses numProj++; int type = ProjectileID.PoisonSeedPlantera; - int damage = npc.GetProjectileDamage(type); + int damage = PoisonSeedDamage; float rotation = MathHelper.ToRadians(spread); bool vomitTentacles = vomitFreeTentacles && NPC.CountNPCS(ModContent.NPCType()) < maxTentaclesAfterFirstTentaclePhase; if (vomitTentacles) @@ -818,7 +811,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (shootPinkSeed) { type = ProjectileID.SeedPlantera; - damage = npc.GetProjectileDamage(type); + damage = PinkSeedDamage; } else type = ProjectileID.PoisonSeedPlantera; @@ -870,7 +863,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (shootThornBall) { type = ProjectileID.ThornBall; - damage = npc.GetProjectileDamage(type); + damage = ThornBallDamage; Vector2 spawnOffset = npc.Center + projectileVelocity * 50f; if (Main.netMode != NetmodeID.MultiplayerClient) @@ -968,7 +961,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPlanterasHookAI(NPC npc, Mod mod) { // Variables - bool enrage = BossRushEvent.BossRushActive; + bool enrage = false; bool despawn = false; bool death = CalamityWorld.death || enrage; @@ -989,7 +982,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses despawn = true; // Enrage if Plantera's target is on the surface - if (!enrage && ((Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > Main.UnderworldLayer * 16) | despawn)) + if (!enrage && !BossRushEvent.BossRushActive && ((Main.player[Main.npc[NPC.plantBoss].target].position.Y < Main.worldSurface * 16.0 || Main.player[Main.npc[NPC.plantBoss].target].position.Y > Main.UnderworldLayer * 16) | despawn)) { npc.localAI[0] -= 4f; enrage = true; @@ -1095,7 +1088,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float hookMoveDistance = (float)Math.Sqrt(hookMoveX * hookMoveX + hookMoveY * hookMoveY); if (hookMoveDistance < 12f + velocity) { - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld && npc.localAI[3] == 1f) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode && npc.localAI[3] == 1f) { npc.localAI[3] = 0f; WorldGen.SpawnPlanteraThorns(npc.Center); @@ -1106,7 +1099,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else { - if (Main.netMode != NetmodeID.MultiplayerClient && Main.getGoodWorld) + if (Main.netMode != NetmodeID.MultiplayerClient && CalamityWorld.LegendaryMode) npc.localAI[3] = 1f; hookMoveDistance = velocity / hookMoveDistance; @@ -1140,7 +1133,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { if (Main.rand.NextBool(5)) npc.reflectsProjectiles = true; @@ -1176,8 +1169,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float extendTime = 180f; if (planteraIsCharging) { - npc.damage = 0; - if (npc.localAI[0] > 0f) { npc.localAI[0] = 0f; @@ -1186,7 +1177,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.localAI[0] < extendTime) { - npc.damage = npc.defDamage; npc.localAI[0] += 1f; if (npc.localAI[0] >= extendTime) npc.SyncExtraAI(); @@ -1218,7 +1208,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses deceleration *= 0.75f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) tentacleAcceleration += 4f; // Fast retraction diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs index 6815bf8ea1..d2cd39bd11 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenBeeAI.cs @@ -15,6 +15,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class QueenBeeAI { + // Vanilla values + public static int StingerDamage = 11; // 44; Also applies to GFB stinger replacements + + // Death exclusive + public static int BeenadeDamage = 15; // 90 + public static int BeenadeBeeDamage = 12; // 72 + public static bool BuffedQueenBeeAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); @@ -23,10 +30,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; - bool enrage = true; + bool enrage = !BossRushEvent.BossRushActive; int targetTileX = (int)Main.player[npc.target].Center.X / 16; int targetTileY = (int)Main.player[npc.target].Center.Y / 16; @@ -36,22 +42,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float maxEnrageScale = 2f; float enrageScale = death ? 0.5f : 0f; - if (((npc.position.Y / 16f) < Main.worldSurface && enrage) || bossRush) + if ((npc.position.Y / 16f) < Main.worldSurface && enrage) { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; + calamityGlobalNPC.CurrentlyEnraged = true; enrageScale += 0.5f; } - if (!Main.player[npc.target].ZoneJungle || bossRush) + if (!Main.player[npc.target].ZoneJungle && enrage) { - calamityGlobalNPC.CurrentlyEnraged = !bossRush; + calamityGlobalNPC.CurrentlyEnraged = true; enrageScale += 0.5f; } - if (Main.getGoodWorld) - enrageScale += ((CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 1f : 0.5f); - - if (bossRush) - enrageScale = 2f; + if (CalamityWorld.LegendaryMode) + enrageScale += 1f; if (enrageScale > maxEnrageScale) enrageScale = maxEnrageScale; @@ -145,7 +148,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; // Always start in enemy spawning phase @@ -746,7 +748,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 stingerVelocity = new Vector2(stingerTargetX, stingerTargetY); int type = Main.zenithWorld ? (phase3 ? ModContent.ProjectileType() : ProjectileID.FlamingWood) : ProjectileID.QueenBeeStinger; - int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation, stingerVelocity, type, Main.zenithWorld ? 25 : npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); + int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation, stingerVelocity, type, StingerDamage, 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); Main.projectile[projectile].timeLeft = 1200; Main.projectile[projectile].extraUpdates = 1; @@ -755,7 +757,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int numExtraStingers = death ? (phase6 ? 4 : 2) : (phase6 ? 2 : 1); for (int i = 0; i < numExtraStingers; i++) { - projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + Main.rand.NextVector2CircularEdge(16f, 16f) * (i + 1), stingerVelocity * MathHelper.Lerp(0.75f, 1f, i / (float)numExtraStingers), type, Main.zenithWorld ? 25 : npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); + projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + Main.rand.NextVector2CircularEdge(16f, 16f) * (i + 1), stingerVelocity * MathHelper.Lerp(0.75f, 1f, i / (float)numExtraStingers), type, StingerDamage, 0f, Main.myPlayer, 0f, (Main.zenithWorld && phase3) ? Main.player[npc.target].position.Y : 0f); Main.projectile[projectile].timeLeft = 1200; Main.projectile[projectile].extraUpdates = 1; } @@ -878,7 +880,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (i % 2f != 0f) perturbedSpeed *= 0.8f; - int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, Main.zenithWorld ? 25 : npc.GetProjectileDamage(type), 0f, Main.myPlayer, 0f, Main.player[npc.target].position.Y); + int projectile = Projectile.NewProjectile(npc.GetSource_FromAI(), stingerSpawnLocation + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 10f, perturbedSpeed, type, StingerDamage, 0f, Main.myPlayer, 0f, Main.player[npc.target].position.Y); Main.projectile[projectile].timeLeft = 1200; Main.projectile[projectile].extraUpdates = 1; @@ -949,9 +951,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 beenadeSpawnLocation = npc.Center + new Vector2(20f * npc.direction, -40f); SoundEngine.PlaySound(SoundID.Item76, beenadeSpawnLocation); int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(npc.GetSource_FromAI(), beenadeSpawnLocation, Vector2.UnitX * 6f * npc.direction, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), beenadeSpawnLocation, Vector2.UnitX * 6f * npc.direction, type, BeenadeDamage, 0f, Main.myPlayer); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs index 347925e93e..c16a8274e0 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/QueenSlimeAI.cs @@ -12,11 +12,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class QueenSlimeAI { + // Vanilla values + public static int SmallGelDamage = Main.masterMode ? 20 : 17; // 68 + public static int SpikeDamage = Main.masterMode ? 20 : 17; // 68 + public static int LargeGelDamage = 30; // 120 + public static int SlamDamage = 40; // 160 + public static bool BuffedQueenSlimeAI(NPC npc, Mod mod) { // Difficulty bools - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -208,9 +213,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses break; npc.ai[1] += 1f; - int idleTime = bossRush ? 20 : death ? 30 : 40; + int idleTime = death ? 30 : 40; if (phase2) - idleTime = bossRush ? 40 : death ? 60 : 80; + idleTime = death ? 60 : 80; if (phase4) idleTime /= 2; @@ -272,7 +277,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = 0f; npc.ai[1] += 1f; - float teleportEndTime = bossRush ? 10f : death ? 15f : 20f; + float teleportEndTime = death ? 15f : 20f; slimeScale = MathHelper.Clamp(npc.ai[1] / teleportEndTime, 0f, 1f); slimeScale = 0.5f + slimeScale * 0.5f; if (npc.ai[1] >= teleportEndTime && Main.netMode != NetmodeID.MultiplayerClient) @@ -312,7 +317,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = 0f; npc.ai[1] += 1f; - float teleportTime = bossRush ? 20f : death ? 30f : 40f; + float teleportTime = death ? 30f : 40f; slimeScale = MathHelper.Clamp((teleportTime - npc.ai[1]) / teleportTime, 0f, 1f); slimeScale = 0.5f + slimeScale * 0.5f; @@ -328,12 +333,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (death) { int numGelProjectiles = 12; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numGelProjectiles = 15; float gelVelocity = death ? 20f : 16f; int type = ProjectileID.QueenSlimeGelAttack; - int damage = npc.GetProjectileDamage(type); if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -345,7 +349,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses spinningpoint *= Main.rand.NextFloat() + 0.5f; spinningpoint = spinningpoint.RotatedBy((float)(-j) * MathHelper.TwoPi / (float)numGelProjectiles, Vector2.Zero); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -388,7 +392,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Faster fall if (npc.velocity.Y > 0f) - npc.velocity.Y += bossRush ? 0.1f : death ? 0.05f : 0f; + npc.velocity.Y += death ? 0.05f : 0f; npc.rotation = 0f; if (npc.velocity.Y == 0f) @@ -400,7 +404,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.velocity.X > -0.1 && npc.velocity.X < 0.1) npc.velocity.X = 0f; - float timerIncrement = bossRush ? 7f : death ? 6f : 5f; + float timerIncrement = death ? 6f : 5f; npc.ai[1] += timerIncrement; if (lifeRatio < 0.85f) npc.ai[1] += timerIncrement; @@ -428,7 +432,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 3f) { npc.velocity.Y = -13f * speedMult; - npc.velocity.X += (bossRush ? 7f : death ? 6f : 5.5f) * npc.direction; + npc.velocity.X += (death ? 6f : 5.5f) * npc.direction; npc.ai[1] = 0f; npc.ai[2] = 0f; if (npc.timeLeft > 10) @@ -442,15 +446,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 2f) { - npc.velocity.Y = -(bossRush ? 10f : death ? 8f : 6f) * speedMult; - npc.velocity.X += (bossRush ? 8.5f : death ? 7.5f : 7f) * npc.direction; + npc.velocity.Y = -(death ? 8f : 6f) * speedMult; + npc.velocity.X += (death ? 7.5f : 7f) * npc.direction; npc.ai[1] = -40f; npc.ai[2] += 1f; } else { - npc.velocity.Y = -(bossRush ? 12f : death ? 10f : 8f) * speedMult; - npc.velocity.X += (bossRush ? 7.5f : death ? 6.5f : 6f) * npc.direction; + npc.velocity.Y = -(death ? 10f : 8f) * speedMult; + npc.velocity.X += (death ? 6.5f : 6f) * npc.direction; npc.ai[1] = -40f; npc.ai[2] += 1f; } @@ -465,16 +469,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.target >= Main.maxPlayers) break; - float jumpVelocity = bossRush ? 9f : death ? 7f : 4.5f; - if (Main.getGoodWorld) + float jumpVelocity = death ? 7f : 4.5f; + if (CalamityWorld.LegendaryMode) jumpVelocity = 12f; if ((npc.direction == 1 && npc.velocity.X < jumpVelocity) || (npc.direction == -1 && npc.velocity.X > 0f - jumpVelocity)) { if ((npc.direction == -1 && npc.velocity.X < 0.1) || (npc.direction == 1 && npc.velocity.X > -0.1)) - npc.velocity.X += (bossRush ? 1f : death ? 0.45f : 0.3f) * npc.direction; + npc.velocity.X += (death ? 0.45f : 0.3f) * npc.direction; else - npc.velocity.X *= bossRush ? 0.8f : death ? 0.85f : 0.91f; + npc.velocity.X *= death ? 0.85f : 0.91f; } if (!Main.player[npc.target].dead) @@ -512,7 +516,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (phase2) slamDelay = 10; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) slamDelay = 0; if (npc.velocity.Y == 0f) @@ -521,8 +525,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.QueenSlimeSmash; - int damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Bottom, Vector2.Zero, type, SlamDamage, 0f, Main.myPlayer); // Line of explosions in Master Mode if (death) @@ -538,7 +541,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { expandDelay = MathHelper.Lerp(0f, maxExpandDelay, Math.Abs(i - maxSmashesPerSide) / (float)maxSmashesPerSide); if (i != maxSmashesPerSide) - Projectile.NewProjectile(npc.GetSource_FromAI(), extraSmashPosition, Vector2.Zero, type, damage, 0f, Main.myPlayer, -expandDelay); + Projectile.NewProjectile(npc.GetSource_FromAI(), extraSmashPosition, Vector2.Zero, type, SlamDamage, 0f, Main.myPlayer, -expandDelay); extraSmashPosition -= Vector2.UnitX * smashSpawnDistanceOffset; } @@ -549,7 +552,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileVelocity = death ? 18f : 12f; type = ProjectileID.QueenSlimeMinionBlueSpike; - damage = npc.GetProjectileDamage(type); Vector2 destination = (new Vector2(npc.Center.X, npc.Center.Y - 100f) - npc.Center).SafeNormalize(Vector2.UnitY); destination *= projectileVelocity; int numProj = 20; @@ -557,7 +559,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, -2f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, SpikeDamage, 0f, Main.myPlayer, 0f, -2f); } if (phase5) @@ -567,7 +569,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, -2f); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, SpikeDamage, 0f, Main.myPlayer, 0f, -2f); } } } @@ -624,9 +626,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set damage npc.damage = npc.defDamage; - npc.velocity.Y += bossRush ? 2f : death ? 1.75f : 1.5f; - float slamVelocity = bossRush ? 15.99f : death ? 15.5f : 15f; - if (Main.getGoodWorld) + npc.velocity.Y += death ? 1.75f : 1.5f; + float slamVelocity = death ? 15.5f : 15f; + if (CalamityWorld.LegendaryMode) { npc.velocity.Y += 1f; slamVelocity = 15.99f; @@ -647,7 +649,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 fireFrom = npc.Center; int projectileAmt = 2; int type = ProjectileID.QueenSlimeMinionBlueSpike; - int damage = npc.GetProjectileDamage(type); Vector2 velocityIncrease = death ? (Vector2.UnitY * 4f) : Vector2.Zero; for (int i = 0; i < projectileAmt; i++) { @@ -656,7 +657,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int j = 0; j < totalProjectiles; j++) { Vector2 projVelocity = (npc.velocity + velocityIncrease).RotatedBy(radians * j + MathHelper.PiOver2); - Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f); + Projectile.NewProjectile(npc.GetSource_FromAI(), fireFrom, projVelocity, type, SpikeDamage, 0f, Main.myPlayer, 0f, -1f); } } } @@ -701,7 +702,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.velocity = center - npc.Center; npc.velocity = npc.velocity.SafeNormalize(Vector2.Zero); - npc.velocity *= bossRush ? 30f : death ? 27.3f : 24f; + npc.velocity *= death ? 27.3f : 24f; } else npc.velocity.Y *= 0.95f; @@ -732,12 +733,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int numGelProjectiles = phase4 ? Main.rand.Next(9, 12) : phase2 ? Main.rand.Next(6, 9) : 12; if (phase5) numGelProjectiles += 6; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) numGelProjectiles = 20; float projectileVelocity = death ? 12f : 10.5f; int type = ProjectileID.QueenSlimeGelAttack; - int damage = npc.GetProjectileDamage(type); if (phase2) { Vector2 destination = (new Vector2(npc.Center.X, npc.Center.Y + 100f) - npc.Center).SafeNormalize(Vector2.UnitY); @@ -749,7 +749,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses destination *= Main.rand.NextFloat() + 0.5f; Vector2 perturbedSpeed = destination.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numGelProjectiles - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, perturbedSpeed, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -763,7 +763,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses spinningpoint *= Main.rand.NextFloat() + 0.5f; spinningpoint = spinningpoint.RotatedBy((-j) * MathHelper.TwoPi / numGelProjectiles, Vector2.Zero); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, spinningpoint, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -781,7 +781,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses foreach (int t in targets) { Vector2 velocity2 = (Main.player[t].Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileVelocity; - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, damage, 0f, Main.myPlayer, 0f, -2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, velocity2, type, LargeGelDamage, 0f, Main.myPlayer, 0f, -2f); Main.projectile[proj].timeLeft = 900; } } @@ -921,14 +921,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static void QueenSlime_FlyMovement(NPC npc) { // Difficulty bools - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; npc.noTileCollide = true; npc.noGravity = true; - float flyVelocity = bossRush ? 24f : death ? 21f : 16f; - float flyAcceleration = bossRush ? 0.3f : death ? 0.18f : 0.12f; + float flyVelocity = death ? 21f : 16f; + float flyAcceleration = death ? 0.18f : 0.12f; float flyDistanceY = death ? 350f : 450f; Vector2 desiredVelocity = npc.Center; @@ -1027,7 +1026,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses vector6 *= 1.5f; int type = ProjectileID.QueenSlimeMinionBlueSpike; - Projectile.NewProjectile(npc.GetSource_FromAI(), center, vector6 * (death ? 0.8f : 0.5f), type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), center, vector6 * (death ? 0.8f : 0.5f), type, SpikeDamage, 0f, Main.myPlayer); npc.localAI[0] = 25f; if (num22 > 4) break; @@ -1057,7 +1056,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[0] = 50f; int type = ProjectileID.QueenSlimeMinionBlueSpike; Vector2 spikeVelocity = new Vector2(num19, num20) * (death ? 0.8f : 0.5f); - Projectile.NewProjectile(npc.GetSource_FromAI(), center, spikeVelocity, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), center, spikeVelocity, type, SpikeDamage, 0f, Main.myPlayer); } } } @@ -1212,7 +1211,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses int type = ProjectileID.QueenSlimeMinionPinkBall; Vector2 pinkBallVelocity = new Vector2(num24, num25) * (death ? 0.8f : 0.5f); - Projectile.NewProjectile(npc.GetSource_FromAI(), center2, pinkBallVelocity, type, npc.GetProjectileDamage(type), 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), center2, pinkBallVelocity, type, SmallGelDamage, 0f, Main.myPlayer); } } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs index fb166011a6..830249b332 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronAI.cs @@ -18,12 +18,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float HandSwipeDistance = 960f; // 60 tiles public const float HandSwipeDistance_Master = 1280f; // 80 tiles + // Vanilla values + public static float SpinDamageMult = 1.3f; // 91 + public static int SkullDamage = 17; // 68; Also applies to crossbones + + // Rev+ exclusive + public static int ShadowflameDamage = 20; // 80 + public static bool BuffedSkeletronAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -56,6 +62,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Set defense npc.defense = npc.defDefense; + npc.damage = npc.defDamage; npc.reflectsProjectiles = false; @@ -139,7 +146,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Daytime enrage - if (Main.IsItDay() && !bossRush && npc.ai[1] != 3f && npc.ai[1] != 2f) + if (Main.IsItDay() && !BossRushEvent.BossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) { npc.ai[1] = 2f; SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); @@ -155,40 +162,40 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Hand variables bool handsDead = numHandsAlive == 0; - int numProj = Main.getGoodWorld ? 22 : death ? 5 : 3; - float spread = Main.getGoodWorld ? 180 : 60; - float headSpinVelocityMult = bossRush ? (phase3 ? 18f : 9f) : (phase3 ? 12f : 4.5f); + int numProj = CalamityWorld.LegendaryMode ? 22 : death ? 5 : 3; + float spread = CalamityWorld.LegendaryMode ? 180 : 60; + float headSpinVelocityMult = phase3 ? 12f : 4.5f; switch (numHandsAlive) { case 0: - numProj = Main.getGoodWorld ? 36 : death ? 9 : 7; - spread = Main.getGoodWorld ? 180 : death ? 90 : 82; - headSpinVelocityMult = bossRush ? (phase3 ? 18f : 12f) : (phase3 ? 12f : 6f); + numProj = CalamityWorld.LegendaryMode ? 36 : death ? 9 : 7; + spread = CalamityWorld.LegendaryMode ? 180 : death ? 90 : 82; + headSpinVelocityMult = phase3 ? 12f : 6f; break; case 1: - numProj = Main.getGoodWorld ? 27 : death ? 7 : 5; - spread = Main.getGoodWorld ? 150 : death ? 76 : 68; - headSpinVelocityMult = bossRush ? (phase3 ? 15f : 10f) : (phase3 ? 11.5f : 5f); + numProj = CalamityWorld.LegendaryMode ? 27 : death ? 7 : 5; + spread = CalamityWorld.LegendaryMode ? 150 : death ? 76 : 68; + headSpinVelocityMult = phase3 ? 11.5f : 5f; break; case 2: - numProj = Main.getGoodWorld ? 18 : death ? 6 : 4; - spread = Main.getGoodWorld ? 140 : death ? 70 : 62; - headSpinVelocityMult = bossRush ? (phase3 ? 13.5f : 9f) : (phase3 ? 11f : 4.5f); + numProj = CalamityWorld.LegendaryMode ? 18 : death ? 6 : 4; + spread = CalamityWorld.LegendaryMode ? 140 : death ? 70 : 62; + headSpinVelocityMult = phase3 ? 11f : 4.5f; break; case 3: - numProj = Main.getGoodWorld ? 15 : death ? 5 : 3; - spread = Main.getGoodWorld ? 130 : death ? 64 : 56; - headSpinVelocityMult = bossRush ? (phase3 ? 12f : 8f) : (phase3 ? 10.5f : 4f); + numProj = CalamityWorld.LegendaryMode ? 15 : death ? 5 : 3; + spread = CalamityWorld.LegendaryMode ? 130 : death ? 64 : 56; + headSpinVelocityMult = phase3 ? 10.5f : 4f; break; case 4: - numProj = Main.getGoodWorld ? 12 : death ? 4 : 3; - spread = Main.getGoodWorld ? 120 : 56; - headSpinVelocityMult = bossRush ? (phase3 ? 10f : 7f) : (phase3 ? 10f : 3.5f); + numProj = CalamityWorld.LegendaryMode ? 12 : death ? 4 : 3; + spread = CalamityWorld.LegendaryMode ? 120 : 56; + headSpinVelocityMult = phase3 ? 10f : 3.5f; break; } @@ -207,11 +214,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Velocity used to move Skeletron away from the target before charging float moveAwayVelocity = headSpinVelocityMult; if (!phase3) - moveAwayVelocity *= (bossRush ? 1.5f : 2f); + moveAwayVelocity *= 2f; // Hand DR, scale DR up if the hands are still alive as Skeletron's HP lowers npc.chaseable = handsDead; - float minDR = 0.05f; + float minDR = 0f; float maxDR = 0.9999f; calamityGlobalNPC.DR = !handsDead ? (float)Math.Sqrt(MathHelper.Lerp(minDR, maxDR, respawnHands ? (respawnHandsLifeRatio - lifeRatio) / respawnHandsLifeRatio : 2f - lifeRatio / respawnHandsLifeRatio)) : minDR; calamityGlobalNPC.unbreakableDR = !handsDead; @@ -241,7 +248,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); // Inverse parabolic projectile spreads Vector2 baseVel = npc.SafeDirectionTo(Main.player[npc.target].Center) * (death ? 6f : 5f); @@ -251,7 +257,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float offset = MathHelper.ToRadians(MathHelper.Lerp(-spread * 0.5f, spread * 0.5f, i / (numProj - 1f))); float velocityMult = MathHelper.Lerp(0.5f, 1.5f, MathF.Abs(centralCount - i) / centralCount); - Projectile shot = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), firingPos, baseVel.RotatedBy(offset) * velocityMult, type, damage, 0f, Main.myPlayer, -2f); + Projectile shot = Projectile.NewProjectileDirect(npc.GetSource_FromAI(), firingPos, baseVel.RotatedBy(offset) * velocityMult, type, SkullDamage, 0f, Main.myPlayer, -2f); shot.timeLeft = 600; } @@ -272,13 +278,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // If hands are dead: 7 seconds // If hands are not dead: 14 seconds // If hands are dead in phase 2: 4.7 seconds - npc.ai[3] += 1f + (((phase2 && handsDead) || bossRush || phase4) ? 0.5f : 0f) - ((handsDead || bossRush) ? 0f : 0.5f); + npc.ai[3] += 1f + (((phase2 && handsDead) || phase4) ? 0.5f : 0f) - (handsDead ? 0f : 0.5f); // Dust to show teleport int ai3 = (int)npc.ai[3]; // 0 to 30, and -60 - bool emitDust = false; - if (ai3 >= teleportGateValue && calamityGlobalNPC.newAI[2] == 0f && calamityGlobalNPC.newAI[3] == 0f) + if (npc.localAI[0] == 1f && calamityGlobalNPC.newAI[2] == 0f && calamityGlobalNPC.newAI[3] == 0f) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -312,6 +317,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } + // Teleport location telegraph if (calamityGlobalNPC.newAI[2] != 0f && calamityGlobalNPC.newAI[3] != 0f) { for (int m = 0; m < 5; m++) @@ -322,24 +328,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - if (ai3 >= teleportGateValue + 90) - { - emitDust = true; - } - else if (ai3 >= teleportGateValue + 30) - { - if (Main.rand.Next(teleportGateValue + 10, ai3 + 1) >= teleportGateValue + 25) - emitDust = true; - } - - if (emitDust) - { - int dust = Dust.NewDust(npc.position, npc.width, npc.height, dustType, 0f, 0f, 100, default, 1.5f); - Main.dust[dust].noGravity = true; - } - // Teleport - if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[3] >= teleportGateValue + 120 && (!(npc.ai[1] == 1f && phase3) || death)) + if (Main.netMode != NetmodeID.MultiplayerClient && npc.localAI[0] == 0f && npc.ai[1] != 1f && calamityGlobalNPC.newAI[2] != 0f && calamityGlobalNPC.newAI[3] != 0f) { // Teleport dust for (int m = 0; m < 30; m++) @@ -351,10 +341,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // New location npc.Center = new Vector2(calamityGlobalNPC.newAI[2], calamityGlobalNPC.newAI[3]); - - // Do not set velocity to zero during charge attacks - if (npc.ai[1] != 1f) - npc.velocity = Vector2.Zero; + npc.velocity = Vector2.Zero; npc.ai[3] = -60f; calamityGlobalNPC.newAI[2] = calamityGlobalNPC.newAI[3] = 0f; @@ -366,8 +353,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Skull shooting if ((handsDead || death) && npc.ai[1] == 0f && !phase4) { - float skullProjFrequency = bossRush ? 15f : phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; - if (Main.getGoodWorld) + float skullProjFrequency = phase2 ? (48f - (death ? 17.5f * (1f - lifeRatio) : 0f)) : 60f; + if (CalamityWorld.LegendaryMode) skullProjFrequency *= 0.8f; skullProjFrequency = (float)Math.Ceiling(skullProjFrequency); @@ -379,22 +366,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Collision.CanHit(skullFiringPos, 1, 1, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { float skullProjSpeed = phase2 ? (5f + (death ? 3f * (1f - lifeRatio) : 0f)) : 4f; - int spread2 = bossRush ? 100 : 50; + int spread2 = 50; Vector2 skullProjDirection = new Vector2(skullProjTargetX + Main.rand.Next(-spread2, spread2 + 1) * 0.01f, skullProjTargetY + Main.rand.Next(-spread2, spread2 + 1) * 0.01f).SafeNormalize(Vector2.UnitY); skullProjDirection *= skullProjSpeed; skullProjDirection += npc.velocity; skullFiringPos += skullProjDirection * 5f; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, damage, 0f, Main.myPlayer, -1f); + int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, SkullDamage, 0f, Main.myPlayer, -1f); Main.projectile[skullProjectile].timeLeft = 600; if (death && handsDead) { skullProjDirection = new Vector2(skullProjTargetX, skullProjTargetY).SafeNormalize(Vector2.UnitY); skullProjDirection *= skullProjSpeed * 2f; - int skullProjectile2 = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, damage, 0f, Main.myPlayer, -2f); + int skullProjectile2 = Projectile.NewProjectile(npc.GetSource_FromAI(), skullFiringPos, skullProjDirection, type, SkullDamage, 0f, Main.myPlayer, -2f); Main.projectile[skullProjectile2].timeLeft = 600; } @@ -406,9 +392,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Float above target if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; - calamityGlobalNPC.newAI[1] += 1f; float chargePhaseChangeRateBoost = phase5 ? (death ? 24f : 8f) : phase4 ? (death ? 6f : 4f) : ((death ? 4.5f : 3f) * ((1f - lifeRatio) / (1f - phase4LifeRatio))); if (!handsDead) @@ -422,11 +405,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[1] = chargePhaseGateValue; float forcedMoveAwayTime = death ? 15f : 45f; - float canChargeDistance = phase3 ? 480f : 320f; // 20 tile distance, 30 tile distance in phase 3 + float canChargeDistance = 320f; // 20 tile distance bool hasMovedForcedDistance = npc.localAI[2] >= forcedMoveAwayTime; bool canCharge = Vector2.Distance(Main.player[npc.target].Center, npc.Center) >= canChargeDistance; bool charge = npc.ai[2] >= chargePhaseGateValue && canCharge; - bool forceCharge = npc.ai[2] > chargePhaseGateValue + 120f * chargePhaseChangeRate; + bool forceCharge = npc.ai[2] > chargePhaseGateValue + 120f; if (charge || forceCharge) { npc.localAI[2] += 1f; @@ -434,6 +417,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.ai[2] = 0f; npc.ai[1] = 1f; + npc.localAI[0] = 1f; npc.localAI[1] = chargePhaseGateValue; npc.localAI[2] = 0f; calamityGlobalNPC.newAI[1] = 0f; @@ -444,17 +428,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - float headYAcceleration = (Main.getGoodWorld ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); + float headYAcceleration = (CalamityWorld.LegendaryMode ? 0.07f : death ? (0.06f + 0.04f * (1f - lifeRatio)) : 0.04f); float headYTopSpeed = headYAcceleration * 100f; - float headXAcceleration = (Main.getGoodWorld ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); + float headXAcceleration = (CalamityWorld.LegendaryMode ? 0.21f : death ? (0.16f + 0.08f * (1f - lifeRatio)) : 0.08f); float headXTopSpeed = headXAcceleration * 100f; - float deceleration = Main.getGoodWorld ? 0.83f : death ? 0.86f : 0.89f; - - if (bossRush) - { - headYAcceleration *= 1.25f; - headXAcceleration *= 1.25f; - } + float deceleration = CalamityWorld.LegendaryMode ? 0.83f : death ? 0.86f : 0.89f; float moveAwayGateValue = chargePhaseGateValue - (5f + chargePhaseChangeRate); bool moveAwayBeforeCharge = npc.ai[2] >= moveAwayGateValue; @@ -462,8 +440,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (!canCharge || !hasMovedForcedDistance) { - float phase5Multiplier = 1.33f; - float maxVelocity = (npc.ai[2] - moveAwayGateValue) * (moveAwayVelocity * 0.008f); + float phase5Multiplier = 1.2f; + float maxVelocity = (npc.ai[2] - moveAwayGateValue) * (moveAwayVelocity * 0.002f); if (phase5) maxVelocity *= phase5Multiplier; @@ -474,7 +452,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses maxVelocity = maxVelocityCap; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * -maxVelocity; - npc.SyncMotionToServer(); } @@ -497,7 +474,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Force net updates every frame during this movement to avoid despawning in multiplayer // I'm doing this because npc.ai[2] changes every frame and that's used to calculate Skeletron's velocity here npc.ForceNetUpdate(); - return false; } @@ -542,10 +518,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spin charge else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { npc.reflectsProjectiles = true; if (Main.netMode != NetmodeID.MultiplayerClient && npc.ai[2] == 0f) @@ -599,7 +572,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } } - npc.defense -= 10; + npc.defense = npc.defDefense - 10; + npc.damage = (int)Math.Round(npc.defDamage * SpinDamageMult); float phaseChangeRateBoost = phase3 ? 0f : 1f - (lifeRatio - phase3LifeRatio) / (1f - phase3LifeRatio); npc.ai[2] += 1f + phaseChangeRateBoost; @@ -623,8 +597,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float shadowFlameProjectileSpeed = death ? 6f : 4f; Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * shadowFlameProjectileSpeed; int type = ProjectileID.Shadowflames; - int damage = npc.GetProjectileDamage(type); - int shadowFlameProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + int shadowFlameProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, ShadowflameDamage, 0f, Main.myPlayer, 0f, 1f); Main.projectile[shadowFlameProjectile].timeLeft = 600; } } @@ -646,7 +619,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float dashPhaseTime = death ? 210f : 300f; if (npc.ai[2] >= dashPhaseTime) { - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { if (Main.netMode != NetmodeID.MultiplayerClient && NPC.CountNPCS(NPCID.DarkCaster) < 6) { @@ -682,15 +655,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float skullProjSpeed = phase5 ? (6f + (death ? 2f * ((phase5LifeRatio - lifeRatio) / phase5LifeRatio) : 0f)) : 4f; Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * skullProjSpeed; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); for (int k = 0; k < chargeSkullAmt + 1; k++) { Vector2 perturbedSpeed = initialProjectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, k / (float)(chargeSkullAmt - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, -1f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, SkullDamage, 0f, Main.myPlayer, -1f); Main.projectile[proj].timeLeft = 600; if (death) { - int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, damage, 0f, Main.myPlayer, -2f); + int proj2 = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center - perturbedSpeed.SafeNormalize(Vector2.UnitY) * 5f, perturbedSpeed, type, SkullDamage, 0f, Main.myPlayer, -2f); Main.projectile[proj2].timeLeft = 600; } } @@ -719,12 +691,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float headSpinTargetDist = (float)Math.Sqrt(headSpinTargetX * headSpinTargetX + headSpinTargetY * headSpinTargetY); // Increase speed while charging - npc.damage = (int)Math.Round(npc.defDamage * 1.3); - if (!phase3) { float velocityBoost = MathHelper.Lerp(0f, 3f, (1f - lifeRatio) / (1f - phase3LifeRatio)); - if (handsDead || bossRush) + if (handsDead) headSpinVelocityMult += velocityBoost; } @@ -737,7 +707,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses headSpinVelocityMult *= baseDistanceVelocityMult; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) headSpinVelocityMult *= 1.3f; headSpinTargetDist = headSpinVelocityMult / headSpinTargetDist; @@ -752,7 +722,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] < altDashPhaseTime) { if (npc.Center.Distance(Main.player[npc.target].Center) > altDashStopDistance || npc.ai[2] == 1f + phaseChangeRateBoost) - npc.velocity = headSpinVelocity.SafeNormalize(Vector2.UnitY) * headSpinVelocityMult + npc.Center.DirectionTo(Main.player[npc.target].Center + (bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero)) * 2f; + npc.velocity = headSpinVelocity.SafeNormalize(Vector2.UnitY) * headSpinVelocityMult + npc.Center.DirectionTo(Main.player[npc.target].Center) * 2f; else npc.ai[2] = altDashPhaseTime; } @@ -795,9 +765,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - // Avoid cheap bullshit - npc.damage = 0; - npc.velocity.Y += 0.1f; if (npc.velocity.Y < 0f) npc.velocity.Y *= 0.95f; @@ -830,8 +797,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -902,7 +868,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float velocityMultiplier = MathHelper.Lerp(death ? 0.6f : 0.7f, 1f, skeletronLifeRatio); float velocityIncrement = MathHelper.Lerp(0.2f, death ? 0.4f : 0.3f, 1f - skeletronLifeRatio); float handSwipeVelocity = MathHelper.Lerp(16f, death ? 24f : 20f, 1f - skeletronLifeRatio); - float deceleration = Main.getGoodWorld ? 0.78f : death ? 0.82f : 0.86f; + float deceleration = CalamityWorld.LegendaryMode ? 0.78f : death ? 0.82f : 0.86f; if (death) { @@ -924,9 +890,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 0f || npc.ai[2] == 3f) { - // Avoid cheap bullshit - npc.damage = 0; - if (Main.npc[(int)npc.ai[1]].ai[1] == 3f && npc.timeLeft > 10) npc.timeLeft = 10; @@ -1050,9 +1013,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[2] == 1f) { - // Avoid cheap bullshit - npc.damage = 0; - Vector2 handCurrentPosition = npc.Center; float handDrawbackXPos = Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0] - handCurrentPosition.X; float handDrawbackYPos = Main.npc[(int)npc.ai[1]].Top.Y + 230f - handCurrentPosition.Y; @@ -1068,9 +1028,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.Top.Y < Main.npc[(int)npc.ai[1]].Top.Y - 200f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] = 2f; npc.ai[3] = 0f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * handSwipeVelocity; @@ -1079,9 +1036,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 2f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[3] += 1f; if (npc.ai[3] >= handSwipeDuration || Vector2.Distance(Main.npc[(int)npc.ai[1]].Center, npc.Center) > handSwipeDistance || cancelSlap) { @@ -1099,8 +1053,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float skullProjSpeed = handSwipeVelocity * (phase3 ? 0.6f : 0.2f); Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * skullProjSpeed; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, damage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); + int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, SkullDamage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); Main.projectile[skullProjectile].timeLeft = 600; } } @@ -1109,9 +1062,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 4f) { - // Avoid cheap bullshit - npc.damage = 0; - Vector2 handStrikeCurrentPos = npc.Center; float handStrikeXPos = Main.npc[(int)npc.ai[1]].Center.X - 200f * npc.ai[0] - handStrikeCurrentPos.X; float handStrikeYPos = Main.npc[(int)npc.ai[1]].Top.Y + 230f - handStrikeCurrentPos.Y; @@ -1127,9 +1077,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 500f || npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X + 500f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] = 5f; npc.ai[3] = 0f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * handSwipeVelocity; @@ -1138,9 +1085,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[2] == 5f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[3] += 1f; if (npc.ai[3] >= handSwipeDuration || Vector2.Distance(Main.npc[(int)npc.ai[1]].Center, npc.Center) > handSwipeDistance || cancelSlap) { @@ -1158,8 +1102,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float skullProjSpeed = handSwipeVelocity * (phase3 ? 0.6f : 0.2f); Vector2 initialProjectileVelocity = npc.Center.DirectionTo(Main.player[npc.target].Center) * skullProjSpeed; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, damage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); + int skullProjectile = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center, initialProjectileVelocity, type, SkullDamage, 0f, Main.myPlayer, -(phase3 ? 2f : 1f)); Main.projectile[skullProjectile].timeLeft = 600; } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs index e4889ff152..77cd83cc81 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/SkeletronPrimeAI.cs @@ -17,12 +17,19 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class SkeletronPrimeAI { + // Vanilla values + public static int SpinDamageMult = 2; // 158 + public static int LaserDamage = 25; // 100 + + // Rev+ exclusive + public static int SkullDamage = 25; // 100 + public static int RocketDamage = 30; // 120 + public static bool BuffedSkeletronPrimeAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -37,119 +44,42 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spawn arms if (calamityGlobalNPC.newAI[1] == 0f) { + CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); calamityGlobalNPC.newAI[1] = 1f; if (Main.netMode != NetmodeID.MultiplayerClient) { - // Spawn second head in Master Mode - // The main head owns the Saw and the Laser in Master Mode - if (death) - { - int head = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType(), npc.whoAmI); - Main.npc[head].ai[0] = npc.whoAmI; - Main.npc[head].target = npc.target; - Main.npc[head].netUpdate = true; - npc.ai[0] = head; + int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeCannon, npc.whoAmI); + Main.npc[arm].ai[0] = -1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; - int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); + Main.npc[arm].ai[0] = 1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - Main.npc[arm].ai[3] = 150f; + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeVice, npc.whoAmI); + Main.npc[arm].ai[0] = -1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].ai[3] = 150f; + Main.npc[arm].netUpdate = true; - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", Main.npc[head].TypeName), 175, 75); - else if (Main.dedServ) - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", Main.npc[head].GetTypeNetName()), new Color(175, 75, 255)); - } - else - { - int arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeCannon, npc.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeSaw, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeVice, npc.whoAmI); - Main.npc[arm].ai[0] = -1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].ai[3] = 150f; - Main.npc[arm].netUpdate = true; - - arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); - Main.npc[arm].ai[0] = 1f; - Main.npc[arm].ai[1] = npc.whoAmI; - Main.npc[arm].target = npc.target; - Main.npc[arm].netUpdate = true; - Main.npc[arm].ai[3] = 150f; - } + arm = NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, NPCID.PrimeLaser, npc.whoAmI); + Main.npc[arm].ai[0] = 1f; + Main.npc[arm].ai[1] = npc.whoAmI; + Main.npc[arm].target = npc.target; + Main.npc[arm].netUpdate = true; + Main.npc[arm].ai[3] = 150f; } npc.netUpdate = true; npc.SyncExtraAI(); } - if (death) - { - if (!Main.npc[(int)npc.ai[0]].active || Main.npc[(int)npc.ai[0]].aiStyle != NPCAIStyleID.SkeletronPrimeHead) - { - npc.life = 0; - npc.HitEffect(); - npc.active = false; - npc.netUpdate = true; - } - else - { - // Link the HP of both heads - if (npc.life > Main.npc[(int)npc.ai[0]].life) - npc.life = Main.npc[(int)npc.ai[0]].life; - - // Push away from the lead head if too close, pull closer if too far, if Mechdusa isn't real - if (!NPC.IsMechQueenUp) - { - float pushVelocity = 0.25f; - if (Vector2.Distance(npc.Center, Main.npc[(int)npc.ai[0]].Center) < 80f * npc.scale) - { - if (npc.position.X < Main.npc[(int)npc.ai[0]].position.X) - npc.velocity.X -= pushVelocity; - else - npc.velocity.X += pushVelocity; - - if (npc.position.Y < Main.npc[(int)npc.ai[0]].position.Y) - npc.velocity.Y -= pushVelocity; - else - npc.velocity.Y += pushVelocity; - } - else if (Vector2.Distance(npc.Center, Main.npc[(int)npc.ai[0]].Center) > 240f * npc.scale) - { - if (npc.position.X < Main.npc[(int)npc.ai[0]].position.X) - npc.velocity.X += pushVelocity; - else - npc.velocity.X -= pushVelocity; - - if (npc.position.Y < Main.npc[(int)npc.ai[0]].position.Y) - npc.velocity.Y += pushVelocity; - else - npc.velocity.Y -= pushVelocity; - } - } - } - } - // Check if arms are alive bool cannonAlive = false; bool laserAlive = false; @@ -179,76 +109,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.chaseable = allArmsDead; npc.defense = npc.defDefense; + npc.damage = npc.defDamage; // Phases bool phase2 = lifeRatio < 0.66f; - bool spawnDestroyer = lifeRatio < 0.75f && death && !bossRush && npc.localAI[2] == 0f; bool phase3 = lifeRatio < 0.33f; - bool spawnRetinazer = lifeRatio < 0.5f && death && !bossRush && npc.localAI[2] == 1f; - - // Spawn The Destroyer in Master Mode (just like Oblivion from Avalon) - if (spawnDestroyer) - { - Player destroyerSpawnPlayer = Main.player[Player.FindClosest(npc.position, npc.width, npc.height)]; - SoundEngine.PlaySound(SoundID.Roar, destroyerSpawnPlayer.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int destroyer = NPC.NewNPC(NPC.GetBossSpawnSource(destroyerSpawnPlayer.whoAmI), (int)destroyerSpawnPlayer.Center.X, (int)destroyerSpawnPlayer.Center.Y + 810, NPCID.TheDestroyer, 1); - if (destroyer != Main.maxNPCs) - { - Main.npc[destroyer].target = destroyerSpawnPlayer.whoAmI; - Main.npc[destroyer].timeLeft *= 20; - Main.npc[destroyer].localAI[3] = 1f; - Main.npc[destroyer].SyncVanillaLocalAI(); - string typeName = Main.npc[destroyer].TypeName; - if (Main.dedServ && destroyer < Main.maxNPCs) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, destroyer); - - AchievementsHelper.CheckMechaMayhem(); - - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Language.GetTextValue("Announcement.HasAwoken", typeName), 175, 75); - else if (Main.dedServ) - ChatHelper.BroadcastChatMessage(NetworkText.FromKey("Announcement.HasAwoken", Main.npc[destroyer].GetTypeNetName()), new Color(175, 75, 255)); - } - } - - npc.localAI[2] = 1f; - npc.SyncVanillaLocalAI(); - } - - // Spawn Retinazer in Master Mode (just like Oblivion from Avalon) - if (spawnRetinazer) - { - Player retinazerSpawnPlayer = Main.player[Player.FindClosest(npc.position, npc.width, npc.height)]; - SoundEngine.PlaySound(SoundID.Roar, retinazerSpawnPlayer.Center); - - if (Main.netMode != NetmodeID.MultiplayerClient) - { - int retinazer = NPC.NewNPC(NPC.GetBossSpawnSource(retinazerSpawnPlayer.whoAmI), (int)retinazerSpawnPlayer.Center.X, (int)retinazerSpawnPlayer.Center.Y - 810, NPCID.Retinazer, 1); - if (retinazer != Main.maxNPCs) - { - Main.npc[retinazer].target = retinazerSpawnPlayer.whoAmI; - Main.npc[retinazer].timeLeft *= 20; - Main.npc[retinazer].localAI[3] = 1f; - Main.npc[retinazer].SyncVanillaLocalAI(); - string typeName = Main.npc[retinazer].TypeName; - if (Main.dedServ && retinazer < Main.maxNPCs) - NetMessage.SendData(MessageID.SyncNPC, -1, -1, null, retinazer); - - AchievementsHelper.CheckMechaMayhem(); - - if (Main.netMode == NetmodeID.SinglePlayer) - Main.NewText(Lang.misc[48].Value, 175, 75); - else if (Main.dedServ) - ChatHelper.BroadcastChatMessage(Lang.misc[48].ToNetworkText(), new Color(175, 75, 255)); - } - } - - npc.localAI[2] = 2f; - npc.SyncVanillaLocalAI(); - } // Despawn if (npc.ai[1] != 3f) @@ -265,7 +130,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Activate daytime enrage - if (Main.IsItDay() && !bossRush && npc.ai[1] != 3f && npc.ai[1] != 2f) + if (Main.IsItDay() && !BossRushEvent.BossRushActive && npc.ai[1] != 3f && npc.ai[1] != 2f) { // Heal if (Main.netMode != NetmodeID.MultiplayerClient) @@ -292,40 +157,24 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; npc.buffImmune[ModContent.BuffType()] = immuneToSlowingDebuffs; - npc.buffImmune[BuffID.Slow] = immuneToSlowingDebuffs; npc.buffImmune[BuffID.Webbed] = immuneToSlowingDebuffs; bool normalLaserRotation = npc.localAI[1] % 2f == 0f; - // Prevents cheap hits - bool canUseAttackInMaster = npc.position.Y < Main.player[npc.target].position.Y - 350f; - // Float near player if (npc.ai[1] == 0f || npc.ai[1] == 4f) { - // Avoid unfair bullshit - npc.damage = 0; - // Start other phases; if arms are dead, start with spin phase - bool otherHeadChargingOrSpinning = Main.npc[(int)npc.ai[0]].ai[1] == 5f || Main.npc[(int)npc.ai[0]].ai[1] == 1f; - if (phase2 || CalamityWorld.LegendaryMode || allArmsDead || death) + if (phase2 || CalamityWorld.LegendaryMode || allArmsDead) { // Start spin phase after 1.5 seconds npc.ai[2] += phase3 ? 1.5f : 1f; - if (npc.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f)) && (!otherHeadChargingOrSpinning || !death || phase3) && (canUseAttackInMaster || !death)) + if (npc.ai[2] >= (90f - (death ? 15f * (1f - lifeRatio) : 0f))) { bool shouldSpinAround = npc.ai[1] == 4f && npc.position.Y < Main.player[npc.target].position.Y - 320f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) < 600f && Vector2.Distance(Main.player[npc.target].Center, npc.Center) > 400f; - bool shouldCharge = death && !phase2 && !allArmsDead && !CalamityWorld.LegendaryMode; - if (shouldCharge) - { - npc.ai[2] = 0f; - npc.ai[1] = 1f; - CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); - npc.netUpdate = true; - } - else if (shouldSpinAround || npc.ai[1] != 4f) + if (shouldSpinAround || npc.ai[1] != 4f) { if (shouldSpinAround) { @@ -335,6 +184,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] = 0f; npc.ai[1] = shouldSpinAround ? 5f : 1f; + CalamityUtils.CalamityTargeting(npc, CalamityTargetingParameters.BossDefaults); npc.netUpdate = true; } } @@ -345,7 +195,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else npc.rotation = npc.velocity.X / 15f; - float acceleration = bossRush ? 0.2f : (death ? (0.12f + 0.05f * (1f - lifeRatio)) : 0.1f); + float acceleration = death ? (0.12f + 0.05f * (1f - lifeRatio)) : 0.1f; float accelerationMult = 1f; if (!cannonAlive) { @@ -426,8 +276,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Spinning if (npc.ai[1] == 1f) { - npc.defense *= 2; - npc.damage = npc.defDamage * 2; + npc.defense = npc.defDefense * 2; + npc.damage = npc.defDamage * SpinDamageMult; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; @@ -438,21 +288,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { npc.localAI[0] = 0f; - int totalProjectiles = bossRush ? 24 : death ? 15 : 12; + int totalProjectiles = death ? 15 : 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float velocity = 3f; double angleA = radians * 0.5; @@ -462,7 +300,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 laserFireDirection = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; } npc.localAI[1] += 1f; @@ -496,7 +334,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float headTargetY = Main.player[npc.target].Center.Y - headPosition.Y; float headTargetDistance = (float)Math.Sqrt(headTargetX * headTargetX + headTargetY * headTargetY); - float speed = bossRush ? 12f : death ? 8f : 6f; + float speed = death ? 8f : 6f; if (phase2) speed += 0.5f; if (phase3) @@ -595,9 +433,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Despawning if (npc.ai[1] == 3f) { - // Avoid unfair bullshit - npc.damage = 0; - if (NPC.IsMechQueenUp) { int mechdusaBossDespawning = NPC.FindFirstNPC(NPCID.Retinazer); @@ -641,16 +476,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Fly around in a circle if (npc.ai[1] == 5f) { - // Avoid unfair bullshit - npc.damage = 0; - npc.ai[2] += 1f; npc.rotation = npc.velocity.X / 50f; - float skullSpawnDivisor = bossRush ? 9f : death ? 15f - (float)Math.Round(3f * (1f - lifeRatio)) : 15f; + float skullSpawnDivisor = death ? 15f - (float)Math.Round(3f * (1f - lifeRatio)) : 15f; float totalSkulls = 12f; - int skullSpread = bossRush ? 250 : death ? 125 : 100; + int skullSpread = death ? 125 : 100; // Spin for about 3 seconds // Decreasing this number will INCREASE how fast he moves while spinning @@ -705,27 +537,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses enragedHeadSkullTargetY = value.Y; int type = ProjectileID.Skull; - int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - if (npc.localAI[0] % 3f == 0f) - { - int probeLimit = death ? 3 : 2; - if (NPC.CountNPCS(NPCID.Probe) < probeLimit) - NPC.NewNPC(npc.GetSource_FromAI(), (int)headCenter.X, (int)headCenter.Y + 30, NPCID.Probe); - } - - int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, damage, 0f, Main.myPlayer, -3f, 0f); + int enragedSkulls = Projectile.NewProjectile(npc.GetSource_FromAI(), headCenter.X, headCenter.Y + 30f, enragedHeadSkullTargetX, enragedHeadSkullTargetY, type, SkullDamage.CalculateMechDamage(), 0f, Main.myPlayer, -3f, 0f); Main.projectile[enragedSkulls].timeLeft = 480; Main.projectile[enragedSkulls].tileCollide = false; } @@ -754,13 +567,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Fly overhead and spit missiles if (npc.ai[1] == 6f) { - // Avoid unfair bullshit - npc.damage = 0; - npc.rotation = npc.velocity.X / 15f; - float flightVelocity = bossRush ? 29f : death ? 25f : 18f; - float flightAcceleration = bossRush ? 1.12f : death ? 0.96f : 0.6f; + float flightVelocity = death ? 25f : 18f; + float flightAcceleration = death ? 0.96f : 0.6f; Vector2 destination = new Vector2(Main.player[npc.target].Center.X, Main.player[npc.target].Center.Y - 420f); npc.SimpleFlyMovement((destination - npc.Center).SafeNormalize(Vector2.UnitY) * flightVelocity, flightAcceleration); @@ -769,8 +579,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.localAI[3] += 1f; if (Vector2.Distance(npc.Center, destination) < 80f || npc.ai[2] > 0f || npc.localAI[3] > 120f) { - float missileSpawnDivisor = death ? 10f : 12f; - float totalMissiles = death ? 12f : 10f; + float missileSpawnDivisor = 12f; + float totalMissiles = 10f; npc.ai[2] += 1f; if (npc.ai[2] % missileSpawnDivisor == 0f) { @@ -780,20 +590,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 velocity = (-Vector2.UnitY * 3f).RotatedByRandom(MathHelper.Pi / 8f); int type = ProjectileID.RocketSkeleton; - int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 30f, velocity.X, velocity.Y, type, damage, 0f, Main.myPlayer, npc.target, 1f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center.X + Main.rand.Next(npc.width / 2), npc.Center.Y + 30f, velocity.X, velocity.Y, type, RocketDamage.CalculateMechDamage(), 0f, Main.myPlayer, npc.target, 1f); Main.projectile[proj].timeLeft = 540; } @@ -821,8 +619,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeLaserAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -875,13 +672,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } - // Avoid cheap bullshit - npc.damage = 0; - bool normalLaserRotation = npc.localAI[1] % 2f == 0f; // Movement - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -985,26 +779,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] >= 48f) { npc.localAI[0] = 0f; - float laserSpeed = bossRush ? 5f : 4f; + float laserSpeed = 4f; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } laserArmTargetDist = laserSpeed / laserArmTargetDist; laserArmTargetX *= laserArmTargetDist; laserArmTargetY *= laserArmTargetDist; Vector2 laserVelocity = new Vector2(laserArmTargetX, laserArmTargetY); - Projectile.NewProjectile(npc.GetSource_FromAI(), laserArmPosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 100f, laserVelocity, type, damage, 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(npc.GetSource_FromAI(), laserArmPosition + laserVelocity.SafeNormalize(Vector2.UnitY) * 100f, laserVelocity, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); } } } @@ -1052,21 +834,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.localAI[0] >= 120f) { npc.localAI[0] = 0f; - int totalProjectiles = bossRush ? 32 : death ? 24 : 16; + int totalProjectiles = death ? 24 : 16; float radians = MathHelper.TwoPi / totalProjectiles; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float velocity = 3f; double angleA = radians * 0.5; @@ -1076,7 +846,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int k = 0; k < totalProjectiles; k++) { Vector2 laserFireDirection = spinningPoint.RotatedBy(radians * k); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserFireDirection.SafeNormalize(Vector2.UnitY) * 100f, laserFireDirection, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; } npc.localAI[1] += 1f; @@ -1089,8 +859,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeCannonAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1141,9 +910,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SyncExtraAI(); } - // Avoid cheap bullshit - npc.damage = 0; - bool fireSlower = false; if (laserAlive) { @@ -1203,7 +969,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } // Movement - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!laserAlive) { @@ -1289,18 +1055,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item62, npc.Center); npc.localAI[0] = 0f; int type = ProjectileID.RocketSkeleton; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float rocketSpeed = 10f; cannonArmTargetDist = rocketSpeed / cannonArmTargetDist; @@ -1308,7 +1062,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses cannonArmTargetY *= cannonArmTargetDist; Vector2 rocketVelocity = new Vector2(cannonArmTargetX, cannonArmTargetY); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), cannonArmPosition + rocketVelocity.SafeNormalize(Vector2.UnitY) * 40f, rocketVelocity, type, damage, 0f, Main.myPlayer, npc.target, 2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), cannonArmPosition + rocketVelocity.SafeNormalize(Vector2.UnitY) * 40f, rocketVelocity, type, RocketDamage.CalculateMechDamage(), 0f, Main.myPlayer, npc.target, 2f); Main.projectile[proj].timeLeft = 540; } } @@ -1336,27 +1090,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item62, npc.Center); npc.localAI[0] = 0f; int type = ProjectileID.RocketSkeleton; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } float rocketSpeed = 10f; Vector2 cannonSpreadTargetDist = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * rocketSpeed; - int numProj = bossRush ? 5 : 3; - float rotation = MathHelper.ToRadians(bossRush ? 15 : 9); + int numProj = 3; + float rotation = MathHelper.ToRadians(9); for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = cannonSpreadTargetDist.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 40f, perturbedSpeed, type, damage, 0f, Main.myPlayer, npc.target, 2f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 40f, perturbedSpeed, type, RocketDamage.CalculateMechDamage(), 0f, Main.myPlayer, npc.target, 2f); Main.projectile[proj].timeLeft = 600; } } @@ -1368,8 +1110,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeViceAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1427,13 +1168,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sawAlive = true; } - // Avoid cheap bullshit - npc.damage = 0; - // Return to the head if (npc.ai[2] == 99f) { - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1523,7 +1261,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1613,10 +1351,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 280f) { - // Set damage - npc.damage = npc.defDamage; - - float chargeVelocity = bossRush ? 20f : 16f; + float chargeVelocity = 16f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1639,9 +1374,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge 4 times (more if arms are dead) else if (npc.ai[2] == 2f) { - // Set damage - npc.damage = npc.defDamage; - if (npc.position.Y > Main.player[npc.target].position.Y || npc.velocity.Y < 0f) { float chargeAmt = 4f; @@ -1681,10 +1413,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.Center.X < Main.npc[(int)npc.ai[1]].Center.X - 500f || npc.Center.X > Main.npc[(int)npc.ai[1]].Center.X + 500f) { - // Set damage - npc.damage = npc.defDamage; - - float chargeVelocity = bossRush ? 17.5f : 14f; + float chargeVelocity = 14f; if (!cannonAlive) chargeVelocity += 1f; if (!laserAlive) @@ -1707,9 +1436,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge 4 times (more if arms are dead) else if (npc.ai[2] == 5f && npc.Center.X < Main.player[npc.target].Center.X - 100f) { - // Set damage - npc.damage = npc.defDamage; - float chargeAmt = 4f; if (!cannonAlive) chargeAmt += 1f; @@ -1736,8 +1462,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public static bool BuffedPrimeSawAI(NPC npc, Mod mod) { - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -1791,15 +1516,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses viceAlive = true; } - // Min saw damage - int reducedSetDamage = (int)Math.Round(npc.defDamage * 0.5); - - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - if (npc.ai[2] == 99f) { - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1885,7 +1604,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.netUpdate = true; } - float acceleration = bossRush ? 0.6f : death ? 0.375f : 0.25f; + float acceleration = death ? 0.375f : 0.25f; float accelerationMult = 1f; if (!cannonAlive) { @@ -1969,10 +1688,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.position.Y < Main.npc[(int)npc.ai[1]].position.Y - 200f) { - // Set damage - npc.damage = npc.defDamage; - - float chargeVelocity = bossRush ? 27.5f : 22f; + float chargeVelocity = 22f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -1994,9 +1710,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[2] == 2f) { - // Set damage - npc.damage = npc.defDamage; - if (npc.position.Y > Main.player[npc.target].position.Y || npc.velocity.Y < 0f) npc.ai[2] = 3f; } @@ -2005,10 +1718,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (npc.ai[2] == 4f) { - // Set damage - npc.damage = npc.defDamage; - - float chargeVelocity = bossRush ? 13.5f : 11f; + float chargeVelocity = 11f; if (!cannonAlive) chargeVelocity += 1.5f; if (!laserAlive) @@ -2026,7 +1736,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses sawArmOtherChargeTargetX *= sawArmOtherChargeTargetDist; sawArmOtherChargeTargetY *= sawArmOtherChargeTargetDist; - float acceleration = bossRush ? 0.3f : death ? 0.125f : 0.08f; + float acceleration = death ? 0.125f : 0.08f; float deceleration = death ? 0.6f : 0.8f; if (npc.velocity.X > sawArmOtherChargeTargetX) diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs index 10f0500657..b9c320c399 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/TwinsAI.cs @@ -13,12 +13,37 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { public static class TwinsAI { + // Vanilla values + public static float RapidFireDamageMult = 0.75f; // 80 (buffed) + public static float RetinazerPhase2ContactDamageMult = 1.5f; // 114 + public static float SpazmatismPhase2ContactDamageMult = 1.5f; // 127 + public static int FlamethrowerDamage = 27; // 108; Applies to both flamethrower types + public static int FireballDamage = 22; // 88; Applies to both fireball types + + // Rev+ exclusive + public static int LaserDamage = 23; // 92 (buffed) + public static int RedLaserDamage = 27; // 108 (buffed) + public static int HomingDartDamage = 27; // 108 + + public static int CalculateMechDamage(this int damage) + { + // Reduce mech boss projectile damage depending on the new ore progression changes + if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) + { + double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; + double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; + if (!NPC.downedMechBossAny) + damage = (int)(damage * firstMechMultiplier); + else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) + damage = (int)(damage * secondMechMultiplier); + } + return damage; + } + public static bool BuffedRetinazerAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -28,13 +53,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -71,37 +89,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { for (int i = 0; i < Main.maxNPCs; i++) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism || Main.npc[i].type == ModContent.NPCType()) && Main.npc[i].timeLeft - 1 > npc.timeLeft) + if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism) && Main.npc[i].timeLeft - 1 > npc.timeLeft) npc.timeLeft = Main.npc[i].timeLeft - 1; } } - // Check for Oblivion in Master Mode - bool oblivionAlive = false; - if (death && !bossRush && npc.localAI[3] == 1f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - { - oblivionAlive = true; - break; - } - } - } - - // Foveanator spawn - if (!oblivionAlive && death && calamityGlobalNPC.newAI[0] == 0f && Main.netMode != NetmodeID.MultiplayerClient && !bossRush) - { - NPC.NewNPC(npc.GetSource_FromAI(), (int)npc.Center.X, (int)npc.Center.Y, ModContent.NPCType()); - calamityGlobalNPC.newAI[0] = 1f; - npc.SyncExtraAI(); - } - - bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); - // Phase HP ratios - float phase2LifeRatio = oblivionAlive ? 0.5f : death ? 0.85f : 0.7f; + float phase2LifeRatio = death ? 0.85f : 0.7f; float finalPhaseLifeRatio = death ? 0.4f : 0.25f; // Movement variables @@ -112,16 +106,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Phase duration variables float phase1MaxLaserPhaseDurationDecrease = death ? 120f : 300f; - // If Oblivion is alive reduce aggression of all attacks - if (oblivionAlive) - { - phase1MaxSpeedIncrease = death ? 1f : 2f; - phase1MaxAccelerationIncrease = death ? 0.0125f : 0.025f; - phase1MaxChargeSpeedIncrease = death ? 1.5f : 3f; - - phase1MaxLaserPhaseDurationDecrease = death ? 60f : 150f; - } - // Phase checks bool phase2 = lifeRatio < phase2LifeRatio; bool finalPhase = lifeRatio < finalPhaseLifeRatio; @@ -141,8 +125,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.reflectsProjectiles = false; // Despawn - bool oblivionFightDespawn = ((oblivionAlive && lifeRatio < 0.8f) || (oblivionAlive && !spazAlive && lifeRatio < 0.95f)) && npc.localAI[3] == 1f; - if (Main.player[npc.target].dead || oblivionFightDespawn) + if ((Main.player[npc.target].dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) @@ -156,13 +139,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; - - float maxVelocity = 8.25f; - float acceleration = 0.115f; - maxVelocity += 4f * enrageScale; - acceleration += 0.05f * enrageScale; + float maxVelocity = (death ? 9.45f : 8.25f); + float acceleration = (death ? 0.13f : 0.115f); if (death) { @@ -170,7 +148,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -199,7 +177,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.SimpleFlyMovement(idealVelocity * maxVelocity, acceleration); float phaseGateValue = death ? (300f - phase1MaxLaserPhaseDurationDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))) : 450f; - float laserGateValue = oblivionAlive ? 60f : foveanatorAlive ? 45f : 30f; + float laserGateValue = 30f; if (NPC.IsMechQueenUp) { phaseGateValue = 900f; @@ -224,7 +202,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.ai[3] += 0.5f; } @@ -234,23 +212,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { - float laserSpeed = 10.5f; - laserSpeed += 3f * enrageScale; + float laserSpeed = death ? 11.4f : 10.5f; int type = ProjectileID.EyeLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - + int damage = LaserDamage.CalculateMechDamage(); Vector2 laserVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 90f, laserVelocity, type, damage, 0f, Main.myPlayer); } @@ -260,16 +225,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - npc.rotation = hoverRotation; - float chargeSpeed = 15f; - chargeSpeed += 10f * enrageScale; + float chargeSpeed = death ? 18f : 15f; if (death) chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -278,16 +239,10 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] += 1f; float decelerateGateValue = (death ? 36f : 32f) + (death ? 6f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); if (npc.ai[2] >= decelerateGateValue) { - // Avoid cheap bullshit - npc.damage = 0; - float decelerationMultiplier = (death ? 0.84f : 0.92f) - (death ? 0.16f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); npc.velocity *= decelerationMultiplier; @@ -300,7 +255,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = npc.velocity.ToRotation() - MathHelper.PiOver2; float delayBeforeChargingAgain = (death ? 48f : 56f) - (death ? 3f * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 0f); - if (npc.ai[2] >= delayBeforeChargingAgain + (oblivionAlive ? 15f : 0f)) + if (npc.ai[2] >= delayBeforeChargingAgain) { npc.ai[3] += 1f; npc.ai[2] = 0f; @@ -308,8 +263,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; float totalCharges = death ? 6f : 5f; - if (foveanatorAlive) - totalCharges -= 1f; if (npc.ai[3] >= totalCharges) { @@ -343,9 +296,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - if (NPC.IsMechQueenUp) npc.reflectsProjectiles = true; @@ -372,31 +322,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses SoundEngine.PlaySound(SoundID.Item33, npc.Center); if (Main.netMode != NetmodeID.MultiplayerClient) { - bool shootLaser = npc.ai[1] % 20f == 0f; - int type = shootLaser ? ProjectileID.DeathLaser : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); + int type = ProjectileID.DeathLaser; - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? 6f : 7f); - int numProj = shootLaser ? 6 : 2; - int spread = shootLaser ? 20 : 80; - float rotation = MathHelper.ToRadians(spread); - float offset = shootLaser ? 90f : 50f; - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * offset, perturbedSpeed, type, damage, 0f, Main.myPlayer); - } + Vector2 projectileVelocity = npc.rotation.ToRotationVector2() * 7f; + float offset = 90f; + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + Vector2.Normalize(projectileVelocity) * offset, projectileVelocity, type, LaserDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -450,7 +380,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.chaseable = !spazInPhase1; - int setDamage = (int)Math.Round(npc.defDamage * 1.5); + npc.damage = (int)Math.Round(npc.defDamage * RetinazerPhase2ContactDamageMult); npc.defense = npc.defDefense + 10; calamityGlobalNPC.DR = spazInPhase1 ? 0.9999f : 0.2f; calamityGlobalNPC.unbreakableDR = spazInPhase1; @@ -460,21 +390,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; + float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; + float acceleration = death ? 0.1975f + 0.05f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.175f; - float maxVelocity = 9.5f + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.175f + (death ? 0.05f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 4.5f * enrageScale; - acceleration += 0.075f * enrageScale; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; } - float distanceFromTarget = oblivionAlive ? 480f : 420f; + float distanceFromTarget = 420f; Vector2 destination = Main.player[npc.target].Center - Vector2.UnitY * distanceFromTarget; float distanceFromDestination = (destination - npc.Center).Length(); Vector2 idealVelocity = (destination - npc.Center).SafeNormalize(Vector2.UnitX * direction); @@ -516,30 +441,17 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] >= (spazAlive ? (oblivionAlive ? 76f : foveanatorAlive ? 64f : 52f) : foveanatorAlive ? 39f : 26f)) + if (npc.localAI[1] >= (spazAlive ? 52f : 26f)) { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { npc.localAI[1] = 0f; float laserSpeed = 10f; - laserSpeed += enrageScale; int type = ProjectileID.DeathLaser; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 laserVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 120f, laserVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 120f, laserVelocity, type, RedLaserDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -548,21 +460,16 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { if (npc.ai[1] == 1f) { - // Avoid cheap bullshit - npc.damage = 0; + float maxVelocity = death ? 10.85f + 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 9.5f; + float acceleration = death ? 0.295f + 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0.25f; - float maxVelocity = 9.5f + (death ? 3f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.25f + (death ? 0.075f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 4.5f * enrageScale; - acceleration += 0.15f * enrageScale; - - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; } - float distanceFromTarget = oblivionAlive ? 480f : 420f; + float distanceFromTarget = 420f; Vector2 destination = Main.player[npc.target].Center + Vector2.UnitX * distanceFromTarget * direction; float distanceFromDestination = (destination - npc.Center).Length(); Vector2 idealVelocity = (destination - npc.Center).SafeNormalize(Vector2.UnitX * direction); @@ -573,27 +480,15 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { npc.localAI[1] += 1f + (death ? (phase2LifeRatio - lifeRatio) / phase2LifeRatio : 0f); - if (npc.localAI[1] > (spazAlive ? (oblivionAlive ? 30f : foveanatorAlive ? 25f : 20f) : foveanatorAlive ? 15f : 10f)) + if (npc.localAI[1] > (spazAlive ? 20f : 10f)) { if (Collision.CanHit(npc.position, npc.width, npc.height, Main.player[npc.target].position, Main.player[npc.target].width, Main.player[npc.target].height)) { npc.localAI[1] = 0f; float laserSpeed = 9f; - laserSpeed += enrageScale; int type = ProjectileID.DeathLaser; - int damage = (int)Math.Round(npc.GetProjectileDamage(type) * 0.75); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } + int damage = (int)Math.Round(RedLaserDamage.CalculateMechDamage() * RapidFireDamageMult); Vector2 laserVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 120f, laserVelocity, type, damage, 0f, Main.myPlayer); @@ -619,17 +514,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = setDamage; - // Set rotation and velocity npc.rotation = hoverRotation; - float chargeSpeed = 22f + (death ? 8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 10f * enrageScale; + float chargeSpeed = (death ? 25f : 22f) + (death ? 8f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (!spazAlive) chargeSpeed += 2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) chargeSpeed += 2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * chargeSpeed; @@ -639,9 +530,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (npc.ai[1] == 3f) { - // Set damage - npc.damage = setDamage; - npc.ai[2] += 1f; float chargeTime = spazAlive ? 45f : 30f; @@ -649,14 +537,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeTime = spazAlive ? 90f : 60f; if (death) chargeTime -= chargeTime * 0.25f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio); - chargeTime -= chargeTime / 5 * enrageScale; + chargeTime -= chargeTime * (death ? 0.06f : 0f); // Slow down if (npc.ai[2] >= chargeTime) { - // Avoid cheap bullshit - npc.damage = 0; - npc.velocity *= 0.93f; if (Math.Abs(npc.velocity.X) < 0.1) @@ -670,7 +555,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[3] % 3f == 0f) { - float fireRate = spazAlive ? 13f : foveanatorAlive ? 11f : 9f; + float fireRate = spazAlive ? 13f : 9f; if (npc.ai[2] % fireRate == 0f) { SoundEngine.PlaySound(SoundID.Item33, npc.Center); @@ -678,7 +563,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float laserDartSpeed = (death ? 9f : 6f) * (spazAlive ? 1f : 1.5f); int type = ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); + int damage = HomingDartDamage.CalculateMechDamage(); // Reduce mech boss projectile damage depending on the new ore progression changes if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) @@ -700,7 +585,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge four times float chargeGateValue = 30f; - chargeGateValue -= chargeGateValue / 4 * enrageScale; + chargeGateValue -= chargeGateValue * (death ? 0.07f : 0f); if (npc.ai[2] >= chargeTime + chargeGateValue) { npc.ai[2] = 0f; @@ -735,14 +620,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Get in position for charge else if (npc.ai[1] == 4f) { - // Avoid cheap bullshit - npc.damage = 0; - float chargeLineUpDistance = spazAlive ? 600f : 500f; - float chargeSpeed = 18f + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float chargeAcceleration = 0.45f + (death ? 0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 6f * enrageScale; - chargeAcceleration += 0.15f * enrageScale; + float chargeSpeed = (death ? 19.8f : 18f) + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeAcceleration = (death ? 0.495f : 0.45f) + (death ? 0.15f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (spazAlive) { @@ -750,7 +630,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -779,8 +659,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target if (npc.target < 0 || npc.target == Main.maxPlayers || Main.player[npc.target].dead || !Main.player[npc.target].active) @@ -790,13 +669,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses CalamityUtils.CalamityTargeting(npc, options); } - float enrageScale = bossRush ? 0.5f : death ? 0.3f : 0f; - if (Main.IsItDay() || bossRush) - { - npc.Calamity().CurrentlyEnraged = !bossRush; - enrageScale += 1f; - } - // Percent life remaining float lifeRatio = npc.life / (float)npc.lifeMax; @@ -838,29 +710,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { for (int i = 0; i < Main.maxNPCs; i++) { - if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism || Main.npc[i].type == ModContent.NPCType()) && Main.npc[i].timeLeft - 1 > npc.timeLeft) + if (i != npc.whoAmI && Main.npc[i].active && (Main.npc[i].type == NPCID.Retinazer || Main.npc[i].type == NPCID.Spazmatism) && Main.npc[i].timeLeft - 1 > npc.timeLeft) npc.timeLeft = Main.npc[i].timeLeft - 1; } } - // Check for Oblivion in Master Mode - bool oblivionAlive = false; - if (death && !bossRush && npc.localAI[3] == 1f) - { - for (int i = 0; i < Main.maxNPCs; i++) - { - if (Main.npc[i].active && (Main.npc[i].type == ModContent.NPCType() || Main.npc[i].type == NPCID.SkeletronPrime)) - { - oblivionAlive = true; - break; - } - } - } - - bool foveanatorAlive = NPC.AnyNPCs(ModContent.NPCType()); - // Phase HP ratios - float phase2LifeRatio = oblivionAlive ? 0.5f : death ? 0.85f : 0.7f; + float phase2LifeRatio = death ? 0.85f : 0.7f; float finalPhaseLifeRatio = death ? 0.3f : 0.15f; // Movement variables @@ -872,17 +728,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float phase1MaxCursedFlamePhaseDurationDecrease = death ? 80f : 200f; float phase1MaxChargesDecrease = death ? 2f : 4f; - // If Oblivion is alive reduce aggression of all attacks - if (oblivionAlive) - { - phase1MaxSpeedIncrease = death ? 1.125f : 2.25f; - phase1MaxAccelerationIncrease = death ? 0.0375f : 0.075f; - phase1MaxChargeSpeedIncrease = death ? 1.5f : 3f; - - phase1MaxCursedFlamePhaseDurationDecrease = death ? 40f : 100f; - phase1MaxChargesDecrease = death ? 1f : 2f; - } - // Phase checks bool phase2 = lifeRatio < phase2LifeRatio; bool finalPhase = lifeRatio < finalPhaseLifeRatio; @@ -902,8 +747,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.reflectsProjectiles = false; // Despawn - bool oblivionFightDespawn = ((oblivionAlive && lifeRatio < 0.8f) || (oblivionAlive && !retAlive && lifeRatio < 0.95f)) && npc.localAI[3] == 1f; - if (Main.player[npc.target].dead || oblivionFightDespawn) + if ((Main.player[npc.target].dead || Main.IsItDay()) && !BossRushEvent.BossRushActive) { npc.velocity.Y -= 0.04f; if (npc.timeLeft > 10) @@ -919,14 +763,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Cursed fireball phase if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = 0; - // Velocity - float maxVelocity = 12f; - float acceleration = 0.4f; - maxVelocity += 6f * enrageScale; - acceleration += 0.2f * enrageScale; + float maxVelocity = death ? 13.8f : 12f; + float acceleration = death ? 0.46f : 0.4f; if (death) { @@ -934,13 +773,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses acceleration += phase1MaxAccelerationIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; } - float distanceFromTarget = oblivionAlive ? 480f : 400f; + float distanceFromTarget = 400f; Vector2 destination = Main.player[npc.target].Center + Vector2.UnitX * distanceFromTarget * direction; float distanceFromDestination = (destination - npc.Center).Length(); Vector2 idealVelocity = (destination - npc.Center).SafeNormalize(Vector2.UnitX * direction); @@ -979,34 +818,21 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (!Main.player[npc.target].dead) { npc.ai[3] += 1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) npc.ai[3] += 0.4f; } - if (npc.ai[3] >= (oblivionAlive ? 60f : foveanatorAlive ? 45f : 30f)) + if (npc.ai[3] >= 30f) { npc.ai[3] = 0f; if (Main.netMode != NetmodeID.MultiplayerClient) { - float cursedFireballSpeed = 15f; - cursedFireballSpeed += 3f * enrageScale; + float cursedFireballSpeed = death ? 15.9f : 15f; int type = ProjectileID.CursedFlameHostile; - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 fireballVelocity = ((Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * cursedFireballSpeed) + new Vector2(Main.rand.Next(-10, 11), Main.rand.Next(-10, 11)) * 0.05f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + fireballVelocity.SafeNormalize(Vector2.UnitY) * 50f, fireballVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + fireballVelocity.SafeNormalize(Vector2.UnitY) * 50f, fireballVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -1015,17 +841,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charging phase else if (npc.ai[1] == 1f) { - // Set damage - npc.damage = npc.defDamage; - // Rotation and velocity npc.rotation = hoverRotation; - float chargeSpeed = 18f; - chargeSpeed += 8f * enrageScale; - if (death) - chargeSpeed += phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)); - if (Main.getGoodWorld) + float chargeSpeed = death ? 20.4f + phase1MaxChargeSpeedIncrease * ((1f - lifeRatio) / (1f - phase2LifeRatio)) : 18f; + if (CalamityWorld.LegendaryMode) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1034,17 +854,11 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } else if (npc.ai[1] == 2f) { - // Set damage - npc.damage = npc.defDamage; - npc.ai[2] += 1f; float timeBeforeSlowDown = death ? 30f : 10f; if (npc.ai[2] >= timeBeforeSlowDown) { - // Avoid cheap bullshit - npc.damage = 0; - // Slow down npc.velocity *= 0.8f; @@ -1058,7 +872,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge 8 times float chargeTime = death ? 45f : 25f; - if (npc.ai[2] >= chargeTime + (oblivionAlive ? 15f : 0f)) + if (npc.ai[2] >= chargeTime) { // Reset AI array and go to cursed fireball phase npc.ai[3] += 1f; @@ -1066,7 +880,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = hoverRotation; - float totalCharges = foveanatorAlive ? 6f : 8f; + float totalCharges = 8f; if (death) totalCharges -= (float)Math.Round(phase1MaxChargesDecrease * ((1f - lifeRatio) / (1f - phase2LifeRatio))); @@ -1100,9 +914,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Transition phase else if (npc.ai[0] == 1f || npc.ai[0] == 2f) { - // Avoid cheap bullshit - npc.damage = 0; - if (NPC.IsMechQueenUp) npc.reflectsProjectiles = true; @@ -1131,21 +942,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = npc.ai[1] % 20f == 0f ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * (oblivionAlive ? 12f : 16f) + Main.rand.NextVector2CircularEdge(3f, 3f); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, 1f); + Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * 16f + Main.rand.NextVector2CircularEdge(3f, 3f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f, projectileVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer, 0f, 1f); Main.projectile[proj].tileCollide = false; } } @@ -1204,8 +1003,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.chaseable = !retInPhase1; // Increase defense and damage - int setDamage = (int)Math.Round(npc.defDamage * 1.5); - int reducedSetDamage = (int)Math.Round(setDamage * 0.5); + npc.damage = (int)Math.Round(npc.defDamage * SpazmatismPhase2ContactDamageMult); npc.defense = npc.defDefense + 18; calamityGlobalNPC.DR = retInPhase1 ? 0.9999f : 0.2f; calamityGlobalNPC.unbreakableDR = retInPhase1; @@ -1217,13 +1015,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Shadowflamethrower phase if (npc.ai[1] == 0f) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - - float maxVelocity = 6.2f + (death ? 2f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float acceleration = 0.1f + (death ? 0.03f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - maxVelocity += 3f * enrageScale; - acceleration += 0.06f * enrageScale; + float maxVelocity = (death ? 7.1f : 6.2f) + (death ? 2f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float acceleration = (death ? 0.118f : 0.1f) + (death ? 0.03f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); float distanceFromTarget = 180f; Vector2 destination = Main.player[npc.target].Center + Vector2.UnitX * distanceFromTarget * direction; @@ -1234,9 +1027,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { // Boost speed if too far from target if (distanceFromDestination > distanceFromTarget) - maxVelocity += MathHelper.Lerp(0f, oblivionAlive ? 3f : death ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); + maxVelocity += MathHelper.Lerp(0f, death ? 8f : 6f, MathHelper.Clamp((distanceFromDestination - distanceFromTarget) / 1000f, 0f, 1f)); - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { maxVelocity *= 1.15f; acceleration *= 1.15f; @@ -1275,36 +1068,22 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[3] += 1f; npc.localAI[1] = 0f; - float flamethrowerSpeed = foveanatorAlive ? 5f : 6f; - flamethrowerSpeed += 3f * enrageScale; + float flamethrowerSpeed = death ? 6.9f : 6f; float timeForFlamethrowerToReachMaxVelocity = 60f; float flamethrowerSpeedScalar = MathHelper.Clamp(npc.ai[2] / timeForFlamethrowerToReachMaxVelocity, 0f, 1f); flamethrowerSpeed = MathHelper.Lerp(0.1f, flamethrowerSpeed, flamethrowerSpeedScalar); int type = npc.ai[3] % 2f == 0f ? ModContent.ProjectileType() : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } Vector2 flamethrowerVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * flamethrowerSpeed + npc.velocity * 0.5f; if (NPC.IsMechQueenUp) flamethrowerVelocity = (npc.rotation + MathHelper.PiOver2).ToRotationVector2() * flamethrowerSpeed + npc.velocity * 0.5f; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 25f, flamethrowerVelocity, type, FlamethrowerDamage.CalculateMechDamage(), 0f, Main.myPlayer); if (death && npc.ai[3] % 30f == 0f) { type = npc.ai[3] % 60f == 0f ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; - damage = npc.GetProjectileDamage(type); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 50f, flamethrowerVelocity * 2f, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + flamethrowerVelocity.SafeNormalize(Vector2.UnitY) * 50f, flamethrowerVelocity * 2f, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } } @@ -1332,18 +1111,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Charge if (npc.ai[1] == 1f) { - // Set damage - npc.damage = setDamage; - // Play charge sound SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); // Set rotation and velocity npc.rotation = hoverRotation; - float chargeSpeed = 18f + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 16f * enrageScale; - if (Main.getGoodWorld) + float chargeSpeed = (death ? 22.8f : 18f) + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + if (CalamityWorld.LegendaryMode) chargeSpeed *= 1.2f; npc.velocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitX * direction) * chargeSpeed; @@ -1355,9 +1130,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (npc.ai[1] == 2f) { - // Set damage - npc.damage = setDamage; - npc.ai[2] += retAlive ? 1f : 1.25f; float chargeTime = 30f - (death ? 10f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); @@ -1365,9 +1137,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Slow down if (npc.ai[2] >= chargeTime) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - float deceleration = 0.85f - (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); npc.velocity *= deceleration; @@ -1380,14 +1149,14 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.rotation = npc.velocity.ToRotation() - MathHelper.PiOver2; // Charges 5 times - if (npc.ai[2] >= (chargeTime * 1.6f) + (oblivionAlive ? 15f : 0f)) + if (npc.ai[2] >= chargeTime * 1.6f) { npc.ai[3] += 1f; npc.ai[2] = 0f; npc.rotation = hoverRotation; - float totalCharges = foveanatorAlive ? 4f : 5f; + float totalCharges = 5f; if (npc.ai[3] >= totalCharges) { npc.ai[1] = 0f; @@ -1402,9 +1171,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Crazy charge else if (npc.ai[1] == 3f) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - // Reset AI array and go to shadowflamethrower phase or fireball phase if ret is dead float secondFastCharge = 4f; if (npc.ai[3] >= (retAlive ? secondFastCharge : secondFastCharge + 1f)) @@ -1423,14 +1189,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses else if (Main.netMode != NetmodeID.MultiplayerClient) { // Velocity - float spazmatismPhase3ChargeSpeed = 20f + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - spazmatismPhase3ChargeSpeed += 10f * enrageScale; + float spazmatismPhase3ChargeSpeed = (death ? 23f : 20f) + (death ? 6f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (npc.ai[2] == -1f || (!retAlive && npc.ai[3] == secondFastCharge)) spazmatismPhase3ChargeSpeed *= 1.3f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) spazmatismPhase3ChargeSpeed *= 1.2f; - Vector2 distanceVector = Main.player[npc.target].Center + (!retAlive && bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center; + Vector2 distanceVector = Main.player[npc.target].Center - npc.Center; npc.velocity = distanceVector.SafeNormalize(Vector2.UnitY) * spazmatismPhase3ChargeSpeed; if (retAlive) @@ -1456,20 +1221,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileSpeed = spazmatismPhase3ChargeSpeed * 0.5f; int type = (!retAlive && npc.ai[3] % 2f == 0f) ? ModContent.ProjectileType() : ProjectileID.CursedFlameHostile; - int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Vector2 projectileVelocity = (Main.player[npc.target].Center + ((!retAlive && bossRush) ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; + Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; int numProj = 3; int spread = 15; float rotation = MathHelper.ToRadians(spread); @@ -1477,7 +1230,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses for (int i = 0; i < numProj; i++) { Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 25f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 25f, perturbedSpeed, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer); } } @@ -1489,9 +1242,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Crazy charge else if (npc.ai[1] == 4f) { - // Set damage - npc.damage = setDamage; - if (npc.ai[2] == 0f) SoundEngine.PlaySound(SoundID.ForceRoar, npc.Center); @@ -1505,9 +1255,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Slow down if (npc.ai[2] >= spazmatismRetDeadChargeSpeed) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - npc.velocity *= 0.93f; if (Math.Abs(npc.velocity.X) < 0.1) npc.velocity.X = 0f; @@ -1536,14 +1283,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Get in position for charge else if (npc.ai[1] == 5f) { - // Avoid cheap bullshit - npc.damage = reducedSetDamage; - float chargeLineUpDistance = retAlive ? 600f : 500f; - float chargeSpeed = 16f + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - float chargeAcceleration = 0.4f + (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); - chargeSpeed += 5.333f * enrageScale; - chargeAcceleration += 0.133f * enrageScale; + float chargeSpeed = (death ? 17.5f : 16f) + (death ? 5f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); + float chargeAcceleration = (death ? 0.44f : 0.4f) + (death ? 0.1f * ((phase2LifeRatio - lifeRatio) / phase2LifeRatio) : 0f); if (retAlive) { @@ -1551,7 +1293,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses chargeAcceleration *= 0.75f; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { chargeSpeed *= 1.15f; chargeAcceleration *= 1.15f; @@ -1564,7 +1306,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[2] += 1f; // Fire shadowflames and cursed fireballs - float fireRate = retAlive ? 30f : foveanatorAlive ? 25f : 20f; + float fireRate = retAlive ? 30f : 20f; if (npc.ai[2] % fireRate == 0f) { npc.ai[3] += 1f; @@ -1572,21 +1314,9 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float projectileSpeed = 16f; int type = npc.ai[3] % 2f == 0f ? ProjectileID.CursedFlameHostile : ModContent.ProjectileType(); - int damage = npc.GetProjectileDamage(type); - // Reduce mech boss projectile damage depending on the new ore progression changes - if (CalamityServerConfig.Instance.EarlyHardmodeProgressionRework && !BossRushEvent.BossRushActive) - { - double firstMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkFirstMechStatMultiplier_Expert; - double secondMechMultiplier = CalamityGlobalNPC.EarlyHardmodeProgressionReworkSecondMechStatMultiplier_Expert; - if (!NPC.downedMechBossAny) - damage = (int)(damage * firstMechMultiplier); - else if ((!NPC.downedMechBoss1 && !NPC.downedMechBoss2) || (!NPC.downedMechBoss2 && !NPC.downedMechBoss3) || (!NPC.downedMechBoss3 && !NPC.downedMechBoss1)) - damage = (int)(damage * secondMechMultiplier); - } - - Vector2 projectileVelocity = (Main.player[npc.target].Center + (!retAlive && bossRush ? Main.player[npc.target].velocity * 20f : Vector2.Zero) - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 25f, projectileVelocity, type, damage, 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); + Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * projectileSpeed; + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 25f, projectileVelocity, type, FireballDamage.CalculateMechDamage(), 0f, Main.myPlayer, 0f, retAlive ? 0f : 1f); } } diff --git a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs index 38aea8f081..70a5fb1b21 100644 --- a/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs +++ b/NPCs/VanillaNPCAIOverrides/Bosses/WallOfFleshAI.cs @@ -16,12 +16,18 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses public const float TotalLasersPerBarrage = 3f; public const float EnragedLaserFiringDuration = 300f; + // Rev+ exclusive + public static int LaserDamage = 15; // 60 (modified to be always at maximum Expert damage and does not scale) + public static int SickleDamage = 22; // 88 + + // Death exclusive + public static int FireballDamage = 18; // 108 + public static bool BuffedWallofFleshAI(NPC npc, Mod mod) { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Despawn if (npc.position.X < 160f || npc.position.X > ((Main.maxTilesX - 10) * 16)) @@ -45,7 +51,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses bool phase2 = lifeRatio < 0.66f; bool phase3 = lifeRatio < 0.33f; - if (Main.getGoodWorld && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) + if (CalamityWorld.LegendaryMode && Main.netMode != NetmodeID.MultiplayerClient && Main.rand.NextBool(180)) { if (NPC.CountNPCS(NPCID.FireImp) < 4) { @@ -88,8 +94,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.ai[1] += 1f; if (phase3) npc.ai[1] += 1f; - if (bossRush) - npc.ai[1] += 3f; if (CalamityWorld.LegendaryMode) npc.ai[1] += 9f; @@ -122,8 +126,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses Vector2 projectileVelocity = (Main.player[npc.target].Center - npc.Center).SafeNormalize(Vector2.UnitY) * npc.velocity.Length(); Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * 50f; - int damage = npc.GetProjectileDamage(ProjectileID.DemonSickle); - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, ProjectileID.DemonSickle, damage, 0f, Main.myPlayer, 0f, projectileVelocity.Length() * 3f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, ProjectileID.DemonSickle, SickleDamage, 0f, Main.myPlayer, 0f, projectileVelocity.Length() * 3f); Main.projectile[proj].timeLeft = 600; Main.projectile[proj].tileCollide = false; @@ -134,7 +137,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ProjectileID.Fireball; - damage = npc.GetProjectileDamage(type); int numProj = 3; int spread = 15; float rotation = MathHelper.ToRadians(spread); @@ -143,7 +145,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { Vector2 randomVelocity = Main.rand.NextVector2CircularEdge(fireballVelocity, fireballVelocity); Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, j / (float)(numProj - 1))) + randomVelocity; - Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 50f, perturbedSpeed, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(npc.GetSource_FromAI(), npc.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 50f, perturbedSpeed, type, FireballDamage, 0f, Main.myPlayer); } } } @@ -252,9 +254,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses float timeBeforeEnrage = death ? (150f - 130f * (1f - lifeRatio)) : 600f; float speedMult = 1f; - if (bossRush) - timeBeforeEnrage *= 0.25f; - if (calamityGlobalNPC.newAI[0] < timeBeforeEnrage) { if (distanceFromTarget > halfAverageScreenWidth) @@ -304,9 +303,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses calamityGlobalNPC.CurrentlyEnraged = distanceFromTarget > halfAverageScreenWidth || npc.ai[3] == 1f; - if (bossRush) - speedMult += 0.2f; - float deathModeVelocityBoost = 0f; if (death) { @@ -321,13 +317,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // NOTE: Max velocity is 9 in For The Worthy float velocityBoost = 4f * (1f - lifeRatio); - float velocityX = (bossRush ? 7f : death ? 3.5f : 2f) + deathModeVelocityBoost + velocityBoost; + float velocityX = (death ? 3.5f : 2f) + deathModeVelocityBoost + velocityBoost; velocityX *= speedMult; if (death) velocityX *= 1.2f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { velocityX *= 1.1f; velocityX += 0.1f; @@ -439,9 +435,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses // Range of 64 to 268 chance *= 2; - if (bossRush) - chance /= 4; - else if (death) + if (death) chance /= 2; if (chance < 2) @@ -548,8 +542,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses return false; } - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; CalamityUtils.CalamityTargeting(npc, default); float acceleration = death ? 0.15f : 0.12f; @@ -558,13 +551,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses npc.defense = npc.defDefense; if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.5) { - npc.damage = death ? 180 : 120; + npc.damage = npc.defDamage * 2; npc.defense = 30; acceleration += death ? 0.1f : 0.08f; } else if ((double)Main.npc[Main.wofNPCIndex].life < (double)Main.npc[Main.wofNPCIndex].lifeMax * 0.75) { - npc.damage = death ? 135 : 90; + npc.damage = (int)Math.Round(npc.defDamage * 1.5f); npc.defense = 20; acceleration += death ? 0.05f : 0.04f; } @@ -702,8 +695,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { CalamityGlobalNPC calamityGlobalNPC = npc.Calamity(); - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Avoid cheap bullshit npc.damage = 0; @@ -814,8 +806,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses } Vector2 eyeLocation = npc.Center; - float predictionAmount = MathHelper.Lerp(0f, 20f, (float)Math.Sqrt(1f - lifeRatio)); - Vector2 lookAt = Main.player[npc.target].Center + (bossRush ? (Main.player[npc.target].velocity * predictionAmount) : Vector2.Zero); + Vector2 lookAt = Main.player[npc.target].Center; float eyeTargetX = lookAt.X - eyeLocation.X; float eyeTargetY = lookAt.Y - eyeLocation.Y; float wallVelocity = (float)Math.Sqrt(eyeTargetX * eyeTargetX + eyeTargetY * eyeTargetY); @@ -891,14 +882,13 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses { float velocity = (fireEnragedLasers ? 3f : 4f) + shootBoost; int projectileType = ProjectileID.EyeLaser; - int damage = npc.GetProjectileDamage(projectileType); bool targetTooClose = npc.Distance(Main.player[npc.target].Center) < 160f; float projectileOffset = targetTooClose ? 60f : 150f; Vector2 projectileVelocity = (lookAt - npc.Center).SafeNormalize(Vector2.UnitY) * velocity; Vector2 projectileSpawn = npc.Center + projectileVelocity.SafeNormalize(Vector2.UnitY) * projectileOffset; - int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, damage, 0f, Main.myPlayer, 1f, 0f); + int proj = Projectile.NewProjectile(npc.GetSource_FromAI(), projectileSpawn, projectileVelocity, projectileType, LaserDamage, 0f, Main.myPlayer, 1f, 0f); Main.projectile[proj].timeLeft = 900; if (!canHit) diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs index 9b9ac80d81..16c8b29ac6 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/RevengeanceAndDeathAI.cs @@ -4167,7 +4167,7 @@ PrepareToShoot: if (Main.netMode != NetmodeID.MultiplayerClient && !targetDead) { - if (Main.getGoodWorld && npc.type == NPCID.EaterofSouls) + if (CalamityWorld.LegendaryMode && npc.type == NPCID.EaterofSouls) { if (NPC.AnyNPCs(NPCID.EaterofWorldsHead)) { @@ -5433,7 +5433,7 @@ PrepareToShoot: } else { - if (Main.getGoodWorld && npc.type == NPCID.FireImp) + if (CalamityWorld.LegendaryMode && npc.type == NPCID.FireImp) { if (NPC.AnyNPCs(NPCID.WallofFlesh)) { @@ -6790,9 +6790,9 @@ PrepareToShoot: int projType = ProjectileID.SandBallFalling; - // If FTW is enabled, can fire 8 to 13 sand balls (random chance for 10x the amount) + // If Legendary is enabled, can fire 8 to 13 sand balls (random chance for 10x the amount) int projAmt = 1; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) { projAmt = Main.rand.Next(8, 14); if (Main.rand.NextBool(1000) || Main.zenithWorld) diff --git a/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs b/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs index 2573731e44..f167f0e5c5 100644 --- a/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs +++ b/NPCs/VanillaNPCAIOverrides/RegularEnemies/SlimeAI.cs @@ -12,10 +12,6 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies { public static class SlimeAI { - public const float SpikedSlimeSpikeBarrageGateValue = 30f; - public const float SpikedSlimeSpikeGateValue = 50f; - public const float SpikedSlimeSpikeTelegraphTime = 30f; - public static void ChooseRandomItem(out int dropItem) { // Use a fallback of -1. @@ -105,7 +101,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (npc.type == NPCID.SpikedJungleSlime) { projectileShootType = ProjectileID.JungleSpike; - projectileShootSpeedFactor *= 1.5f; + projectileShootSpeedFactor *= 0.6f; } ref float jumpDelay = ref npc.ai[0]; @@ -184,7 +180,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (Main.netMode != NetmodeID.MultiplayerClient && projectileShootCountdown <= 0f) { var source = npc.GetSource_FromAI(); - if (Main.expertMode && distanceFromTarget < 120f) + if (distanceFromTarget < 120f) { for (int i = 0; i < 5; i++) { @@ -196,12 +192,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (CalamityWorld.death) Main.projectile[proj].extraUpdates += 1; - projectileShootCountdown = SpikedSlimeSpikeBarrageGateValue; + projectileShootCountdown = 30f; } } else { - Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center - Vector2.UnitY * (npc.type == NPCID.SpikedJungleSlime ? 10f : 100f)) * projectileShootSpeedFactor * (CalamityWorld.death ? 3.25f : CalamityWorld.revenge ? 5.5f : 4.5f); + Vector2 velocity = npc.SafeDirectionTo(Main.player[npc.target].Center - Vector2.UnitY * 100f) * projectileShootSpeedFactor * (CalamityWorld.death ? 3.25f : CalamityWorld.revenge ? 5.5f : 4.5f); int proj = Projectile.NewProjectile(source, npc.Center, velocity, projectileShootType, 9, 0f, Main.myPlayer); if (CalamityWorld.death) { @@ -209,43 +205,12 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies Main.projectile[proj].timeLeft = 1200; } - projectileShootCountdown = SpikedSlimeSpikeGateValue; + projectileShootCountdown = 50f; } } } else - projectileShootCountdown = SpikedSlimeSpikeGateValue; - - if (npc.type == NPCID.SpikedIceSlime) - { - // Emit dust from center when about to shoot - if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) - { - Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 135, 0f, 0f, 100, default, 3f); - dust.noGravity = true; - dust.velocity *= 0f; - } - } - else if (npc.type == NPCID.SpikedJungleSlime) - { - // Emit dust from center when about to shoot - if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) - { - Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 61, 0f, 0f, 0, default, 3f); - dust.noGravity = true; - dust.velocity *= 0f; - } - } - else if (npc.type == NPCID.SlimeSpiked) - { - // Emit dust from center when about to shoot - if (projectileShootCountdown <= SpikedSlimeSpikeTelegraphTime) - { - Dust dust = Dust.NewDustDirect(npc.position, npc.width, npc.height, 4, 0f, 0f, 0, new Color(78, 136, 255, 150), 1.5f); - dust.noGravity = true; - dust.velocity *= 0f; - } - } + projectileShootCountdown = 50f; } // Decrement the target reset counter. @@ -407,7 +372,7 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies { // Move up if tiles are hit on the Y axis. if (npc.collideY) - npc.velocity.Y = -(CalamityWorld.death ? 4f : CalamityWorld.revenge ? 3f : 2f); + npc.velocity.Y = -(CalamityWorld.death ? 4f : 3f); if (npc.velocity.Y < 0f && npc.ai[3] == npc.position.X) { @@ -418,8 +383,8 @@ namespace CalamityMod.NPCs.VanillaNPCAIOverrides.RegularEnemies if (npc.velocity.Y > 0f) npc.ai[3] = npc.position.X; - float riseSpeed = CalamityWorld.death ? 0.6f : CalamityWorld.revenge ? 0.55f : 0.5f; - float maxRiseSpeed = CalamityWorld.death ? 6f : CalamityWorld.revenge ? 5f : 4f; + float riseSpeed = CalamityWorld.death ? 0.6f : 0.55f; + float maxRiseSpeed = CalamityWorld.death ? 6f : 5f; if (isLavaSlime) { riseSpeed += 0.2f; diff --git a/NPCs/Yharon/Yharon.cs b/NPCs/Yharon/Yharon.cs index 12220297eb..65231a42f7 100644 --- a/NPCs/Yharon/Yharon.cs +++ b/NPCs/Yharon/Yharon.cs @@ -99,11 +99,19 @@ namespace CalamityMod.NPCs.Yharon } } + public static int FlareDamage = 72; // 288; FlareBomb, FlareDust, FlareDust2 + public static int FireballDamage = 72; // 288 + public static int TornadoDamage = 90; // 360; Flarenado, Infernado, Infernado2 + public static int BordernadoDamage = 125; // 500; SkyFlareRevenge + + // GFB exclusive + public static int VortexDamage = 90; // 360 + public override void SetDefaults() { NPC.Calamity().canBreakPlayerDefense = true; + NPC.damage = 220; // 440 NPC.npcSlots = 50f; - NPC.GetNPCDamage(); NPC.width = 200; NPC.height = 200; NPC.defense = 90; @@ -111,7 +119,7 @@ namespace CalamityMod.NPCs.Yharon NPC.knockBackResist = 0f; NPC.aiStyle = -1; AIType = -1; - NPC.value = Item.buyPrice(2, 50, 0, 0); + NPC.value = Item.buyPrice(platinum: 2, gold: 50); NPC.boss = true; NPC.DR_NERD(normalDR); @@ -123,9 +131,6 @@ namespace CalamityMod.NPCs.Yharon NPC.Calamity().VulnerableToHeat = false; NPC.Calamity().VulnerableToCold = true; NPC.Calamity().VulnerableToSickness = true; - - // Scale HP in Master - CalamityGlobalNPC.AdjustMasterModeStatScaling(NPC, true); } public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry) @@ -201,12 +206,9 @@ namespace CalamityMod.NPCs.Yharon CalamityWorld.StopRain(); // Variables - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; - - float pie = (float)Math.PI; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; CalamityGlobalNPC.yharon = NPC.whoAmI; CalamityGlobalNPC.yharonP2 = -1; @@ -216,14 +218,14 @@ namespace CalamityMod.NPCs.Yharon // Start phase 2 or not if (startSecondAI) { - Yharon_AI2(expertMode, revenge, death, bossRush, pie, lifeRatio, calamityGlobalNPC, setDamage); + Yharon_AI2(expertMode, revenge, death, lifeRatio, calamityGlobalNPC, setDamage); return; } // Phase booleans - float phase2GateValue = revenge ? 0.9f : expertMode ? 0.85f : 0.75f; + float phase2GateValue = revenge ? 0.9f : expertMode ? 0.85f : 0.8f; bool phase2Check = death || lifeRatio <= phase2GateValue; - bool phase3Check = lifeRatio <= (death ? 0.8f : revenge ? 0.75f : expertMode ? 0.7f : 0.625f); + bool phase3Check = lifeRatio <= (death ? 0.8f : revenge ? 0.75f : expertMode ? 0.7f : 0.65f); bool phase4Check = lifeRatio <= ai2GateValue; bool phase1Change = NPC.ai[0] > -1f; bool phase2Change = NPC.ai[0] > 5f; @@ -255,7 +257,7 @@ namespace CalamityMod.NPCs.Yharon float reduceSpeedChargeDistance = 540f; int chargeTime = expertMode ? 40 : 45; float chargeSpeed = expertMode ? 28f : 26f; - float fastChargeVelocityMultiplier = bossRush ? 2f : 1.5f; + float fastChargeVelocityMultiplier = 1.5f; bool playFastChargeRoarSound = NPC.localAI[1] == fastChargeTelegraphTime * 0.5f; bool doFastCharge = NPC.localAI[1] > fastChargeTelegraphTime; @@ -274,8 +276,8 @@ namespace CalamityMod.NPCs.Yharon if (revenge) { - int chargeTimeDecrease = bossRush ? 6 : death ? 4 : 2; - float velocityMult = bossRush ? 1.15f : death ? 1.1f : 1.05f; + int chargeTimeDecrease = death ? 4 : 2; + float velocityMult = death ? 1.1f : 1.05f; phaseSwitchTimer -= chargeTimeDecrease; acceleration *= velocityMult; velocity *= velocityMult; @@ -284,17 +286,17 @@ namespace CalamityMod.NPCs.Yharon } float reduceSpeedFlareBombDistance = 570f; - int flareBombPhaseTimer = bossRush ? 30 : death ? 40 : 60; + int flareBombPhaseTimer = death ? 40 : 60; int flareBombSpawnDivisor = flareBombPhaseTimer / 20; - float flareBombPhaseAcceleration = bossRush ? 1f : death ? 0.92f : 0.8f; - float flareBombPhaseVelocity = bossRush ? 16f : death ? 14f : 12f; + float flareBombPhaseAcceleration = death ? 0.92f : 0.8f; + float flareBombPhaseVelocity = death ? 14f : 12f; int fireTornadoPhaseTimer = 90; int newPhaseTimer = 180; - int flareDustPhaseTimer = bossRush ? 160 : death ? 200 : 240; - int flareDustPhaseTimer2 = bossRush ? 80 : death ? 100 : 120; + int flareDustPhaseTimer = death ? 200 : 240; + int flareDustPhaseTimer2 = death ? 100 : 120; float spinTime = flareDustPhaseTimer / 2; @@ -369,12 +371,12 @@ namespace CalamityMod.NPCs.Yharon enraged = false; if (Main.netMode != NetmodeID.MultiplayerClient) { - safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f)); + safeBox.X = (int)(player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f)); safeBox.Y = (int)Main.topWorld; - safeBox.Width = Main.zenithWorld ? 3000 : Main.getGoodWorld ? 2000 : bossRush ? 4000 : revenge ? 6000 : 7000; + safeBox.Width = Main.zenithWorld ? 3000 : CalamityWorld.LegendaryMode ? 2000 : revenge ? 6000 : 7000; safeBox.Height = Main.maxTilesY * 16; - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); - Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.zenithWorld ? 1500f : Main.getGoodWorld ? 1000f : bossRush ? 2000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X + (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), player.Center.X - (Main.zenithWorld ? 1500f : CalamityWorld.LegendaryMode ? 1000f : revenge ? 3000f : 3500f), player.Center.Y + 100f, 0f, 0f, ModContent.ProjectileType(), 0, 0f, Main.myPlayer); } // Force Yharon to send a sync packet so that the arena gets sent immediately @@ -396,7 +398,7 @@ namespace CalamityMod.NPCs.Yharon protectionBoost = false; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) phaseSwitchTimer /= 2; // Set DR based on protection boost (aka enrage) @@ -410,17 +412,17 @@ namespace CalamityMod.NPCs.Yharon { if (phase3Change) { - calamityGlobalNPC.DR = phase4Check ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase4Check ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4Check; } else if (phase2Change) { - calamityGlobalNPC.DR = phase3Check ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase3Check ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3Check; } else if (phase1Change) { - calamityGlobalNPC.DR = phase2Check ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase2Check ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2Check; } } @@ -443,7 +445,7 @@ namespace CalamityMod.NPCs.Yharon // Rotation float npcRotation = (float)Math.Atan2(player.Center.Y - NPC.Center.Y, player.Center.X - NPC.Center.X); if (NPC.spriteDirection == 1) - npcRotation += pie; + npcRotation += MathHelper.Pi; if (npcRotation < 0f) npcRotation += MathHelper.TwoPi; if (npcRotation > MathHelper.TwoPi) @@ -551,7 +553,7 @@ namespace CalamityMod.NPCs.Yharon Vector2 distanceFromDestination = destination - NPC.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * velocity; - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -560,12 +562,12 @@ namespace CalamityMod.NPCs.Yharon if (phaseSwitchFaceDirection != 0) { if (NPC.ai[2] == 0f && phaseSwitchFaceDirection != NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -612,7 +614,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -659,7 +661,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = phaseSwitchFaceDirection; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -676,7 +678,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -716,8 +718,7 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, FlareDamage, 0f, Main.myPlayer, NPC.target, 1f); } } @@ -727,7 +728,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -803,7 +804,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -832,7 +833,7 @@ namespace CalamityMod.NPCs.Yharon Vector2 distanceFromDestination = destination - NPC.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * velocity; - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -841,12 +842,12 @@ namespace CalamityMod.NPCs.Yharon if (playerFaceDirectionFurtherPhases != 0) { if (NPC.ai[2] == 0f && playerFaceDirectionFurtherPhases != NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -896,7 +897,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -923,7 +924,7 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = Main.zenithWorld ? NPC.GetProjectileDamage(type) : 0; + int damage = Main.zenithWorld ? VortexDamage : 0; float bulletHellVortexDuration = flareDustPhaseTimer + teleportPhaseTimer - 15f; int extraTime = Main.zenithWorld ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); @@ -989,7 +990,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1007,7 +1008,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1026,7 +1027,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1060,7 +1061,7 @@ namespace CalamityMod.NPCs.Yharon { int ringReduction = (int)MathHelper.Lerp(0f, 14f, NPC.ai[2] / flareDustPhaseTimer); int totalProjectiles = 38 - ringReduction; // 36 for first ring, 22 for last ring - DoFlareDustBulletHell(0, flareDustSpawnDivisor, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, 0f, 0f, false); + DoFlareDustBulletHell(0, flareDustSpawnDivisor, FlareDamage, totalProjectiles, 0f, 0f, false); } } @@ -1131,7 +1132,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1163,10 +1164,9 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float finalVelocity = 12f; float projectileAcceleration = 1.1f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, FlareDamage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); } } @@ -1199,7 +1199,7 @@ namespace CalamityMod.NPCs.Yharon Vector2 distanceFromDestination = destination - NPC.Center; Vector2 desiredVelocity = Vector2.Normalize(distanceFromDestination - NPC.velocity) * velocity; - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -1208,12 +1208,12 @@ namespace CalamityMod.NPCs.Yharon if (playerFaceDirectionFurtherPhases != 0) { if (NPC.ai[2] == 0f && playerFaceDirectionFurtherPhases != NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1266,7 +1266,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1293,7 +1293,7 @@ namespace CalamityMod.NPCs.Yharon NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = Main.zenithWorld ? NPC.GetProjectileDamage(type) : 0; + int damage = Main.zenithWorld ? VortexDamage : 0; float bulletHellVortexDuration = flareDustPhaseTimer + teleportPhaseTimer - 15f; int extraTime = Main.zenithWorld ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); @@ -1359,7 +1359,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1377,7 +1377,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirectionFurtherPhases; if (NPC.spriteDirection == 1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1403,7 +1403,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1436,7 +1436,7 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { - DoFlareDustBulletHell(1, flareDustPhaseTimer, NPC.GetProjectileDamage(ModContent.ProjectileType()), 8, 12f, 3.6f, false); + DoFlareDustBulletHell(1, flareDustPhaseTimer, FlareDamage, 8, 13f, 3.6f, false); } } @@ -1510,7 +1510,7 @@ namespace CalamityMod.NPCs.Yharon // Set damage NPC.damage = setDamage; - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[2] += 1f; if (NPC.ai[2] >= chargeTime) @@ -1542,10 +1542,9 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); float finalVelocity = 15f; float projectileAcceleration = 1.11f; - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, damage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, projectileVelocity, type, FlareDamage, 0f, Main.myPlayer, finalVelocity, projectileAcceleration); } } @@ -1589,8 +1588,7 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, damage, 0f, Main.myPlayer, NPC.target, 1f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), fromMouth, Vector2.Zero, type, FlareDamage, 0f, Main.myPlayer, NPC.target, 1f); } } @@ -1600,7 +1598,7 @@ namespace CalamityMod.NPCs.Yharon NPC.direction = playerFaceDirection; if (NPC.spriteDirection != -NPC.direction) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.spriteDirection = -NPC.direction; } @@ -1619,16 +1617,14 @@ namespace CalamityMod.NPCs.Yharon } #region AI2 - public void Yharon_AI2(bool expertMode, bool revenge, bool death, bool bossRush, float pie, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC, int contactDamage) + public void Yharon_AI2(bool expertMode, bool revenge, bool death, float lifeRatio, CalamityGlobalNPC calamityGlobalNPC, int contactDamage) { CalamityGlobalNPC.yharonP2 = NPC.whoAmI; - float phase2GateValue = revenge ? 0.44f : expertMode ? 0.385f : 0.275f; + float phase2GateValue = revenge ? 0.45f : expertMode ? 0.35f : 0.3f; bool phase2 = death || lifeRatio <= phase2GateValue; - float phase3GateValue = death ? 0.358f : revenge ? 0.275f : expertMode ? 0.22f : 0.138f; - bool phase3 = lifeRatio <= phase3GateValue; - float phase4GateValue = death ? 0.165f : 0.11f; - bool phase4 = lifeRatio <= phase4GateValue && revenge; + bool phase3 = lifeRatio <= (death ? 0.35f : revenge ? 0.3f : expertMode ? 0.2f : 0.15f); + bool phase4 = lifeRatio <= (death ? 0.2f : 0.15f) && revenge; if (NPC.ai[0] != 5f && NPC.ai[0] != 8f) { @@ -1732,21 +1728,21 @@ namespace CalamityMod.NPCs.Yharon { case 1: - calamityGlobalNPC.DR = phase2 ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase2 ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase2; break; case 2: - calamityGlobalNPC.DR = phase3 ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase3 ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase3; break; case 3: - calamityGlobalNPC.DR = phase4 ? (bossRush ? 0.99f : 0.7f) : normalDR; + calamityGlobalNPC.DR = phase4 ? 0.7f : normalDR; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = phase4; break; @@ -1754,20 +1750,20 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[0] == 9f) { - calamityGlobalNPC.DR = bossRush ? 0.99f : 0.7f; + calamityGlobalNPC.DR = 0.7f; calamityGlobalNPC.CurrentlyIncreasingDefenseOrDR = true; } } float reduceSpeedChargeDistance = 500f; float reduceSpeedFireballSpitChargeDistance = 800f; - float phaseSwitchTimer = bossRush ? 28f : expertMode ? 30f : 32f; + float phaseSwitchTimer = expertMode ? 30f : 32f; float acceleration = expertMode ? 0.92f : 0.9f; float velocity = expertMode ? 14.5f : 14f; float chargeTime = expertMode ? 32f : 35f; float chargeSpeed = expertMode ? 32f : 30f; - float fastChargeVelocityMultiplier = bossRush ? 2f : 1.5f; + float fastChargeVelocityMultiplier = 1.5f; fastChargeTelegraphTime = protectionBoost ? 60 : (100 - secondPhasePhase * 10); bool playFastChargeRoarSound = NPC.localAI[1] == fastChargeTelegraphTime * 0.5f; bool doFastChargeTelegraph = NPC.localAI[1] <= fastChargeTelegraphTime; @@ -1784,9 +1780,9 @@ namespace CalamityMod.NPCs.Yharon float splittingFireballBreathYVelocityTimer = 40f; float splittingFireballBreathPhaseTimer = splittingFireballBreathTimer + splittingFireballBreathTimer2 + splittingFireballBreathYVelocityTimer; - int spinPhaseTimer = secondPhasePhase == 4 ? (bossRush ? 80 : death ? 100 : 120) : (bossRush ? 120 : death ? 150 : 180); + int spinPhaseTimer = secondPhasePhase == 4 ? (death ? 100 : 120) : (death ? 150 : 180); int flareDustSpawnDivisor = spinPhaseTimer / 10; - int flareDustSpawnDivisor2 = spinPhaseTimer / 20 + (secondPhasePhase == 4 ? spinPhaseTimer / 60 : 0); + int flareDustSpawnDivisor2 = spinPhaseTimer / 15 + (secondPhasePhase == 4 ? spinPhaseTimer / 60 : 0); float increasedIdleTimeAfterBulletHell = (death ? 120f : 180f) + phaseSwitchTimer; bool moveSlowerAfterBulletHell = NPC.ai[1] < 0f; @@ -1799,23 +1795,23 @@ namespace CalamityMod.NPCs.Yharon chargeSpeed *= reducedMovementMultiplier; } - float flareSpawnDecelerationTimer = bossRush ? 60f : death ? 75f : 90f; + float flareSpawnDecelerationTimer = death ? 75f : 90f; int flareSpawnPhaseTimerReduction = revenge ? (int)(flareSpawnDecelerationTimer * (ai2GateValue - lifeRatio)) : 0; - float flareSpawnPhaseTimer = (bossRush ? 120f : death ? 150f : 180f) - flareSpawnPhaseTimerReduction; + float flareSpawnPhaseTimer = (death ? 150f : 180f) - flareSpawnPhaseTimerReduction; float teleportPhaseTimer = 45f; if (revenge) { - float chargeTimeDecrease = bossRush ? 6f : death ? 4f : 2f; - float velocityMult = bossRush ? 1.15f : death ? 1.1f : 1.05f; + float chargeTimeDecrease = death ? 4f : 2f; + float velocityMult = death ? 1.1f : 1.05f; acceleration *= velocityMult; velocity *= velocityMult; chargeTime -= chargeTimeDecrease; chargeSpeed *= velocityMult; } - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) phaseSwitchTimer *= 0.5f; if (NPC.ai[0] == 0f) @@ -1845,7 +1841,7 @@ namespace CalamityMod.NPCs.Yharon if (!targetDead) { - if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance) + if (Vector2.Distance(NPC.Center, destination) > reduceSpeedChargeDistance && NPC.localAI[1] <= fastChargeTelegraphTime * 0.5f) NPC.SimpleFlyMovement(desiredVelocity, acceleration); else NPC.velocity *= 0.98f; @@ -2004,7 +2000,7 @@ namespace CalamityMod.NPCs.Yharon float amount = 0.04f; if (NPC.spriteDirection == -1) - newRotation += pie; + newRotation += MathHelper.Pi; if (amount != 0f) NPC.rotation = NPC.rotation.AngleTowards(newRotation, amount); @@ -2024,19 +2020,13 @@ namespace CalamityMod.NPCs.Yharon if (Main.netMode != NetmodeID.MultiplayerClient) { - if (CalamityWorld.LegendaryMode && revenge) - { - if (!NPC.AnyNPCs(ModContent.NPCType())) - NPC.SpawnOnPlayer(NPC.FindClosestPlayer(), ModContent.NPCType()); - } - float bulletHellTeleportLocationDistance = 540f; Vector2 teleportLocation = -Vector2.UnitY * bulletHellTeleportLocationDistance * (targetData.velocity.Y >= 0f).ToDirectionInt(); Vector2 center = targetData.Center + teleportLocation; NPC.Center = center; int type = ModContent.ProjectileType(); - int damage = Main.zenithWorld ? NPC.GetProjectileDamage(type) : 0; + int damage = Main.zenithWorld ? VortexDamage : 0; float bulletHellVortexDuration = spinPhaseTimer + 15f; int extraTime = Main.zenithWorld ? 300 : 0; Projectile.NewProjectile(NPC.GetSource_FromAI(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, bulletHellVortexDuration + extraTime, NPC.whoAmI); @@ -2067,7 +2057,7 @@ namespace CalamityMod.NPCs.Yharon float amount = 0.04f; if (NPC.spriteDirection == -1) - newRotation += pie; + newRotation += MathHelper.Pi; if (amount != 0f) NPC.rotation = NPC.rotation.AngleTowards(newRotation, amount); @@ -2144,7 +2134,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * chargeSpeed; @@ -2176,7 +2166,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * chargeSpeed * fastChargeVelocityMultiplier; @@ -2195,7 +2185,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == 1f) SoundEngine.PlaySound(ShortRoarSound, NPC.Center); - ChargeDust(7, pie); + ChargeDust(7); NPC.ai[1] += 1f; if (NPC.ai[1] >= chargeTime) @@ -2243,7 +2233,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = vector * fireballBreathPhaseVelocity; @@ -2252,6 +2242,9 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] >= fireballBreathTimer) { + // Set damage once charge starts + NPC.damage = setDamage; + if (NPC.ai[1] % (expertMode ? 6f : 8f) == 0f && Main.netMode != NetmodeID.MultiplayerClient) { float xOffset = 30f; @@ -2259,8 +2252,7 @@ namespace CalamityMod.NPCs.Yharon Vector2 projectileVelocity = NPC.velocity; projectileVelocity.Normalize(); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_FromAI(), position, projectileVelocity, type, damage, 0f, Main.myPlayer); + Projectile.NewProjectile(NPC.GetSource_FromAI(), position, projectileVelocity, type, FlareDamage, 0f, Main.myPlayer); } if (Math.Abs(targetData.Center.X - NPC.Center.X) > 700f && Math.Abs(NPC.velocity.X) < chargeSpeed) @@ -2307,7 +2299,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = yharonFireballMoveDirection.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; NPC.velocity = yharonFireballMoveDirection * splittingFireballBreathPhaseVelocity; SoundEngine.PlaySound(FireSound, NPC.Center); @@ -2322,9 +2314,8 @@ namespace CalamityMod.NPCs.Yharon int yharonFireballTimer = (int)(NPC.ai[1] - splittingFireballBreathTimer + 1f); int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); if (yharonFireballTimer <= splittingFireballBreathTimer2 && yharonFireballTimer % splittingFireballBreathDivisor == 0 && Main.netMode != NetmodeID.MultiplayerClient) - Projectile.NewProjectile(NPC.GetSource_FromAI(), position, NPC.velocity, type, damage, 0f, Main.myPlayer, 0f, 0f); + Projectile.NewProjectile(NPC.GetSource_FromAI(), position, NPC.velocity, type, FireballDamage, 0f, Main.myPlayer, 0f, 0f); } if (NPC.ai[1] > splittingFireballBreathPhaseTimer - splittingFireballBreathYVelocityTimer) @@ -2364,17 +2355,17 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] % flareDustSpawnDivisor2 == 0f) { int totalProjectiles = secondPhasePhase == 4 ? 12 : 10; - float projectileVelocity = secondPhasePhase == 4 ? 16f : 12f; + float projectileVelocity = secondPhasePhase == 4 ? 17f : 13f; float radialOffset = secondPhasePhase == 4 ? 2.8f : 3.2f; if (NPC.localAI[3] == 0f) { - DoFlareDustBulletHell(1, spinPhaseTimer, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, projectileVelocity, radialOffset, true); + DoFlareDustBulletHell(1, spinPhaseTimer, FlareDamage, totalProjectiles, projectileVelocity, radialOffset, true); } else { int ringReduction = (int)MathHelper.Lerp(0f, 12f, NPC.ai[1] / spinPhaseTimer); int totalProjectiles2 = 38 - ringReduction; // 36 for first ring, 24 for last ring - DoFlareDustBulletHell(0, flareDustSpawnDivisor2, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles2, 0f, 0f, true); + DoFlareDustBulletHell(0, flareDustSpawnDivisor2, FlareDamage, totalProjectiles2, 0f, 0f, true); } } } @@ -2384,7 +2375,7 @@ namespace CalamityMod.NPCs.Yharon { int ringReduction = (int)MathHelper.Lerp(0f, 12f, NPC.ai[1] / spinPhaseTimer); int totalProjectiles = 38 - ringReduction; // 36 for first ring, 24 for last ring - DoFlareDustBulletHell(0, flareDustSpawnDivisor, NPC.GetProjectileDamage(ModContent.ProjectileType()), totalProjectiles, 0f, 0f, true); + DoFlareDustBulletHell(0, flareDustSpawnDivisor, FlareDamage, totalProjectiles, 0f, 0f, true); } } @@ -2449,7 +2440,7 @@ namespace CalamityMod.NPCs.Yharon { SoundEngine.PlaySound(ShortRoarSound, NPC.Center); - DoFireRing(expertMode ? 300 : 180, NPC.GetProjectileDamage(ModContent.ProjectileType()), NPC.target, 1f); + DoFireRing(expertMode ? 300 : 180, FlareDamage, NPC.target, 1f); } } @@ -2479,7 +2470,7 @@ namespace CalamityMod.NPCs.Yharon if (NPC.ai[1] == 1f) SoundEngine.PlaySound(ShortRoarSound, NPC.Center); - ChargeDust(14, pie); + ChargeDust(14); NPC.ai[1] += 1f; if (NPC.ai[1] >= chargeTime) @@ -2544,7 +2535,7 @@ namespace CalamityMod.NPCs.Yharon NPC.rotation = vector.ToRotation(); if (NPC.spriteDirection == -1) - NPC.rotation += pie; + NPC.rotation += MathHelper.Pi; if (NPC.ai[2] == 120f) { @@ -2603,10 +2594,10 @@ namespace CalamityMod.NPCs.Yharon case 4: rotationSpeed = 0.01f; - facingAngle = pie; + facingAngle = MathHelper.Pi; if (NPC.spriteDirection == 1) - facingAngle += pie; + facingAngle += MathHelper.Pi; break; case 6: @@ -2614,13 +2605,13 @@ namespace CalamityMod.NPCs.Yharon facingAngle = 0f; if (NPC.spriteDirection == -1) - facingAngle -= pie; + facingAngle -= MathHelper.Pi; break; } if (NPC.spriteDirection == -1) - facingAngle += pie; + facingAngle += MathHelper.Pi; if (rotationSpeed != 0f) NPC.rotation = NPC.rotation.AngleTowards(facingAngle, rotationSpeed); @@ -2628,13 +2619,13 @@ namespace CalamityMod.NPCs.Yharon #endregion #region Charge Dust - private void ChargeDust(int dustAmt, float pie) + private void ChargeDust(int dustAmt) { for (int i = 0; i < dustAmt; i++) { Vector2 dustRotate = Vector2.Normalize(NPC.velocity) * new Vector2((NPC.width + 50) / 2f, NPC.height) * 0.75f; - dustRotate = dustRotate.RotatedBy((i - (dustAmt / 2 - 1)) * (double)pie / (float)dustAmt) + NPC.Center; - Vector2 dustVel = ((float)(Main.rand.NextDouble() * pie) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); + dustRotate = dustRotate.RotatedBy((i - (dustAmt / 2 - 1)) * MathHelper.Pi / (float)dustAmt) + NPC.Center; + Vector2 dustVel = ((float)(Main.rand.NextDouble() * MathHelper.Pi) - MathHelper.PiOver2).ToRotationVector2() * Main.rand.Next(3, 8); int chargeDust = Dust.NewDust(dustRotate + dustVel, 0, 0, DustID.CopperCoin, dustVel.X * 2f, dustVel.Y * 2f, 100, default, 1.4f); Main.dust[chargeDust].noGravity = true; Main.dust[chargeDust].noLight = true; @@ -3023,7 +3014,7 @@ namespace CalamityMod.NPCs.Yharon npcLoot.AddConditionalPerPlayer(() => !DownedBossSystem.downedYharon, ModContent.ItemType(), desc: DropHelper.FirstKillText); } - public override void BossLoot(ref string name, ref int potionType) + public override void BossLoot(ref int potionType) { potionType = ModContent.ItemType(); } @@ -3058,21 +3049,12 @@ namespace CalamityMod.NPCs.Yharon for (int i = 0; i < 4; i++) { int type = ModContent.ProjectileType(); - int damage = NPC.GetProjectileDamage(type); - Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, damage, 0f, Main.myPlayer, 360, NPC.whoAmI); + Projectile.NewProjectile(NPC.GetSource_Death(), NPC.Center, Vector2.Zero, type, VortexDamage, 0f, Main.myPlayer, 360, NPC.whoAmI); } } } #endregion - #region On Hit Player - public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo) - { - if (hurtInfo.Damage > 0) - target.AddBuff(ModContent.BuffType(), 180); - } - #endregion - #region HP Bar Cooldown Slot and Stats public override bool? DrawHealthBar(byte hbPosition, ref float scale, ref Vector2 position) { @@ -3089,7 +3071,6 @@ namespace CalamityMod.NPCs.Yharon public override void ApplyDifficultyAndPlayerScaling(int numPlayers, float balance, float bossAdjustment) { NPC.lifeMax = (int)(NPC.lifeMax * 0.8f * balance * bossAdjustment); - NPC.damage = (int)(NPC.damage * NPC.GetExpertDamageMultiplier()); } #endregion @@ -3118,7 +3099,7 @@ namespace CalamityMod.NPCs.Yharon bool doTelegraphFlightAnimation = NPC.localAI[1] < fastChargeTelegraphTime * 0.5f || NPC.localAI[1] > fastChargeTelegraphTime - (fastChargeTelegraphTime / 6f); bool doTelegraphRoarAnimation = NPC.localAI[1] > fastChargeTelegraphTime - fastChargeTelegraphTime * 0.4f && NPC.localAI[1] < fastChargeTelegraphTime - fastChargeTelegraphTime * 0.2f; - bool phase4 = startSecondAI && lifeRatio <= ((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.165f : 0.11f) && (CalamityWorld.revenge || BossRushEvent.BossRushActive); + bool phase4 = startSecondAI && lifeRatio <= ((CalamityWorld.death || BossRushEvent.BossRushActive) ? 0.2f : 0.15f) && (CalamityWorld.revenge || BossRushEvent.BossRushActive); if (doTelegraphFlightAnimation) { NPC.frameCounter += phase4 ? 2D : 1D; diff --git a/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs b/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs index 3ba126974b..c153053208 100644 --- a/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs +++ b/Packets/TileEntities/TEUpdateCodebreakerContainedStuffPacket.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Packets packet.Write(codeBreaker.InputtedCellCount); packet.Write(codeBreaker.InitialCellCountBeforeDecrypting); packet.Write(codeBreaker.HeldSchematicID); - packet.Write(codeBreaker.ContainsBloodSample); + packet.Write(codeBreaker.ContainsBloodyVein); packet.Send(toClient, ignoreClient); } @@ -35,7 +35,7 @@ namespace CalamityMod.Packets int cellCount = packet.ReadInt32(); int cellCountBeforeDecrypting = packet.ReadInt32(); int schematicID = packet.ReadInt32(); - bool containsBloodSample = packet.ReadBoolean(); + bool containsBloodyVein = packet.ReadBoolean(); // Verify to ensure that the tile entity is a valid one. if (codeBreaker is null) @@ -44,7 +44,7 @@ namespace CalamityMod.Packets codeBreaker.InputtedCellCount = cellCount; codeBreaker.InitialCellCountBeforeDecrypting = cellCountBeforeDecrypting; codeBreaker.HeldSchematicID = schematicID; - codeBreaker.ContainsBloodSample = containsBloodSample; + codeBreaker.ContainsBloodyVein = containsBloodyVein; } } } diff --git a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs index 5d6e660d58..cf7e6014d3 100644 --- a/Projectiles/BaseProjectiles/BaseMinionProjectile.cs +++ b/Projectiles/BaseProjectiles/BaseMinionProjectile.cs @@ -140,6 +140,7 @@ namespace CalamityMod.Projectiles.BaseProjectiles public override void SetStaticDefaults() { Main.projFrames[Type] = AnimationFrames; + // IMPORTANT: Setting Main.projPet disables projectile damage! If you are making a charging minion, be sure to override the MinionContactDamage hook Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; diff --git a/Projectiles/Boss/ApolloChargeTelegraph.cs b/Projectiles/Boss/ApolloChargeTelegraph.cs index b038018e4c..f2e9d814cd 100644 --- a/Projectiles/Boss/ApolloChargeTelegraph.cs +++ b/Projectiles/Boss/ApolloChargeTelegraph.cs @@ -37,13 +37,12 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - Projectile.timeLeft = bossRush ? 45 : death ? 60 : revenge ? 68 : expertMode ? 75 : 90; - if (Main.getGoodWorld) + Projectile.timeLeft = death ? 60 : revenge ? 68 : expertMode ? 75 : 90; + if (CalamityWorld.LegendaryMode) Projectile.timeLeft /= 2; } @@ -78,14 +77,13 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Determine opacity - float telegraphTotalTime = bossRush ? 45f : death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; - if (Main.getGoodWorld) + float telegraphTotalTime = death ? 60f : revenge ? 68f : expertMode ? 75f : 90f; + if (CalamityWorld.LegendaryMode) telegraphTotalTime *= 0.5f; Projectile.Opacity = Utils.GetLerpValue(0f, 6f, Projectile.timeLeft, true) * Utils.GetLerpValue(telegraphTotalTime, telegraphTotalTime - 6f, Projectile.timeLeft, true); diff --git a/Projectiles/Boss/ApolloFireball.cs b/Projectiles/Boss/ApolloFireball.cs index 569a7b3921..ba04dae241 100644 --- a/Projectiles/Boss/ApolloFireball.cs +++ b/Projectiles/Boss/ApolloFireball.cs @@ -2,6 +2,7 @@ using System.IO; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -35,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; CooldownSlot = ImmunityCooldownID.Bosses; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 48 : timeLeft; + Projectile.timeLeft = timeLeft; } public override void SendExtraAI(BinaryWriter writer) @@ -55,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.tileCollide = true; int fadeInTime = 3; - Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - ((BossRushEvent.BossRushActive ? 48 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); + Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - (timeLeft - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(Projectile.Center, 0f, 0.6f * Projectile.Opacity, 0f); @@ -127,14 +128,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.CursedInferno, 180); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); @@ -164,7 +157,7 @@ namespace CalamityMod.Projectiles.Boss } // Plasma bolts - int totalProjectiles = BossRushEvent.BossRushActive ? 6 : 4; + int totalProjectiles = 4; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 0.5f; @@ -175,7 +168,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.8), 0f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, Apollo.BoltDamage, 0f, Main.myPlayer); } } diff --git a/Projectiles/Boss/ApolloRocket.cs b/Projectiles/Boss/ApolloRocket.cs index 6b95f59bbb..65c5918527 100644 --- a/Projectiles/Boss/ApolloRocket.cs +++ b/Projectiles/Boss/ApolloRocket.cs @@ -118,10 +118,9 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Light Lighting.AddLight(Projectile.Center, 0.2f, 1f, 0f); @@ -131,7 +130,7 @@ namespace CalamityMod.Projectiles.Boss Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = bossRush ? 120f : death ? 160f : revenge ? 180f : expertMode ? 200f : 240f; + float stopHomingDistance = death ? 160f : revenge ? 180f : expertMode ? 200f : 240f; if (distanceFromTarget.Length() < stopHomingDistance || Projectile.ai[0] == 1f || Projectile.timeLeft < 480) { Projectile.ai[0] = 1f; @@ -144,7 +143,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = bossRush ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; + float inertia = death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -152,8 +151,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= scaleFactor; // Fly away from other rockets - float pushForce = bossRush ? 0.07f : death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; - float pushDistance = bossRush ? 120f : death ? 100f : revenge ? 90f : expertMode ? 80f : 60f; + float pushForce = death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; + float pushDistance = death ? 100f : revenge ? 90f : expertMode ? 80f : 60f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; @@ -179,14 +178,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(BuffID.CursedInferno, 180); - } - public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); diff --git a/Projectiles/Boss/AresDeathBeamStart.cs b/Projectiles/Boss/AresDeathBeamStart.cs index 76c213e5bf..a42cd03c9b 100644 --- a/Projectiles/Boss/AresDeathBeamStart.cs +++ b/Projectiles/Boss/AresDeathBeamStart.cs @@ -91,14 +91,13 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Telegraph duration for deathray spiral - float deathrayTelegraphDuration = bossRush ? AresBody.deathrayTelegraphDuration_BossRush : death ? AresBody.deathrayTelegraphDuration_Death : - revenge ? AresBody.deathrayTelegraphDuration_Rev : expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; + float deathrayTelegraphDuration = death ? AresBody.deathrayTelegraphDuration_Death : revenge ? AresBody.deathrayTelegraphDuration_Rev : + expertMode ? AresBody.deathrayTelegraphDuration_Expert : AresBody.deathrayTelegraphDuration_Normal; Time = Main.npc[OwnerIndex].Calamity().newAI[2] - deathrayTelegraphDuration; } @@ -106,12 +105,11 @@ namespace CalamityMod.Projectiles.Boss public override void UpdateLaserMotion() { // Declare difficulty modes. - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - float angularSlowdownDivisor = bossRush ? 300f : death ? 320f : revenge ? 330f : expertMode ? 340f : 360f; + float angularSlowdownDivisor = death ? 320f : revenge ? 330f : expertMode ? 340f : 360f; float angularVelocity = MathHelper.TwoPi * Time / Lifetime / angularSlowdownDivisor; if (Main.npc[OwnerIndex].ai[3] % 2f == 0f) angularVelocity *= -1f; diff --git a/Projectiles/Boss/AresDeathBeamTelegraph.cs b/Projectiles/Boss/AresDeathBeamTelegraph.cs index 52458b6833..77e04e94a5 100644 --- a/Projectiles/Boss/AresDeathBeamTelegraph.cs +++ b/Projectiles/Boss/AresDeathBeamTelegraph.cs @@ -27,7 +27,6 @@ namespace CalamityMod.Projectiles.Boss public const float deathrayTelegraphDuration_Expert = 120f; public const float deathrayTelegraphDuration_Rev = 105f; public const float deathrayTelegraphDuration_Death = 90f; - public const float deathrayTelegraphDuration_BossRush = 60f; public const float TelegraphFadeTime = 15f; public const float TelegraphWidth = 2400f; @@ -48,13 +47,12 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - Projectile.timeLeft = (int)(bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : - revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal); + Projectile.timeLeft = (int)(death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : + expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal); } public override void SendExtraAI(BinaryWriter writer) @@ -106,13 +104,12 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - float TelegraphTotalTime = bossRush ? deathrayTelegraphDuration_BossRush : death ? deathrayTelegraphDuration_Death : - revenge ? deathrayTelegraphDuration_Rev : expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; + float TelegraphTotalTime = death ? deathrayTelegraphDuration_Death : revenge ? deathrayTelegraphDuration_Rev : + expertMode ? deathrayTelegraphDuration_Expert : deathrayTelegraphDuration_Normal; if (TelegraphDelay >= TelegraphTotalTime) return true; diff --git a/Projectiles/Boss/AresGaussNukeProjectile.cs b/Projectiles/Boss/AresGaussNukeProjectile.cs index e657cca25b..5bf8a352df 100644 --- a/Projectiles/Boss/AresGaussNukeProjectile.cs +++ b/Projectiles/Boss/AresGaussNukeProjectile.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; Projectile.timeLeft = timeLeft; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } @@ -72,10 +72,9 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) - MathHelper.PiOver2; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Spawn effects if (Projectile.localAI[0] == 0f) @@ -101,7 +100,7 @@ namespace CalamityMod.Projectiles.Boss // Gauss sparks if (Main.myPlayer == Projectile.owner) { - int totalProjectiles = bossRush ? 18 : 12; + int totalProjectiles = 12; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = Projectile.velocity.Length(); @@ -112,7 +111,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + Vector2.Normalize(Projectile.velocity) * -6f, type, (int)Math.Round(Projectile.damage * 0.5), 0f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + Vector2.Normalize(Projectile.velocity) * -6f, type, AresGaussNuke.SparkDamage, 0f, Main.myPlayer); } } } @@ -124,8 +123,15 @@ namespace CalamityMod.Projectiles.Boss int target = Player.FindClosest(Projectile.Center, 1, 1); Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; + // Instant explode upon collision with the target + if (CalamityUtils.CircularHitboxCollision(Projectile.Center, 45f, Main.player[target].Hitbox)) + { + Projectile.Kill(); + return; + } + // Set AI to stop homing, start accelerating - float stopHomingDistance = bossRush ? 260f : death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; + float stopHomingDistance = death ? 280f : revenge ? 290f : expertMode ? 300f : 320f; if ((distanceFromTarget.Length() < stopHomingDistance && Projectile.ai[0] != -1f) || Projectile.ai[0] == 1f) { Projectile.ai[0] = 1f; @@ -138,7 +144,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = bossRush ? 6f : death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; + float inertia = death ? 8f : revenge ? 9f : expertMode ? 10f : 12f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -176,10 +182,8 @@ namespace CalamityMod.Projectiles.Boss Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Projectiles/Boss/AresGaussNukeProjectileGlow").Value, Projectile.Center - Main.screenPosition, new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, drawStart, texture.Width, height)), Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 45f, targetHitbox); - - // Explodes on contact - public override void ModifyHitPlayer(Player target, ref Player.HurtModifiers modifiers) => Projectile.Kill(); + // Does not do damage by itself, only through the explosion + public override bool? CanDamage() => false; public override void OnKill(int timeLeft) { @@ -201,7 +205,7 @@ namespace CalamityMod.Projectiles.Boss // Explosion waves for (int i = 0; i < 3; i++) { - Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + Projectile explosion = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), i == 2 ? Projectile.damage : 0, 0f, Main.myPlayer); if (explosion.whoAmI.WithinBounds(Main.maxProjectiles)) { // Make the max explosion radius decrease over time, creating a ring effect. diff --git a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs index 2c7d2d2db3..1d60927f9f 100644 --- a/Projectiles/Boss/AresGaussNukeProjectileBoom.cs +++ b/Projectiles/Boss/AresGaussNukeProjectileBoom.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Terraria; @@ -29,6 +30,8 @@ namespace CalamityMod.Projectiles.Boss } public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + private List PlayersHit = new List() { -1 }; + public override void SetStaticDefaults() { ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; @@ -48,6 +51,8 @@ namespace CalamityMod.Projectiles.Boss public override void PostAI() => Lighting.AddLight(Projectile.Center, 0.2f, 0.1f, 0f); - public override bool CanHitPlayer(Player target) => CalamityUtils.CircularHitboxCollision(Projectile.Center, CurrentRadius * Projectile.scale * 0.4f, target.Hitbox) && Projectile.timeLeft > 6; + public override bool CanHitPlayer(Player target) => CalamityUtils.CircularHitboxCollision(Projectile.Center, CurrentRadius * Projectile.scale * 0.4f, target.Hitbox) && Projectile.timeLeft > 6 && !PlayersHit.Contains(target.whoAmI); + + public override void OnHitPlayer(Player target, Player.HurtInfo info) => PlayersHit.Add(target.whoAmI); } } diff --git a/Projectiles/Boss/AresLaserBeamStart.cs b/Projectiles/Boss/AresLaserBeamStart.cs index fd96c14180..46f236d723 100644 --- a/Projectiles/Boss/AresLaserBeamStart.cs +++ b/Projectiles/Boss/AresLaserBeamStart.cs @@ -228,14 +228,6 @@ namespace CalamityMod.Projectiles.Boss return false; } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 150); - } - public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; } } diff --git a/Projectiles/Boss/AresPlasmaBolt.cs b/Projectiles/Boss/AresPlasmaBolt.cs index dc9c8a14e0..923848fd8f 100644 --- a/Projectiles/Boss/AresPlasmaBolt.cs +++ b/Projectiles/Boss/AresPlasmaBolt.cs @@ -22,7 +22,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; @@ -70,14 +69,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.CursedInferno, 90); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); diff --git a/Projectiles/Boss/AresPlasmaFireball.cs b/Projectiles/Boss/AresPlasmaFireball.cs index e1611af3ba..669e1333c7 100644 --- a/Projectiles/Boss/AresPlasmaFireball.cs +++ b/Projectiles/Boss/AresPlasmaFireball.cs @@ -2,6 +2,7 @@ using System.IO; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.Sounds; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -26,7 +27,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 36; Projectile.height = 36; Projectile.hostile = true; @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; CooldownSlot = ImmunityCooldownID.Bosses; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 96 : timeLeft; + Projectile.timeLeft = timeLeft; } public override void SendExtraAI(BinaryWriter writer) @@ -58,7 +58,7 @@ namespace CalamityMod.Projectiles.Boss } int fadeInTime = 3; - Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - ((BossRushEvent.BossRushActive ? 96 : timeLeft) - fadeInTime)) / (float)fadeInTime), 0f, 1f); + Projectile.Opacity = MathHelper.Clamp(1f - ((Projectile.timeLeft - (timeLeft - fadeInTime)) / (float)fadeInTime), 0f, 1f); Lighting.AddLight(Projectile.Center, 0f, 0.6f * Projectile.Opacity, 0f); @@ -126,14 +126,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => Projectile.Opacity == 1f; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.CursedInferno, 180); - } - public override bool PreDraw(ref Color lightColor) { lightColor.R = (byte)(255 * Projectile.Opacity); @@ -163,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss } // Plasma bolts - int totalProjectiles = BossRushEvent.BossRushActive ? 12 : 8; + int totalProjectiles = 8; // Reduce the total amount of projectiles by half if Ares Plasma Arm is shooting them and in deathray phase and not the last mech if (Projectile.ai[0] == -1f) @@ -179,7 +171,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.8), 0f, Main.myPlayer); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, AresPlasmaFlamethrower.BoltDamage, 0f, Main.myPlayer); } } diff --git a/Projectiles/Boss/AresTeslaOrb.cs b/Projectiles/Boss/AresTeslaOrb.cs index 4878f29a10..3c9e9676bc 100644 --- a/Projectiles/Boss/AresTeslaOrb.cs +++ b/Projectiles/Boss/AresTeslaOrb.cs @@ -149,12 +149,11 @@ namespace CalamityMod.Projectiles.Boss return null; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; - float detachDistance = bossRush ? 1600f : death ? 1360f : revenge ? 1280f : expertMode ? 1200f : 960f; + float detachDistance = death ? 1360f : revenge ? 1280f : expertMode ? 1200f : 960f; foreach (Projectile p in Main.ActiveProjectiles) { if (p.type != Projectile.type || p.ai[0] != Identity + 1f || Main.npc[CalamityGlobalNPC.draedonExoMechPrime].Calamity().newAI[0] == (float)AresBody.Phase.Deathrays) diff --git a/Projectiles/Boss/ArtemisLaser.cs b/Projectiles/Boss/ArtemisLaser.cs index 454670d01a..cd81ae8c20 100644 --- a/Projectiles/Boss/ArtemisLaser.cs +++ b/Projectiles/Boss/ArtemisLaser.cs @@ -106,8 +106,8 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } @@ -195,14 +195,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => TelegraphDelay > TelegraphTotalTime; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || TelegraphDelay <= TelegraphTotalTime) - return; - - target.AddBuff(ModContent.BuffType(), 90); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { return CalamityUtils.CircularHitboxCollision(projHitbox.Center(), Projectile.Size.Length() * 0.5f, targetHitbox); diff --git a/Projectiles/Boss/ArtemisSpinLaserbeam.cs b/Projectiles/Boss/ArtemisSpinLaserbeam.cs index 08b27e1575..3bf0879995 100644 --- a/Projectiles/Boss/ArtemisSpinLaserbeam.cs +++ b/Projectiles/Boss/ArtemisSpinLaserbeam.cs @@ -151,7 +151,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 300); } public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; diff --git a/Projectiles/Boss/AstralFlame.cs b/Projectiles/Boss/AstralFlame.cs index 99629bc81a..fc740c018b 100644 --- a/Projectiles/Boss/AstralFlame.cs +++ b/Projectiles/Boss/AstralFlame.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 50; Projectile.height = 50; Projectile.hostile = true; @@ -33,17 +32,16 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 600; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } public override void AI() { // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; Projectile.frameCounter++; if (Projectile.frameCounter > 4) @@ -104,8 +102,8 @@ namespace CalamityMod.Projectiles.Boss // Move away from other flames if (Projectile.ai[0] >= 60f) { - float pushForce = bossRush ? 0.07f : death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; - float pushDistance = bossRush ? 180f : death ? 150f : revenge ? 135f : expertMode ? 120f : 90f; + float pushForce = death ? 0.06f : revenge ? 0.055f : expertMode ? 0.05f : 0.04f; + float pushDistance = death ? 150f : revenge ? 135f : expertMode ? 120f : 90f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; @@ -150,7 +148,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 75); + target.AddBuff(ModContent.BuffType(), 120); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Boss/AstralGodRay.cs b/Projectiles/Boss/AstralGodRay.cs index bca3fb8b44..1dabcb8439 100644 --- a/Projectiles/Boss/AstralGodRay.cs +++ b/Projectiles/Boss/AstralGodRay.cs @@ -103,7 +103,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 75); + target.AddBuff(ModContent.BuffType(), 120); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Boss/AstralLaser.cs b/Projectiles/Boss/AstralLaser.cs index f81ffeeeac..af2e96b9ad 100644 --- a/Projectiles/Boss/AstralLaser.cs +++ b/Projectiles/Boss/AstralLaser.cs @@ -101,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft >= 85) - target.AddBuff(ModContent.BuffType(), 45); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/AstralShot2.cs b/Projectiles/Boss/AstralShot2.cs index 82f15bd2a2..2281798333 100644 --- a/Projectiles/Boss/AstralShot2.cs +++ b/Projectiles/Boss/AstralShot2.cs @@ -37,11 +37,10 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 1f) { Projectile.extraUpdates = 2; - bool bossRush = BossRushEvent.BossRushActive; - float maxVelocity = bossRush ? 3.75f : 3f; + float maxVelocity = 3f; if (Projectile.velocity.Length() < maxVelocity) { - Projectile.velocity *= bossRush ? 1.02f : 1.015f; + Projectile.velocity *= 1.015f; if (Projectile.velocity.Length() > maxVelocity) { Projectile.velocity.Normalize(); @@ -78,7 +77,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 45); + target.AddBuff(ModContent.BuffType(), 60); } public override Color? GetAlpha(Color lightColor) diff --git a/Projectiles/Boss/BirbAura.cs b/Projectiles/Boss/BirbAura.cs index bf325251d8..d3e0fc4f53 100644 --- a/Projectiles/Boss/BirbAura.cs +++ b/Projectiles/Boss/BirbAura.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.tileCollide = false; Projectile.timeLeft = 1200; + Projectile.Calamity().DealsDefenseDamage = true; } public override void SendExtraAI(BinaryWriter writer) diff --git a/Projectiles/Boss/BirbAuraFlare.cs b/Projectiles/Boss/BirbAuraFlare.cs index cb17ddd3fd..7b77bda05b 100644 --- a/Projectiles/Boss/BirbAuraFlare.cs +++ b/Projectiles/Boss/BirbAuraFlare.cs @@ -114,7 +114,7 @@ namespace CalamityMod.Projectiles.Boss float y = projTileX * 16 + 900; Vector2 laserVelocity = new Vector2(x, 160f) - new Vector2(x, y); int type = ModContent.ProjectileType(); - int damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + int damage = Dragonfolly.LightningDamage; if (Projectile.ai[0] >= 2f) { x += 1000f; diff --git a/Projectiles/Boss/BrimstoneBall.cs b/Projectiles/Boss/BrimstoneBall.cs index 8009e83729..a171fbf0b7 100644 --- a/Projectiles/Boss/BrimstoneBall.cs +++ b/Projectiles/Boss/BrimstoneBall.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/BrimstoneBarrage.cs b/Projectiles/Boss/BrimstoneBarrage.cs index 0913198f87..59e57349d3 100644 --- a/Projectiles/Boss/BrimstoneBarrage.cs +++ b/Projectiles/Boss/BrimstoneBarrage.cs @@ -36,20 +36,8 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(Projectile.localAI[0]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - Projectile.localAI[0] = reader.ReadSingle(); - } - public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - int target = Player.FindClosest(Projectile.Center, 1, 1); float targetDist; @@ -60,7 +48,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity.Length() < Projectile.ai[2]) { - Projectile.velocity *= bossRush ? 1.0125f : 1.01f; + Projectile.velocity *= 1.01f; if (Projectile.velocity.Length() > Projectile.ai[2]) { Projectile.velocity.Normalize(); @@ -120,14 +108,6 @@ namespace CalamityMod.Projectiles.Boss trailDust.scale = Main.rand.NextFloat(0.2f, 0.6f); } - if (Projectile.localAI[0] == 0f) - { - Projectile.localAI[0] = 1f; - - if (Projectile.ai[0] == 0f) - Projectile.damage = NPC.AnyNPCs(ModContent.NPCType()) ? Projectile.GetProjectileDamage(ModContent.NPCType()) : Projectile.GetProjectileDamage(ModContent.NPCType()); - } - Lighting.AddLight(Projectile.Center, 0.75f * Projectile.Opacity, 0f, 0f); time++; } @@ -142,7 +122,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 0f || Main.zenithWorld) target.AddBuff(ModContent.BuffType(), 180); else - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/BrimstoneFire.cs b/Projectiles/Boss/BrimstoneFire.cs index 2fb7384d2e..52038731eb 100644 --- a/Projectiles/Boss/BrimstoneFire.cs +++ b/Projectiles/Boss/BrimstoneFire.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 240); // Cook you up (still scales with player size in case it's manipulated) int smokeCount = 4 + (int)MathHelper.Clamp(target.width * 0.1f, 0f, 20f); diff --git a/Projectiles/Boss/BrimstoneHellblast.cs b/Projectiles/Boss/BrimstoneHellblast.cs index 2b2c2d18c1..dee61c274d 100644 --- a/Projectiles/Boss/BrimstoneHellblast.cs +++ b/Projectiles/Boss/BrimstoneHellblast.cs @@ -126,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 0f || Main.zenithWorld) target.AddBuff(ModContent.BuffType(), 180); else - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Boss/BrimstoneHellblast2.cs b/Projectiles/Boss/BrimstoneHellblast2.cs index c734f9520a..36f5a082d3 100644 --- a/Projectiles/Boss/BrimstoneHellblast2.cs +++ b/Projectiles/Boss/BrimstoneHellblast2.cs @@ -40,7 +40,7 @@ namespace CalamityMod.Projectiles.Boss // Cal Clone bullet hell projectiles accelerate after a certain time has passed if (Projectile.ai[0] == 2f && (Main.expertMode || BossRushEvent.BossRushActive) && Projectile.timeLeft < 1260) { - if (Projectile.velocity.Length() < (BossRushEvent.BossRushActive ? 12.5f : 10f)) + if (Projectile.velocity.Length() < 10f) Projectile.velocity *= 1.005f; } @@ -107,7 +107,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[0] == 0f || Main.zenithWorld) target.AddBuff(ModContent.BuffType(), 180); else - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/BrimstoneHellfireball.cs b/Projectiles/Boss/BrimstoneHellfireball.cs index c35f3e1f66..ce7f33d38b 100644 --- a/Projectiles/Boss/BrimstoneHellfireball.cs +++ b/Projectiles/Boss/BrimstoneHellfireball.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; @@ -83,7 +82,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 240); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/BrimstoneMonster.cs b/Projectiles/Boss/BrimstoneMonster.cs index 9ae84d9397..3c9dab94fa 100644 --- a/Projectiles/Boss/BrimstoneMonster.cs +++ b/Projectiles/Boss/BrimstoneMonster.cs @@ -34,7 +34,7 @@ namespace CalamityMod.Projectiles.Boss internal static readonly float CircularHitboxRadius = 170f; public static int MinimumDamagePerFrame = 4; - public static int MaximumDamagePerFrame = 16; + public static int MaximumDamagePerFrame = 14; public static float AdrenalineLossPerFrame = 0.04f; public static float SpeedToForceMaxDamage = 25f; diff --git a/Projectiles/Boss/BrimstoneRay.cs b/Projectiles/Boss/BrimstoneRay.cs index 860895fc39..de5275700d 100644 --- a/Projectiles/Boss/BrimstoneRay.cs +++ b/Projectiles/Boss/BrimstoneRay.cs @@ -114,17 +114,15 @@ namespace CalamityMod.Projectiles.Boss Vector2 dustSpawnPos = Projectile.Center + Projectile.velocity * (Projectile.localAI[1] - 14f); // Fire brimstone darts along the laser - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; if (Main.npc[(int)Projectile.ai[1]].ai[1] == 210f && Projectile.owner == Main.myPlayer && Main.npc[(int)Projectile.ai[1]].ai[0] == 5) { Vector2 velocity = Projectile.velocity; velocity.Normalize(); - float distanceBetweenProjectiles = Main.zenithWorld ? 360 : bossRush ? 72f : 144f; + float distanceBetweenProjectiles = Main.zenithWorld ? 360 : 144f; Vector2 fireFrom = new Vector2(Main.npc[(int)Projectile.ai[1]].Center.X + (Main.npc[(int)Projectile.ai[1]].spriteDirection > 0 ? 34f : -34f), Main.npc[(int)Projectile.ai[1]].Center.Y - 74f) + velocity * distanceBetweenProjectiles; int projectileAmt = (int)(Projectile.localAI[1] / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); - int damage = (int)Math.Round(Projectile.damage * 0.6); float projectileVelocityToPass = 12f; for (int i = 0; i < projectileAmt; i++) @@ -134,9 +132,9 @@ namespace CalamityMod.Projectiles.Boss for (int j = 0; j < totalProjectiles; j++) { Vector2 projVelocity = Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2); - int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), fireFrom, projVelocity, type, damage, 0f, Main.myPlayer, death ? 2f : 1f, 0f, projectileVelocityToPass); + int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), fireFrom, projVelocity, type, BrimstoneElemental.DartDamage, 0f, Main.myPlayer, death ? 2f : 1f, 0f, projectileVelocityToPass); Main.projectile[proj].tileCollide = true; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Main.projectile[proj].extraUpdates += 1; } fireFrom += velocity * distanceBetweenProjectiles; @@ -235,7 +233,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 240); } public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; diff --git a/Projectiles/Boss/CrimulanSpike.cs b/Projectiles/Boss/CrimulanSpike.cs index 233db11b4a..619f104cac 100644 --- a/Projectiles/Boss/CrimulanSpike.cs +++ b/Projectiles/Boss/CrimulanSpike.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 20; Projectile.height = 20; Projectile.hostile = true; diff --git a/Projectiles/Boss/DarkEnergyBall.cs b/Projectiles/Boss/DarkEnergyBall.cs index ad7fa65911..498edb8a4e 100644 --- a/Projectiles/Boss/DarkEnergyBall.cs +++ b/Projectiles/Boss/DarkEnergyBall.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DarkEnergyBall2.cs b/Projectiles/Boss/DarkEnergyBall2.cs index 17076168fc..53e95b4bfe 100644 --- a/Projectiles/Boss/DarkEnergyBall2.cs +++ b/Projectiles/Boss/DarkEnergyBall2.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.Opacity = 0f; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DesertScourgeSpit.cs b/Projectiles/Boss/DesertScourgeSpit.cs index 15b83a8c5d..8f1271c812 100644 --- a/Projectiles/Boss/DesertScourgeSpit.cs +++ b/Projectiles/Boss/DesertScourgeSpit.cs @@ -25,12 +25,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.width = 16; Projectile.height = 16; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 900 : 600; + Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 600; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; } diff --git a/Projectiles/Boss/DestroyerElectricLaser.cs b/Projectiles/Boss/DestroyerElectricLaser.cs index 5a30ce18b1..0b9e4572dd 100644 --- a/Projectiles/Boss/DestroyerElectricLaser.cs +++ b/Projectiles/Boss/DestroyerElectricLaser.cs @@ -59,7 +59,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/DeusMine.cs b/Projectiles/Boss/DeusMine.cs index 83a4612665..d440cb096b 100644 --- a/Projectiles/Boss/DeusMine.cs +++ b/Projectiles/Boss/DeusMine.cs @@ -135,7 +135,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Main.myPlayer, 1f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, AstrumDeusBody.LaserDamage, 0f, Main.myPlayer, 1f, 0f); } } } @@ -146,7 +146,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.timeLeft > MaxTimeLeft - FadeTime || (Projectile.timeLeft < FadeTime && Projectile.ai[0] == 0f)) return; - target.AddBuff(ModContent.BuffType(), 75); + target.AddBuff(ModContent.BuffType(), 120); } } } diff --git a/Projectiles/Boss/DoGBeam.cs b/Projectiles/Boss/DoGBeam.cs index 6be31c977f..7336ec46f6 100644 --- a/Projectiles/Boss/DoGBeam.cs +++ b/Projectiles/Boss/DoGBeam.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 960; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } diff --git a/Projectiles/Boss/DoGBeamPortal.cs b/Projectiles/Boss/DoGBeamPortal.cs index dca2e08b29..830b80d8a0 100644 --- a/Projectiles/Boss/DoGBeamPortal.cs +++ b/Projectiles/Boss/DoGBeamPortal.cs @@ -84,10 +84,9 @@ namespace CalamityMod.Projectiles.Boss } // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool expertMode = Main.expertMode || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool death = CalamityWorld.death || bossRush; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; Lighting.AddLight(Projectile.Center, 0f, 0.95f, 1.15f); @@ -102,7 +101,7 @@ namespace CalamityMod.Projectiles.Boss double deg = Projectile.ai[1]; double rad = deg * (Math.PI / 180); - double dist = bossRush ? 360D : death ? 400D : revenge ? 420D : expertMode ? 440D : 480D; + double dist = death ? 400D : revenge ? 420D : expertMode ? 440D : 480D; Projectile.position.X = player.Center.X - (int)(Math.Cos(rad) * dist) - Projectile.width / 2; Projectile.position.Y = player.Center.Y - (int)(Math.Sin(rad) * dist) - Projectile.height / 2; Projectile.ai[1] += 1f; diff --git a/Projectiles/Boss/DoGDeath.cs b/Projectiles/Boss/DoGDeath.cs index b1ff1dcefa..4245e1eeb9 100644 --- a/Projectiles/Boss/DoGDeath.cs +++ b/Projectiles/Boss/DoGDeath.cs @@ -83,7 +83,7 @@ namespace CalamityMod.Projectiles.Boss // If an old velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (OldVelocity != Vector2.Zero) { - Projectile.velocity = OldVelocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.velocity = OldVelocity; OldVelocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/FlareBomb.cs b/Projectiles/Boss/FlareBomb.cs index 0d9d4a4d21..515af26689 100644 --- a/Projectiles/Boss/FlareBomb.cs +++ b/Projectiles/Boss/FlareBomb.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.hostile = true; diff --git a/Projectiles/Boss/FlareDust.cs b/Projectiles/Boss/FlareDust.cs index 24a4917bfb..665620b277 100644 --- a/Projectiles/Boss/FlareDust.cs +++ b/Projectiles/Boss/FlareDust.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.scale = 1.5f; @@ -82,14 +81,14 @@ namespace CalamityMod.Projectiles.Boss float earlyTimeProjSpeed = Projectile.localAI[0] / 120f; if (earlyTimeProjSpeed > 1f) earlyTimeProjSpeed = 1f; - distance += MathHelper.Lerp(1f, 9f, earlyTimeProjSpeed); + distance += MathHelper.Lerp(1f, 11f, earlyTimeProjSpeed); if (Projectile.timeLeft < 380) { float longTimeProjSpeed = (Projectile.localAI[0] - 300f) / 240f; if (longTimeProjSpeed > 1f) longTimeProjSpeed = 1f; - distance += MathHelper.Lerp(1f, 9f, longTimeProjSpeed); + distance += MathHelper.Lerp(1f, 11f, longTimeProjSpeed); } double rad = MathHelper.ToRadians(Projectile.ai[1]); @@ -216,10 +215,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[0] == 3f) - target.AddBuff(ModContent.BuffType(), 160); - else - target.AddBuff(ModContent.BuffType(), 60); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/FlareDust2.cs b/Projectiles/Boss/FlareDust2.cs index a2252c2bca..c6e34661ec 100644 --- a/Projectiles/Boss/FlareDust2.cs +++ b/Projectiles/Boss/FlareDust2.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 64; Projectile.height = 66; Projectile.scale = 1.5f; diff --git a/Projectiles/Boss/Flarenado.cs b/Projectiles/Boss/Flarenado.cs index e8e1ce6b58..dcaba5ba77 100644 --- a/Projectiles/Boss/Flarenado.cs +++ b/Projectiles/Boss/Flarenado.cs @@ -129,12 +129,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.velocity.X *= 1.5f; } if (Projectile.timeLeft == 480) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + Projectile.damage = Yharon.TornadoDamage; } public override bool CanHitPlayer(Player target) => Projectile.timeLeft <= 480; @@ -159,7 +159,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft <= 480) - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/FoveanatorEnergyBomb.cs b/Projectiles/Boss/FoveanatorEnergyBomb.cs deleted file mode 100644 index 246e80bfb4..0000000000 --- a/Projectiles/Boss/FoveanatorEnergyBomb.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Events; -using CalamityMod.NPCs; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class FoveanatorEnergyBomb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Boss"; - - private const int TotalXFrames = 2; - private const int TotalYFrames = 8; - private const int ExplodeFrames = 6; - private const int ExplodeDamageStartFrame = 3; - private const int FrameTimer = 6; - - public int frameX = 0; - public int frameY = 0; - - public int CurrentFrame - { - get => frameX * TotalYFrames + frameY; - set - { - frameX = value / TotalYFrames; - frameY = value % TotalYFrames; - } - } - - private const int TimeLeft = 300; - private const int SlowDownTime = TimeLeft / 2; - private const int ExplosionDuration = FrameTimer * ExplodeFrames; - - private const float ExplodeDistance = 50f; - - public override void SetDefaults() - { - Projectile.width = 133; - Projectile.height = 142; - Projectile.hostile = true; - Projectile.ignoreWater = true; - Projectile.tileCollide = false; - Projectile.penetrate = -1; - Projectile.timeLeft = TimeLeft; - } - - public override void AI() - { - // If moving, decelerate. - if (Projectile.velocity.Length() > 0f && Projectile.timeLeft <= SlowDownTime) - Projectile.velocity *= 0.95f; - - // Get a target and calculate distance from it. - int target = Player.FindClosest(Projectile.Center, 1, 1); - float distanceFromTarget = Projectile.Distance(Main.player[target].Center); - - // Explode when within a certain distance of the target. - if (distanceFromTarget <= ExplodeDistance && Projectile.timeLeft > ExplosionDuration) - Projectile.timeLeft = ExplosionDuration; - - bool explode = Projectile.timeLeft <= ExplosionDuration; - - // Stop immediately if explosion is triggered. - if (explode && Projectile.velocity.Length() > 0f) - Projectile.velocity = Vector2.Zero; - - // Reset the frame counter and frameY when explosion is triggered. - if (Projectile.timeLeft == ExplosionDuration) - { - Projectile.frameCounter = 0; - frameY = 0; - } - - // Explosion noise when actually exploding. - if (frameY == ExplodeDamageStartFrame && explode && Projectile.localAI[0] == 0f) - { - Projectile.localAI[0] = 1f; - SoundEngine.PlaySound(DeusMine.ExplodeSound, Projectile.Center); - } - - Projectile.frameCounter++; - if (Projectile.frameCounter % FrameTimer == 0) - { - CurrentFrame++; - - // Non-explosion uses the left side of the sheet, explosion uses the right side of the sheet. - frameX = explode ? 1 : 0; - - // Kill the projectile when the explosion animation is done. - if (explode && frameY >= ExplodeFrames) - { - if (Projectile.ai[0] > 0f) - { - if (Projectile.owner == Main.myPlayer) - { - float laserSpeed = 2f; - int type = ModContent.ProjectileType(); - int damage = (int)Math.Round(Projectile.damage * 0.85); - Vector2 laserVelocity = (Main.player[target].Center - Projectile.Center).SafeNormalize(Vector2.UnitY) * laserSpeed; - Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + laserVelocity.SafeNormalize(Vector2.UnitY) * 16f, laserVelocity, type, damage, 0f, Main.myPlayer); - - if (Projectile.ai[0] == 2f) - { - Vector2 projectileVelocity = (Main.player[target].Center - Projectile.Center).SafeNormalize(Vector2.UnitY) * laserSpeed * 0.75f; - int numProj = 2; - int spread = 30; - float rotation = MathHelper.ToRadians(spread); - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = projectileVelocity.RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(Projectile.GetSource_FromAI(), Projectile.Center + perturbedSpeed.SafeNormalize(Vector2.UnitY) * 16f, perturbedSpeed, type, damage, 0f, Main.myPlayer); - } - } - } - } - - Projectile.Kill(); - - return; - } - } - - // Explosion has brighter light. - Color lightColor = Color.Lerp(new Color(25, 25, 128), new Color(100, 25, 128), Main.DiscoR / 255f); - float divisor = explode ? 128f : 255f; - Lighting.AddLight(Projectile.Center, lightColor.R / divisor, lightColor.G / divisor, lightColor.B / divisor); - } - - public override bool PreDraw(ref Color lightColor) => false; - - public override void PostDraw(Color lightColor) - { - if (Projectile.frameCounter < 5) - return; - - lightColor.R = (byte)(255 * Projectile.Opacity); - lightColor.G = (byte)(255 * Projectile.Opacity); - lightColor.B = (byte)(255 * Projectile.Opacity); - - Texture2D texture = TextureAssets.Projectile[Type].Value; - Vector2 position = Projectile.Center - Main.screenPosition; - Vector2 origin = texture.Size() / new Vector2(TotalXFrames, TotalYFrames) * 0.5f; - Rectangle frame = texture.Frame(TotalXFrames, TotalYFrames, frameX, frameY); - Main.EntitySpriteDraw(texture, position, frame, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None); - } - - public override bool CanHitPlayer(Player target) => Projectile.timeLeft <= ExplosionDuration && frameY >= ExplodeDamageStartFrame; - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, ExplodeDistance, targetHitbox); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (Projectile.timeLeft <= ExplosionDuration) - target.AddBuff(BuffID.Frostburn, 180); - } - } -} diff --git a/Projectiles/Boss/FoveanatorEnergyBomb.png b/Projectiles/Boss/FoveanatorEnergyBomb.png deleted file mode 100644 index 4e2a8120cb..0000000000 Binary files a/Projectiles/Boss/FoveanatorEnergyBomb.png and /dev/null differ diff --git a/Projectiles/Boss/FoveanatorFlamethrower.cs b/Projectiles/Boss/FoveanatorFlamethrower.cs deleted file mode 100644 index 6583bef428..0000000000 --- a/Projectiles/Boss/FoveanatorFlamethrower.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Dusts; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class FoveanatorFlamethrower : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Boss"; - public override string Texture => "CalamityMod/Projectiles/FireProj"; - - public static int Lifetime => 180; - public static int Fadetime => 160; - public ref float Time => ref Projectile.ai[0]; - public int MistType = -1; - - public override void SetDefaults() - { - Projectile.width = Projectile.height = 10; - Projectile.hostile = true; - Projectile.ignoreWater = true; - Projectile.penetrate = -1; - Projectile.MaxUpdates = 3; - Projectile.timeLeft = Lifetime; - CooldownSlot = ImmunityCooldownID.Bosses; - } - - public override void AI() - { - Time++; - if (Time < Fadetime && Main.rand.NextBool(6)) - { - Vector2 cinderPos = Projectile.Center + Main.rand.NextVector2Circular(60f, 60f) * Utils.Remap(Time, 0f, Lifetime, 0.5f, 1f); - float cinderSize = Utils.GetLerpValue(6f, 12f, Time, true); - Dust cinder = Dust.NewDustDirect(cinderPos, 4, 4, Main.rand.NextBool() ? (int)CalamityDusts.BlueCosmilite : (int)CalamityDusts.PurpleCosmilite, Projectile.velocity.X * 0.25f, Projectile.velocity.Y * 0.25f); - if (Main.rand.NextBool(3)) - { - cinder.scale *= 2f; - cinder.velocity *= 2f; - } - cinder.noGravity = true; - cinder.scale *= cinderSize * 1.2f; - cinder.velocity += Projectile.velocity * Utils.Remap(Time, 0f, Fadetime * 0.75f, 1f, 0.1f) * Utils.Remap(Time, 0f, Fadetime * 0.1f, 0.1f, 1f); - } - - if (MistType == -1) - MistType = Main.rand.Next(3); - - Color lightColor = Color.Lerp(new Color(50, 50, 255), new Color(200, 50, 255), Main.DiscoR / 255f); - Lighting.AddLight(Projectile.Center, lightColor.R / 255f, lightColor.G / 255f, lightColor.B / 255f); - } - - // Keeping the flames in place when hitting a block - public override bool OnTileCollide(Vector2 oldVelocity) - { - Projectile.velocity = oldVelocity * 0.95f; - Projectile.position -= Projectile.velocity; - Time++; - Projectile.timeLeft--; - return false; - } - - // Cannot hit the player if fading out - public override bool CanHitPlayer(Player target) => Time <= Fadetime; - - // Expanding hitbox - public override void ModifyDamageHitbox(ref Rectangle hitbox) - { - int size = (int)Utils.Remap(Time, 0f, Fadetime, 8f, 32f); - - // Shrinks again after fading - if (Time > Fadetime) - size = (int)Utils.Remap(Time, Fadetime, Lifetime, 32f, 0f); - - hitbox.Inflate(size, size); - } - - // Anti-wall hacking checks - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => projHitbox.Intersects(targetHitbox) && Collision.CanHit(Projectile.Center, 0, 0, targetHitbox.Center.ToVector2(), 0, 0) ? null : false; - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(BuffID.Frostburn, 300); - - // Cook you up (still scales with player size in case it's manipulated) - int smokeCount = 4 + (int)MathHelper.Clamp(target.width * 0.1f, 0f, 20f); - for (int i = 0; i < smokeCount; i++) - { - Vector2 smokePos = target.Center + Main.rand.NextVector2Circular(target.width * 0.5f, target.height * 0.5f); - Vector2 smokeVel = Vector2.UnitY * Main.rand.NextFloat(-2.4f, -0.8f) * MathHelper.Clamp(target.height * 0.1f, 1f, 10f); - Particle smoke = new MediumMistParticle(smokePos, smokeVel, Color.Lerp(new Color(50, 50, 255), new Color(200, 50, 255), Main.DiscoR / 255f), Color.DarkMagenta, Main.rand.NextFloat(1f, 2f), 245 - Main.rand.Next(50), 0.1f); - GeneralParticleHandler.SpawnParticle(smoke); - } - } - - public override bool PreDraw(ref Color lightColor) - { - Texture2D fire = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Texture2D mist = ModContent.Request("CalamityMod/Particles/MediumMist").Value; - - // The conga line of colors to sift through - Color color1 = new Color(50, 50, 255, 200); - Color color2 = new Color(50, 0, 225, 70); - Color color3 = new Color(200, 50, 255, 100); - Color color4 = new Color(150, 15, 85, 100); - float length = ((Time > Fadetime - 10f) ? 0.1f : 0.15f); - float vOffset = Math.Min(Time, 20f); - float timeRatio = Utils.GetLerpValue(0f, Lifetime, Time); - float fireSize = Utils.Remap(timeRatio, 0.2f, 0.5f, 0.25f, 1f); - - if (timeRatio >= 1f) - return false; - - for (float j = 1f; j >= 0f; j -= length) - { - // Color - Color fireColor = ((timeRatio < 0.1f) ? Color.Lerp(Color.Transparent, color1, Utils.GetLerpValue(0f, 0.1f, timeRatio)) : - ((timeRatio < 0.2f) ? Color.Lerp(color1, color2, Utils.GetLerpValue(0.1f, 0.2f, timeRatio)) : - ((timeRatio < 0.35f) ? color2 : - ((timeRatio < 0.7f) ? Color.Lerp(color2, color3, Utils.GetLerpValue(0.35f, 0.7f, timeRatio)) : - ((timeRatio < 0.85f) ? Color.Lerp(color3, color4, Utils.GetLerpValue(0.7f, 0.85f, timeRatio)) : - Color.Lerp(color4, Color.Transparent, Utils.GetLerpValue(0.85f, 1f, timeRatio))))))); - fireColor *= (1f - j) * Utils.GetLerpValue(0f, 0.2f, timeRatio, true); - Color innerColor = Color.Lerp(fireColor, Color.Black, 0.3f); - - // Positions and rotations - Vector2 firePos = Projectile.Center - Main.screenPosition - Projectile.velocity * vOffset * j; - float mainRot = -j * MathHelper.PiOver2 - Main.GlobalTimeWrappedHourly * (j + 1f) * 2f / length; - float trailRot = MathHelper.PiOver4 - mainRot; - - // Draw one backtrail - Vector2 trailOffset = Projectile.velocity * vOffset * length * 0.5f; - Main.EntitySpriteDraw(fire, firePos - trailOffset, null, innerColor * 0.25f, trailRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the main fire - Main.EntitySpriteDraw(fire, firePos, null, innerColor, mainRot, fire.Size() * 0.5f, fireSize, SpriteEffects.None); - - // Draw the masking smoke - Main.spriteBatch.SetBlendState(BlendState.Additive); - Rectangle frame = mist.Frame(1, 3, 0, MistType); - Main.EntitySpriteDraw(mist, firePos, frame, Color.Lerp(fireColor, Color.White, 0.3f), mainRot, frame.Size() * 0.5f, fireSize, SpriteEffects.None); - Main.EntitySpriteDraw(mist, firePos, frame, fireColor, mainRot, frame.Size() * 0.5f, fireSize * 3f, SpriteEffects.None); - Main.spriteBatch.SetBlendState(BlendState.AlphaBlend); - } - - return false; - } - } -} diff --git a/Projectiles/Boss/FoveanatorLaser.cs b/Projectiles/Boss/FoveanatorLaser.cs deleted file mode 100644 index fc73073e84..0000000000 --- a/Projectiles/Boss/FoveanatorLaser.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.NPCs.TownNPCs; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Boss -{ - public class FoveanatorLaser : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Boss"; - - private const int FadeOutTime = 30; - - private const float Acceleration = 1.05f; - private const float MaxVelocity = 24f; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - ProjectileID.Sets.TrailCacheLength[Type] = 2; - ProjectileID.Sets.TrailingMode[Type] = 0; - } - - public override void SetDefaults() - { - Projectile.width = 16; - Projectile.height = 16; - Projectile.hostile = true; - Projectile.ignoreWater = true; - Projectile.Opacity = 0f; - Projectile.penetrate = -1; - Projectile.timeLeft = 300; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter > 4) - { - Projectile.frame++; - Projectile.frameCounter = 0; - } - if (Projectile.frame > 3) - Projectile.frame = 0; - - if (Projectile.velocity.Length() < MaxVelocity) - { - Projectile.velocity *= Acceleration; - if (Projectile.velocity.Length() > MaxVelocity) - { - Projectile.velocity.Normalize(); - Projectile.velocity *= MaxVelocity; - } - } - - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - - Color lightColor = Color.Lerp(new Color(25, 25, 128), new Color(100, 25, 128), Main.DiscoR / 255f); - Lighting.AddLight(Projectile.Center, lightColor.R / 255f, lightColor.G / 255f, lightColor.B / 255f); - - if (Projectile.timeLeft < FadeOutTime) - { - Projectile.Opacity -= 1f / FadeOutTime; - } - else if (Projectile.Opacity < 1f) - { - Projectile.Opacity += 0.25f; - if (Projectile.Opacity > 1f) - Projectile.Opacity = 1f; - } - } - - public override bool PreDraw(ref Color lightColor) - { - lightColor.R = (byte)(255 * Projectile.Opacity); - lightColor.G = (byte)(255 * Projectile.Opacity); - lightColor.B = (byte)(255 * Projectile.Opacity); - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; - } - - public override bool CanHitPlayer(Player target) => Projectile.timeLeft >= FadeOutTime; - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (Projectile.timeLeft >= FadeOutTime) - target.AddBuff(BuffID.Frostburn, 90); - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - Collision.HitTiles(Projectile.Center, Projectile.velocity, Projectile.width, Projectile.height); - SoundEngine.PlaySound(SoundID.Item10, Projectile.position); - return true; - } - } -} diff --git a/Projectiles/Boss/FoveanatorLaser.png b/Projectiles/Boss/FoveanatorLaser.png deleted file mode 100644 index 543c692773..0000000000 Binary files a/Projectiles/Boss/FoveanatorLaser.png and /dev/null differ diff --git a/Projectiles/Boss/FrostMist.cs b/Projectiles/Boss/FrostMist.cs index dc8229123f..14f0fba566 100644 --- a/Projectiles/Boss/FrostMist.cs +++ b/Projectiles/Boss/FrostMist.cs @@ -128,7 +128,6 @@ namespace CalamityMod.Projectiles.Boss return; target.AddBuff(BuffID.Frostburn, 180, true); - target.AddBuff(BuffID.Chilled, 90, true); } } } diff --git a/Projectiles/Boss/GreatSandBlast.cs b/Projectiles/Boss/GreatSandBlast.cs index b7fa0c573f..cbceb613d7 100644 --- a/Projectiles/Boss/GreatSandBlast.cs +++ b/Projectiles/Boss/GreatSandBlast.cs @@ -22,12 +22,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.width = 10; Projectile.height = 10; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.scale = 2f; Projectile.hostile = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 900 : 600; + Projectile.timeLeft = CalamityWorld.LegendaryMode ? 900 : 600; Projectile.aiStyle = ProjAIStyleID.Arrow; Projectile.alpha = 255; } diff --git a/Projectiles/Boss/HolyBlast.cs b/Projectiles/Boss/HolyBlast.cs index 4b2b1d3666..90d11517e0 100644 --- a/Projectiles/Boss/HolyBlast.cs +++ b/Projectiles/Boss/HolyBlast.cs @@ -1,11 +1,7 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using CalamityMod.Graphics.Primitives; -using CalamityMod.NPCs; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; -using CalamityMod.NPCs.TownNPCs; using CalamityMod.Particles; using CalamityMod.World; using Microsoft.Xna.Framework; @@ -13,7 +9,6 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; -using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; @@ -22,6 +17,7 @@ namespace CalamityMod.Projectiles.Boss public class HolyBlast : ModProjectile, ILocalizedModType { public bool started = false; + public int FireDamage = 0; private const int TimeLeft = 120; private const int AccelerationTime = 60; @@ -36,10 +32,6 @@ namespace CalamityMod.Projectiles.Boss Main.projFrames[Type] = 4; } - public override void OnSpawn(IEntitySource source) - { - } - public override void SetDefaults() { Projectile.Calamity().DealsDefenseDamage = true; @@ -52,6 +44,17 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + FireDamage = Providence.FireDamage.CalculateProvidenceDamage(); + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + FireDamage = ProfanedGuardianCommander.FireDamage; + } + } + public override void SendExtraAI(BinaryWriter writer) { writer.Write(Projectile.localAI[0]); @@ -64,7 +67,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 320, 20); + ProvUtils.ApplyGFBDamage(Projectile, 180, 20); Lighting.AddLight(Projectile.Center, 0.9f, 0.7f, 0f); @@ -111,8 +114,7 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(ShootSound, Projectile.Center); } - if (Math.Abs(Projectile.velocity.X) > 0.2) - Projectile.spriteDirection = -Projectile.direction; + Projectile.direction = Projectile.spriteDirection = (Math.Abs(Projectile.velocity.X) > 0.2).ToDirectionInt(); GeneralParticleHandler.SpawnParticle(new GlowOrbParticle(Projectile.Center + new Vector2(Main.rand.NextFloat(50), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, false, 20, Main.rand.NextFloat(1f, 2f), ProvUtils.GetProjectileColor(255))); GeneralParticleHandler.SpawnParticle(new MediumMistParticle(Projectile.Center + new Vector2(40, 0).RotatedBy(Vector2.Zero.AngleTo(-Projectile.velocity)) + new Vector2(Main.rand.NextFloat(20), 0).RotatedByRandom(MathHelper.TwoPi), Projectile.velocity.RotatedBy(Math.PI) * 0.6f, Color.LightSlateGray, Color.DarkSlateGray, Main.rand.NextFloat(1f, 3f), 150f)); @@ -128,12 +130,11 @@ namespace CalamityMod.Projectiles.Boss public override bool PreDraw(ref Color lightColor) { Texture2D texture = ProvUtils.StandardAI() ? Terraria.GameContent.TextureAssets.Projectile[Type].Value : ModContent.Request("CalamityMod/Projectiles/Boss/HolyBlastNight").Value; - int framing = texture.Height / Main.projFrames[Type]; - int y6 = framing * Projectile.frame; - Vector2 sc = Vector2.One; - Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, sc, texture); + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + SpriteEffects sp = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Projectile.DrawBackglow(ProvUtils.GetProjectileColor(lightColor, true), 4f, texture, effects: sp); - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, framing / 2f), sc, SpriteEffects.None, 0); + Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), frame, Projectile.GetAlpha(lightColor), Projectile.rotation, frame.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } @@ -158,7 +159,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int totalProjectiles = !ProvUtils.StandardAI() ? 8 : 6; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) totalProjectiles *= 2; float radians = MathHelper.TwoPi / totalProjectiles; @@ -169,7 +170,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + additionalVelocity, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2 + additionalVelocity, type, FireDamage, 0f, Projectile.owner); } } @@ -200,7 +201,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 320); + ProvUtils.ApplyDebuffs(target, 180); } } } diff --git a/Projectiles/Boss/HolyBomb.cs b/Projectiles/Boss/HolyBomb.cs index cb0933c919..f3dfbf99bc 100644 --- a/Projectiles/Boss/HolyBomb.cs +++ b/Projectiles/Boss/HolyBomb.cs @@ -2,12 +2,14 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -16,6 +18,7 @@ namespace CalamityMod.Projectiles.Boss public class HolyBomb : ModProjectile, ILocalizedModType { float SquishAnimation = 1f; + public int FireDamage = 0; public new string LocalizationCategory => "Projectiles.Boss"; public override void SetStaticDefaults() @@ -35,9 +38,19 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + FireDamage = Providence.FireDamage.CalculateProvidenceDamage(); + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + FireDamage = ProfanedGuardianDefender.FireDamage; + } + } public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 160, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 20); Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); @@ -62,7 +75,7 @@ namespace CalamityMod.Projectiles.Boss SquishAnimation = 0f; if (Projectile.owner == Main.myPlayer) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, velocityY, ModContent.ProjectileType(), (int)Math.Round(Projectile.damage * 0.75), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, 0f, velocityY, ModContent.ProjectileType(), FireDamage, Projectile.knockBack, Projectile.owner, 0f, 0f); } if (Projectile.ai[1] == 0f) @@ -129,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 160); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/HolyBurnOrb.cs b/Projectiles/Boss/HolyBurnOrb.cs index 64c20b7f63..0ac7a0ce8b 100644 --- a/Projectiles/Boss/HolyBurnOrb.cs +++ b/Projectiles/Boss/HolyBurnOrb.cs @@ -42,9 +42,6 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); - if (Projectile.ai[0] == 0f && BossRushEvent.BossRushActive) - Projectile.velocity *= 1.25f; - if (!started) { Color cl = ProvUtils.GetProjectileColor(255); @@ -60,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.timeLeft = 160; } - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { if (Projectile.velocity.Length() < 12f && Projectile.ai[1] == 0f) { diff --git a/Projectiles/Boss/HolyFire.cs b/Projectiles/Boss/HolyFire.cs index 3385962d35..0a3936aef6 100644 --- a/Projectiles/Boss/HolyFire.cs +++ b/Projectiles/Boss/HolyFire.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 80, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -93,12 +93,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.01f, 0f); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); @@ -109,12 +109,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 velocity = new Vector2(0.05f, 0f); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) velocity *= Main.rand.NextFloat(1f, 2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, -velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f); @@ -131,7 +131,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 80); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/HolyFire2.cs b/Projectiles/Boss/HolyFire2.cs index 2c3b539632..b72f9b7df6 100644 --- a/Projectiles/Boss/HolyFire2.cs +++ b/Projectiles/Boss/HolyFire2.cs @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 80, 10); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -50,16 +50,12 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame > 3) Projectile.frame = 0; - float maxVelocity = Projectile.ai[0] == 0f ? 7f : BossRushEvent.BossRushActive ? 13f : CalamityWorld.death ? 11f : CalamityWorld.revenge ? 10f : Main.expertMode ? 9f : 7f; + float maxVelocity = Projectile.ai[0] == 0f ? 7f : CalamityWorld.death ? 11f : CalamityWorld.revenge ? 10f : Main.expertMode ? 9f : 7f; if (Math.Abs(Projectile.velocity.X) < maxVelocity) Projectile.velocity.X *= 1.05f; int playerTracker = Player.FindClosest(Projectile.Center, 1, 1); - // Natural damage is removed from GFB - if (Projectile.ai[1] == 0f && !Main.zenithWorld) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); - Projectile.ai[1] += 1f; if (Projectile.ai[1] < 180f && Projectile.ai[1] > 60f) { @@ -130,7 +126,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 80); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/HolyFlare.cs b/Projectiles/Boss/HolyFlare.cs index d07046f83a..85d5c1a5bb 100644 --- a/Projectiles/Boss/HolyFlare.cs +++ b/Projectiles/Boss/HolyFlare.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 120, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.35f, 0.275f, 0f); diff --git a/Projectiles/Boss/HolySpear.cs b/Projectiles/Boss/HolySpear.cs index 00a92cabf5..a2d60a83e6 100644 --- a/Projectiles/Boss/HolySpear.cs +++ b/Projectiles/Boss/HolySpear.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 120, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.45f * Projectile.Opacity, 0.35f * Projectile.Opacity, 0f); diff --git a/Projectiles/Boss/HomingGasBulb.cs b/Projectiles/Boss/HomingGasBulb.cs index 8865901223..58c661a17a 100644 --- a/Projectiles/Boss/HomingGasBulb.cs +++ b/Projectiles/Boss/HomingGasBulb.cs @@ -2,6 +2,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Events; using CalamityMod.NPCs.TownNPCs; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -56,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss float scaleFactor2 = Projectile.velocity.Length(); velocity.Normalize(); velocity *= scaleFactor2; - Projectile.velocity = (Projectile.velocity * 24f + velocity) / 25f; + Projectile.velocity = (Projectile.velocity * 22f + velocity) / (death ? 12f : 15f); // Tracking strength Projectile.velocity.Normalize(); Projectile.velocity *= scaleFactor2; } @@ -89,7 +90,8 @@ namespace CalamityMod.Projectiles.Boss { int type = ModContent.ProjectileType(); float ai0 = Main.rand.Next(3); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Normalize(Projectile.velocity) * 0.2f, type, (int)Math.Round(Projectile.damage * 0.8), 0f, Main.myPlayer, ai0); + int proj = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Normalize(Projectile.velocity) * 0.2f, type, PlanteraAI.PinkCloudDamage, 0f, Main.myPlayer, ai0); + Main.projectile[proj].timeLeft = 180; } } } diff --git a/Projectiles/Boss/HomingGasBulbSporeGas.cs b/Projectiles/Boss/HomingGasBulbSporeGas.cs index d467e3eeb4..f7f002d02e 100644 --- a/Projectiles/Boss/HomingGasBulbSporeGas.cs +++ b/Projectiles/Boss/HomingGasBulbSporeGas.cs @@ -43,7 +43,6 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) { Projectile.localAI[0] += 10f; - Projectile.damage = 0; } if (Projectile.localAI[0] > 255f) @@ -55,25 +54,23 @@ namespace CalamityMod.Projectiles.Boss float lightValues = (255 - Projectile.alpha) * 0.6f / 255f; Lighting.AddLight(Projectile.Center, lightValues, 0f, lightValues); - Projectile.alpha = (int)(100.0 + Projectile.localAI[0] * 0.7); Projectile.rotation += Projectile.velocity.X * 0.02f; Projectile.rotation += Projectile.direction * 0.002f; if (Projectile.velocity.Length() > (CalamityWorld.LegendaryMode ? 2f : 0.5f)) Projectile.velocity *= 0.985f; + + if (Projectile.timeLeft <= 40) + { + Projectile.Opacity = Utils.GetLerpValue(0, 40, Projectile.timeLeft); + } } - public override bool CanHitPlayer(Player target) => Projectile.ai[1] <= (CalamityWorld.LegendaryMode ? 600f : 900f) && Projectile.ai[1] > 120f; + public override bool CanHitPlayer(Player target) => Projectile.Opacity > 0.8f; public override Color? GetAlpha(Color lightColor) { - if (Projectile.ai[1] > (CalamityWorld.LegendaryMode ? 600f : 900f)) - { - byte b2 = (byte)((26f - (Projectile.ai[1] - (CalamityWorld.LegendaryMode ? 600f : 900f))) * 10f); - byte a2 = (byte)(Projectile.alpha * (b2 / 255f)); - return new Color(b2, b2, b2, a2); - } - return new Color(255, 255, 255, Projectile.alpha); + return lightColor; } public override bool PreDraw(ref Color lightColor) @@ -93,7 +90,7 @@ namespace CalamityMod.Projectiles.Boss default: break; } - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1, texture); + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor * Projectile.Opacity, 1, texture); return false; } diff --git a/Projectiles/Boss/HomingLaserDart.cs b/Projectiles/Boss/HomingLaserDart.cs index dc93ed2c2b..fd55783718 100644 --- a/Projectiles/Boss/HomingLaserDart.cs +++ b/Projectiles/Boss/HomingLaserDart.cs @@ -193,14 +193,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(BuffID.OnFire, 180); - } - public override Color? GetAlpha(Color lightColor) => new Color(255, 50, 50, Projectile.alpha); public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/IceBlast.cs b/Projectiles/Boss/IceBlast.cs index 5d27626298..2e152db191 100644 --- a/Projectiles/Boss/IceBlast.cs +++ b/Projectiles/Boss/IceBlast.cs @@ -92,7 +92,6 @@ namespace CalamityMod.Projectiles.Boss return; target.AddBuff(BuffID.Frostburn, 120, true); - target.AddBuff(BuffID.Chilled, 60, true); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/IceBomb.cs b/Projectiles/Boss/IceBomb.cs index 1ec84ca3e6..548dc997ad 100644 --- a/Projectiles/Boss/IceBomb.cs +++ b/Projectiles/Boss/IceBomb.cs @@ -78,13 +78,12 @@ namespace CalamityMod.Projectiles.Boss int totalProjectiles = 8; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); - int damage = (int)Math.Round(Projectile.damage * 0.75); float velocity = 1f; Vector2 spinningPoint = new Vector2(0f, -velocity); for (int k = 0; k < totalProjectiles; k++) { Vector2 vector255 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vector255, type, damage, 0f, Projectile.owner, 1f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vector255, type, Cryogen.IceRainDamage, 0f, Projectile.owner, 1f, 0f); } } @@ -97,14 +96,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - if (Projectile.ai[0] >= 120f) - { - target.AddBuff(BuffID.Frostburn, 180, true); - target.AddBuff(BuffID.Chilled, 90, true); - - if (!target.Calamity().glacialState) - target.AddBuff(ModContent.BuffType(), 60); - } + target.AddBuff(BuffID.Frostburn, 180, true); } } } diff --git a/Projectiles/Boss/IceRain.cs b/Projectiles/Boss/IceRain.cs index 53674d6619..e2c4acdebe 100644 --- a/Projectiles/Boss/IceRain.cs +++ b/Projectiles/Boss/IceRain.cs @@ -106,7 +106,6 @@ namespace CalamityMod.Projectiles.Boss return; target.AddBuff(BuffID.Frostburn, 120, true); - target.AddBuff(BuffID.Chilled, 60, true); } } } diff --git a/Projectiles/Boss/IchorBlob.cs b/Projectiles/Boss/IchorBlob.cs index 479fb920eb..2281985e4c 100644 --- a/Projectiles/Boss/IchorBlob.cs +++ b/Projectiles/Boss/IchorBlob.cs @@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.localAI[1] <= 900f && Projectile.localAI[1] > 120f) - target.AddBuff(BuffID.Ichor, 240); + target.AddBuff(BuffID.Ichor, 360); } } } diff --git a/Projectiles/Boss/IchorShot.cs b/Projectiles/Boss/IchorShot.cs index f1e2338a03..5933ef2afd 100644 --- a/Projectiles/Boss/IchorShot.cs +++ b/Projectiles/Boss/IchorShot.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(BuffID.Ichor, 180); + target.AddBuff(BuffID.Ichor, 240); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/Infernado.cs b/Projectiles/Boss/Infernado.cs index 691c909e79..a312ab8007 100644 --- a/Projectiles/Boss/Infernado.cs +++ b/Projectiles/Boss/Infernado.cs @@ -131,12 +131,12 @@ namespace CalamityMod.Projectiles.Boss { Projectile.velocity.X = Main.rand.NextBool() ? -tornadoSpeed : tornadoSpeed; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) Projectile.velocity.X *= 1.5f; } if (Projectile.timeLeft == 600) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + Projectile.damage = Yharon.TornadoDamage; } public override bool CanHitPlayer(Player target) => Projectile.timeLeft <= 600; @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft <= 600) - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/Infernado2.cs b/Projectiles/Boss/Infernado2.cs index c73d5dc424..7b2c97c25d 100644 --- a/Projectiles/Boss/Infernado2.cs +++ b/Projectiles/Boss/Infernado2.cs @@ -130,7 +130,7 @@ namespace CalamityMod.Projectiles.Boss } if (Projectile.timeLeft == 720) - Projectile.damage = Projectile.GetProjectileDamage(ModContent.NPCType()); + Projectile.damage = Yharon.TornadoDamage; } public override bool CanHitPlayer(Player target) => Projectile.timeLeft <= 720; @@ -155,7 +155,7 @@ namespace CalamityMod.Projectiles.Boss return; if (Projectile.timeLeft <= 720) - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/InfernadoRevenge.cs b/Projectiles/Boss/InfernadoRevenge.cs index d193737273..bcd9d4b570 100644 --- a/Projectiles/Boss/InfernadoRevenge.cs +++ b/Projectiles/Boss/InfernadoRevenge.cs @@ -75,6 +75,7 @@ namespace CalamityMod.Projectiles.Boss Main.spriteBatch.EnterShaderRegion(); GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); + GameShaders.Misc["CalamityMod:Bordernado"].UseOpacity(1f); GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.Request("Terraria/Images/Misc/Perlin")); Vector2[] drawPoints = new Vector2[5]; Vector2 upwardAscent = Vector2.UnitY * TornadoHeight; @@ -112,7 +113,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 150); + target.AddBuff(ModContent.BuffType(), 180); } } } diff --git a/Projectiles/Boss/MoltenBlast.cs b/Projectiles/Boss/MoltenBlast.cs index 457affed38..f23933c8f6 100644 --- a/Projectiles/Boss/MoltenBlast.cs +++ b/Projectiles/Boss/MoltenBlast.cs @@ -2,6 +2,7 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.NPCs; +using CalamityMod.NPCs.ProfanedGuardians; using CalamityMod.NPCs.Providence; using CalamityMod.Particles; using CalamityMod.World; @@ -9,6 +10,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; @@ -16,6 +18,8 @@ namespace CalamityMod.Projectiles.Boss { public class MoltenBlast : ModProjectile, ILocalizedModType { + public int BlobDamage = 0; + private const int TimeLeft = 90; private const int AccelerationTime = 60; private const float Acceleration = 1.05f; @@ -39,6 +43,17 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + BlobDamage = Providence.BlobDamage.CalculateProvidenceDamage(); + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + BlobDamage = ProfanedGuardianDefender.BlobDamage; + } + } + public override void SendExtraAI(BinaryWriter writer) { writer.Write(Projectile.localAI[0]); @@ -53,7 +68,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 160, 20); + ProvUtils.ApplyGFBDamage(Projectile, 120, 20); Lighting.AddLight(Projectile.Center, 0.45f, 0.35f, 0f); @@ -153,10 +168,10 @@ namespace CalamityMod.Projectiles.Boss for (int b = 0; b < blobAmt; b++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f) + additionalBlobVelocity; - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) velocity *= 2f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), BlobDamage, 0f, Projectile.owner); } } @@ -171,7 +186,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 160); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/MoltenBlob.cs b/Projectiles/Boss/MoltenBlob.cs index 9c3698fe8f..07160d9da1 100644 --- a/Projectiles/Boss/MoltenBlob.cs +++ b/Projectiles/Boss/MoltenBlob.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 12; Projectile.height = 12; Projectile.hostile = true; @@ -37,7 +36,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - ProvUtils.ApplyGFBDamage(Projectile, 80, 10); + ProvUtils.ApplyGFBDamage(Projectile, 120, 10); Lighting.AddLight(Projectile.Center, 0.3f, 0.225f, 0f); @@ -143,7 +142,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 80); + ProvUtils.ApplyDebuffs(target, 120); } } } diff --git a/Projectiles/Boss/MushBombFall.cs b/Projectiles/Boss/MushBombFall.cs index 61adeb46bc..19339c838f 100644 --- a/Projectiles/Boss/MushBombFall.cs +++ b/Projectiles/Boss/MushBombFall.cs @@ -76,8 +76,8 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(Projectile.Center, 0f, 0.15f, 0.3f); - float velocityYLimit = Projectile.ai[0] == 1f ? 1f : BossRushEvent.BossRushActive ? 12f : CalamityWorld.death ? 6f : 5f; - float velocityYIncrement = Projectile.ai[0] == 1f ? 0.1f : BossRushEvent.BossRushActive ? 0.24f : CalamityWorld.death ? 0.12f : 0.1f; + float velocityYLimit = Projectile.ai[0] == 1f ? 1f : CalamityWorld.death ? 6f : 5f; + float velocityYIncrement = Projectile.ai[0] == 1f ? 0.1f : CalamityWorld.death ? 0.12f : 0.1f; if (Projectile.velocity.Y < velocityYLimit) Projectile.velocity.Y += velocityYIncrement; diff --git a/Projectiles/Boss/MushBombGround.cs b/Projectiles/Boss/MushBombGround.cs index c2eacefa36..ca844bdb13 100644 --- a/Projectiles/Boss/MushBombGround.cs +++ b/Projectiles/Boss/MushBombGround.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Boss Lighting.AddLight(Projectile.Center, 0f, 0.15f, 0.3f); float xVelocityMultiplier = 1.025f; - float xVelocityLimit = BossRushEvent.BossRushActive ? 24f : 12f; + float xVelocityLimit = 12f; if (Math.Abs(Projectile.velocity.X) < xVelocityLimit) Projectile.velocity.X *= xVelocityMultiplier; } diff --git a/Projectiles/Boss/OldDukeGore.cs b/Projectiles/Boss/OldDukeGore.cs index b1fcb344fb..74b72f6f9a 100644 --- a/Projectiles/Boss/OldDukeGore.cs +++ b/Projectiles/Boss/OldDukeGore.cs @@ -80,14 +80,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 180); - } - public override bool PreDraw(ref Color lightColor) { CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); diff --git a/Projectiles/Boss/OldDukeToothBallSpike.cs b/Projectiles/Boss/OldDukeToothBallSpike.cs index 6640ed68aa..16bfa07763 100644 --- a/Projectiles/Boss/OldDukeToothBallSpike.cs +++ b/Projectiles/Boss/OldDukeToothBallSpike.cs @@ -63,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 360); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Boss/PermafrostColdheartIcicle.cs b/Projectiles/Boss/PermafrostColdheartIcicle.cs index f58b5d3119..808004ddb1 100644 --- a/Projectiles/Boss/PermafrostColdheartIcicle.cs +++ b/Projectiles/Boss/PermafrostColdheartIcicle.cs @@ -163,6 +163,6 @@ namespace CalamityMod.Projectiles.Boss // Prevent the crystals from utilizing velocity. Their movement is entirely dependant on Center setting. public override bool ShouldUpdatePosition() => false; - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 300); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Frozen, 300); } } diff --git a/Projectiles/Boss/PhantomBlast.cs b/Projectiles/Boss/PhantomBlast.cs index 8069efd309..b0083c28d1 100644 --- a/Projectiles/Boss/PhantomBlast.cs +++ b/Projectiles/Boss/PhantomBlast.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; @@ -111,13 +110,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[killGhostDust2].velocity *= 2f; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 120); - } } } diff --git a/Projectiles/Boss/PhantomBlast2.cs b/Projectiles/Boss/PhantomBlast2.cs index f581c4a065..e801a4083e 100644 --- a/Projectiles/Boss/PhantomBlast2.cs +++ b/Projectiles/Boss/PhantomBlast2.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 18; Projectile.height = 18; Projectile.hostile = true; @@ -111,13 +110,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[killGhostDust2].velocity *= 2f; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 180); - } } } diff --git a/Projectiles/Boss/PhantomGhostShot.cs b/Projectiles/Boss/PhantomGhostShot.cs index 61f6e7a116..f11f34fd13 100644 --- a/Projectiles/Boss/PhantomGhostShot.cs +++ b/Projectiles/Boss/PhantomGhostShot.cs @@ -66,14 +66,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 120); - } - public override Color? GetAlpha(Color lightColor) { return new Color(100, 250, 250, Projectile.alpha); diff --git a/Projectiles/Boss/PhantomHookShot.cs b/Projectiles/Boss/PhantomHookShot.cs index 32d119dd72..e8f110184e 100644 --- a/Projectiles/Boss/PhantomHookShot.cs +++ b/Projectiles/Boss/PhantomHookShot.cs @@ -66,14 +66,6 @@ namespace CalamityMod.Projectiles.Boss } } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 80); - } - public override Color? GetAlpha(Color lightColor) { return new Color(100, 250, 250, Projectile.alpha); diff --git a/Projectiles/Boss/PhantomMine.cs b/Projectiles/Boss/PhantomMine.cs index fcadc0e03b..ace2a64f74 100644 --- a/Projectiles/Boss/PhantomMine.cs +++ b/Projectiles/Boss/PhantomMine.cs @@ -14,7 +14,6 @@ namespace CalamityMod.Projectiles.Boss public new string LocalizationCategory => "Projectiles.Boss"; public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; @@ -39,7 +38,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= Projectile.ai[0]; } - if (CalamityWorld.LegendaryMode && CalamityWorld.revenge) + if (CalamityWorld.LegendaryMode) { if (Projectile.velocity.Length() >= Projectile.ai[0]) { @@ -98,17 +97,5 @@ namespace CalamityMod.Projectiles.Boss Main.dust[phantomDust2].velocity *= 2f; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - if (Projectile.velocity.Length() >= Projectile.ai[0]) - { - target.AddBuff(ModContent.BuffType(), 120); - target.AddBuff(ModContent.BuffType(), 180); - } - } } } diff --git a/Projectiles/Boss/PhantomShot.cs b/Projectiles/Boss/PhantomShot.cs index 0cc7f9eed7..82aee0921a 100644 --- a/Projectiles/Boss/PhantomShot.cs +++ b/Projectiles/Boss/PhantomShot.cs @@ -67,13 +67,5 @@ namespace CalamityMod.Projectiles.Boss { return new Color(100, 250, 250, Projectile.alpha); } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 80); - } } } diff --git a/Projectiles/Boss/PhantomShot2.cs b/Projectiles/Boss/PhantomShot2.cs index fc48efce2d..352a950538 100644 --- a/Projectiles/Boss/PhantomShot2.cs +++ b/Projectiles/Boss/PhantomShot2.cs @@ -67,13 +67,5 @@ namespace CalamityMod.Projectiles.Boss { return new Color(250, 100, 100, Projectile.alpha); } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0) - return; - - target.AddBuff(ModContent.BuffType(), 120); - } } } diff --git a/Projectiles/Boss/PlagueStingerGoliath.cs b/Projectiles/Boss/PlagueStingerGoliath.cs index 0f064415ea..dfa96ab31d 100644 --- a/Projectiles/Boss/PlagueStingerGoliath.cs +++ b/Projectiles/Boss/PlagueStingerGoliath.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/PlagueStingerGoliathV2.cs b/Projectiles/Boss/PlagueStingerGoliathV2.cs index cba5fae545..70a5a75a2c 100644 --- a/Projectiles/Boss/PlagueStingerGoliathV2.cs +++ b/Projectiles/Boss/PlagueStingerGoliathV2.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/ProvidenceCrystal.cs b/Projectiles/Boss/ProvidenceCrystal.cs index b77439580e..de4bf7114b 100644 --- a/Projectiles/Boss/ProvidenceCrystal.cs +++ b/Projectiles/Boss/ProvidenceCrystal.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.width = 160; Projectile.height = 160; Projectile.ignoreWater = true; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 1500 : CalamityWorld.death ? 2100 : 3600; + Projectile.timeLeft = CalamityWorld.death ? 2100 : 3600; Projectile.alpha = 255; Projectile.tileCollide = false; Projectile.penetrate = -1; diff --git a/Projectiles/Boss/ProvidenceCrystalShard.cs b/Projectiles/Boss/ProvidenceCrystalShard.cs index a745f81594..4f99f0d4d1 100644 --- a/Projectiles/Boss/ProvidenceCrystalShard.cs +++ b/Projectiles/Boss/ProvidenceCrystalShard.cs @@ -25,7 +25,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; diff --git a/Projectiles/Boss/ProvidenceHolyRay.cs b/Projectiles/Boss/ProvidenceHolyRay.cs index 7ca90e54b2..4f73827498 100644 --- a/Projectiles/Boss/ProvidenceHolyRay.cs +++ b/Projectiles/Boss/ProvidenceHolyRay.cs @@ -85,7 +85,7 @@ namespace CalamityMod.Projectiles.Boss } if (projScale == 1f) - ProvUtils.ApplyGFBDamage(Projectile, 400, 20); + ProvUtils.ApplyGFBDamage(Projectile, 240, 20); Projectile.scale = (float)Math.Sin(Projectile.localAI[0] * MathHelper.Pi / (scissorLasers ? 100f : 180f)) * 10f * projScale; if (Projectile.scale > projScale) @@ -240,7 +240,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || target.creativeGodMode) return; - ProvUtils.ApplyDebuffs(target, 400); + ProvUtils.ApplyDebuffs(target, 240); } public override bool CanHitPlayer(Player target) => Projectile.scale >= 0.5f; diff --git a/Projectiles/Boss/QueenBeenade.cs b/Projectiles/Boss/QueenBeenade.cs index 4a2ff25994..952687ebf8 100644 --- a/Projectiles/Boss/QueenBeenade.cs +++ b/Projectiles/Boss/QueenBeenade.cs @@ -1,4 +1,5 @@ using System; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -126,7 +127,7 @@ namespace CalamityMod.Projectiles.Boss { float speedX = (float)Main.rand.Next(-35, 36) * 0.02f; float speedY = (float)Main.rand.Next(-35, 36) * 0.02f; - Projectile.NewProjectile(Projectile.GetSource_Death(), Projectile.Center, new Vector2(speedX, speedY), type, (int)Math.Round(Projectile.damage * 0.85), 0f, Main.myPlayer, 0f, minVelocity, maxVelocity); + Projectile.NewProjectile(Projectile.GetSource_Death(), Projectile.Center, new Vector2(speedX, speedY), type, QueenBeeAI.BeenadeBeeDamage, 0f, Main.myPlayer, 0f, minVelocity, maxVelocity); } } } diff --git a/Projectiles/Boss/QueenBeenadeBee.cs b/Projectiles/Boss/QueenBeenadeBee.cs index 489609310c..905267966e 100644 --- a/Projectiles/Boss/QueenBeenadeBee.cs +++ b/Projectiles/Boss/QueenBeenadeBee.cs @@ -47,15 +47,14 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = Projectile.velocity.X * 0.1f; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; // Get a target and calculate distance from it int target = Player.FindClosest(Projectile.Center, 1, 1); Vector2 distanceFromTarget = Main.player[target].Center - Projectile.Center; // Set AI to stop homing, start accelerating - float stopHomingDistance = bossRush ? 80f : 120f; + float stopHomingDistance = 120f; if (distanceFromTarget.Length() < stopHomingDistance || Projectile.ai[0] == 1f || Projectile.timeLeft < 120) { Projectile.ai[0] = 1f; @@ -79,7 +78,7 @@ namespace CalamityMod.Projectiles.Boss // Home in on target float scaleFactor = Projectile.velocity.Length(); - float inertia = bossRush ? 12f : 16f; + float inertia = 16f; distanceFromTarget.Normalize(); distanceFromTarget *= scaleFactor; Projectile.velocity = (Projectile.velocity * inertia + distanceFromTarget) / (inertia + 1f); @@ -87,8 +86,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.velocity *= scaleFactor; // Fly away from other bees - float pushForce = bossRush ? 0.06f : 0.05f; - float pushDistance = bossRush ? 90f : 60f; + float pushForce = 0.05f; + float pushDistance = 60f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; diff --git a/Projectiles/Boss/RavagerFlame.cs b/Projectiles/Boss/RavagerFlame.cs index 69f81fa5da..1cb0daf453 100644 --- a/Projectiles/Boss/RavagerFlame.cs +++ b/Projectiles/Boss/RavagerFlame.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = 1; Projectile.timeLeft = 300; Projectile.aiStyle = ProjAIStyleID.Arrow; - Projectile.extraUpdates = BossRushEvent.BossRushActive ? 2 : 1; + Projectile.extraUpdates = 1; } public override void AI() diff --git a/Projectiles/Boss/RavagerNuke.cs b/Projectiles/Boss/RavagerNuke.cs index 5b00ec67d8..09a008f4ff 100644 --- a/Projectiles/Boss/RavagerNuke.cs +++ b/Projectiles/Boss/RavagerNuke.cs @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 44; Projectile.height = 44; Projectile.hostile = true; @@ -36,8 +35,7 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { - bool bossRush = BossRushEvent.BossRushActive; - bool revenge = CalamityWorld.revenge || bossRush; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; if (Projectile.timeLeft < 180) Projectile.tileCollide = true; @@ -53,8 +51,8 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; - float inertia = bossRush ? 70f : revenge ? 90f : 110f; - float scaleFactor12 = bossRush ? 20f : revenge ? 16f : 12f; + float inertia = revenge ? 90f : 110f; + float scaleFactor12 = revenge ? 16f : 12f; if (Projectile.alpha > 0) Projectile.alpha -= 10; diff --git a/Projectiles/Boss/RedLightning.cs b/Projectiles/Boss/RedLightning.cs index 7f2f6405fa..8a241ad463 100644 --- a/Projectiles/Boss/RedLightning.cs +++ b/Projectiles/Boss/RedLightning.cs @@ -175,7 +175,7 @@ IL_25092: if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 90); + target.AddBuff(ModContent.BuffType(), 120); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Boss/RedLightningFeather.cs b/Projectiles/Boss/RedLightningFeather.cs index 4941a9ffe3..d663afad52 100644 --- a/Projectiles/Boss/RedLightningFeather.cs +++ b/Projectiles/Boss/RedLightningFeather.cs @@ -129,7 +129,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0 || Projectile.Opacity != 1f) return; - target.AddBuff(ModContent.BuffType(), 40); + target.AddBuff(ModContent.BuffType(), 60); } } } diff --git a/Projectiles/Boss/SCalBrimstoneFireblast.cs b/Projectiles/Boss/SCalBrimstoneFireblast.cs index 81036fdca1..7fdd5e45b1 100644 --- a/Projectiles/Boss/SCalBrimstoneFireblast.cs +++ b/Projectiles/Boss/SCalBrimstoneFireblast.cs @@ -3,12 +3,15 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.CalClone; +using CalamityMod.NPCs.Cryogen; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using static Humanizer.In; @@ -20,6 +23,7 @@ namespace CalamityMod.Projectiles.Boss { public new string LocalizationCategory => "Projectiles.Boss"; public static readonly SoundStyle ImpactSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneFireblastImpact"); + public int DartDamage = 0; public bool withinRange = false; public bool setLifetime = false; public override void SetStaticDefaults() @@ -41,6 +45,19 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + DartDamage = SupremeCalamitas.DartDamage; + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + DartDamage = Cryogen.IceRainDamage; + else if (parent.type == ModContent.NPCType()) + DartDamage = CalamitasClone.DartDamage; + } + } + public override void AI() { Projectile.frameCounter++; @@ -197,16 +214,15 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(ImpactSound, Projectile.Center); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (Projectile.ai[2] == 0f) { if (Projectile.owner == Main.myPlayer) { - int totalProjectiles = bossRush ? 20 : death ? 16 : revenge ? 14 : expertMode ? 12 : 8; + int totalProjectiles = death ? 16 : revenge ? 14 : expertMode ? 12 : 8; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 8f; @@ -214,7 +230,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, DartDamage, 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); } } diff --git a/Projectiles/Boss/SCalBrimstoneGigablast.cs b/Projectiles/Boss/SCalBrimstoneGigablast.cs index 92d27f5bc5..4cc65df873 100644 --- a/Projectiles/Boss/SCalBrimstoneGigablast.cs +++ b/Projectiles/Boss/SCalBrimstoneGigablast.cs @@ -3,12 +3,14 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Events; using CalamityMod.NPCs; +using CalamityMod.NPCs.CalClone; using CalamityMod.NPCs.SupremeCalamitas; using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.DataStructures; using Terraria.ID; using Terraria.ModLoader; using CalamityMod.Particles; @@ -19,6 +21,7 @@ namespace CalamityMod.Projectiles.Boss { public new string LocalizationCategory => "Projectiles.Boss"; public static readonly SoundStyle ImpactSound = new("CalamityMod/Sounds/Custom/SCalSounds/BrimstoneGigablastImpact"); + public int DartDamage = 0; public bool withinRange = false; public bool setLifetime = false; public override void SetStaticDefaults() @@ -40,6 +43,17 @@ namespace CalamityMod.Projectiles.Boss CooldownSlot = ImmunityCooldownID.Bosses; } + public override void OnSpawn(IEntitySource source) + { + DartDamage = SupremeCalamitas.DartDamage; + + if (source is EntitySource_Parent { Entity: NPC parent }) + { + if (parent.type == ModContent.NPCType()) + DartDamage = CalamitasClone.DartDamage; + } + } + public override void AI() { Projectile.frameCounter++; @@ -181,16 +195,15 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(ImpactSound, Projectile.Center); // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; if (Projectile.ai[2] == 0f) { if (Projectile.owner == Main.myPlayer) { - int totalProjectiles = bossRush ? 44 : death ? 36 : revenge ? 32 : expertMode ? 28 : 20; + int totalProjectiles = death ? 36 : revenge ? 32 : expertMode ? 28 : 20; float radians = MathHelper.TwoPi / totalProjectiles; int type = ModContent.ProjectileType(); float velocity = 6.5f; @@ -198,7 +211,7 @@ namespace CalamityMod.Projectiles.Boss for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, (int)Math.Round(Projectile.damage * 0.75), 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity2, type, DartDamage, 0f, Projectile.owner, 0f, Projectile.ai[1], velocity * 1.5f); } } diff --git a/Projectiles/Boss/SandPoisonCloud.cs b/Projectiles/Boss/SandPoisonCloud.cs index 6db2345c81..2b5d10c0b6 100644 --- a/Projectiles/Boss/SandPoisonCloud.cs +++ b/Projectiles/Boss/SandPoisonCloud.cs @@ -84,7 +84,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(BuffID.Venom, 180); } } } diff --git a/Projectiles/Boss/SandPoisonCloudOldDuke.cs b/Projectiles/Boss/SandPoisonCloudOldDuke.cs index aba5827d69..ec90cc8009 100644 --- a/Projectiles/Boss/SandPoisonCloudOldDuke.cs +++ b/Projectiles/Boss/SandPoisonCloudOldDuke.cs @@ -92,7 +92,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 240, true); + target.AddBuff(ModContent.BuffType(), 480, true); } } } diff --git a/Projectiles/Boss/ShadeNimbusHostile.cs b/Projectiles/Boss/ShadeNimbusHostile.cs index a4e68db418..cc42d08de0 100644 --- a/Projectiles/Boss/ShadeNimbusHostile.cs +++ b/Projectiles/Boss/ShadeNimbusHostile.cs @@ -50,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss else { Projectile.ai[0] += 1f; - if (Projectile.ai[0] >= (Main.getGoodWorld ? 10f : 36f)) + if (Projectile.ai[0] >= (CalamityWorld.LegendaryMode ? 10f : 36f)) { Projectile.ai[0] = 0f; int rainSpawnX = (int)(Projectile.position.X + 14f + (float)Main.rand.Next(Projectile.width - 28)); diff --git a/Projectiles/Boss/SirenSong.cs b/Projectiles/Boss/SirenSong.cs index 8a343083b5..bf58180b67 100644 --- a/Projectiles/Boss/SirenSong.cs +++ b/Projectiles/Boss/SirenSong.cs @@ -78,13 +78,5 @@ namespace CalamityMod.Projectiles.Boss CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); return false; } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(BuffID.Dazed, 120); - } } } diff --git a/Projectiles/Boss/SkyFlareRevenge.cs b/Projectiles/Boss/SkyFlareRevenge.cs index 7cb58e9c83..0856f46a52 100644 --- a/Projectiles/Boss/SkyFlareRevenge.cs +++ b/Projectiles/Boss/SkyFlareRevenge.cs @@ -75,8 +75,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { int type = ModContent.ProjectileType(); - int damage = Projectile.GetProjectileDamage(ModContent.NPCType()); - int nado = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, type, damage, 4f, Main.myPlayer, 16f, 50f); + int nado = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, type, Yharon.BordernadoDamage, 4f, Main.myPlayer, 16f, 50f); Main.projectile[nado].Bottom = Projectile.Center; Main.projectile[nado].netUpdate = true; } diff --git a/Projectiles/Boss/SporeGasPlantera.cs b/Projectiles/Boss/SporeGasPlantera.cs index f1527b37fd..37da7212b3 100644 --- a/Projectiles/Boss/SporeGasPlantera.cs +++ b/Projectiles/Boss/SporeGasPlantera.cs @@ -28,7 +28,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 32; Projectile.height = 32; Projectile.hostile = true; diff --git a/Projectiles/Boss/SupremeCataclysmFist.cs b/Projectiles/Boss/SupremeCataclysmFist.cs index edb9e872bf..0ed0cb59ab 100644 --- a/Projectiles/Boss/SupremeCataclysmFist.cs +++ b/Projectiles/Boss/SupremeCataclysmFist.cs @@ -43,10 +43,9 @@ namespace CalamityMod.Projectiles.Boss public override void AI() { // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // The Orb if (Projectile.ai[2] >= 3) @@ -281,13 +280,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => (Projectile.Opacity >= 1f || Projectile.ai[2] >= 3); - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || Projectile.Opacity != 1f) - return; - - target.AddBuff(ModContent.BuffType(), 240, true); - } public override bool OnTileCollide(Vector2 oldVelocity) { SoundStyle b = new("CalamityMod/Sounds/Custom/Kickball"); diff --git a/Projectiles/Boss/SupremeCatastropheSlash.cs b/Projectiles/Boss/SupremeCatastropheSlash.cs index afa91f3d53..1939353905 100644 --- a/Projectiles/Boss/SupremeCatastropheSlash.cs +++ b/Projectiles/Boss/SupremeCatastropheSlash.cs @@ -26,8 +26,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; - // These never naturally use rotations, so this shouldn't be an issue. Projectile.width = 100; Projectile.height = 60; @@ -46,10 +44,9 @@ namespace CalamityMod.Projectiles.Boss Time++; // Difficulty modes - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Decide frames. Projectile.frameCounter++; diff --git a/Projectiles/Boss/THanosSideLaser.cs b/Projectiles/Boss/THanosSideLaser.cs index 89b47ae15d..e17154f9d9 100644 --- a/Projectiles/Boss/THanosSideLaser.cs +++ b/Projectiles/Boss/THanosSideLaser.cs @@ -94,8 +94,8 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } diff --git a/Projectiles/Boss/ThanatosBeamStart.cs b/Projectiles/Boss/ThanatosBeamStart.cs index 1169549444..570c563721 100644 --- a/Projectiles/Boss/ThanatosBeamStart.cs +++ b/Projectiles/Boss/ThanatosBeamStart.cs @@ -107,10 +107,9 @@ namespace CalamityMod.Projectiles.Boss return; // Difficulty modes. Used during the firing of the perpendicular lasers. - bool bossRush = BossRushEvent.BossRushActive; - bool death = CalamityWorld.death || bossRush; - bool revenge = CalamityWorld.revenge || bossRush; - bool expertMode = Main.expertMode || bossRush; + bool death = CalamityWorld.death || BossRushEvent.BossRushActive; + bool revenge = CalamityWorld.revenge || BossRushEvent.BossRushActive; + bool expertMode = Main.expertMode || BossRushEvent.BossRushActive; // Spawn dust at the end of the beam. int dustType = (int)CalamityDusts.Brimstone; @@ -137,7 +136,7 @@ namespace CalamityMod.Projectiles.Boss } // Periodically fire beams along the laser perpendicular to its direction. - float laserFireRate = (CalamityWorld.LegendaryMode && revenge) ? 60f : expertMode ? 80f : 160f; + float laserFireRate = (CalamityWorld.LegendaryMode) ? 60f : expertMode ? 80f : 160f; if (Main.npc[OwnerIndex].Calamity().newAI[2] % laserFireRate == 0f) { // Play a laser sound to go with the beams. @@ -146,19 +145,18 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.owner == Main.myPlayer) { Vector2 beamDirection = Projectile.velocity.SafeNormalize(Vector2.UnitY); - float distanceBetweenProjectiles = bossRush ? 160f : death ? 256f : revenge ? 288f : 320f; + float distanceBetweenProjectiles = death ? 256f : revenge ? 288f : 320f; Vector2 laserFirePosition = Main.npc[OwnerIndex].Center + beamDirection * distanceBetweenProjectiles; int laserCount = (int)(LaserLength / distanceBetweenProjectiles); int type = ModContent.ProjectileType(); - int damage = Projectile.GetProjectileDamage(Main.npc[OwnerIndex].type); for (int i = 0; i < laserCount; i++) { int totalProjectiles = 2; float radians = MathHelper.TwoPi / totalProjectiles; for (int j = 0; j < totalProjectiles; j++) { - Vector2 projVelocity = (CalamityWorld.LegendaryMode && revenge) ? new Vector2(Main.rand.Next(-12, 12), Main.rand.Next(-12, 12)) : Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserFirePosition, projVelocity, type, damage, 0f, Main.myPlayer, 0f, -1f); + Vector2 projVelocity = (CalamityWorld.LegendaryMode) ? new Vector2(Main.rand.Next(-12, 12), Main.rand.Next(-12, 12)) : Projectile.velocity.RotatedBy(radians * j + MathHelper.PiOver2) * 12f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserFirePosition, projVelocity, type, ThanatosHead.LaserDamage, 0f, Main.myPlayer, 0f, -1f); } laserFirePosition += beamDirection * distanceBetweenProjectiles; } @@ -242,7 +240,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 300); } public override bool CanHitPlayer(Player target) => OwnerIsValid && Projectile.scale >= 0.5f; diff --git a/Projectiles/Boss/ThanatosLaser.cs b/Projectiles/Boss/ThanatosLaser.cs index 75739ff077..48e3353558 100644 --- a/Projectiles/Boss/ThanatosLaser.cs +++ b/Projectiles/Boss/ThanatosLaser.cs @@ -38,7 +38,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 22; Projectile.height = 22; Projectile.hostile = true; @@ -98,8 +97,8 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } @@ -161,8 +160,8 @@ namespace CalamityMod.Projectiles.Boss // If a velocity is in reserve, set the true velocity to it and make it as "taken" by setting it to <0,0> if (Velocity != Vector2.Zero) { - Projectile.extraUpdates = Main.getGoodWorld ? 4 : 3; - Projectile.velocity = Velocity * (BossRushEvent.BossRushActive ? 1.25f : 1f); + Projectile.extraUpdates = CalamityWorld.LegendaryMode ? 4 : 3; + Projectile.velocity = Velocity; Velocity = Vector2.Zero; Projectile.netUpdate = true; } @@ -240,14 +239,6 @@ namespace CalamityMod.Projectiles.Boss public override bool CanHitPlayer(Player target) => TelegraphDelay > TelegraphTotalTime; - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (info.Damage <= 0 || TelegraphDelay <= TelegraphTotalTime) - return; - - target.AddBuff(ModContent.BuffType(), 90); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { return CalamityUtils.CircularHitboxCollision(projHitbox.Center(), Projectile.Size.Length() * 0.5f, targetHitbox); diff --git a/Projectiles/Boss/ThornBallSpike.cs b/Projectiles/Boss/ThornBallSpike.cs index 790a4288bb..e60fdf23eb 100644 --- a/Projectiles/Boss/ThornBallSpike.cs +++ b/Projectiles/Boss/ThornBallSpike.cs @@ -56,7 +56,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.rotation = (float)Math.Atan2(Projectile.velocity.Y, Projectile.velocity.X) + MathHelper.PiOver2; } - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 90); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 120); public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); diff --git a/Projectiles/Boss/ToxicCloud.cs b/Projectiles/Boss/ToxicCloud.cs index c1c879d50c..f0286ca08f 100644 --- a/Projectiles/Boss/ToxicCloud.cs +++ b/Projectiles/Boss/ToxicCloud.cs @@ -36,8 +36,7 @@ namespace CalamityMod.Projectiles.Boss { Lighting.AddLight(Projectile.Center, 0.1f, 0.7f, 0f); - bool bossRush = BossRushEvent.BossRushActive; - if (Projectile.velocity.Length() < (bossRush ? 6.25f : 5f)) + if (Projectile.velocity.Length() < 5f) Projectile.velocity *= 1.01f; Projectile.ai[0] += 1f; @@ -88,9 +87,7 @@ namespace CalamityMod.Projectiles.Boss if (info.Damage <= 0) return; - target.AddBuff(BuffID.Poisoned, 240); - target.AddBuff(BuffID.Venom, 240); - target.AddBuff(ModContent.BuffType(), 240); + target.AddBuff(ModContent.BuffType(), 480); } } } diff --git a/Projectiles/Boss/UnstableCrimulanGlob.cs b/Projectiles/Boss/UnstableCrimulanGlob.cs index 71ac79c0a2..3db3a7a054 100644 --- a/Projectiles/Boss/UnstableCrimulanGlob.cs +++ b/Projectiles/Boss/UnstableCrimulanGlob.cs @@ -14,16 +14,15 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; Projectile.penetrate = 1; Projectile.Opacity = 0.8f; Projectile.tileCollide = false; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 640 : CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; + Projectile.timeLeft = CalamityWorld.death ? 490 : CalamityWorld.revenge ? 440 : Main.expertMode ? 390 : 240; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } @@ -51,7 +50,7 @@ namespace CalamityMod.Projectiles.Boss { if (Projectile.velocity.Length() < 15f && (Main.expertMode || BossRushEvent.BossRushActive)) { - float velocityMult = BossRushEvent.BossRushActive ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; + float velocityMult = CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; Projectile.velocity *= velocityMult; } } diff --git a/Projectiles/Boss/UnstableEbonianGlob.cs b/Projectiles/Boss/UnstableEbonianGlob.cs index 89b77b7a77..95ef39e3df 100644 --- a/Projectiles/Boss/UnstableEbonianGlob.cs +++ b/Projectiles/Boss/UnstableEbonianGlob.cs @@ -14,16 +14,15 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 30; Projectile.height = 30; Projectile.hostile = true; Projectile.penetrate = 1; Projectile.Opacity = 0.8f; Projectile.tileCollide = false; - Projectile.timeLeft = BossRushEvent.BossRushActive ? 780 : CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; + Projectile.timeLeft = CalamityWorld.death ? 600 : CalamityWorld.revenge ? 540 : Main.expertMode ? 480 : 300; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Projectile.extraUpdates = 1; } @@ -34,7 +33,7 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.velocity.Length() < 12f && (Main.expertMode || BossRushEvent.BossRushActive || Projectile.ai[0] == 1f)) { - float velocityMult = BossRushEvent.BossRushActive ? 1.025f : CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; + float velocityMult = CalamityWorld.death ? 1.015f : CalamityWorld.revenge ? 1.0125f : Main.expertMode ? 1.01f : 1.005f; if (Projectile.ai[0] == 1f) velocityMult += 0.02f; diff --git a/Projectiles/Boss/YharonBulletHellVortex.cs b/Projectiles/Boss/YharonBulletHellVortex.cs index 4fde90ccdf..430144499a 100644 --- a/Projectiles/Boss/YharonBulletHellVortex.cs +++ b/Projectiles/Boss/YharonBulletHellVortex.cs @@ -31,6 +31,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.penetrate = -1; Projectile.alpha = 255; Projectile.timeLeft = 60000; + Projectile.Calamity().DealsDefenseDamage = true; } public override void SendExtraAI(BinaryWriter writer) @@ -62,7 +63,7 @@ namespace CalamityMod.Projectiles.Boss Projectile.hostile = true; Projectile.width = Projectile.height = (int)(408f * Projectile.scale); float inertia = 5f; - float speed = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 10.7f : 5.35f; + float speed = CalamityWorld.LegendaryMode ? 10.7f : 5.35f; float minDist = 160f; if (victim >= 0 && Main.player[victim].active && !Main.player[victim].dead) { @@ -79,7 +80,7 @@ namespace CalamityMod.Projectiles.Boss } // Fly away from other vortices - float pushForce = (CalamityWorld.LegendaryMode && CalamityWorld.revenge) ? 0.1f : 0.05f; + float pushForce = CalamityWorld.LegendaryMode ? 0.1f : 0.05f; for (int k = 0; k < Main.maxProjectiles; k++) { Projectile otherProj = Main.projectile[k]; diff --git a/Projectiles/Boss/YharonFireball.cs b/Projectiles/Boss/YharonFireball.cs index 2f8648e584..b7b87e1de4 100644 --- a/Projectiles/Boss/YharonFireball.cs +++ b/Projectiles/Boss/YharonFireball.cs @@ -11,8 +11,8 @@ namespace CalamityMod.Projectiles.Boss public class YharonFireball : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Boss"; - private float speedX = -1f; - private float speedX2 = -2f; + private float speedX = -3f; + private float speedX2 = -5f; public override void SetStaticDefaults() { @@ -23,7 +23,6 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; @@ -95,13 +94,13 @@ namespace CalamityMod.Projectiles.Boss { for (int x = 0; x < 3; x++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -6f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); - speedX += 1f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX, -50f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + speedX += 3f; } for (int x = 0; x < 2; x++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -6f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); - speedX2 += 4f; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, speedX2, -75f, ModContent.ProjectileType(), Projectile.damage, 0f, Main.myPlayer); + speedX2 += 10f; } } Projectile.ExpandHitboxBy(144); diff --git a/Projectiles/Boss/YharonFireball2.cs b/Projectiles/Boss/YharonFireball2.cs index df9e249e70..96b9044f0d 100644 --- a/Projectiles/Boss/YharonFireball2.cs +++ b/Projectiles/Boss/YharonFireball2.cs @@ -29,10 +29,10 @@ namespace CalamityMod.Projectiles.Boss public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 34; Projectile.height = 34; Projectile.hostile = true; + Projectile.Opacity = 0.25f; Projectile.alpha = 255; Projectile.penetrate = -1; Projectile.timeLeft = 3600; @@ -60,21 +60,43 @@ namespace CalamityMod.Projectiles.Boss if (Projectile.frame >= Main.projFrames[Type]) Projectile.frame = 0; - if (Projectile.ai[0] < TimeBeforeFalling) + if (Projectile.velocity.Y >= -16f) { - Projectile.ai[0] += 1f; - Projectile.velocity.Y -= 0.1f; - if (Projectile.velocity.Y < MaxUpwardVelocity) - Projectile.velocity.Y = MaxUpwardVelocity; + if (Projectile.Opacity < 1f) + { + Projectile.Opacity = 1f; + SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); + int dustAmount = 36; + + for (int i = 0; i < dustAmount; i++) + { + Vector2 dustSpawnPosition = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.5f; + dustSpawnPosition = dustSpawnPosition.RotatedBy((double)((float)(i - (dustAmount / 2 - 1)) * MathHelper.TwoPi / (float)dustAmount), default) + Projectile.Center; + Vector2 dustVelocity = dustSpawnPosition - Projectile.Center; + + int dust = Dust.NewDust(dustSpawnPosition + dustVelocity, 0, 0, DustID.Pixie, dustVelocity.X, dustVelocity.Y); + Main.dust[dust].noGravity = true; + Main.dust[dust].noLight = true; + Main.dust[dust].velocity = dustVelocity; + } + } + } + + if (Projectile.velocity.Y < -1f) + { + // 129 frames to get from -50 to -1 + Projectile.velocity.Y *= 0.97f; } else { - Projectile.velocity.X *= 0.8f; + // 85 frames to get from -1 to 16 Projectile.velocity.Y += 0.2f; - if (Projectile.velocity.Y > MaxDownwardVelocity) - Projectile.velocity.Y = MaxDownwardVelocity; + if (Projectile.velocity.Y > 16f) + Projectile.velocity.Y = 16f; } + Projectile.velocity.X *= 0.995f; + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; if (Projectile.localAI[0] == 0f) @@ -83,6 +105,13 @@ namespace CalamityMod.Projectiles.Boss SoundEngine.PlaySound(FireballSound, Projectile.Center); } + if (Projectile.ai[0] >= 2f) + { + Projectile.alpha -= 25; + if (Projectile.alpha < 0) + Projectile.alpha = 0; + } + if (Main.rand.NextBool(16)) { Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Pixie, 0f, 0f, 200, default, 1f); @@ -91,6 +120,7 @@ namespace CalamityMod.Projectiles.Boss } } + public override bool CanHitPlayer(Player target) => Projectile.velocity.Y >= -16f; public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, Projectile.alpha); public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index da046e41d1..a211a8a134 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -14,9 +14,11 @@ using CalamityMod.ExtraTextures; using CalamityMod.Items.Accessories; using CalamityMod.Items.Ammo; using CalamityMod.Items.Potions.Alcohol; +using CalamityMod.Items.VanillaArmorChanges; using CalamityMod.NPCs; using CalamityMod.NPCs.NormalNPCs; using CalamityMod.NPCs.PlagueEnemies; +using CalamityMod.NPCs.VanillaNPCAIOverrides.Bosses; using CalamityMod.Particles; using CalamityMod.Projectiles.Boss; using CalamityMod.Projectiles.Healing; @@ -115,7 +117,7 @@ namespace CalamityMod.Projectiles /// If true, this projectile is able to spawn lightning while using Arc Flash Ring.
/// This is set to false when lightning is procced, and is reset to true when the cooldown ends. ///
- public bool spawnArcFlash = true; + public bool showArcFlash = true; /// Cooldown variable for Arc Flash Ring's lightning. Primarily used for lingering projectiles and minions. public int arcFlashCooldown = 0; @@ -294,7 +296,6 @@ namespace CalamityMod.Projectiles public int BloodstoneOrbValue = 0; #region On Spawn - public override void OnSpawn(Projectile projectile, IEntitySource source) { // TODO -- it would be nice to move frame one hacks here, but this runs in the middle of NewProjectile @@ -306,18 +307,50 @@ namespace CalamityMod.Projectiles if (sourceItem != null) extorterBoost = true; - if (source is EntitySource_Parent { Entity: NPC npc }) - { - if (!npc.friendly) - ParentNPCIndex = npc.whoAmI; - } - // Whenever the player has Daawnlight Spirit Origin, any ranged projectile will have the capacity to infintely supercrit. if (Main.player[projectile.owner].Calamity().spiritOrigin && projectile.CountsAsClass()) { projectile.CritChance += Main.player[projectile.owner].Calamity().spiritOriginCritBoost; projectile.Calamity().supercritHits = -1; } + + if (source is EntitySource_Parent { Entity: NPC npc }) + { + if (!npc.friendly) + ParentNPCIndex = npc.whoAmI; + } + // + // SPECIFIC PROJECTILE BALANCE CHANGES + // + else if (source is EntitySource_Parent { Entity: Projectile parent }) + { + // Nerf Crystal bullet shard damage by 45% + // Vanilla crystal shards deal 50% of the bullet's damage which is absurd, this nerfs them to 27.5% + if (parent.type == ProjectileID.CrystalBullet && projectile.type == ProjectileID.CrystalShard) + projectile.damage = (int)(projectile.damage * 0.55f); + + // Nerf Mushroom Spear mushroom damage by 50% + if (parent.type == ProjectileID.MushroomSpear && projectile.type == ProjectileID.Mushroom) + projectile.damage /= 2; + + // Nerf Luminite Arrow trail damage by 50% + if (parent.type == ProjectileID.MoonlordArrow && projectile.type == ProjectileID.MoonlordArrowTrail) + projectile.damage /= 2; + + // Nerf Cursed Dart flame damage by 50% + if (parent.type == ProjectileID.CursedDart && projectile.type == ProjectileID.CursedDartFlame) + projectile.damage /= 2; + } + + if (source is EntitySource_OnHit e) + { + // Nerf Orichalcum armor's set bonus petal damage by 25% + if (e.Context == "SetBonus_Orichalcum") + projectile.damage = (int)(projectile.damage * 0.75f); + // Nerf Spectre armor's set bonus soul damage by 50% + if (e.Context == "SetBonus_GhostHurt") + projectile.damage /= 2; + } } public override void SendExtraAI(Projectile projectile, BitWriter bitWriter, BinaryWriter binaryWriter) => binaryWriter.Write(ParentNPCIndex); public override void ReceiveExtraAI(Projectile projectile, BitReader bitReader, BinaryReader binaryReader) => ParentNPCIndex = binaryReader.ReadInt32(); @@ -486,10 +519,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) { @@ -528,7 +561,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; @@ -702,11 +735,6 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - if (Main.masterMode && !CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * CalamityGlobalNPC.MasterModeEnemyDamageMultiplier); - if (!CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * 0.65); - SoundEngine.PlaySound(SoundID.Item17, projectile.Center); projectile.localAI[0] = 1f; for (int i = 0; i < 8; i++) @@ -735,11 +763,6 @@ namespace CalamityMod.Projectiles { if (projectile.localAI[0] == 0f) { - if (Main.masterMode && !CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * CalamityGlobalNPC.MasterModeEnemyDamageMultiplier); - if (!CalamityPlayer.areThereAnyDamnBosses) - projectile.damage = (int)Math.Round(projectile.damage * 0.65); - SoundEngine.PlaySound(SoundID.Item171, projectile.Center); projectile.localAI[0] = 1f; for (int i = 0; i < 8; i++) @@ -1021,8 +1044,6 @@ namespace CalamityMod.Projectiles else if (projectile.type == ProjectileID.Sharknado) { - projectile.damage = projectile.GetProjectileDamage(NPCID.DukeFishron); - int num535 = 10; int num536 = 15; float num537 = 1f; @@ -1123,8 +1144,6 @@ namespace CalamityMod.Projectiles // Larger cthulhunadoes else if (projectile.type == ProjectileID.Cthulunado) { - projectile.damage = projectile.GetProjectileDamage(NPCID.DukeFishron); - if (CalamityWorld.revenge || BossRushEvent.BossRushActive) { bool death = CalamityWorld.death || BossRushEvent.BossRushActive; @@ -1212,7 +1231,7 @@ namespace CalamityMod.Projectiles { int sharkron = NPC.NewNPC(projectile.GetSource_FromAI(), (int)center.X, (int)center.Y, NPCID.Sharkron2); Main.npc[sharkron].velocity = projectile.velocity; - Main.npc[sharkron].scale = death ? 2f : 1.5f; + Main.npc[sharkron].scale = 1.5f; Main.npc[sharkron].netUpdate = true; Main.npc[sharkron].ai[2] = projectile.width; Main.npc[sharkron].ai[3] = -1.5f; @@ -2096,7 +2115,7 @@ namespace CalamityMod.Projectiles float dustVelocityMultiplier = 0.75f; int numDust = 5; int numDust2 = 5; - int fadeInTime = 50; + int fadeInTime = 25; int fadeOutGateValue = death ? 90 : 65; float killGateValue = death ? 100f : 75f; int maxFrames = 5; @@ -2131,7 +2150,7 @@ namespace CalamityMod.Projectiles if (fadeIn) { - projectile.Opacity += 0.02f; + projectile.Opacity += 0.04f; if (projectile.Opacity > 1f) projectile.Opacity = 1f; @@ -2317,115 +2336,6 @@ namespace CalamityMod.Projectiles } } - else if (projectile.type == ProjectileID.BombSkeletronPrime && projectile.ai[0] < 0f && death) - { - int num = (int)(projectile.Center.X / 16f); - int num2 = (int)(projectile.Center.Y / 16f); - if (WorldGen.InWorld(num, num2) && projectile.tileCollide) - { - Tile tile = Main.tile[num, num2]; - if (tile != null && tile.HasTile && (TileID.Sets.Platforms[tile.TileType] || tile.TileType == TileID.PlanterBox)) - { - projectile.Kill(); - return false; - } - } - - bool deathModeSkeletronPrimeHomingBomb = projectile.ai[0] == -1f; - bool deathModeSkeletronPrimeFallingBomb = projectile.ai[0] == -2f; - - int target = 0; - target = Player.FindClosest(projectile.Center, 1, 1); - - if (projectile.Hitbox.Intersects(Main.player[target].Hitbox)) - { - projectile.Kill(); - return false; - } - - if (projectile.timeLeft < SkeletronPrime2.BombTimeLeft / 2 && projectile.timeLeft > 3) - projectile.tileCollide = true; - - if (deathModeSkeletronPrimeHomingBomb) - { - projectile.ai[1] += 1f; - float homingStartTime = 20f; - float homingEndTime = death ? 140f : 110f; - - if (Vector2.Distance(projectile.Center, Main.player[target].Center) < 192f && projectile.ai[1] < homingEndTime) - projectile.ai[1] = homingEndTime; - - if (projectile.ai[1] < homingEndTime && projectile.ai[1] > homingStartTime) - { - float num134 = projectile.velocity.Length(); - Vector2 vector24 = Main.player[target].Center - projectile.Center; - vector24.Normalize(); - vector24 *= num134; - float inertia = death ? 25f : 30f; - projectile.velocity = (projectile.velocity * (inertia - 1f) + vector24) / inertia; - projectile.velocity.Normalize(); - projectile.velocity *= num134; - } - - float maxVelocity = death ? 18f : 15f; - float acceleration = 1.02f; - if (projectile.velocity.Length() < maxVelocity) - projectile.velocity *= acceleration; - } - else - { - if (projectile.velocity.Y > 10f) - projectile.velocity.Y = 10f; - } - - if (projectile.localAI[0] == 0f) - { - projectile.localAI[0] = 1f; - SoundEngine.PlaySound(SoundID.Item10, projectile.Center); - } - - projectile.frameCounter++; - if (projectile.frameCounter > 3) - { - projectile.frame++; - projectile.frameCounter = 0; - } - - if (projectile.frame > 1) - projectile.frame = 0; - - if (projectile.owner == Main.myPlayer && projectile.timeLeft <= 3) - { - projectile.tileCollide = false; - projectile.ai[2] = 0f; - projectile.alpha = 255; - } - else if (Main.rand.NextBool()) - { - int num28 = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100); - Main.dust[num28].scale = 0.1f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num28].fadeIn = 1.5f + (float)Main.rand.Next(5) * 0.1f; - Main.dust[num28].noGravity = true; - Main.dust[num28].position = projectile.Center + new Vector2(0f, -projectile.height / 2).RotatedBy(projectile.rotation) * 1.1f; - int num29 = 6; - Dust dust8 = Dust.NewDustDirect(projectile.position, projectile.width, projectile.height, num29, 0f, 0f, 100); - dust8.scale = 1f + (float)Main.rand.Next(5) * 0.1f; - dust8.noGravity = true; - dust8.position = projectile.Center + new Vector2(0f, -projectile.height / 2 - 6).RotatedBy(projectile.rotation) * 1.1f; - } - - if (deathModeSkeletronPrimeFallingBomb) - { - projectile.ai[2] += 1f; - if (projectile.ai[2] > 60f) - projectile.velocity.Y += 0.2f; - } - - projectile.rotation += projectile.velocity.X * 0.1f; - - return false; - } - else if (projectile.type == ProjectileID.RocketSkeleton && projectile.ai[1] >= 1f) { bool primeCannonProjectile = projectile.ai[1] == 2f; @@ -2589,7 +2499,7 @@ namespace CalamityMod.Projectiles for (int k = 0; k < totalProjectiles; k++) { Vector2 velocity2 = spinningPoint.RotatedBy(radians * k); - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center + Vector2.Normalize(velocity2) * 16f, velocity2, type, (int)Math.Round(projectile.damage * 0.8), 0f, Main.myPlayer); + Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center + Vector2.Normalize(velocity2) * 16f, velocity2, type, PlanteraAI.ThornBallSpikeDamage, 0f, Main.myPlayer); } } @@ -2677,7 +2587,7 @@ namespace CalamityMod.Projectiles Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0.3f; Main.dust[dust].velocity += projectile.velocity * 0.1f; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Main.dust[dust].noLight = true; } @@ -2727,7 +2637,7 @@ namespace CalamityMod.Projectiles Main.dust[dust].noGravity = true; Main.dust[dust].position = dustPosition; Main.dust[dust].velocity = dustVelocity; - if (Main.getGoodWorld) + if (CalamityWorld.LegendaryMode) Main.dust[dust].noLight = true; } @@ -3183,97 +3093,6 @@ namespace CalamityMod.Projectiles if (projectile.type == ProjectileID.Nail && Main.expertMode) projectile.damage /= 2; - // Nerf all these Master Mode enemy projectiles - if (Main.masterMode && !CalamityPlayer.areThereAnyDamnBosses) - { - switch (projectile.type) - { - case ProjectileID.DemonSickle: - case ProjectileID.HarpyFeather: - case ProjectileID.JavelinHostile: - case ProjectileID.SalamanderSpit: - case ProjectileID.SkeletonBone: - case ProjectileID.IceSpike: - case ProjectileID.JungleSpike: - case ProjectileID.PinkLaser: - case ProjectileID.FrostBlastHostile: - case ProjectileID.GoldenShowerHostile: - case ProjectileID.RainNimbus: - case ProjectileID.FlamingArrow: - case ProjectileID.BulletDeadeye: - case ProjectileID.CannonballHostile: - case ProjectileID.UnholyTridentHostile: - case ProjectileID.FrostBeam: - case ProjectileID.CursedFlameHostile: - case ProjectileID.Stinger: - case ProjectileID.BloodNautilusTears: - case ProjectileID.RockGolemRock: - case ProjectileID.IcewaterSpit: - case ProjectileID.RocketSkeleton: - case ProjectileID.SniperBullet: - case ProjectileID.DrManFlyFlask: - case ProjectileID.DesertDjinnCurse: - case ProjectileID.InfernoHostileBlast: - case ProjectileID.InfernoHostileBolt: - case ProjectileID.Shadowflames: - case ProjectileID.ShadowBeamHostile: - case ProjectileID.PaladinsHammerHostile: - case ProjectileID.LostSoulHostile: - case ProjectileID.RuneBlast: - case ProjectileID.DandelionSeed: - case ProjectileID.SandnadoHostile: - case ProjectileID.SandnadoHostileMark: - case ProjectileID.SnowBallHostile: - case ProjectileID.EyeLaser: - case ProjectileID.Nail: - case ProjectileID.BrainScramblerBolt: - case ProjectileID.GigaZapperSpear: - case ProjectileID.MartianWalkerLaser: - case ProjectileID.RayGunnerLaser: - case ProjectileID.MartianTurretBolt: - case ProjectileID.NebulaSphere: - case ProjectileID.NebulaLaser: - case ProjectileID.NebulaBolt: - case ProjectileID.StardustJellyfishSmall: - case ProjectileID.StardustSoldierLaser: - case ProjectileID.Twinkle: - case ProjectileID.VortexAcid: - case ProjectileID.VortexLaser: - case ProjectileID.VortexLightning: - case ProjectileID.VortexVortexLightning: - case ProjectileID.FlamingWood: - case ProjectileID.GreekFire1: - case ProjectileID.GreekFire2: - case ProjectileID.GreekFire3: - case ProjectileID.FlamingScythe: - case ProjectileID.OrnamentHostile: - case ProjectileID.OrnamentHostileShrapnel: - case ProjectileID.PineNeedleHostile: - case ProjectileID.FrostShard: - case ProjectileID.FrostWave: - case ProjectileID.Missile: - case ProjectileID.Present: - case ProjectileID.Spike: - case ProjectileID.SaucerDeathray: - case ProjectileID.SaucerLaser: - case ProjectileID.SaucerMissile: - case ProjectileID.SaucerScrap: - case ProjectileID.DD2GoblinBomb: - case ProjectileID.DD2JavelinHostile: - case ProjectileID.DD2JavelinHostileT3: - case ProjectileID.DD2DarkMageBolt: - case ProjectileID.DD2DrakinShot: - case ProjectileID.DD2OgreSmash: - case ProjectileID.DD2OgreSpit: - case ProjectileID.DD2OgreStomp: - case ProjectileID.DD2LightningBugZap: - case ProjectileID.DD2BetsyFireball: - case ProjectileID.DD2BetsyFlameBreath: - projectile.damage = (int)Math.Round(projectile.damage * CalamityGlobalNPC.MasterModeEnemyDamageMultiplier); - break; - } - } - // Nerf several Hardmode enemy projectiles because they deal way too much damage if (!CalamityPlayer.areThereAnyDamnBosses) { @@ -3291,6 +3110,8 @@ namespace CalamityMod.Projectiles case ProjectileID.FrostBeam: case ProjectileID.CursedFlameHostile: case ProjectileID.Stinger: + case ProjectileID.BloodShot: + case ProjectileID.BloodNautilusShot: case ProjectileID.BloodNautilusTears: case ProjectileID.RockGolemRock: case ProjectileID.IcewaterSpit: @@ -3402,6 +3223,18 @@ namespace CalamityMod.Projectiles break; } + // Makes flares from Firestorm Cannon ignore gravity + // Spectralstorm Cannon uses a custom flare projectile + if (projectile.aiStyle == ProjAIStyleID.Flare && projectile.ai[2] == 1f && projectile.localAI[0] == 0f) + projectile.localAI[1]--; + + // Hack to allow Desert Tiger minion to fall through platforms while attacking + if (projectile.type >= ProjectileID.StormTigerTier1 && projectile.type <= ProjectileID.StormTigerTier3) + { + if (projectile.ai[0] == 5f) + projectile.tileCollide = false; + } + // Jack O Lantern Launcher projectile tweak if (projectile.type == ProjectileID.JackOLantern) { @@ -3414,6 +3247,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) { @@ -3444,6 +3278,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) @@ -3469,7 +3319,7 @@ namespace CalamityMod.Projectiles projectile.ai[0]--; // Acceleration for certain lasers - if ((projectile.type == ProjectileID.EyeLaser || projectile.type == ProjectileID.DeathLaser || projectile.type == ProjectileID.FrostBeam) && projectile.ai[0] == 1f) + if ((projectile.type == ProjectileID.EyeLaser || projectile.type == ProjectileID.DeathLaser) && projectile.ai[0] == 1f) { if (projectile.velocity.Length() < AcceleratingBossLaserVelocityCap) projectile.velocity *= 1.0025f; @@ -3480,7 +3330,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 @@ -3682,16 +3532,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; } } } @@ -3841,14 +3688,14 @@ namespace CalamityMod.Projectiles confetti.velocity.Y += Main.rand.Next(-50, 51) * 0.05f; } } - // Support to help things like holdout swords work with Arc Flash Ring - if (!spawnArcFlash && projectile.numHits == 0) - spawnArcFlash = true; + // Support to help things like holdout swords look better with Arc Flash Ring + if (!showArcFlash && projectile.numHits == 0) + showArcFlash = true; // Cooldown for the arc flash so that long lasting projectiles (like dashing summons) can spawn multiple bolts if (arcFlashCooldown >= 0) arcFlashCooldown--; if (arcFlashCooldown == 0) - spawnArcFlash = true; + showArcFlash = true; if (conditionalHomingRange > 0f) { CalamityUtils.HomeInOnNPC(projectile, !projectile.tileCollide, conditionalHomingRange, 12f, 20f); @@ -4129,6 +3976,8 @@ namespace CalamityMod.Projectiles float mult = 1f; if (player.Calamity().reaverSpeed) mult += 0.5f; + if (player.Calamity().tungstenArmorHookBoost) + mult += TungstenArmorSetChange.HookBoost; if (player.Calamity().bloomStone) mult += 0.5f; speed *= mult; @@ -4146,6 +3995,8 @@ namespace CalamityMod.Projectiles float mult = 1f; if (player.Calamity().reaverSpeed) mult += 0.5f; + if (player.Calamity().tungstenArmorHookBoost) + mult += TungstenArmorSetChange.HookBoost; if (player.Calamity().bloomStone) mult += 0.5f; speed *= mult; @@ -4180,10 +4031,11 @@ namespace CalamityMod.Projectiles projectile.damage = 1; } - // Heat Ray damage falloff - if (projectile.type == ProjectileID.HeatRay && projectile.numHits > 0) + // Super Star Shooter has damage falloff + if (projectile.type == ProjectileID.SuperStar) { - projectile.damage = (int)(projectile.damage * 0.9f); + if (projectile.numHits > 0) + projectile.damage = (int)(projectile.damage * 0.95f); if (projectile.damage < 1) projectile.damage = 1; } @@ -4205,7 +4057,9 @@ namespace CalamityMod.Projectiles else if (modPlayer.vampiricTalisman && projectile.Calamity().stealthStrike) { target.AddBuff(BuffType(), VampiricTalisman.ArmorCrunchDebuffTime); - target.AddBuff(BuffType(), VampiricTalisman.HeavyBleedingDebuffTime); + + if (!modPlayer.nanotech) + target.AddBuff(BuffType(), VampiricTalisman.HeavyBleedingDebuffTime); } if (modPlayer.flamingItemEnchant && !projectile.minion && !projectile.npcProj && !projectile.Calamity().CreatedByPlayerDash) @@ -4418,7 +4272,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; @@ -4743,7 +4597,6 @@ namespace CalamityMod.Projectiles #region Pre Kill public override bool PreKill(Projectile projectile, int timeLeft) { - bool masterRevSkeletronPrimeBomb = projectile.type == ProjectileID.BombSkeletronPrime && projectile.ai[0] < 0f && (CalamityWorld.death || BossRushEvent.BossRushActive); bool revQueenBeeBeeHive = projectile.type == ProjectileID.BeeHive && (CalamityWorld.revenge || BossRushEvent.BossRushActive) && (projectile.ai[2] == 1f || CalamityWorld.death); bool revGolemInferno = projectile.type == ProjectileID.InfernoHostileBolt && projectile.ai[2] > 0f; @@ -4765,96 +4618,7 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer) { - if (masterRevSkeletronPrimeBomb) - { - SoundEngine.PlaySound(SoundID.Item14, projectile.Center); - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 22; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - - for (int num951 = 0; num951 < 20; num951++) - { - int num952 = Dust.NewDust(projectile.position, projectile.width, projectile.height, DustID.Smoke, 0f, 0f, 100, default(Color), 1.5f); - Dust dust2 = Main.dust[num952]; - dust2.velocity *= 1.4f; - } - - int num950 = 6; - for (int num953 = 0; num953 < 10; num953++) - { - int num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 2.5f); - Main.dust[num954].noGravity = true; - Dust dust2 = Main.dust[num954]; - dust2.velocity *= 5f; - num954 = Dust.NewDust(projectile.position, projectile.width, projectile.height, num950, 0f, 0f, 100, default(Color), 1.5f); - dust2 = Main.dust[num954]; - dust2.velocity *= 3f; - } - - int num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - Gore gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y += 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X += 1f; - Main.gore[num955].velocity.Y -= 1f; - num955 = Gore.NewGore(projectile.GetSource_FromAI(), projectile.position, default(Vector2), Main.rand.Next(61, 64)); - gore2 = Main.gore[num955]; - gore2.velocity *= 0.4f; - Main.gore[num955].velocity.X -= 1f; - Main.gore[num955].velocity.Y -= 1f; - - Vector2 vector76 = projectile.position; - projectile.position.X += projectile.width / 2; - projectile.position.Y += projectile.height / 2; - projectile.width = projectile.height = 128; - projectile.position.X -= projectile.width / 2; - projectile.position.Y -= projectile.height / 2; - projectile.Damage(); - projectile.position = vector76; - projectile.width = projectile.height = 22; - - if (Main.getGoodWorld && !Main.remixWorld) - { - int num1011 = 4; - Vector2 center3 = projectile.position; - int num1012 = num1011; - int num1013 = num1011; - int num1014 = (int)(center3.X / 16f - (float)num1012); - int num1015 = (int)(center3.X / 16f + (float)num1012); - int num1016 = (int)(center3.Y / 16f - (float)num1013); - int num1017 = (int)(center3.Y / 16f + (float)num1013); - if (num1014 < 0) - num1014 = 0; - - if (num1015 > Main.maxTilesX) - num1015 = Main.maxTilesX; - - if (num1016 < 0) - num1016 = 0; - - if (num1017 > Main.maxTilesY) - num1017 = Main.maxTilesY; - - bool wallSplode2 = projectile.ShouldWallExplode(center3, num1011, num1014, num1015, num1016, num1017); - projectile.ExplodeTiles(center3, num1011, num1014, num1015, num1016, num1017, wallSplode2); - } - - if (Main.netMode != NetmodeID.SinglePlayer) - NetMessage.SendData(MessageID.KillProjectile, -1, -1, null, projectile.identity, projectile.owner); - } - - else if (revQueenBeeBeeHive) + if (revQueenBeeBeeHive) { if (Main.netMode != NetmodeID.MultiplayerClient) { @@ -4920,7 +4684,7 @@ namespace CalamityMod.Projectiles } } - if (masterRevSkeletronPrimeBomb || revQueenBeeBeeHive || revGolemInferno) + if (revQueenBeeBeeHive || revGolemInferno) { projectile.active = false; return false; @@ -4981,34 +4745,5 @@ namespace CalamityMod.Projectiles } } #endregion - - #region Life Steal - public static bool CanSpawnLifeStealProjectile(double healMultiplier, float healAmount) => healMultiplier > 0D && (int)healAmount > 0; - - public static void SpawnLifeStealProjectile(Projectile projectile, Player player, float healAmount, int healProjectileType, float distanceRequired, float cooldownMultiplier = 1f) - { - if (Main.LocalPlayer.moonLeech) - return; - - Main.LocalPlayer.lifeSteal -= healAmount * cooldownMultiplier; - - float lowestHealthCheck = 0f; - int healTarget = projectile.owner; - foreach (Player otherPlayer in Main.ActivePlayers) - { - if (!otherPlayer.dead && ((!player.hostile && !otherPlayer.hostile) || player.team == otherPlayer.team)) - { - float playerDist = Vector2.Distance(projectile.Center, otherPlayer.Center); - if (playerDist < distanceRequired && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) - { - lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; - healTarget = otherPlayer.whoAmI; - } - } - } - - Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, healProjectileType, 0, 0f, projectile.owner, healTarget, healAmount); - } - #endregion } } diff --git a/Projectiles/CalamityGlobalProjectileTweaks.cs b/Projectiles/CalamityGlobalProjectileTweaks.cs index 76a983fc1c..ba1286866a 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) }, @@ -162,7 +162,6 @@ namespace CalamityMod.Projectiles { ProjectileID.GoldenShowerFriendly, Do(PiercingExact(2), DefaultIDStaticIFrames) }, { ProjectileID.GreenCounterweight, counterweightTweaks }, { ProjectileID.Hamdrax, standardDrillTweaks }, // Drax (never internally renamed since 1.1) - { ProjectileID.HeatRay, Do(InfinitePiercing, IDStaticIFrames(6)) }, // Due to the weapon's fast use speed, the lasers need to give less than 10 iframes { ProjectileID.IceBoomerang, Do(ExtraUpdatesExact(1), DefaultIDStaticIFrames) }, { ProjectileID.IceSickle, Do(ExtraUpdatesExact(1)) }, { ProjectileID.IchorBullet, Do(PointBlank, ExtraUpdatesDelta(+2), DefaultIDStaticIFrames) }, @@ -294,40 +293,18 @@ namespace CalamityMod.Projectiles #endregion #region CATEGORY 5: Defense Damage support - { ProjectileID.BombSkeletronPrime, defenseDamage }, - { ProjectileID.CannonballHostile, defenseDamage }, { ProjectileID.Cthulunado, defenseDamage }, // Duke Fishron's larger Sharknados - { ProjectileID.CultistBossFireBall, defenseDamage }, - { ProjectileID.CultistBossFireBallClone, defenseDamage }, - { ProjectileID.CultistBossIceMist, defenseDamage }, - { ProjectileID.CultistBossLightningOrbArc, defenseDamage }, - { ProjectileID.DD2BetsyFireball, defenseDamage }, { ProjectileID.DD2BetsyFlameBreath, defenseDamage }, { ProjectileID.DeerclopsIceSpike, defenseDamage }, - { ProjectileID.DeerclopsRangedProjectile, defenseDamage }, // Deerclops shadow hands - { ProjectileID.DemonSickle, defenseDamage }, - { ProjectileID.FairyQueenLance, defenseDamage }, // Empress of Light's lance walls { ProjectileID.FairyQueenSunDance, defenseDamage }, // Empress of Light's Sun Dance { ProjectileID.FlamingScythe, defenseDamage }, // Pumpking orange spinning scythes - { ProjectileID.FrostWave, defenseDamage }, // Ice Queen frost waves - { ProjectileID.HallowBossLastingRainbow, defenseDamage }, // Empress of Light's lingering rainbow trail hitboxes { ProjectileID.InfernoHostileBlast, defenseDamage }, // Diabolist inferno fork explosions - { ProjectileID.JavelinHostile, defenseDamage }, { ProjectileID.PaladinsHammerHostile, defenseDamage }, { ProjectileID.PhantasmalDeathray, defenseDamage }, { ProjectileID.PhantasmalSphere, defenseDamage }, - { ProjectileID.Present, defenseDamage }, // Falling present bombs in Frost Moon - { ProjectileID.RocketSkeleton, defenseDamage }, // Skeleton Commando rockets - { ProjectileID.RockGolemRock, defenseDamage }, - { ProjectileID.RuneBlast, defenseDamage }, // Rune Wizard shots { ProjectileID.SaucerDeathray, defenseDamage }, - { ProjectileID.SaucerMissile, defenseDamage }, { ProjectileID.Sharknado, defenseDamage }, - { ProjectileID.Skull, defenseDamage }, // Skeletron Expert+ skulls - { ProjectileID.SniperBullet, defenseDamage }, // Skeleton Sniper bullets - { ProjectileID.Spike, defenseDamage }, // Santank spike balls { ProjectileID.ThornBall, Do(Main.zenithWorld ? IgnoreWater : DontIgnoreWater, DefenseDamage) }, // Plantera bouncing thorn balls - { ProjectileID.UnholyTridentHostile, defenseDamage }, #endregion #region CATEGORY 6: ID-Static Immunity Frame changes @@ -434,6 +411,7 @@ namespace CalamityMod.Projectiles {ProjectileID.Grenade, Do(DefaultIDStaticIFrames)}, {ProjectileID.HallowSpray, Do(DefaultIDStaticIFrames)}, {ProjectileID.HallowStar, Do(DefaultIDStaticIFrames)}, + {ProjectileID.HeatRay, Do(DefaultIDStaticIFrames)}, {ProjectileID.HolyWater, Do(DefaultIDStaticIFrames)}, {ProjectileID.HoneyBomb, Do(DefaultIDStaticIFrames)}, {ProjectileID.HoneyGrenade, Do(DefaultIDStaticIFrames)}, diff --git a/Projectiles/DraedonsArsenal/AugerHoldout.cs b/Projectiles/DraedonsArsenal/AugerHoldout.cs new file mode 100644 index 0000000000..50ddab506d --- /dev/null +++ b/Projectiles/DraedonsArsenal/AugerHoldout.cs @@ -0,0 +1,274 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; +using static Terraria.Player; + + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AugerHoldout : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float attackTimer => ref Projectile.ai[0]; + public Player Owner => Main.player[Projectile.owner]; + public float scaleFx = 1; + public int fireRate => Owner.itemAnimationMax; + public int time = 0; + public bool longSwing => swingCount >= 2; + public int cooldown => -Owner.itemAnimationMax * (Owner.Calamity().buffedAuger ? 2 : longSwing ? 3 : 1); + public float bladeRot = 0; // Rotation of the blade + public int swingCount = 0; // Increases at the start of a swing + public float bladefx = 0; // Scaling on the effects of the blade + // Both checks to make sure sounds/hitboxes only happen once per swing + public bool makeSound = true; + public bool makeHitbox = true; + public int cooldownGiven => (int)(400 / Owner.GetAttackSpeed()); // Cooldown is effected by melee speed, lines up perfectly so you do 10 swings and end in time for a big swing + public float pullFx = 1; // Scaling on the effects of the blade when it's buffed + public bool pressedRight = false; + // Spawns a hitbox to do damage, rather than dealing damage itself + // Theres many reasons this is better, but at the very least it prevents bloating this single projectile's code + public override bool? CanDamage() => false; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 100; + Projectile.friendly = true; + Projectile.DamageType = TrueMeleeDamageClass.Instance; + Projectile.timeLeft = 5; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public void Positioning(Vector2 toMouse) // Hand and holdout positioning + { + Owner.heldProj = Projectile.whoAmI; + Owner.itemTime = Owner.itemAnimation = 2; + Owner.itemRotation = (Projectile.velocity * Owner.direction).ToRotation(); + + Owner.ChangeDir(Math.Sign(toMouse.X)); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, (toMouse.ToRotation() + bladeRot * Owner.direction + MathHelper.PiOver2 * -Owner.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Vector2 handPos = Owner.GetFrontHandPosition(CompositeArmStretchAmount.None, Owner.compositeFrontArm.rotation) + (Owner.compositeFrontArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 9; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, armRotation); + Projectile.velocity = toMouse.RotatedBy(bladeRot * Owner.direction); + Projectile.rotation = Projectile.velocity.ToRotation(); + Projectile.Center = handPos; + } + public void OnSpawn() + { + if (time == 0) + { + scaleFx = Owner.Calamity().buffedAuger ? 1.5f : 1; + attackTimer = cooldown; + if (Owner.Calamity().buffedAuger) + { + swingCount = 1; + } + } + } + public override void AI() + { + if (!Owner.CantUseHoldout(false)) + Projectile.timeLeft = 5; + + Vector2 toMouse = Utils.DirectionTo(Owner.Center, Owner.ClampedMouseWorld()); + + Positioning(toMouse); + + if (Owner.Calamity().mouseRight) + pressedRight = true; + + #region Right Click + if (Projectile.ai[2] > 0) // Right click "gravity well" and buff + { + if (Projectile.ai[2] == 5) + { + time = 0; + attackTimer = 0; + swingCount = -1; + makeHitbox = true; + Projectile.ai[2]--; + pullFx = 5; + } + if (bladefx > 0) + bladefx = 0; + bladeRot = 0; + pullFx = MathHelper.Lerp(pullFx, 1, 0.12f); + + if (attackTimer > fireRate && makeHitbox) + { + Projectile magnetZone = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.ClampedMouseWorld(), Vector2.Zero, ModContent.ProjectileType(), 0, 0, Projectile.owner, 0, 0, 0); + + SoundStyle pull = new("CalamityMod/Sounds/Item/AugerPull"); + SoundEngine.PlaySound(pull with { Volume = 0.9f, Pitch = 0 }, Owner.ClampedMouseWorld()); + Owner.Calamity().buffedAuger = true; + Owner.Calamity().arsenalCooldown = cooldownGiven; + Owner.AddCooldown(ArsenalPower.ID, cooldownGiven); + makeHitbox = false; + } + if (attackTimer >= fireRate * 2) + { + Projectile.Kill(); + return; + } + time++; + attackTimer++; + return; + } + #endregion + + OnSpawn(); + + if (scaleFx > 1 && !Owner.Calamity().buffedAuger) // Fade out the extra size from the big blade + scaleFx = MathHelper.Lerp(scaleFx, 1, 0.15f * Owner.GetAttackSpeed()); + + #region Not Swinging + if (attackTimer < 0) // When the sword isn't swinging + { + if ((pressedRight || Owner.Calamity().mouseRight) && !Owner.Calamity().buffedAuger && Owner.Calamity().arsenalCooldown <= 0) + Projectile.ai[2] = 5; + else + pressedRight = false; + if (longSwing && attackTimer == -1) + { + swingCount = 0; + } + attackTimer++; + time++; + + if (longSwing && attackTimer <= cooldown * 0.35f) + { + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + bladefx = MathHelper.Lerp(bladefx, 0, lerp); + } + else + { + if (!Main.mouseLeft && longSwing && !Owner.Calamity().buffedAuger) + { + Projectile.Kill(); + return; + } + + float lerp = Utils.GetLerpValue((longSwing ? cooldown * 0.35f : cooldown), -1, attackTimer, true); + bladefx = MathHelper.Lerp(bladefx, 1.5f, lerp); + } + if (attackTimer >= cooldown * 0.3f) + { + if (makeSound && Owner.Calamity().buffedAuger) // Windup Sound + { + SoundStyle windup = new("CalamityMod/Sounds/Item/AugerWindup"); + SoundEngine.PlaySound(windup with { Volume = 0.9f, Pitch = 0 }, Projectile.Center); + makeSound = false; + } + } + if (attackTimer == 0) // Reset a few things in prep for the next swing + { + pressedRight = false; + swingCount++; + makeSound = true; + makeHitbox = true; + } + else // Wind up animation in prep for the next swing + { + int swingDir = (swingCount % 2 != 0 ? 1 : -1); + float lerp = Utils.GetLerpValue(cooldown, -1, attackTimer, true); + bladeRot = MathHelper.Lerp(-MathHelper.Pi * swingDir, -MathHelper.PiOver4 * 3 * swingDir, CalamityUtils.EaseInOutExp(lerp, 2f, 2f)); + } + return; + } + #endregion + + if (attackTimer >= fireRate) // Once the swing is done, put it on cooldown + { + attackTimer = cooldown * (Owner.Calamity().buffedAuger ? 3 : 1); + if (Owner.Calamity().buffedAuger) + { + Owner.Calamity().buffedAuger = false; + } + } + else // Do the swing + { + #region Swinging + int swingDir = (swingCount % 2 != 0 ? -1 : 1); + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + bladeRot = MathHelper.Lerp(-MathHelper.PiOver4 * 3 * swingDir, MathHelper.Pi * swingDir, CalamityUtils.EaseInOutExp(lerp, 5f, 3f)); + + if (lerp > 0.5f) // Halfway through make the hitbox and sound + { + if (makeHitbox) + { + SoundStyle swing = Owner.Calamity().buffedAuger ? new("CalamityMod/Sounds/Item/AugerBigSlash") : swingCount % 2 != 0 ? new("CalamityMod/Sounds/Item/AugerSlash1") : new("CalamityMod/Sounds/Item/AugerSlash2"); + SoundEngine.PlaySound(swing with { Volume = Owner.Calamity().buffedAuger ? 1f : 0.7f, Pitch = -0.1f, MaxInstances = 2 }, Projectile.Center); + + int damage = Projectile.damage; + if (Owner.Calamity().buffedAuger) + { + Owner.Calamity().GeneralScreenShakePower = 5f; + damage = (int)(damage * 2.5f); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + toMouse * 20 * (float)Math.Pow(scaleFx, 4), toMouse * 25, ModContent.ProjectileType(), damage, 0, Projectile.owner, 0, swingCount, Owner.Calamity().buffedAuger ? 5 : 0); + makeHitbox = false; + } + } + #endregion + } + time++; + attackTimer++; + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 3) + return false; + + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AugerHoldout").Value; + Texture2D glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AugerHoldoutGlow").Value; + Texture2D blade = ModContent.Request("CalamityMod/Particles/GlowBlade").Value; + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + float randSize = Main.rand.NextFloat(0.8f, 1f); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Owner.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Owner.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + float lerp = Utils.GetLerpValue(0, fireRate - 1, attackTimer, true); + float length = MathHelper.Lerp(0f, 0.1f, CalamityUtils.EaseInOutExp(lerp, 1f, 1f)); + float bladeRotation = drawRotation + MathHelper.PiOver2 * Owner.direction; + Vector2 bladePlaceAdjust = (bladeRotation - MathHelper.PiOver2).ToRotationVector2(); + for (int i = 0; i < 2; i++) // The actual energy blade + Main.EntitySpriteDraw(blade, drawPosition + bladePlaceAdjust * 20, null, (i == 0 ? Effects.ArsenalEffects.ArsenalGaussColor : Color.White) with { A = 0 }, bladeRotation, new Vector2(blade.Width / 2, blade.Height), new Vector2((i == 0 ? 0.2f : 0.1f) * randSize, 0.2f * bladefx) * Projectile.scale * 0.07f * bladefx * scaleFx, SpriteEffects.None); + for (int i = 0; i < 2; i++) // The glow at the "hilt" + Main.EntitySpriteDraw(bloom, drawPosition + bladePlaceAdjust * 20, null, (i == 0 ? Effects.ArsenalEffects.ArsenalGaussColor : Color.White) with { A = 0 }, bladeRotation, bloom.Size() / 2, (Projectile.ai[2] > 0 ? new Vector2(randSize, randSize * (i == 0 ? 1f : 0.9f)) * 0.1f : new Vector2(0.15f * bladefx * randSize, (i == 0 ? 0.1f : 0.05f))) * Projectile.scale * 0.9f * (Projectile.ai[2] > 0 ? pullFx : bladefx) * scaleFx, SpriteEffects.None); + + if (scaleFx > 1) // Extra blade tips for the improved slash + { + for (int b = -2; b <= 2; b++) + { + if (b == 0) b++; + for (int i = 0; i < 2; i++) + { + Main.EntitySpriteDraw(blade, drawPosition + bladePlaceAdjust * 20, null, (i == 0 ? Effects.ArsenalEffects.ArsenalGaussColor : Color.White) with { A = 0 }, bladeRotation + (MathHelper.PiOver4 * 0.55f * b), new Vector2(blade.Width / 2, blade.Height), new Vector2(0.65f * (i == 0 ? 0.1f : 0.05f), 0.09f * (i == 0 ? 1f : 0.9f) * (2 - Math.Abs(b * 0.5f))) * randSize * Projectile.scale * 0.2f * bladefx * (scaleFx - 1), SpriteEffects.None); + } + } + } + Vector2 placeAdjust = (drawRotation + MathHelper.PiOver2).ToRotationVector2() * 2.5f; + Main.EntitySpriteDraw(texture, drawPosition + placeAdjust, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The holdout + + Main.EntitySpriteDraw(glow, drawPosition + placeAdjust, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); // The glow + + return false; + } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + overPlayers.Add(index); + } + } +} diff --git a/Projectiles/DraedonsArsenal/AugerHoldout.png b/Projectiles/DraedonsArsenal/AugerHoldout.png new file mode 100644 index 0000000000..ec5c4b477a Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerHoldout.png differ diff --git a/Projectiles/DraedonsArsenal/AugerHoldoutGlow.png b/Projectiles/DraedonsArsenal/AugerHoldoutGlow.png new file mode 100644 index 0000000000..63a21f6979 Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerHoldoutGlow.png differ diff --git a/Projectiles/DraedonsArsenal/AugerPull.cs b/Projectiles/DraedonsArsenal/AugerPull.cs new file mode 100644 index 0000000000..4362c1686c --- /dev/null +++ b/Projectiles/DraedonsArsenal/AugerPull.cs @@ -0,0 +1,109 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AugerPull : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public int time = 0; + public float sine = 0; + public float shrink = 1; + public int strongTimer = 0; + public bool strong => strongTimer < 10; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 250; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.tileCollide = false; + Projectile.timeLeft = 90; + Projectile.penetrate = -1; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + + public override void AI() + { + if (strongTimer == 0) + { + Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalGaussColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, 0, 1.1f, 0.7f, 30); + GeneralParticleHandler.SpawnParticle(bolt2); + for (int i = 0; i < 20; i++) + { + Vector2 dustVel2 = (Vector2.UnitX).RotatedByRandom(100) * Main.rand.NextFloat(10f, 15.5f); + Dust dust2 = Dust.NewDustPerfect(Projectile.Center + dustVel2.SafeNormalize(Vector2.UnitX) * 360, ModContent.DustType(), -dustVel2 * 1.5f, 0, default, Main.rand.NextFloat(1.2f, 1.8f)); + dust2.noGravity = true; + dust2.fadeIn = 0.3f; + dust2.color = Effects.ArsenalEffects.ArsenalGaussColor; + } + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC target = Main.npc[i]; + if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1) && Vector2.Distance(target.Center, Projectile.Center) < 650) + { + Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX); + target.velocity = moveDir * 20; + target.Center += moveDir * 3f; + } + } + } + + Vector2 dustVel = (Vector2.UnitX).RotatedByRandom(100) * Main.rand.NextFloat(3f, 8.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + dustVel.SafeNormalize(Vector2.UnitX) * 120, Effects.ArsenalEffects.ArsenalGaussDust, -dustVel, 0, default, Main.rand.NextFloat(0.5f, 1f)); + dust.noGravity = true; + dust.fadeIn = 0.05f; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + + if (Projectile.timeLeft > 2) + { + for (int i = 0; i < Main.maxNPCs; i++) + { + NPC target = Main.npc[i]; + if (target != null && target.CanBeMoved(true) && Collision.CanHit(Projectile.Center, 1, 1, target.Center, 1, 1)) + { + if (Vector2.Distance(target.Center, Projectile.Center) > 15 && Vector2.Distance(target.Center, Projectile.Center) < 300) + { + Vector2 moveDir = target.Center.DirectionTo(Projectile.Center).SafeNormalize(Vector2.UnitX); + target.velocity = Vector2.Lerp(target.velocity, moveDir * 18, 0.12f); + target.Center += moveDir * 2f; + } + } + } + } + + Projectile.rotation += 0.05f; + if (shrink > 0) + shrink -= 0.05f; + else + shrink = 1; + + if (!strong) + time++; + strongTimer++; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => false; + public override bool PreDraw(ref Color lightColor) + { + float shrinkFade = Math.Min(Utils.GetLerpValue(1, 0.7f, shrink, true), Utils.GetLerpValue(0f, 0.3f, shrink, true)); + float sine = Math.Abs(MathHelper.Lerp((float)Math.Sin(time * 0.1f / MathHelper.Pi), 0.4f, 0.8f)); + float sine2 = Math.Abs(MathHelper.Lerp((float)Math.Sin(time * 0.3f / MathHelper.Pi), 0.4f, 0.8f)); + float fade = (float)Math.Pow(Utils.GetLerpValue(0, 10, Projectile.timeLeft, true), 3); + float areaScale = (strong ? 1f : 1) * fade; + Texture2D tex2 = ModContent.Request("CalamityMod/Particles/GlowSquareParticleBig").Value; + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * (strong ? 0.5f : 0.3f) * shrinkFade; + + Main.EntitySpriteDraw(tex2, Projectile.Center - Main.screenPosition, null, drawColor, MathHelper.PiOver4 - MathHelper.PiOver2 * sine * 3, tex2.Size() / 2f, (areaScale + sine * 0.5f) * shrink, SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex2, Projectile.Center - Main.screenPosition, null, drawColor, MathHelper.PiOver2 * sine2 * 3, tex2.Size() / 2f, (areaScale - sine2 * 0.5f) * (float)Math.Pow(shrink, 2), SpriteEffects.None, 0); + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/AugerSlash.cs b/Projectiles/DraedonsArsenal/AugerSlash.cs new file mode 100644 index 0000000000..6ead6c5d0c --- /dev/null +++ b/Projectiles/DraedonsArsenal/AugerSlash.cs @@ -0,0 +1,155 @@ +using System; +using CalamityMod.Dusts; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class AugerSlash : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float time => ref Projectile.ai[0]; + public float fade = 1; + public int lifetime = 25; + public Player Owner => Main.player[Projectile.owner]; + public float scaleFx => Projectile.ai[2] == 5 ? 2 : 1; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 120; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Melee; + Projectile.timeLeft = lifetime; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + fade = (float)Math.Pow(Utils.GetLerpValue(lifetime * 0.1f, lifetime * 0.5f, Projectile.timeLeft, true), 4); + if (Projectile.velocity.Length() > 0.1f) + Projectile.velocity *= 0.45f; + int dusts = (int)(30 * scaleFx); + if (time == 1) + { + for (int i = 0; i < dusts; i++) + { + float variance = Utils.GetLerpValue(0, dusts, i, true) * Main.rand.NextFloat(0.9f, 1f); + float rot = MathHelper.Lerp(-0.7f * scaleFx, 0.7f * scaleFx, variance) * Projectile.direction; + float swingDirScale = Projectile.ai[1] == 1 ? (1 - variance) : variance; + float scale = 0.4f + swingDirScale * 2f; + float rotScaling = 1 - Math.Abs(rot); + Vector2 vel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(rot) * (70 / scaleFx + 80 * (float)Math.Pow(rotScaling, 1.5f) * Main.rand.NextFloat(0.85f, 1f)) * scaleFx; + Vector2 finalDustVel = (vel * (float)Math.Pow(rotScaling, 1.5f) + (vel.RotatedBy(-MathHelper.PiOver2 * rot) * 1.5f)) * 0.03f; + Dust s = Dust.NewDustPerfect(Projectile.Center + vel - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 45 * scaleFx, ModContent.DustType(), finalDustVel / scaleFx); + s.scale = scale * scaleFx; + s.noGravity = true; + s.color = Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor, Color.White, Math.Max(0, swingDirScale - 0.35f)); + s.fadeIn = 0.1f + swingDirScale; + } + } + + Lighting.AddLight(Projectile.Center, Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor, Color.White, 0.3f).ToVector3() * 0.7f); + time++; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if ((damageDone <= 2 || (target.life <= 0 && target.realLife == -1)) && Projectile.numHits > 0) + { + Projectile.numHits -= 1; + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (Projectile.ai[2] == 5) + { + foreach (Projectile p in Main.ActiveProjectiles) + { + if (p.type == ModContent.ProjectileType() && p.owner == Projectile.owner) + { + if (p.timeLeft > 2) + p.timeLeft = 2; + } + } + } + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = (Projectile.ai[2] == 5 ? 35 : 14); + target.MoveNPC(launchVel, launchPower, true); + + if (Projectile.ai[2] == 5) + modifiers.SetCrit(); + + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + float minMult = 0.3f; + int hitsToMinMult = 7; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= (Projectile.ai[2] == 5 ? (1f + critDamage) : 1) * damageMult; + + if (Projectile.numHits == 0) + { + SoundStyle hit = new("CalamityMod/Sounds/Item/AugerHit"); + SoundEngine.PlaySound(hit with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = 2 }, target.Center); + } + if (Projectile.numHits < 4) + { + for (int i = 0; i < (14 - Projectile.numHits * 2); i++) + { + float rot = Main.rand.NextFloat(-0.3f, 0.3f); + Dust s = Dust.NewDustPerfect(target.Center, ModContent.DustType(), Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(rot) * (float)Math.Pow(scaleFx, 1.5f) * Main.rand.NextFloat(8, 12) * (1 - Math.Abs(rot))); + s.scale = Main.rand.NextFloat(1.6f, 1.9f) * (1 - Math.Abs(rot)); + s.noGravity = true; + s.color = Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor, Color.White, Main.rand.NextFloat(0, 0.4f)); + s.fadeIn = -0.5f; + if (i % 3 != 0) + { + Dust s2 = Dust.NewDustPerfect(target.Center, Effects.ArsenalEffects.ArsenalGaussDust, Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.6f) * (float)Math.Pow(scaleFx, 1.5f) * Main.rand.NextFloat(5, 10)); + s2.scale = Main.rand.NextFloat(0.9f, 1.4f); + s2.noGravity = true; + s2.color = Effects.ArsenalEffects.ArsenalGaussColor; + } + } + } + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (Projectile.timeLeft <= 10) + return false; + Player Owner = Main.player[Projectile.owner]; + Vector2 start = (time < 2 ? Owner.Center : Projectile.Center); + float scale = (scaleFx > 1 ? 1.5f : 1); + float length = 135 * scale; + float size = 135 * scale; + float _ = float.NaN; + bool hit = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, start + Projectile.velocity.SafeNormalize(Vector2.UnitX) * length, size, ref _); + return (hit); + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D proj = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/AugerSlash").Value; + + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }; + float drawRotation = Projectile.velocity.ToRotation(); + + float lerp = 1 - (float)Math.Pow((Utils.GetLerpValue(lifetime, 0, time, true)), 2f); + float sizeLerp = (float)Math.Pow((Utils.GetLerpValue(lifetime, lifetime * 0.2f, time, true)), 5f); + Vector2 squash = new Vector2(1 + lerp * 0.5f, 1.25f - lerp * 1.1f) * 0.08f * sizeLerp; + Vector2 rotationPoint = new Vector2(proj.Width * 0.85f, proj.Height / 2); + Vector2 drawPosition = Projectile.Center - Main.screenPosition + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 105; + + SpriteEffects spfx = (Projectile.ai[1] != 1 ? SpriteEffects.None : SpriteEffects.FlipVertically); + if (Projectile.direction == -1) + spfx = (Projectile.ai[1] == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically); + Main.EntitySpriteDraw(proj, drawPosition, null, Color.White with { A = 0 } * sizeLerp, drawRotation, rotationPoint, squash * Projectile.scale * scaleFx, spfx); + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/AugerSlash.png b/Projectiles/DraedonsArsenal/AugerSlash.png new file mode 100644 index 0000000000..c2643dcb63 Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerSlash.png differ diff --git a/Projectiles/DraedonsArsenal/AugerSlashAlt.png b/Projectiles/DraedonsArsenal/AugerSlashAlt.png new file mode 100644 index 0000000000..38d9b158cb Binary files /dev/null and b/Projectiles/DraedonsArsenal/AugerSlashAlt.png differ diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittFinger.png b/Projectiles/DraedonsArsenal/CountermeasureMittFinger.png new file mode 100644 index 0000000000..4872bab1bc Binary files /dev/null and b/Projectiles/DraedonsArsenal/CountermeasureMittFinger.png differ diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittFinger2.png b/Projectiles/DraedonsArsenal/CountermeasureMittFinger2.png new file mode 100644 index 0000000000..c5619e167a Binary files /dev/null and b/Projectiles/DraedonsArsenal/CountermeasureMittFinger2.png differ diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs new file mode 100644 index 0000000000..2ee3ebc154 --- /dev/null +++ b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.cs @@ -0,0 +1,557 @@ +using System; +using System.Collections.Generic; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.NPCs; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.Player; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + [PierceResistException] + public class CountermeasureMittHoldout : BaseGunHoldoutProjectile + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override int AssociatedItemID => ModContent.ItemType(); + + public float offsetBase = 0; + public override float MaxOffsetLengthFromArm => offsetBase; + public override float RecoilResolveSpeed => 0.4f; + public override float OffsetXUpwards => 0f; + public override float BaseOffsetY => 0f; + public override float OffsetYDownwards => 0f; + public override float WeaponTurnSpeed => 0.5f; + public bool forcePalm => Projectile.ai[2] != 0; // If you're performing a palm blast or not + public ref float shootingTimer => ref Projectile.ai[0]; + public ref float fireRate => ref Projectile.ai[1]; + public int time = 0; + + // Finger lerps and rotations + #region Fingers + public float rotSpeed = 0; + public float f1l => 0.02f * rotSpeed; // Finger Lerp Speed + public float f1r = 0; // Finger Rotation + public float f1x = 0; // Finger Effects Multiplier + public float f1d = -0.95f; // Finger Aim Direction + public SlotId AudSlot1; // Finger Laser Audio Slot + public float f2l => 0.016f * rotSpeed; + public float f2r = 0; + public float f2x = 0; + public float f2d = -0.95f; + public SlotId AudSlot2; + public float f3l => 0.012f * rotSpeed; + public float f3r = 0; + public float f3x = 0; + public float f3d = -0.95f; + public SlotId AudSlot3; + public float f4l => 0.008f * rotSpeed; + public float f4r = 0; + public float f4x = 0; + public float f4d = -0.95f; + public SlotId AudSlot4; + public float f5l => 0.004f * rotSpeed; + public float f5r = 0; + public float f5x = 0; + public float f5d = -0.95f; + public SlotId AudSlot5; + #endregion + + public int palmAnimTime = 20; // Animation length for the palm attack + public int cooldownGiven = 400; // Arsenal Cooldown from the palm attack + public int attackTime = 100; // Attack cycle length + public int attackCycles = 0; + public bool failedManaCheck = false; + public bool canHit = false; + public float alteredRotationRot = 0.7f; // Alteration to the holdout rotation so it's not directly to the mouse, changes with the attack cycle + public float alteredRotation => Projectile.rotation + (f2r * alteredRotationRot * -Projectile.direction); + public Vector2 palmBlastPos => Owner.Center + alteredRotation.ToRotationVector2() * 55 * Projectile.scale; + public int palmManaCost => HeldItem.mana * 30; + public int hitTimer = 0; + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.penetrate = -1; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.tileCollide = false; + Projectile.ArmorPenetration = 55; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 5; + } + public override void KillHoldoutLogic() + { + + } + public override bool? CanDamage() => null; + public override bool? CanHitNPC(NPC target) + { + return (canHit ? null : false); + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (!canHit) return false; + float realRot = alteredRotation; + Vector2 handPos = Owner.GetBackHandPosition(CompositeArmStretchAmount.None, Owner.compositeBackArm.rotation) + (Owner.compositeBackArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 9; + + // Every laser has collision for the single hitbox, so it works more like a large wide piercing single beam + float beamLength = 1500 * Projectile.scale; + float beamThickness = 20 * Projectile.scale; + float fingerLength = 6 * Projectile.scale; + float _ = float.NaN; + + bool colCheck = false; + + #region 5 Collision Line Checks + for (int t = 0; t < 5; t++) + { + float rot = t switch + { + 1 => f4r * Projectile.direction, + 2 => f3r * Projectile.direction, + 3 => f2r * Projectile.direction, + 4 => f1r * Projectile.direction, + _ => -f5r * 0.3f * Projectile.direction, + }; + float fx = t switch + { + 1 => f4x, 2 => f3x, 3 => f2x, 4 => f1x, _ => f5x, + }; + + Vector2 basePosition = handPos + alteredRotation.ToRotationVector2() * (t == 0 ? 2.5f : 3.3f) * Projectile.scale + (alteredRotation + rot).ToRotationVector2() * fingerLength + (alteredRotation + MathHelper.PiOver2 * -Projectile.direction).ToRotationVector2() * (t == 0 ? -3 : 3) * Projectile.scale; + if (fx > 0.2f) + colCheck = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), basePosition, basePosition + (realRot + rot).ToRotationVector2() * (fingerLength + beamLength), beamThickness, ref _); + if (colCheck) + t = 5; + } + #endregion + + return (colCheck); + } + public void EndSounds() + { + if (SoundEngine.TryGetActiveSound(AudSlot1, out var s1)) + s1?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot2, out var s2)) + s2?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot3, out var s3)) + s3?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot4, out var s4)) + s4?.Stop(); + if (SoundEngine.TryGetActiveSound(AudSlot5, out var s5)) + s5?.Stop(); + } + public override void HoldoutAI() + { + if (hitTimer > 0) + hitTimer--; + + Owner.SetCompositeArmBack(true, Player.CompositeArmStretchAmount.Full, (alteredRotation + MathHelper.PiOver2 * -Projectile.direction) + (Owner.direction == -1 ? MathHelper.Pi : 0)); + + Vector2 handPos = Owner.GetBackHandPosition(CompositeArmStretchAmount.None, Owner.compositeBackArm.rotation) + (Owner.compositeBackArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 4; + float armRotation = (Utils.DirectionTo(Owner.Center, handPos).ToRotation() - MathHelper.PiOver2) * Owner.gravDir + (Owner.gravDir == -1 ? MathHelper.Pi : 0f); + Owner.SetCompositeArmFront(true, FrontArmStretch, armRotation + ExtraFrontArmRotation * Projectile.direction); + + // Below you see the sacrifice of coding 5 individual fingers + if (time == 0 && forcePalm) + { + rotSpeed = 7f; + alteredRotationRot = 0; + } + if (time == 1) + rotSpeed = 0; + + if (forcePalm) alteredRotationRot = MathHelper.Lerp(alteredRotationRot, 0, 0.1f); + else if (shootingTimer > -10) alteredRotationRot = MathHelper.Lerp(alteredRotationRot, 0.7f, 0.1f); + + #region The Price of 5 Fingers + float fxPower = 5; + if (!forcePalm) + { + if (shootingTimer == 10) f1d *= -1; + if (shootingTimer == 20) f2d *= -1; + if (shootingTimer == 30) f3d *= -1; + if (shootingTimer == 40) f4d *= -1; + if (shootingTimer == 50) f5d *= -1; + if (attackCycles == 0) + { + if (shootingTimer == 10) f1x = fxPower; + if (shootingTimer == 20) f2x = fxPower; + if (shootingTimer == 30) f3x = fxPower; + if (shootingTimer == 40) f4x = fxPower; + if (shootingTimer == 50) f5x = fxPower; + } + } + + f1r = MathHelper.Lerp(f1r, f1d, f1l * rotSpeed); + f2r = MathHelper.Lerp(f2r, f2d * 0.775f, f2l * rotSpeed); + f3r = MathHelper.Lerp(f3r, f3d * 0.55f, f3l * rotSpeed); + f4r = MathHelper.Lerp(f4r, f4d * 0.325f, f4l * rotSpeed); + f5r = MathHelper.Lerp(f5r, f5d * 2.3f - 2, f5l * 4 * rotSpeed); + + float goalValue = (canHit ? 1 : 0); + float lerpPower = (forcePalm ? 0.35f : canHit ? 0.2f : 0.25f); + f1x = MathHelper.Lerp(f1x, (f1x > 0.05f ? goalValue : 0), lerpPower); + f2x = MathHelper.Lerp(f2x, (f2x > 0.05f ? goalValue : 0), lerpPower); + f3x = MathHelper.Lerp(f3x, (f3x > 0.05f ? goalValue : 0), lerpPower); + f4x = MathHelper.Lerp(f4x, (f4x > 0.05f ? goalValue : 0), lerpPower); + f5x = MathHelper.Lerp(f5x, (f5x > 0.05f ? goalValue : 0), lerpPower); + + float sine = (float)Math.Sin(time * 0.2f / MathHelper.Pi) * 0.1f; + float maxVol = 0.4f; + float minPitch = -0.8f; + if (SoundEngine.TryGetActiveSound(AudSlot1, out var f1s) && f1s.IsPlaying) + { + f1s.Position = Projectile.Center; + f1s.Pitch = Utils.Remap(f1x, 0.7f, 1, 0f + minPitch, 0f) + sine; + f1s.Volume = Utils.Remap(f1x, 0, 1, 0f, maxVol) * 100; + } + else if (f1x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld1"); + AudSlot1 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot2, out var f2s) && f2s.IsPlaying) + { + f2s.Position = Projectile.Center; + f2s.Pitch = Utils.Remap(f2x, 0.7f, 1, 0.2f + minPitch, 0.2f) + sine; + f2s.Volume = Utils.Remap(f2x, 0, 1, 0f, maxVol) * 100; + } + else if (f2x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld2"); + AudSlot2 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot3, out var f3s) && f3s.IsPlaying) + { + f3s.Position = Projectile.Center; + f3s.Pitch = Utils.Remap(f3x, 0.7f, 1, 0.4f + minPitch, 0.4f) + sine; + f3s.Volume = Utils.Remap(f3x, 0, 1, 0f, maxVol) * 100; + } + else if (f3x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld3"); + AudSlot3 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot4, out var f4s) && f4s.IsPlaying) + { + f4s.Position = Projectile.Center; + f4s.Pitch = Utils.Remap(f4x, 0.7f, 1, 0.6f + minPitch, 0.6f) + sine; + f4s.Volume = Utils.Remap(f4x, 0, 1, 0f, maxVol) * 100; + } + else if (f4x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld4"); + AudSlot4 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + if (SoundEngine.TryGetActiveSound(AudSlot5, out var f5s) && f5s.IsPlaying) + { + f5s.Position = Projectile.Center; + f5s.Pitch = Utils.Remap(f5x, 0.7f, 1, 0.8f + minPitch, 0.8f) + sine; + f5s.Volume = Utils.Remap(f5x, 0, 1, 0f, maxVol) * 100; + } + else if (f5x > 1) + { + SoundStyle beam = new("CalamityMod/Sounds/Item/MittWelding/Weld5"); + AudSlot5 = SoundEngine.PlaySound(beam with { Volume = 0.01f, Pitch = 0, IsLooped = true }, Projectile.Center); + } + #endregion + + Lighting.AddLight(Projectile.Center, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, 0.3f).ToVector3() * MathHelper.Clamp((f1x + f2x + f3x + f4x + f5x - 4f) * 2f, 0f, 0.7f)); + Projectile.scale = MathHelper.Lerp(Projectile.scale, 1, 0.1f); + + if (time == 0) + { + if (!forcePalm) + shootingTimer = -40; + if (Projectile.ai[2] != 0) + Projectile.ai[2] = palmAnimTime; + fireRate = attackTime; + OffsetLengthFromArm = offsetBase; + } + if (shootingTimer < 0) + { + canHit = false; + // Light cooldown before firing + if (rotSpeed > 0) + rotSpeed -= 0.05f; + + if (shootingTimer == -1 || forcePalm) + { + if ((!Main.mouseLeft && !forcePalm) || failedManaCheck) + { + EndSounds(); + Projectile.Kill(); + return; + } + + attackCycles = 0; + fireRate = attackTime; + } + + } + if (Owner.Calamity().mouseRight && Owner.Calamity().arsenalCooldown <= 0 && !forcePalm && !failedManaCheck) + { + Projectile.ai[2] = 5; + shootingTimer = 0; + } + if (forcePalm) + { + if (!Owner.CheckMana(HeldItem, palmManaCost, false, false)) + { + failedManaCheck = true; + SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); + Projectile.ai[2] = 0; + return; + } + rotSpeed = 5; + + f1d = -Math.Abs(f1d); f2d = -Math.Abs(f2d); f3d = -Math.Abs(f3d); f4d = -Math.Abs(f4d); f5d = -Math.Abs(f5d); + + if (shootingTimer <= palmAnimTime) + { + if (shootingTimer == 1) + { + SoundStyle aud = new("CalamityMod/Sounds/Item/MittReadyPalm"); + SoundEngine.PlaySound(aud with { Volume = 1f, Pitch = 0 }, Projectile.Center); + } + if (shootingTimer == (int)(palmAnimTime * 0.8f)) + { + SoundStyle aud = new("CalamityMod/Sounds/Item/MittThrust"); + SoundEngine.PlaySound(aud with { Volume = 1f, Pitch = 0 }, Projectile.Center); + } + if (shootingTimer == palmAnimTime) + { + Shoot(); + Projectile.ai[2] = 0; + shootingTimer = -30; + rotSpeed = 0; + } + Lighting.AddLight(palmBlastPos, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, 0.3f).ToVector3() * (float)Math.Pow(Utils.GetLerpValue(0, palmAnimTime, shootingTimer), 2)); + } + if (shootingTimer > palmAnimTime * 0.8f) + Projectile.scale *= 1.25f; + canHit = false; + } + else if (shootingTimer >= 0) + { + if (!Main.mouseLeft) + shootingTimer = fireRate; + + if (shootingTimer < fireRate && !failedManaCheck) + { + canHit = true; + if (time % 3 == 0) + { + if (Owner.CheckMana(HeldItem, -1, true, false)) + { + if (rotSpeed < 1.1f) + rotSpeed += 0.1f; + } + else + { + SoundEngine.PlaySound(SoundID.MaxMana with { Pitch = -0.5f }, Projectile.Center); + failedManaCheck = true; + } + } + } + else + { + if (attackCycles < 1 && !failedManaCheck) + { + attackCycles++; + shootingTimer = 0; + } + else + shootingTimer = -30; + } + } + + time++; + shootingTimer++; + } + public void Shoot() + { + bool hitAnything = false; + bool oneFx = true; + float damageMult = 25; + foreach (NPC npc in Main.ActiveNPCs) + { + if (!npc.dontTakeDamage && (Main.zenithWorld || Utils.Distance(npc.Center, palmBlastPos) <= (80 + Math.Max(npc.width / 2, npc.height / 2)))) + { + hitAnything = true; + Vector2 pos = Vector2.Lerp(npc.Center, Projectile.Center, 0.35f); + Vector2 vel = Vector2.Lerp(Projectile.Center.DirectionTo(npc.Center), alteredRotation.ToRotationVector2(), 0.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel, ModContent.ProjectileType(), (int)(Projectile.damage * damageMult), 0, Projectile.owner, 0, npc.whoAmI); + if (oneFx) + { + for (int i = 0; i < 25; i++) + { + Dust dust = Dust.NewDustPerfect(pos, Effects.ArsenalEffects.ArsenalLaserDust, vel.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.4f) * Main.rand.NextFloat(10f, 35f), 0, default, Main.rand.NextFloat(1f, 1.8f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + dust.alpha = 100; + dust.fadeIn = 20; + } + for (int i = 0; i < 2; i++) + { + Particle pulse = new CustomSpark(pos, vel.SafeNormalize(Vector2.UnitX) * 1, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 20, 0.08f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(2f, 0.7f), shrinkSpeed: -0.1f); + GeneralParticleHandler.SpawnParticle(pulse); + Particle pulse1 = new CustomSpark(pos, vel.SafeNormalize(Vector2.UnitX) * 15, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 18, 0.06f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(2f, 0.7f), shrinkSpeed: -0.1f); + GeneralParticleHandler.SpawnParticle(pulse1); + Particle pulse2 = new CustomSpark(pos, vel.SafeNormalize(Vector2.UnitX) * 25, "CalamityMod/Particles/HighResHollowCircleHardEdgeAlt", false, 16, 0.04f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(2f, 0.7f), shrinkSpeed: -0.1f); + GeneralParticleHandler.SpawnParticle(pulse2); + } + oneFx = false; + } + damageMult -= 6; + if (damageMult < 1) + damageMult = 1; + } + } + if (hitAnything && Owner.CheckMana(HeldItem, palmManaCost, true, false)) + { + Owner.Calamity().arsenalCooldown = cooldownGiven; + Owner.AddCooldown(ArsenalPower.ID, cooldownGiven); + + SoundStyle aud = new("CalamityMod/Sounds/Item/MittHit"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(aud with { Volume = 0.8f, Pitch = 0, MaxInstances = 2 }, Projectile.Center); + Owner.Calamity().GeneralScreenShakePower = 8f; + } + else + { + Owner.Calamity().arsenalCooldown = (int)(cooldownGiven / 10); + Owner.AddCooldown(ArsenalPower.ID, (int)(cooldownGiven / 10)); + + for (int i = 0; i < 15; i++) + { + Dust dust = Dust.NewDustPerfect(palmBlastPos, ModContent.DustType(), Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(MathHelper.TwoPi) * Main.rand.NextFloat(4f, 7f), 0, default, Main.rand.NextFloat(0.7f, 0.85f)); + dust.noGravity = false; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + } + for (int i = 0; i < 2; i++) + { + Particle bloom = new CustomSpark(palmBlastPos, Vector2.Zero, "CalamityMod/Particles/BloomCircle", false, 15, 0.5f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(1f, 1f), true, true); + GeneralParticleHandler.SpawnParticle(bloom); + } + SoundStyle aud = new("CalamityMod/Sounds/Item/MittFail"); + SoundEngine.PlaySound(aud with { Volume = 1f, Pitch = 0 }, Projectile.Center); + } + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + if (hitTimer == 0) + { + for (int i = 0; i < 3; i++) + { + Dust dust = Dust.NewDustPerfect(target.Center, Effects.ArsenalEffects.ArsenalLaserDust, Owner.Center.DirectionTo(target.Center).RotatedByRandom(0.3f) * Main.rand.NextFloat(9f, 13f), 0, default, Main.rand.NextFloat(0.6f, 1.1f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + dust.alpha = 100; + dust.fadeIn = 10; + } + hitTimer = Projectile.localNPCHitCooldown; + } + else + { + Dust dust = Dust.NewDustPerfect(target.Center, Effects.ArsenalEffects.ArsenalLaserDust, Owner.Center.DirectionTo(target.Center).RotatedByRandom(0.2f) * Main.rand.NextFloat(6f, 9f), 0, default, Main.rand.NextFloat(0.3f, 0.7f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalLaserColor; + dust.alpha = 100; + dust.fadeIn = 10; + modifiers.SourceDamage *= 0.2f; + } + } + public override bool PreDraw(ref Color lightColor) + { + Vector2 handPos = Owner.GetBackHandPosition(CompositeArmStretchAmount.None, Owner.compositeBackArm.rotation) + (Owner.compositeBackArm.rotation + MathHelper.PiOver2).ToRotationVector2() * 9 * Projectile.scale; + Projectile.Center = handPos; + + if (time < 2) + return false; + + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/CountermeasureMittHoldout").Value; + + Texture2D finger = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/CountermeasureMittFinger2").Value; + Texture2D laser = ModContent.Request("CalamityMod/Particles/BloomLineFade").Value; + Texture2D laser2 = ModContent.Request("CalamityMod/Particles/BloomLineThick").Value; + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + Texture2D diamond = ModContent.Request("CalamityMod/Particles/SquareRotated").Value; + + Vector2 drawPosition = handPos - Main.screenPosition; + Vector2 vel = alteredRotation.ToRotationVector2(); + + float randSize = Main.rand.NextFloat(0.8f, 1.3f); + float fadeIn = (float)Math.Pow(Utils.GetLerpValue(0, palmAnimTime, shootingTimer), 2); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = alteredRotation + (Projectile.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + float exRot = (Projectile.direction == -1 ? MathHelper.PiOver2 : 0); + SpriteEffects flipSprite = Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + float thrustCuttoff = palmAnimTime * 0.8f; + float pullBack = MathHelper.Lerp(0.2f, 1f, (float)Math.Pow(Utils.GetLerpValue(thrustCuttoff, 0, shootingTimer, true), 4)); + float pushOut = MathHelper.Lerp(0.2f, 1.5f, (float)Math.Pow(Utils.GetLerpValue(thrustCuttoff, palmAnimTime, shootingTimer, true), 5)); + float thrustMult = (float)(forcePalm ? (shootingTimer <= thrustCuttoff ? pullBack : pushOut) : 1); + Vector2 thrustAddition = vel * 10 * thrustMult - vel * 10; + + Main.EntitySpriteDraw(texture, drawPosition + thrustAddition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + for (int i = 0; i < 5; i++) + { + float fingerLength = 3f * Projectile.scale; + Vector2 fingerScale = new Vector2(1f, 1f) * Projectile.scale; + Vector2 fingerOrgin = new Vector2(0, finger.Height / 2); + + float rot = i switch + { + 1 => f4r * Projectile.direction, + 2 => f3r * Projectile.direction, + 3 => f2r * Projectile.direction, + 4 => f1r * Projectile.direction, + _ => -f5r * 0.3f * Projectile.direction, + }; + float fx = i switch + { + 1 => f4x, 2 => f3x, 3 => f2x, 4 => f1x, _ => f5x, + }; + Color fingerColor = Color.Lerp(drawColor, Color.Black, (4 - i) * 0.2f); + if (i == 0) + { + fingerScale = new Vector2(0.9f, 1f) * Projectile.scale; + fingerLength = 1f * Projectile.scale; + fingerColor = drawColor; + } + + Vector2 basePosition = handPos + vel * (i == 0 ? 2.5f : 3.3f) * Projectile.scale + thrustAddition + (alteredRotation + rot).ToRotationVector2() * fingerLength + (alteredRotation + MathHelper.PiOver2 * -Projectile.direction).ToRotationVector2() * (i == 0 ? -3 : 3) * Projectile.scale; + Main.EntitySpriteDraw(finger, basePosition - Main.screenPosition, null, fingerColor, alteredRotation + rot, fingerOrgin, fingerScale, SpriteEffects.None); + + Vector2 velocity = (alteredRotation + rot).ToRotationVector2(); + Main.EntitySpriteDraw(laser, basePosition - Main.screenPosition + velocity * 545 * Projectile.scale, null, Effects.ArsenalEffects.ArsenalLaserColor with { A = 0 } * fx, velocity.ToRotation() + MathHelper.PiOver2, laser.Size() / 2, new Vector2(2.5f * randSize * fx, 55f) * Projectile.scale * 0.01f, SpriteEffects.FlipVertically); + Main.EntitySpriteDraw(laser2, basePosition - Main.screenPosition + velocity * 545 * Projectile.scale, null, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, 0.3f) with { A = 0 } * fx, velocity.ToRotation() + MathHelper.PiOver2, laser2.Size() / 2, new Vector2(0.4f * Math.Min(fx, 1), 55f) * Projectile.scale * 0.01f, SpriteEffects.FlipVertically); + + for (int y = 0; y < 2; y++) + Main.EntitySpriteDraw(bloom, basePosition - Main.screenPosition + velocity * 7 * Projectile.scale, null, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, y) with { A = 0 } * (fx - 1), velocity.ToRotation() + MathHelper.PiOver2, bloom.Size() / 2, new Vector2(2 + 0.05f * (fx + 25), 1) * Projectile.scale * MathHelper.Lerp(fx, 1, 0.7f) * (0.03f - 0.01f * y), SpriteEffects.FlipVertically); + } + if (forcePalm) + { + for (int y = 0; y < 8; y++) + Main.EntitySpriteDraw(bloom, palmBlastPos - Main.screenPosition + thrustAddition, null, Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, y * 0.1f) with { A = 0 } * fadeIn * 0.25f, alteredRotation, bloom.Size() / 2, new Vector2(1f, 1f) * Projectile.scale * (0.3f - 0.02f * y) * randSize, SpriteEffects.FlipVertically); + } + return false; + } + public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) + { + behindNPCsAndTiles.Add(index); + } + } +} diff --git a/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.png b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.png new file mode 100644 index 0000000000..389b6646b7 Binary files /dev/null and b/Projectiles/DraedonsArsenal/CountermeasureMittHoldout.png differ diff --git a/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs new file mode 100644 index 0000000000..fd31cc8a9b --- /dev/null +++ b/Projectiles/DraedonsArsenal/CountermeasurePalmBlast.cs @@ -0,0 +1,93 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class CountermeasurePalmBlast : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public float fade => (float)Math.Pow(Utils.GetLerpValue(0, 13, Projectile.timeLeft, true), 4); + public bool onSpawn = true; + private NPC targeted = null; + public override void SetDefaults() + { + Projectile.width = 150; + Projectile.height = 150; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.penetrate = -1; + Projectile.timeLeft = 15; + Projectile.tileCollide = false; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + + public override void AI() + { + Lighting.AddLight(Projectile.Center, Effects.ArsenalEffects.ArsenalLaserColor.ToVector3() * 0.5f); + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (Projectile.ai[1] != -5) + targeted = Main.npc[(int)Projectile.ai[1]]; + if (targeted == null || !targeted.active) + { + targeted = Projectile.Center.ClosestNPCAt(150); + Projectile.ai[1] = -5; + } + if (time == 0) + { + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 25; + targeted.MoveNPC(launchVel, launchPower, true); + + Particle bloom = new CustomSpark(Projectile.Center, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, "CalamityMod/Particles/BloomCircle", false, 12, 0.7f, Effects.ArsenalEffects.ArsenalLaserColor, new Vector2(1f, 3f), true, true, shrinkSpeed: -0.5f, extraRotation: MathHelper.PiOver2); + GeneralParticleHandler.SpawnParticle(bloom); + } + time++; + } + + public override bool? CanHitNPC(NPC target) => (target == targeted) ? null : false; + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + float minMult = 0.25f; + int hitsToMinMult = 7; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + modifiers.SourceDamage *= damageMult + critDamage; + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 40; + target.MoveNPC(launchVel, launchPower, true); + } + public override bool PreDraw(ref Color lightColor) + { + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + Texture2D beam = ModContent.Request("CalamityMod/Particles/BloomLineFade").Value; + Texture2D bloom = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + float completion = Utils.GetLerpValue(15, 0, time); + for (int i = 0; i < 6; i++) + { + Color orbColor = Color.Lerp(Effects.ArsenalEffects.ArsenalLaserColor, Color.White, i * 0.04f) with { A = 0 } * 0.8f; + float scale = Projectile.scale * (0.05f + i * 0.01f) * 3; + + Main.EntitySpriteDraw(beam, Projectile.Center - Main.screenPosition, null, orbColor, Projectile.rotation, new Vector2(beam.Width / 2, beam.Height), new Vector2(0.3f * fade, 2 * completion) * scale, SpriteEffects.None); + Main.EntitySpriteDraw(bloom, Projectile.Center - Main.screenPosition, null, orbColor, Projectile.rotation + MathHelper.PiOver2, bloom.Size() * 0.5f, new Vector2(0.5f, 1 + 2 * completion) * scale * 3 * fade, SpriteEffects.None); + } + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs b/Projectiles/DraedonsArsenal/GatlingLaserProj.cs deleted file mode 100644 index afe5e4399e..0000000000 --- a/Projectiles/DraedonsArsenal/GatlingLaserProj.cs +++ /dev/null @@ -1,165 +0,0 @@ -using System; -using CalamityMod.Items; -using CalamityMod.Items.Weapons.DraedonsArsenal; -using Microsoft.Xna.Framework; -using ReLogic.Utilities; -using Terraria; -using Terraria.Audio; -using Terraria.Localization; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.DraedonsArsenal -{ - public class GatlingLaserProj : ModProjectile - { - public override LocalizedText DisplayName => CalamityUtils.GetItemName(); - private SlotId gatlingLaserLoopID; - private bool fireLasers = false; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - } - - public override void SetDefaults() - { - Projectile.width = 24; - Projectile.height = 58; - Projectile.friendly = true; - Projectile.penetrate = -1; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.DamageType = DamageClass.Magic; - } - - public override void AI() - { - Projectile.frameCounter++; - if (Projectile.frameCounter >= 13) - { - Projectile.frameCounter = 10; - Projectile.frame++; - if (Projectile.frame >= Main.projFrames[Type]) - Projectile.frame = 0; - } - - if (SoundEngine.TryGetActiveSound(gatlingLaserLoopID, out var ShootingSound) && ShootingSound.IsPlaying) - ShootingSound.Position = Projectile.Center; - Player player = Main.player[Projectile.owner]; - Vector2 playerRotation = player.RotatedRelativePoint(player.MountedCenter, true); - if (Projectile.type == ModContent.ProjectileType()) - { - if (Projectile.ai[0] < 5f) - Projectile.ai[0] += 1f; - - if (Projectile.ai[0] > 4f) - Projectile.ai[0] = 2f; - - // The Gatling Laser shoots every other frame (effective use time of 2). - int fireRate = 2; - Projectile.ai[1] += 1f; - bool shootThisFrame = false; - if (Projectile.ai[1] >= fireRate) - { - Projectile.ai[1] = 0f; - shootThisFrame = true; - } - - if (Projectile.soundDelay <= 0) - { - Projectile.soundDelay = fireRate * 6; - if (Projectile.ai[0] != 1f) - { - fireLasers = true; - Projectile.soundDelay *= 6; - gatlingLaserLoopID = SoundEngine.PlaySound(GatlingLaser.FireLoopSound, Projectile.Center); - } - } - if (shootThisFrame && Main.myPlayer == Projectile.owner && fireLasers) - { - Item gatling = player.ActiveItem(); - - // This grabs the weapon's current damage, taking current charge level into account. - int currentDamage = player.GetWeaponDamage(gatling); - - bool stillInUse = !player.CantUseHoldout(); - - // This both checks if the player has sufficient mana and consumes it if they do. - // If this is false, the Gatling Laser stops functioning. - bool hasMana = player.CheckMana(gatling, -1, true, false); - - // Checks if the Gatling Laser has sufficient charge to fire. If this is false, it stops functioning. - CalamityGlobalItem modItem = gatling.Calamity(); - bool hasCharge = modItem.Charge >= GatlingLaser.HoldoutChargeUse; - - if (stillInUse && hasMana && hasCharge) - { - float scaleFactor = player.ActiveItem().shootSpeed * Projectile.scale; - Vector2 laserDirection = playerRotation; - Vector2 aimDirection = Main.screenPosition + new Vector2(Main.mouseX, Main.mouseY) - laserDirection; - if (player.gravDir == -1f) - { - aimDirection.Y = Main.screenHeight - Main.mouseY + Main.screenPosition.Y - laserDirection.Y; - } - Vector2 projVelocity = Vector2.Normalize(aimDirection); - if (float.IsNaN(projVelocity.X) || float.IsNaN(projVelocity.Y)) - { - projVelocity = -Vector2.UnitY; - } - projVelocity *= scaleFactor; - if (projVelocity.X != Projectile.velocity.X || projVelocity.Y != Projectile.velocity.Y) - { - Projectile.netUpdate = true; - } - Projectile.velocity = projVelocity; - int type = ModContent.ProjectileType(); - float velocity = 3f; - laserDirection = Projectile.Center; - Vector2 spinningpoint = Vector2.Normalize(Projectile.velocity) * velocity; - - double spread = Math.PI / 32D; - spinningpoint = spinningpoint.RotatedBy(Main.rand.NextDouble() * 2D * spread - spread); - - if (float.IsNaN(spinningpoint.X) || float.IsNaN(spinningpoint.Y)) - { - spinningpoint = -Vector2.UnitY; - } - Vector2 projVelocitySpread = new Vector2(spinningpoint.X, spinningpoint.Y); - if (projVelocitySpread.Length() > 5f) - { - projVelocitySpread.Normalize(); - projVelocitySpread *= 5f; - } - float SpeedX = projVelocitySpread.X + Main.rand.Next(-1, 2) * 0.005f; - float SpeedY = projVelocitySpread.Y + Main.rand.Next(-1, 2) * 0.005f; - float ai0 = Projectile.ai[0] - 2f; // 0, 1, or 2 - - // Use charge when firing a laser. - modItem.Charge -= GatlingLaser.HoldoutChargeUse; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserDirection.X, laserDirection.Y, SpeedX, SpeedY, type, currentDamage, Projectile.knockBack, Projectile.owner, ai0, 0f); - } - else - { - ActiveSound result; - if (SoundEngine.TryGetActiveSound(gatlingLaserLoopID, out result)) - result.Stop(); - - SoundEngine.PlaySound(GatlingLaser.FireEndSound, Projectile.Center); - Projectile.Kill(); - } - } - } - Projectile.position = player.RotatedRelativePoint(player.MountedCenter, true) - Projectile.Size / 2f; - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - Projectile.spriteDirection = Projectile.direction; - Projectile.timeLeft = 2; - player.ChangeDir(Projectile.direction); - player.heldProj = Projectile.whoAmI; - player.itemTime = 2; - player.itemAnimation = 2; - player.itemRotation = (float)Math.Atan2(Projectile.velocity.Y * Projectile.direction, Projectile.velocity.X * Projectile.direction); - } - - public override bool? CanDamage() => false; - } -} diff --git a/Projectiles/DraedonsArsenal/GatlingLaserProj.png b/Projectiles/DraedonsArsenal/GatlingLaserProj.png deleted file mode 100644 index c4b477bdc8..0000000000 Binary files a/Projectiles/DraedonsArsenal/GatlingLaserProj.png and /dev/null differ diff --git a/Projectiles/DraedonsArsenal/GatlingLaserShot.cs b/Projectiles/DraedonsArsenal/GatlingLaserShot.cs deleted file mode 100644 index f1292b9b35..0000000000 --- a/Projectiles/DraedonsArsenal/GatlingLaserShot.cs +++ /dev/null @@ -1,137 +0,0 @@ -using System; -using CalamityMod.Particles; -using Microsoft.Xna.Framework; -using ReLogic.Utilities; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.DraedonsArsenal -{ - public class GatlingLaserShot : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Misc"; - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - private int dust = 182; - private Player Owner => Main.player[Projectile.owner]; - - private int Time = 0; - - public override void SetDefaults() - { - Projectile.width = 2; - Projectile.height = 2; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Magic; - Projectile.penetrate = 1; - Projectile.extraUpdates = 100; - Projectile.timeLeft = 600; - } - - public override void AI() - { - Time++; - Lighting.AddLight(Projectile.Center, 0.2f, 0f, 0f); - if (Projectile.timeLeft % 11 == 0 && Time > 15 && Time < 460) - { - SparkParticle spark = new SparkParticle(Projectile.Center, Projectile.velocity * 0.01f, false, 6, 1.7f, Color.Red); - GeneralParticleHandler.SpawnParticle(spark); - } - if (Projectile.timeLeft % 4 == 0 && Time > 15 && Time < 460) - { - SparkParticle spark2 = new SparkParticle(Projectile.Center, Projectile.velocity * 0.01f, false, 6, 0.4f, Color.White); - GeneralParticleHandler.SpawnParticle(spark2); - } - } - - public override void OnKill(int timeLeft) - { - int height = 20; - Projectile.position = Projectile.Center; - Projectile.width = Projectile.height = height; - Projectile.Center = Projectile.position; - Projectile.damage = 0; - - LaserBurst(2.4f, 4.2f); // 60 dusts - - int inc; - for (int i = 0; i < 100; i = inc + 1) - { - int gatlingDust = Dust.NewDust(Projectile.Center, 6, 6, dust, 0f, 0f, 100, default, 1f); - float dustVelX = Main.dust[gatlingDust].velocity.X; - float dustVelY = Main.dust[gatlingDust].velocity.Y; - - if (dustVelX == 0f && dustVelY == 0f) - dustVelX = 1f; - - float dustVelocity = (float)Math.Sqrt(dustVelX * dustVelX + dustVelY * dustVelY); - dustVelocity = 4f / dustVelocity; - dustVelX *= dustVelocity; - dustVelY *= dustVelocity; - - Dust dust2 = Main.dust[gatlingDust]; - dust2.velocity *= 0.5f; - dust2.velocity.X = dust2.velocity.X + dustVelX; - dust2.velocity.Y = dust2.velocity.Y + dustVelY; - dust2.scale = 0.66f; - dust2.noGravity = true; - - inc = i; - } - } - - private void LaserBurst(float speed1, float speed2) - { - float angleRandom = 0.05f; - - int inc; - for (int j = 0; j < 4; j = inc + 1) - { - float dustSpeed = Main.rand.NextFloat(speed1, speed2); - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - int burstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 200, default, 0.9f); - Main.dust[burstDust].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; - Main.dust[burstDust].noGravity = true; - - Dust dust2 = Main.dust[burstDust]; - dust2.velocity *= 3f; - dust2 = Main.dust[burstDust]; - - burstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 100, default, 0.66f); - Main.dust[burstDust].position = Projectile.Center + Vector2.UnitY.RotatedByRandom(MathHelper.Pi) * (float)Main.rand.NextDouble() * Projectile.width / 2f; - - dust2 = Main.dust[burstDust]; - dust2.velocity *= 2f; - - Main.dust[burstDust].noGravity = true; - Main.dust[burstDust].fadeIn = 1f; - Main.dust[burstDust].color = Color.Crimson * 0.5f; - - dust2 = Main.dust[burstDust]; - - inc = j; - } - for (int k = 0; k < 2; k = inc + 1) - { - float dustSpeed = Main.rand.NextFloat(speed1, speed2); - Vector2 dustVel = new Vector2(dustSpeed, 0.0f).RotatedBy(Projectile.velocity.ToRotation()); - dustVel = dustVel.RotatedBy(-angleRandom); - dustVel = dustVel.RotatedByRandom(2.0f * angleRandom); - - int moreBurstDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dust, dustVel.X, dustVel.Y, 0, default, 1.2f); - Main.dust[moreBurstDust].position = Projectile.Center + Vector2.UnitX.RotatedByRandom(MathHelper.Pi).RotatedBy(Projectile.velocity.ToRotation()) * Projectile.width / 3f; - Main.dust[moreBurstDust].noGravity = true; - - Dust dust2 = Main.dust[moreBurstDust]; - dust2.velocity *= 0.5f; - dust2 = Main.dust[moreBurstDust]; - - inc = k; - } - } - } -} diff --git a/Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs b/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs similarity index 98% rename from Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs rename to Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs index 4e18c7eadf..e1c2f33af3 100644 --- a/Projectiles/DraedonsArsenal/HolofiberImmolatorHoldout.cs +++ b/Projectiles/DraedonsArsenal/HolofibreImmolatorHoldout.cs @@ -11,10 +11,10 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.DraedonsArsenal { - public class HolofiberImmolatorHoldout : BaseGunHoldoutProjectile + public class HolofibreImmolatorHoldout : BaseGunHoldoutProjectile { public new string LocalizationCategory => "Projectiles.Misc"; - public override int AssociatedItemID => ModContent.ItemType(); + public override int AssociatedItemID => ModContent.ItemType(); public override float MaxOffsetLengthFromArm => 15f; public override float OffsetXUpwards => -0f; public override float BaseOffsetY => -0f; @@ -167,8 +167,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal float fade = Utils.GetLerpValue(chargeMax / 3, chargeMax, CurrentChargingFrames, true); - Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolator").Value; - Texture2D glowTexture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofiberImmolatorGlow").Value; + Texture2D texture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofibreImmolator").Value; + Texture2D glowTexture = ModContent.Request("CalamityMod/Items/Weapons/DraedonsArsenal/HolofibreImmolatorGlow").Value; Vector2 drawPosition = Projectile.Center - Main.screenPosition; Color drawColor = Projectile.GetAlpha(lightColor); float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); diff --git a/Projectiles/DraedonsArsenal/ImmolationArrow.cs b/Projectiles/DraedonsArsenal/ImmolationArrow.cs index 313f5887a1..ec64b427de 100644 --- a/Projectiles/DraedonsArsenal/ImmolationArrow.cs +++ b/Projectiles/DraedonsArsenal/ImmolationArrow.cs @@ -160,7 +160,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal collideWithTiles = false; SoundStyle sound2 = new("CalamityMod/Sounds/Item/ImmolatorPreExplode"); SoundEngine.PlaySound(sound2 with { Volume = 0.3f, Pitch = 0.5f }, Projectile.Center); - SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); + SoundEngine.PlaySound(HolofibreImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) @@ -195,7 +195,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } SoundStyle sound = new("CalamityMod/Sounds/Item/ImmolatorPreExplode"); SoundEngine.PlaySound(sound with { Volume = 0.3f, Pitch = 0.5f }, Projectile.Center); - SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); + SoundEngine.PlaySound(HolofibreImmolator.PlasmaSound with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.3f, -0.4f) }, Projectile.Center); } } public override void OnKill(int timeLeft) diff --git a/Projectiles/DraedonsArsenal/ImmolationSpray.cs b/Projectiles/DraedonsArsenal/ImmolationSpray.cs index d30ccaafbd..91349cf6b1 100644 --- a/Projectiles/DraedonsArsenal/ImmolationSpray.cs +++ b/Projectiles/DraedonsArsenal/ImmolationSpray.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - SoundEngine.PlaySound(HolofiberImmolator.PlasmaSound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); + SoundEngine.PlaySound(HolofibreImmolator.PlasmaSound with { Volume = 0.5f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f) }, Projectile.Center); if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.8f); diff --git a/Projectiles/DraedonsArsenal/MountedScannerSummon.cs b/Projectiles/DraedonsArsenal/MountedScannerSummon.cs index e925397619..3ccb38ab25 100644 --- a/Projectiles/DraedonsArsenal/MountedScannerSummon.cs +++ b/Projectiles/DraedonsArsenal/MountedScannerSummon.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.NeedsUUID[Type] = true; @@ -114,6 +115,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal SoundEngine.PlaySound(CommonCalamitySounds.LaserCannonSound, Projectile.Center); } } - public override bool? CanDamage() => false; } } diff --git a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs index 9501d9e619..bc3e1aa9ec 100644 --- a/Projectiles/DraedonsArsenal/PoleWarperSummon.cs +++ b/Projectiles/DraedonsArsenal/PoleWarperSummon.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 0; @@ -173,6 +174,8 @@ namespace CalamityMod.Projectiles.DraedonsArsenal } } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Texture2D tex = TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs index fc95a46d89..e9a7232cdd 100644 --- a/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs +++ b/Projectiles/DraedonsArsenal/SnakeEyesSummon.cs @@ -42,6 +42,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -237,8 +238,6 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void OnSpawn(IEntitySource source) => DoVFXPulse(); - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs index 526dcb0227..e5c35b3a87 100644 --- a/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs +++ b/Projectiles/DraedonsArsenal/StarSwallowerSummon.cs @@ -28,6 +28,7 @@ namespace CalamityMod.Projectiles.DraedonsArsenal public override void SetStaticDefaults() { Main.projFrames[Type] = 12; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -292,7 +293,5 @@ namespace CalamityMod.Projectiles.DraedonsArsenal fallThrough = Projectile.Bottom.Y < FallThroughYPoint - 120f; return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/DraedonsArsenal/VulcanFlash.png b/Projectiles/DraedonsArsenal/VulcanFlash.png new file mode 100644 index 0000000000..3fc2d1e1d9 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanFlash.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldout.cs b/Projectiles/DraedonsArsenal/VulcanHoldout.cs new file mode 100644 index 0000000000..c2805e2ff1 --- /dev/null +++ b/Projectiles/DraedonsArsenal/VulcanHoldout.cs @@ -0,0 +1,268 @@ +using System; +using CalamityMod.Cooldowns; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.DraedonsArsenal; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class VulcanHoldout : BaseGunHoldoutProjectile + { + public new string LocalizationCategory => "Projectiles.Misc"; + public override int AssociatedItemID => ModContent.ItemType(); + + public float offsetBase = 35; + public override float MaxOffsetLengthFromArm => offsetBase; + public override float RecoilResolveSpeed => 0.2f; + public override float OffsetXUpwards => 0f; + public override float BaseOffsetY => 0f; + public override float OffsetYDownwards => 0f; + public override float WeaponTurnSpeed => (shootingTimer < 0 ? 0 : 0.35f); + public bool firingSpear => Projectile.ai[2] == 5; + public ref float shootingTimer => ref Projectile.ai[0]; + public ref float fireRate => ref Projectile.ai[1]; + public int time = 0; + public int maxShots = 25; + public int shotsToFire = 0; + public bool playRampDown = false; + public int shotsFired = 0; + public float heatVis = 0; + public float flashVis1 = 0; + public float flashVis2 = 0; + public float spearVis = 1; + public int cooldownGiven = 180; + public bool failedManaCheck = false; + public int spearFakeCooldown = 0; + + + public override void KillHoldoutLogic() + { + + } + public override void HoldoutAI() + { + if (flashVis1 > 0) flashVis1 -= 0.2f; if (flashVis1 < 0) flashVis1 = 0; + if (flashVis2 > 0) flashVis2 -= 0.2f; if (flashVis2 < 0) flashVis2 = 0; + + if (time == 0) + { + if (Owner.Calamity().arsenalCooldown > 0) + spearVis = 0; + shootingTimer = -20; + fireRate = Owner.HeldItem.useAnimation; + shotsToFire = maxShots; + OffsetLengthFromArm = offsetBase; + } + if (shootingTimer < 0) + { + // Light cooldown after firing + if (shootingTimer == -20 || shootingTimer == -1) + { + if ((!Main.mouseLeft && !firingSpear) || failedManaCheck) + { + Projectile.Kill(); + return; + } + } + if (playRampDown) + { + SoundStyle sound = new("CalamityMod/Sounds/Item/VulcanRampDown"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound with { Volume = 0.9f, MaxInstances = -1 }, Projectile.Center); + playRampDown = false; + } + if (shootingTimer == -20) + { + SoundStyle sound2 = new("CalamityMod/Sounds/Item/VulcanRampUp"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound2 with { Volume = 0.9f, MaxInstances = -1 }, Projectile.Center); + } + if (shootingTimer == -1) + { + if (!firingSpear) + shootingTimer = fireRate; + else + shootingTimer = 0; + shotsToFire = maxShots; + fireRate = Owner.HeldItem.useAnimation; + shotsFired = 0; + playRampDown = true; + } + Projectile.velocity = Owner.Center.DirectionTo(Owner.Calamity().mouseWorld); + } + if (Owner.Calamity().mouseRight && Owner.Calamity().arsenalCooldown <= 0) + { + Projectile.ai[2] = 5; + } + if (firingSpear && time > 20 && spearFakeCooldown <= 0) + { + Shoot(true); + spearFakeCooldown = 5; + shotsToFire = maxShots; + Projectile.ai[2] = 0; + Owner.Calamity().arsenalCooldown = cooldownGiven; + Owner.AddCooldown(ArsenalPower.ID, cooldownGiven); + } + if (shootingTimer >= 0) + { + if (!Main.mouseLeft && !firingSpear) + shotsToFire = 0; + + if (!firingSpear) + { + if (shotsToFire <= 0) + shootingTimer = -50; + else if (shootingTimer >= fireRate) + { + if (Owner.CheckMana(HeldItem, -1, true, false)) + { + Shoot(false); + + if (shotsFired % 2 == 0) flashVis1 = 1; + else flashVis2 = 1; + + shootingTimer = -1; + if (shotsToFire > maxShots * 0.2f) + { + fireRate -= 1; + if (fireRate < 3) + fireRate = 3; + } + else if (fireRate < Owner.HeldItem.useAnimation) + fireRate += 1; + if (fireRate > Owner.HeldItem.useAnimation) + fireRate = Owner.HeldItem.useAnimation; + + } + else + { + failedManaCheck = true; + shotsToFire = 0; + } + + shotsToFire--; + shotsFired++; + if (shotsToFire <= 0) + { + shootingTimer = -50; + } + } + } + } + if (shotsFired > 0 && shotsToFire > 0) + { + heatVis = MathHelper.Lerp(heatVis, 1, 0.007f); + } + else + heatVis = MathHelper.Lerp(heatVis, 0, 0.085f); + + spearVis = Utils.GetLerpValue(cooldownGiven / 2, 0, Owner.Calamity().arsenalCooldown, true); + spearFakeCooldown--; + + time++; + shootingTimer++; + } + public void Shoot(bool isSpear) + { + if (isSpear) + { + Vector2 spearPos = GunTipPosition + Projectile.velocity.RotatedBy(MathHelper.PiOver2 * Projectile.direction) * 12 - Projectile.velocity * 8; + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0f) * 6f; + Owner.Calamity().GeneralScreenShakePower = 3.5f; + OffsetLengthFromArm -= 16; + SoundStyle sound = new("CalamityMod/Sounds/Item/GunShotHeavy"); + SoundEngine.PlaySound(sound with { Volume = 0.8f, Pitch = 0.8f }, Projectile.Center); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spearPos, shootVelocity, ModContent.ProjectileType(), Projectile.damage * 5, 0, Projectile.owner); + } + else + { + Owner.Calamity().GeneralScreenShakePower = 1f; + OffsetLengthFromArm -= 7; + SoundStyle sound = new("CalamityMod/Sounds/Item/VulcanShot"); + SoundEngine.PlaySound(sound with { Volume = 0.6f, Pitch = Main.rand.NextFloat(-0.1f, 0), MaxInstances = 1 }, Projectile.Center); + + Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0f) * 6f; + Vector2 position = GunTipPosition + Projectile.velocity.RotatedBy(MathHelper.PiOver2 * (shotsFired % 2 == 0 ? -1 : 1)) * 4; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), position, shootVelocity, ModContent.ProjectileType(), Projectile.damage, 0, Projectile.owner); + + for (int i = 0; i < 4; i++) + { + Dust dust = Dust.NewDustPerfect(position, Main.rand.NextBool(3) ? ModContent.DustType() : Effects.ArsenalEffects.ArsenalGaussDust, (shootVelocity * 4).RotatedByRandom(0.05f) * Main.rand.NextFloat(0.1f, 0.8f), 0, default, Main.rand.NextFloat(0.7f, 1.1f)); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + } + } + } + public override bool PreDraw(ref Color lightColor) + { + if (time < 2) + return false; + + Texture2D texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldout").Value; + Texture2D glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutGlow").Value; + Texture2D flash = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanFlash").Value; + Texture2D spear = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpear").Value; + Texture2D spearGlow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpearGlow").Value; + Texture2D heat = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip").Value; + if (Owner.Calamity().arsenalCooldown <= 0 && false) + { + texture = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutSpear").Value; + glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow").Value; + } + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + float randSize = Main.rand.NextFloat(0.9f, 1f); + Color drawColor = Projectile.GetAlpha(lightColor); + float drawRotation = Projectile.rotation + (Projectile.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + int draws = 8; + + Vector2 spearPos = GunTipPosition + vel.RotatedBy(MathHelper.PiOver2 * Projectile.direction) * 12 - vel * 27 - Main.screenPosition; + for (int i = 0; i < draws; i++) + { + float fadeIn = Math.Min(Utils.GetLerpValue(0, 0.8f, spearVis), (float)Math.Pow(Utils.GetLerpValue(1, 0.8f, spearVis), 2)); + Vector2 offset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 6 * (1 - spearVis); + Main.EntitySpriteDraw(spear, spearPos + offset, null, Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * fadeIn * 0.5f, drawRotation, spear.Size() * 0.5f, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(spear, spearPos, null, Color.Lerp(Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }, drawColor, spearVis) * spearVis, drawRotation, spear.Size() * 0.5f, Projectile.scale, flipSprite); + } + Main.EntitySpriteDraw(spearGlow, spearPos, null, Color.White * spearVis, drawRotation, spearGlow.Size() * 0.5f, Projectile.scale, flipSprite); + + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + Main.EntitySpriteDraw(glow, drawPosition, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + for (int i = 0; i < draws; i++) + { + Vector2 offset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 4 * heatVis; + Main.EntitySpriteDraw(heat, drawPosition + offset, null, Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * heatVis * 0.35f, drawRotation, heat.Size() * 0.5f, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(heat, drawPosition, null, Color.White with { A = 0 } * heatVis * 0.3f, drawRotation, heat.Size() * 0.5f, Projectile.scale, flipSprite); + } + + float tipSeperation = 4; + // Tip flash 1 + if (flashVis1 > 0) + { + Vector2 position = GunTipPosition + vel * (12 + 30 * (1 - flashVis1)) + vel.RotatedBy(MathHelper.PiOver2) * tipSeperation - Main.screenPosition; + for (int i = 0; i < 3; i++) + Main.EntitySpriteDraw(flash, position, null, Color.White with { A = 0 } * flashVis1, drawRotation, flash.Size() * 0.5f, new Vector2(0.5f + 2f * (1 - flashVis1), 1 - 0.8f * flashVis1) * Projectile.scale, flipSprite); + } + // Tip flash 1 + if (flashVis2 > 0) + { + Vector2 position = GunTipPosition + vel * (12 + 30 * (1 - flashVis2)) + vel.RotatedBy(-MathHelper.PiOver2) * tipSeperation - Main.screenPosition; + for (int i = 0; i < 3; i++) + Main.EntitySpriteDraw(flash, position, null, Color.White with { A = 0 } * flashVis2, drawRotation, flash.Size() * 0.5f, new Vector2(0.5f + 2f * (1 - flashVis2), 1 - 0.8f * flashVis2) * Projectile.scale, flipSprite); + } + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/VulcanHoldout.png b/Projectiles/DraedonsArsenal/VulcanHoldout.png new file mode 100644 index 0000000000..3df7e215ab Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldout.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutGlow.png b/Projectiles/DraedonsArsenal/VulcanHoldoutGlow.png new file mode 100644 index 0000000000..5a1c73ba6c Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutGlow.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip.png b/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip.png new file mode 100644 index 0000000000..a6efb3b878 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutHeatedTip.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutSpear.png b/Projectiles/DraedonsArsenal/VulcanHoldoutSpear.png new file mode 100644 index 0000000000..5a4cb9de3d Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutSpear.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow.png b/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow.png new file mode 100644 index 0000000000..3eaba56e73 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanHoldoutSpearGlow.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanProjectile.cs b/Projectiles/DraedonsArsenal/VulcanProjectile.cs new file mode 100644 index 0000000000..8f805e1a94 --- /dev/null +++ b/Projectiles/DraedonsArsenal/VulcanProjectile.cs @@ -0,0 +1,116 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class VulcanProjectile : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float time => ref Projectile.ai[0]; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 20; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.timeLeft = 720; + Projectile.extraUpdates = 8; + Projectile.penetrate = 1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 20 * Projectile.MaxUpdates; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + if (time > 120 && Projectile.penetrate > 1) + Projectile.penetrate = 1; + + if (time > 60 && Projectile.extraUpdates > 2 && time % 4 == 0) + Projectile.extraUpdates--; + + if (Projectile.velocity.Length() < 5) + Projectile.velocity *= 1.01f; + if (targetDist < 1400) + { + if (true) + { + Particle trail = new CustomSpark(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 6, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 6, 0.15f, Effects.ArsenalEffects.ArsenalGaussColor * 0.9f, new Vector2(1f, 1f), true, true, glowCenterScale: 0.6f, glowOpacity: 0.8f, shrinkSpeed: 0.9f); + GeneralParticleHandler.SpawnParticle(trail); + } + if (time % 17 == 0) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(4, 4), Effects.ArsenalEffects.ArsenalGaussDust); + dust.velocity = Vector2.One.RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(0.1f, 0.2f); + dust.scale = Main.rand.NextFloat(0.7f, 0.85f); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + dust.noLightEmittence = time % 9 != 0; + dust.fadeIn = 0.3f; + } + } + + time++; + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + impactDust(); + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 4; + target.MoveNPC(launchVel, launchPower, true); + } + + public override void OnKill(int timeLeft) + { + impactDust(); + } + public void impactDust() + { + for (int i = 0; i < 3; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType()); + dust.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.1f) * Main.rand.NextFloat(9f, 19f); + dust.scale = Main.rand.NextFloat(0.6f, 0.85f); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + dust.noLightEmittence = true; + } + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D proj = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanProjectile").Value; + proj = ModContent.Request("CalamityMod/Particles/SquareRotated").Value; + + Texture2D square = ModContent.Request("CalamityMod/Particles/GlowSquareParticleThick").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }; + float drawRotation = Projectile.velocity.ToRotation(); + Vector2 rotationPoint = proj.Size() * 0.5f; + + int rate = 50; + + float shrink = Utils.GetLerpValue(rate - 1, 0, time % rate); + float fade = Math.Min((float)Math.Pow(Utils.GetLerpValue(0, rate * 0.8f, time % rate, true), 3), (float)Math.Pow(Utils.GetLerpValue(rate - 1, rate * 0.8f, time % 30, true), 3)); + float speed = Utils.GetLerpValue(2, 10, Projectile.extraUpdates); + Vector2 squash = new Vector2(1 + 2 * speed, 1 - 0.3f * speed); + + for (int i = 0; i < 2; i++) + Main.EntitySpriteDraw(square, drawPosition, null, drawColor * fade * (1 - speed), drawRotation + MathHelper.PiOver4, square.Size() * 0.5f, Projectile.scale * (0.05f + 0.2f * shrink), SpriteEffects.None); + + + Main.EntitySpriteDraw(proj, drawPosition, null, drawColor, drawRotation, rotationPoint, squash * Projectile.scale * 0.1f, SpriteEffects.None); + Main.EntitySpriteDraw(proj, drawPosition, null, Color.White with { A = 0 }, drawRotation, rotationPoint, squash * Projectile.scale * 0.06f, SpriteEffects.None); + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/VulcanProjectile.png b/Projectiles/DraedonsArsenal/VulcanProjectile.png new file mode 100644 index 0000000000..f5adc1fd7f Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanProjectile.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanSpear.cs b/Projectiles/DraedonsArsenal/VulcanSpear.cs new file mode 100644 index 0000000000..3d9bc39047 --- /dev/null +++ b/Projectiles/DraedonsArsenal/VulcanSpear.cs @@ -0,0 +1,199 @@ +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.DraedonsArsenal +{ + public class VulcanSpear : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Misc"; + public ref float time => ref Projectile.ai[0]; + + public NPC targeted; + public bool stuckInGround = false; + public bool canDamage => (targeted == null && !stuckInGround); + public bool canStick = true; + public int stuckTimer = 420; + public Vector2 placementCenter; + Vector2 placementVelocity; + public override void SetDefaults() + { + Projectile.width = Projectile.height = 35; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Magic; + Projectile.timeLeft = 1200; + Projectile.extraUpdates = 30; + Projectile.penetrate = -1; + Projectile.tileCollide = false; + Projectile.ignoreWater = true; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = -1; + } + public override void AI() + { + Player Owner = Main.player[Projectile.owner]; + float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); + + Lighting.AddLight(Projectile.Center, Effects.ArsenalEffects.ArsenalGaussColor.ToVector3() * 0.5f); + if (targetDist < 1400 && canDamage) + { + if (time % 2 == 0) + { + Particle trail = new CustomSpark(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 14, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 12, 0.065f, Effects.ArsenalEffects.ArsenalGaussColor, new Vector2(1f, 2.5f), true, true, glowCenterScale: 0.7f, shrinkSpeed: 0.4f); + GeneralParticleHandler.SpawnParticle(trail); + } + } + + if (!stuckInGround && targeted == null && Collision.SolidCollision(Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * 15, 6, 6)) + { + Projectile.extraUpdates = 0; + stuckInGround = true; + SoundStyle hitTile = new("CalamityMod/Sounds/NPCHit/ExoHit3"); + SoundEngine.PlaySound(hitTile with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center); + //Get stuck in the ground and fade + } + if (targeted != null && (!targeted.active || targeted.life <= 0)) + targeted = null; + if (targeted != null) + { + Projectile.Center = targeted.Center - placementCenter; + } + else if (Projectile.numHits > 0) + { + Projectile.timeLeft = 1; + } + if (stuckInGround || targeted != null) + { + foreach (Projectile p in Main.ActiveProjectiles) + { + float dist = Utils.Distance(Projectile.Center, p.Center); + if (p.type == ModContent.ProjectileType() && dist <= 900 && p.ai[0] > 120) + { + if (p.velocity.Length() < 6) + p.velocity += p.Center.DirectionTo(Projectile.Center) * Utils.GetLerpValue(1500, 50, dist) * 0.9f; + else + p.velocity *= 0.9f; + if (p.ai[0] % 2 == 0) + p.timeLeft += p.MaxUpdates; + } + } + } + if (!canDamage && Projectile.timeLeft > 300) + Projectile.timeLeft = 300; + time++; + if (Projectile.timeLeft == 35) + { + SoundStyle sound2 = new("CalamityMod/Sounds/Item/VulcanRampUp"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound2 with { Volume = 0.9f, MaxInstances = 5, Pitch = -0.4f }, Projectile.Center); + } + } + public override void OnKill(int timeLeft) + { + SoundStyle die = new("CalamityMod/Sounds/NPCHit/ExoHit2"); + SoundEngine.PlaySound(die with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.4f, 0.5f), MaxInstances = 5 }, Projectile.Center); + SoundStyle sound2 = new("CalamityMod/Sounds/Item/NidhoggFire"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(sound2 with { Volume = 0.8f, MaxInstances = 5, Pitch = -0.1f }, Projectile.Center); + foreach (Projectile p in Main.ActiveProjectiles) + { + float dist = Utils.Distance(Projectile.Center, p.Center); + if (p.type == ModContent.ProjectileType() && dist <= 500) + { + NPC closeTarget = p.Center.ClosestNPCAt(800); + if (closeTarget != null) + p.velocity = p.Center.DirectionTo(closeTarget.Center) * 7; + else + p.velocity = Projectile.Center.DirectionTo(p.Center) * 7; + p.extraUpdates = 8; + p.ai[0] = 0; + p.penetrate = 5; + if (p.ai[1] < 4) // Pretty much just so gfb can't oneshot everything + { + p.damage = (int)(p.damage * 2f); + p.ai[1]++; + } + p.timeLeft = Main.rand.Next(100, 120 + 1); + } + } + Particle bolt = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalGaussColor, "CalamityMod/Particles/GlowSquareParticleThick", Vector2.One, MathHelper.PiOver4, 0.1f, 0.7f, 15); + GeneralParticleHandler.SpawnParticle(bolt); + Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Effects.ArsenalEffects.ArsenalGaussColor, "CalamityMod/Particles/GlowSquareParticleBig", Vector2.One, 0, 0.3f, 1.15f, 10); + GeneralParticleHandler.SpawnParticle(bolt2); + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + impactDust(); + + Vector2 launchVel = Projectile.velocity.SafeNormalize(Vector2.UnitX); + float launchPower = 12; + target.MoveNPC(launchVel, launchPower, true); + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (target.life <= 0 && target.realLife == -1) + { + // Don't stick into dead enemies + Projectile.numHits--; + } + else if (targeted == null && !stuckInGround) + { + //Stick + Projectile.extraUpdates = 0; + SoundStyle hitTile = new("CalamityMod/Sounds/NPCHit/ExoHit1"); + SoundEngine.PlaySound(hitTile with { Volume = 0.8f, Pitch = Main.rand.NextFloat(0.1f, 0.2f) }, Projectile.Center); + targeted = target; + placementCenter = targeted.Center - Projectile.Center; + } + } + public override bool? CanDamage() => canDamage ? null : false; + public override bool ShouldUpdatePosition() + { + return canDamage; + } + public void impactDust() + { + for (int i = 0; i < 7; i++) + { + Dust dust = Dust.NewDustPerfect(Projectile.Center, ModContent.DustType()); + dust.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(0.15f) * Main.rand.NextFloat(12f, 19f); + dust.scale = Main.rand.NextFloat(0.8f, 1.35f); + dust.noGravity = true; + dust.color = Effects.ArsenalEffects.ArsenalGaussColor; + dust.noLightEmittence = true; + } + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D proj = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpear").Value; + Texture2D glow = ModContent.Request("CalamityMod/Projectiles/DraedonsArsenal/VulcanSpearGlow").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Vector2 vel = Projectile.rotation.ToRotationVector2(); + + Color drawColor = Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 }; + float drawRotation = Projectile.velocity.ToRotation() + (Projectile.direction == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = proj.Size() * 0.5f; + SpriteEffects flipSprite = Projectile.direction == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Main.EntitySpriteDraw(proj, drawPosition, null, lightColor, drawRotation, rotationPoint, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(glow, drawPosition, null, Color.White, drawRotation, rotationPoint, Projectile.scale, flipSprite); + + int draws = 16; + for (int i = 0; i < draws; i++) + { + float fadeIn = (float)Math.Pow(Utils.GetLerpValue(300, 1, Projectile.timeLeft, true), 3); + Vector2 offset = (MathHelper.TwoPi / draws * i).ToRotationVector2() * 3 * fadeIn; + Main.EntitySpriteDraw(proj, Projectile.Center - Main.screenPosition + offset + Main.rand.NextVector2Circular(3, 3) * fadeIn, null, Effects.ArsenalEffects.ArsenalGaussColor with { A = 0 } * fadeIn * 0.5f, drawRotation, proj.Size() * 0.5f, Projectile.scale, flipSprite); + Main.EntitySpriteDraw(proj, Projectile.Center - Main.screenPosition, null, Color.White with { A = 0 } * fadeIn, drawRotation, proj.Size() * 0.5f, Projectile.scale, flipSprite); + } + + return false; + } + } +} diff --git a/Projectiles/DraedonsArsenal/VulcanSpear.png b/Projectiles/DraedonsArsenal/VulcanSpear.png new file mode 100644 index 0000000000..cfcab36090 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanSpear.png differ diff --git a/Projectiles/DraedonsArsenal/VulcanSpearGlow.png b/Projectiles/DraedonsArsenal/VulcanSpearGlow.png new file mode 100644 index 0000000000..c010c5ec95 Binary files /dev/null and b/Projectiles/DraedonsArsenal/VulcanSpearGlow.png differ diff --git a/Projectiles/Enemy/EarthRockBig.cs b/Projectiles/Enemy/EarthRockBig.cs index 6d24b0c175..53a8b9b58c 100644 --- a/Projectiles/Enemy/EarthRockBig.cs +++ b/Projectiles/Enemy/EarthRockBig.cs @@ -12,7 +12,6 @@ namespace CalamityMod.Projectiles.Enemy public new string LocalizationCategory => "Projectiles.Enemy"; public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 32; Projectile.height = 32; Projectile.hostile = true; diff --git a/Projectiles/Enemy/MantisRing.cs b/Projectiles/Enemy/MantisRing.cs index 002314546d..b2096ae397 100644 --- a/Projectiles/Enemy/MantisRing.cs +++ b/Projectiles/Enemy/MantisRing.cs @@ -20,7 +20,6 @@ namespace CalamityMod.Projectiles.Enemy public override void SetDefaults() { - Projectile.Calamity().DealsDefenseDamage = true; Projectile.knockBack = 3f; Projectile.width = 72; Projectile.height = 30; diff --git a/Projectiles/Enemy/SulphuricAcidMist.cs b/Projectiles/Enemy/SulphuricAcidMist.cs index f1f5d6b825..2ad2cea566 100644 --- a/Projectiles/Enemy/SulphuricAcidMist.cs +++ b/Projectiles/Enemy/SulphuricAcidMist.cs @@ -95,7 +95,7 @@ namespace CalamityMod.Projectiles.Enemy return; if (Projectile.Opacity >= 0.9f) - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/Projectiles/Enemy/TornadoHostile.cs b/Projectiles/Enemy/TornadoHostile.cs index ed74fd0215..002c255f37 100644 --- a/Projectiles/Enemy/TornadoHostile.cs +++ b/Projectiles/Enemy/TornadoHostile.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Enemy public override void SetDefaults() { + Projectile.Calamity().DealsDefenseDamage = true; Projectile.width = 10; Projectile.height = 10; Projectile.hostile = true; diff --git a/Projectiles/Healing/AltTransfusionTrail.cs b/Projectiles/Healing/AltTransfusionTrail.cs index cb362dbc53..48eec7e713 100644 --- a/Projectiles/Healing/AltTransfusionTrail.cs +++ b/Projectiles/Healing/AltTransfusionTrail.cs @@ -17,13 +17,11 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; - Projectile.penetrate = 1; - Projectile.timeLeft = 600; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.extraUpdates = 5; + Projectile.MaxUpdates = 5; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() diff --git a/Projectiles/Healing/FungalHeal.cs b/Projectiles/Healing/FungalHeal.cs index 1dcb6e2a4f..bcf3dcdf59 100644 --- a/Projectiles/Healing/FungalHeal.cs +++ b/Projectiles/Healing/FungalHeal.cs @@ -12,18 +12,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; - Projectile.penetrate = 1; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.extraUpdates = 3; - Projectile.timeLeft = 300; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 3f, 15f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 4f, 15f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.BlueFairy, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Healing/HydrothermicHealOrb.cs b/Projectiles/Healing/HydrothermicHealOrb.cs index e1df042f9f..fc4d2cbd1d 100644 --- a/Projectiles/Healing/HydrothermicHealOrb.cs +++ b/Projectiles/Healing/HydrothermicHealOrb.cs @@ -13,18 +13,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.penetrate = 1; Projectile.tileCollide = false; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 8f, 15f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Healing/IridescentExcaliburHeal.cs b/Projectiles/Healing/IridescentExcaliburHeal.cs deleted file mode 100644 index c71e6050d7..0000000000 --- a/Projectiles/Healing/IridescentExcaliburHeal.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Healing -{ - public class IridescentExcaliburHeal : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Healing"; - - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; - Projectile.tileCollide = false; - Projectile.extraUpdates = 3; - } - - public override void AI() - { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 10f, 15f); - - Color dustColor = Color.White; - switch (Main.rand.Next(3)) - { - default: - case 0: - dustColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); - break; - - case 1: - dustColor = new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB); - break; - - case 2: - dustColor = new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1); - break; - } - - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, 278, 0f, 0f, 100); - Main.dust[dust].color = dustColor; - Main.dust[dust].fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f; - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f; - Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f; - } - } -} diff --git a/Projectiles/Healing/ManaPolarizerHealOrb.cs b/Projectiles/Healing/ManaPolarizerHealOrb.cs index 3e06d805f6..a0a0bfcf7f 100644 --- a/Projectiles/Healing/ManaPolarizerHealOrb.cs +++ b/Projectiles/Healing/ManaPolarizerHealOrb.cs @@ -13,18 +13,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.penetrate = 1; Projectile.tileCollide = false; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 5; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 4f, 15f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 6f, 15f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.SpectreStaff, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Healing/ReaverHealOrb.cs b/Projectiles/Healing/ReaverHealOrb.cs deleted file mode 100644 index 23d5fb22c0..0000000000 --- a/Projectiles/Healing/ReaverHealOrb.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Healing -{ - public class ReaverHealOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Healing"; - - public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - - public override void SetDefaults() - { - Projectile.width = 4; - Projectile.height = 4; - Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.tileCollide = false; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; - } - - public override void AI() - { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 5f, 15f); - int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.GreenFairy, 0f, 0f, 100); - Main.dust[dust].noGravity = true; - Main.dust[dust].velocity *= 0f; - Main.dust[dust].position.X -= Projectile.velocity.X * 0.2f; - Main.dust[dust].position.Y += Projectile.velocity.Y * 0.2f; - } - } -} diff --git a/Projectiles/Healing/RoyalHeal.cs b/Projectiles/Healing/RoyalHeal.cs index 145c21fc49..fb596b3b52 100644 --- a/Projectiles/Healing/RoyalHeal.cs +++ b/Projectiles/Healing/RoyalHeal.cs @@ -13,18 +13,16 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; Projectile.tileCollide = false; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 5; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() { - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 18f, 10f); + Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 12f, 10f); int dust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PurificationPowder, 0f, 0f, 100); Main.dust[dust].noGravity = true; Main.dust[dust].velocity *= 0f; diff --git a/Projectiles/Healing/ShinobiHealOrb.cs b/Projectiles/Healing/ShinobiHealOrb.cs index 7a507a57a0..062146f90e 100644 --- a/Projectiles/Healing/ShinobiHealOrb.cs +++ b/Projectiles/Healing/ShinobiHealOrb.cs @@ -26,7 +26,6 @@ namespace CalamityMod.Projectiles.Healing Projectile.width = Projectile.height = 20; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.penetrate = -1; Projectile.MaxUpdates = 5; Projectile.timeLeft = 120 * Projectile.MaxUpdates; } diff --git a/Projectiles/Healing/SilvaOrb.cs b/Projectiles/Healing/SilvaOrb.cs deleted file mode 100644 index 1d12d7230d..0000000000 --- a/Projectiles/Healing/SilvaOrb.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Healing -{ - public class SilvaOrb : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Healing"; - - public override void SetDefaults() - { - Projectile.width = 22; - Projectile.height = 22; - Projectile.friendly = true; - Projectile.alpha = 255; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; - Projectile.extraUpdates = 3; - Projectile.tileCollide = false; - } - - public override void AI() - { - Projectile.alpha -= 2; - if (Projectile.localAI[0] == 0f) - { - Projectile.scale += 0.05f; - if (Projectile.scale > 1.2f) - Projectile.localAI[0] = 1f; - } - else - { - Projectile.scale -= 0.05f; - if (Projectile.scale < 0.8f) - Projectile.localAI[0] = 0f; - } - - Projectile.HealingProjectile((int)Projectile.ai[1], (int)Projectile.ai[0], 6f, 15f); - return; - } - - public override Color? GetAlpha(Color lightColor) => new Color(Main.DiscoR, 203, 103, Projectile.alpha); - - public override void OnKill(int timeLeft) - { - for (int i = 0; i < 5; i++) - { - int silvaHeal = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.ChlorophyteWeapon, 0f, 0f, 0, new Color(Main.DiscoR, 203, 103), 1.5f); - Main.dust[silvaHeal].noGravity = true; - Main.dust[silvaHeal].velocity *= 0f; - } - } - } -} diff --git a/Projectiles/Healing/SilvaOrb.png b/Projectiles/Healing/SilvaOrb.png deleted file mode 100644 index 37597f4cad..0000000000 Binary files a/Projectiles/Healing/SilvaOrb.png and /dev/null differ diff --git a/Projectiles/Healing/TransfusionTrail.cs b/Projectiles/Healing/TransfusionTrail.cs index 55d1326d47..289be6034b 100644 --- a/Projectiles/Healing/TransfusionTrail.cs +++ b/Projectiles/Healing/TransfusionTrail.cs @@ -13,13 +13,11 @@ namespace CalamityMod.Projectiles.Healing public override void SetDefaults() { - Projectile.width = 4; - Projectile.height = 4; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; + Projectile.width = Projectile.height = 4; Projectile.friendly = true; Projectile.tileCollide = false; - Projectile.extraUpdates = 3; + Projectile.MaxUpdates = 4; + Projectile.timeLeft = 120 * Projectile.MaxUpdates; } public override void AI() diff --git a/Projectiles/Magic/AnahitasArpeggioNote.cs b/Projectiles/Magic/AnahitasArpeggioNote.cs index 2c779ac44d..3d78d39107 100644 --- a/Projectiles/Magic/AnahitasArpeggioNote.cs +++ b/Projectiles/Magic/AnahitasArpeggioNote.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Weapons.Magic; using CalamityMod.NPCs; +using CalamityMod.Projectiles.Ranged; using CalamityMod.Systems; using Microsoft.Xna.Framework; +using ReLogic.Utilities; using System; using System.IO; using Terraria; @@ -22,7 +24,9 @@ namespace CalamityMod.Projectiles.Magic public int LingeringTime = 300; public int FadeOutTime = 20; public bool HasSetFadeOutVelocity = false; + public Vector2 ReleaseCenterPoint = Vector2.Zero; public float _randomReleaseRotationOffset; + public SlotId StupidEasterEggSlot; public Player Owner => Main.player[Projectile.owner]; @@ -63,8 +67,23 @@ namespace CalamityMod.Projectiles.Magic Projectile.localAI[0] = 0f; } + // Sound business if (Timer == 1f) - SoundEngine.PlaySound(new("CalamityMod/Sounds/Item/HarpLV" + Math.Clamp((int)NoteSequence + 1, 1, 6)), Owner.Center); + { + if (Main.zenithWorld) + { + if (NoteSequence == 0f) + StupidEasterEggSlot = SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GFB/SevenTrebleClefSouls"), Owner.Center); + } + else + SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Item/HarpLV" + Math.Clamp((int)NoteSequence + 1, 1, 6)) with { Volume = 0.8f }, Owner.Center); + } + // They did not obey me + // Big shoutouts to NotRyo for making this Finale remix out of harp notes + if (Main.zenithWorld && NoteSequence == 0f && Timer % 2428f == 0f && AIState == 0f) + StupidEasterEggSlot = SoundEngine.PlaySound(new("CalamityMod/Sounds/Custom/GFB/SevenTrebleClefSouls"), Owner.Center); + if (SoundEngine.TryGetActiveSound(StupidEasterEggSlot, out var TrebleSoul) && TrebleSoul.IsPlaying) + TrebleSoul.Position = Owner.Center; if (Main.zenithWorld) Lighting.AddLight(Projectile.Center, 1.25f, 1.25f, 1.25f); @@ -114,12 +133,19 @@ namespace CalamityMod.Projectiles.Magic Vector2 mouse = Owner.ClampedMouseWorld(); Projectile.Center = mouse + musicNoteRotationOffset * 220f; + ReleaseCenterPoint = mouse; playerDirection = Projectile.Center - mouse; playerDirection.Normalize(); - playerDirection *= -9.2f; + playerDirection *= -13f; Projectile.velocity = playerDirection; - SoundEngine.PlaySound(AnahitasArpeggio.EndSound, Projectile.Center); + if (Main.zenithWorld) + { + if (SoundEngine.TryGetActiveSound(StupidEasterEggSlot, out var Flowey)) + Flowey?.Stop(); + } + else + SoundEngine.PlaySound(AnahitasArpeggio.EndSound with { Volume = 0.8f }, Projectile.Center); AIState = 2f; } } @@ -142,9 +168,18 @@ namespace CalamityMod.Projectiles.Magic // Slow down quickly if (Projectile.velocity.Length() > 0.5f) - Projectile.velocity *= 0.95f; + Projectile.velocity *= 0.925f; else + { Projectile.velocity = Vector2.Zero; + + // Makes the notes slowly follow the mouse and rotate + Vector2 centerPointDirection = (Owner.Calamity().mouseWorld - ReleaseCenterPoint).SafeNormalize(Vector2.Zero); + float distToMove = MathF.Min(2.75f, Vector2.Distance(Owner.Calamity().mouseWorld, ReleaseCenterPoint)); // The constant value is the maximum chase speed + ReleaseCenterPoint += centerPointDirection * distToMove; + Projectile.Center += centerPointDirection * distToMove; + Projectile.Center = ReleaseCenterPoint + Utils.DirectionTo(ReleaseCenterPoint, Projectile.Center).RotatedBy(MathHelper.Pi * 0.01f) * Vector2.Distance(ReleaseCenterPoint, Projectile.Center); + } } } @@ -202,7 +237,6 @@ namespace CalamityMod.Projectiles.Magic } public override void SendExtraAI(BinaryWriter writer) => writer.Write(_randomReleaseRotationOffset); - public override void ReceiveExtraAI(BinaryReader reader) => _randomReleaseRotationOffset = reader.ReadSingle(); } } diff --git a/Projectiles/Magic/AstralachneaFang.cs b/Projectiles/Magic/AstralachneaFang.cs index cf5ed838f9..5619a355ec 100644 --- a/Projectiles/Magic/AstralachneaFang.cs +++ b/Projectiles/Magic/AstralachneaFang.cs @@ -49,7 +49,10 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + //Doze - I gave this long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + //Poison and Venom staff in vanilla do 30 seconds, so this should too as it's a spiritual successor to them. + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(30)); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Magic/CauldronHoldout.cs b/Projectiles/Magic/CauldronHoldout.cs index 80d327c3ef..b499fdf008 100644 --- a/Projectiles/Magic/CauldronHoldout.cs +++ b/Projectiles/Magic/CauldronHoldout.cs @@ -75,11 +75,7 @@ namespace CalamityMod.Projectiles.Magic int projType = ModContent.ProjectileType(); int projDamage = Projectile.damage; float speedscale = 18f; - Vector2 shotSpeed = Vector2.Normalize(Projectile.velocity) * speedscale; - if (float.IsNaN(shotSpeed.X) || float.IsNaN(shotSpeed.Y)) - { - shotSpeed = -Vector2.UnitY; - } + Vector2 shotSpeed = Projectile.velocity.SafeNormalize(-Vector2.UnitY) * speedscale; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, shotSpeed, projType, projDamage, Projectile.knockBack, player.whoAmI); for (int i = 0; i < 6; i++) diff --git a/Projectiles/Magic/CauldronProj.cs b/Projectiles/Magic/CauldronProj.cs index 21c716e995..a414b19b1c 100644 --- a/Projectiles/Magic/CauldronProj.cs +++ b/Projectiles/Magic/CauldronProj.cs @@ -98,8 +98,8 @@ namespace CalamityMod.Projectiles.Magic Main.EntitySpriteDraw(Glow.Value, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, origin, Projectile.scale, SpriteEffects.None, 0); return false; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire, 90); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 90); } } diff --git a/Projectiles/Magic/CauldronProjSmall.cs b/Projectiles/Magic/CauldronProjSmall.cs index 1ae7f52f9a..20ae6b8292 100644 --- a/Projectiles/Magic/CauldronProjSmall.cs +++ b/Projectiles/Magic/CauldronProjSmall.cs @@ -58,13 +58,6 @@ namespace CalamityMod.Projectiles.Magic public override void OnKill(int timeLeft) { SoundEngine.PlaySound(SoundID.DD2_ExplosiveTrapExplode with { Pitch = 0.8f, Volume = 0.6f }, Projectile.Center); - Projectile.ExpandHitboxBy(46); - Projectile.maxPenetrate = -1; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.damage /= 2; - Projectile.Damage(); for (int i = 0; i < 10; i++) { int size = 10; @@ -86,8 +79,8 @@ namespace CalamityMod.Projectiles.Magic public override bool? CanDamage() => Projectile.velocity.Y < 0f ? false : null; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.OnFire, 90); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire3, 90); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.OnFire, 90); } } diff --git a/Projectiles/Magic/DeathValleyDusterProjectile.cs b/Projectiles/Magic/DeathValleyDusterProjectile.cs index 0fd107a6bf..33520aff80 100644 --- a/Projectiles/Magic/DeathValleyDusterProjectile.cs +++ b/Projectiles/Magic/DeathValleyDusterProjectile.cs @@ -10,6 +10,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; using System.Collections.Generic; +using CalamityMod.Items.Placeables.FurnitureMarnite; namespace CalamityMod.Projectiles.Magic { public class DeathValleyDusterProjectile : ModProjectile, ILocalizedModType @@ -34,7 +35,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = -1; - Projectile.extraUpdates = 4; + Projectile.extraUpdates = 7; Projectile.timeLeft = 400; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; @@ -60,7 +61,7 @@ namespace CalamityMod.Projectiles.Magic if (buffList[playerIndex] == false) { buffList[playerIndex] = true; - player.AddBuff(ModContent.BuffType(), 600); + player.AddBuff(ModContent.BuffType(), 720); int Dusts = 12; float radians = MathHelper.TwoPi / Dusts; @@ -141,7 +142,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.rotation += Main.rand.NextFloat(0.01f, 0.18f) * (float)Projectile.direction * Projectile.Opacity * rotDirection; - if (Projectile.timeLeft <= 45) { Projectile.extraUpdates = 1; @@ -152,15 +152,37 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.95f); - if (Projectile.damage < 1) - Projectile.damage = 1; + float minMult = 0.25f; + int hitsToMinMult = 6; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + if (Projectile.numHits == 0) + { + Player Owner = Main.player[Projectile.owner]; + Owner.Calamity().GeneralScreenShakePower = 3.5f; + damageMult += 0.5f; + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact with { Volume = 0.9f, Pitch = -0.4f + i * 0.25f, MaxInstances = 3 }, Projectile.Center); + for (int i = 0; i < 14; i++) + { + float range = Main.rand.NextFloat(-0.5f, 0.5f); + float power = 1 - Math.Abs(range); + Vector2 vel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(range) * Main.rand.NextFloat(45, 50) * power; + MediumMistParticle SandCloud = new MediumMistParticle(Projectile.Center, vel, Color.Peru, Color.PeachPuff, Main.rand.NextFloat(1.7f, 2.3f), 120f, Main.rand.NextFloat(0.03f, -0.03f)); + GeneralParticleHandler.SpawnParticle(SandCloud); + for (int b = 0; b < 5; b++) + { + Color clr = Color.Lerp((Main.rand.NextBool() ? Color.Peru : Color.PeachPuff), Color.Black, Main.rand.NextFloat(0.25f, 0.45f)); + Particle sand = new CustomSpark(Projectile.Center, vel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.4f, 0.9f) * power, "CalamityMod/Particles/SmallSmoke", false, Main.rand.Next(15, 25 + 1), Projectile.scale * Main.rand.NextFloat(0.08f, 0.14f) * 7, clr, new Vector2(1, Main.rand.NextFloat(0.2f, 2f)), false, extraRotation: Main.rand.NextFloat(-4, 4), spin: Main.rand.NextFloat(-0.8f, 0.8f), affectedByLight: true); + GeneralParticleHandler.SpawnParticle(sand); + } + } + } + modifiers.SourceDamage *= damageMult; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Projectile.numHits >= 3 && Projectile.timeLeft > 45) + if (Projectile.numHits >= 5 && Projectile.timeLeft > 45) { Projectile.timeLeft = 45; Projectile.velocity *= 0.4f; 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/PlagueFang.cs b/Projectiles/Magic/PlagueFang.cs index 443df05763..adc787da24 100644 --- a/Projectiles/Magic/PlagueFang.cs +++ b/Projectiles/Magic/PlagueFang.cs @@ -78,7 +78,10 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + //Doze - I gave this long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + //Poison and Venom staff in vanilla do 30 seconds, so this should too as it's a spiritual successor to them. + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(30)); } } } diff --git a/Projectiles/Magic/PrimordialAncientExplosion.cs b/Projectiles/Magic/PrimordialAncientExplosion.cs index 8b4f5a9c1a..0f24414cb2 100644 --- a/Projectiles/Magic/PrimordialAncientExplosion.cs +++ b/Projectiles/Magic/PrimordialAncientExplosion.cs @@ -28,6 +28,9 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); + target.MoveNPC(launchVel, 40, true); + if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.95f); if (Projectile.damage < 1) diff --git a/Projectiles/Magic/PrimordialAncientProjectile.cs b/Projectiles/Magic/PrimordialAncientProjectile.cs index 6eac8df489..b8d71258ae 100644 --- a/Projectiles/Magic/PrimordialAncientProjectile.cs +++ b/Projectiles/Magic/PrimordialAncientProjectile.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using CalamityMod.Buffs.StatBuffs; using CalamityMod.Buffs.StatDebuffs; using CalamityMod.Particles; +using Microsoft.CodeAnalysis.CSharp.Syntax; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -37,10 +38,10 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.tileCollide = false; Projectile.penetrate = -1; - Projectile.extraUpdates = 6; + Projectile.extraUpdates = 8; Projectile.timeLeft = 430; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 40 * Projectile.extraUpdates; + Projectile.localNPCHitCooldown = -1; } public override void AI() { @@ -71,7 +72,7 @@ namespace CalamityMod.Projectiles.Magic if (buffList[playerIndex] == false) { buffList[playerIndex] = true; - player.AddBuff(ModContent.BuffType(), 840); + player.AddBuff(ModContent.BuffType(), 1080); int Dusts = 8; float radians = MathHelper.TwoPi / Dusts; @@ -190,7 +191,6 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(SandCloud); } - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + new Vector2(25, 25).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.3f) * Projectile.scale, Main.rand.NextBool(5) ? 86 : 287, -Projectile.velocity * Main.rand.NextFloat(0.1f, 1.3f)); dust2.noGravity = true; dust2.scale = Main.rand.NextFloat(0.4f, 0.7f); @@ -203,48 +203,81 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - modifiers.SourceDamage *= 0.05f; + float minMult = 0.25f; + int hitsToMinMult = 6; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + if (Projectile.numHits == 0) + { + damageMult += 0.5f; + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact with { Volume = 0.9f, Pitch = -0.4f + i * 0.25f, MaxInstances = 9 }, Projectile.Center); + for (int i = 0; i < 6; i++) + { + float range = Main.rand.NextFloat(-0.3f, 0.3f); + float power = 1 - Math.Abs(range); + Vector2 vel = Projectile.Center.DirectionTo(target.Center).RotatedBy(range) * Main.rand.NextFloat(35, 40) * power; + MediumMistParticle SandCloud = new MediumMistParticle(Projectile.Center, vel, Color.Peru, Color.PeachPuff, Main.rand.NextFloat(1.7f, 2.3f), 120f, Main.rand.NextFloat(0.03f, -0.03f)); + GeneralParticleHandler.SpawnParticle(SandCloud); + for (int b = 0; b < 5; b++) + { + Color clr = Color.Lerp((Main.rand.NextBool() ? Color.Peru : Color.PeachPuff), Color.Black, Main.rand.NextFloat(0.25f, 0.45f)); + Particle sand = new CustomSpark(Projectile.Center, vel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.4f, 0.9f) * power, "CalamityMod/Particles/SmallSmoke", false, Main.rand.Next(25, 35 + 1), Projectile.scale * Main.rand.NextFloat(0.08f, 0.14f) * 7, clr, new Vector2(1, Main.rand.NextFloat(0.2f, 2f)), false, extraRotation: Main.rand.NextFloat(-4, 4), spin: Main.rand.NextFloat(-0.8f, 0.8f), affectedByLight: true); + GeneralParticleHandler.SpawnParticle(sand); + } + } + } - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.95f); - if (Projectile.damage < 1) - Projectile.damage = 1; + modifiers.SourceDamage *= damageMult * 0.03f; } public override void OnKill(int timeLeft) { Lighting.AddLight(Projectile.Center, Color.Purple.ToVector3() * 2); if (Projectile.ai[1] == 1) { - Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Purple, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0f, 0.82f, 11); + Player Owner = Main.player[Projectile.owner]; + Owner.Calamity().GeneralScreenShakePower = 8f; + + Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Purple, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.2f * 2f, 0.6f * 2.5f, 17); GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0f, 0.74f, 11); + Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.1f * 2f, 0.5f * 2.5f, 17); GeneralParticleHandler.SpawnParticle(orb2); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 1.5f, Projectile.owner); SoundStyle explo = new("CalamityMod/Sounds/Item/MineralMortarExplode"); SoundEngine.PlaySound(explo with { Volume = 0.9f }, Projectile.Center); + SoundStyle explo2 = new("CalamityMod/Sounds/Item/EarthMeteor"); + SoundEngine.PlaySound(explo2 with { Volume = 0.9f, Pitch = -0.3f }, Projectile.Center); Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Lerp(Color.Purple, Color.White, 0.5f) * 0.55f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 2.56f * 2.3f, 18); GeneralParticleHandler.SpawnParticle(bolt2); - Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Peru * 0.55f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f, 30); + Particle bolt3 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Peru * 0.55f, "CalamityMod/Particles/SmokeExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.4f, 23); GeneralParticleHandler.SpawnParticle(bolt3); - Particle bolt4 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.PeachPuff * 0.55f, "CalamityMod/Particles/FlameExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.3f * 1.35f, 30); + Particle bolt4 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.PeachPuff * 0.55f, "CalamityMod/Particles/SmokeExplosion", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 0.4f * 1.35f, 18); GeneralParticleHandler.SpawnParticle(bolt4); for (int i = 0; i < 140; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 86 : 287, new Vector2(21, 21).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.3f)); - dust.noGravity = false; - dust.scale = Main.rand.NextFloat(0.8f, 1.3f); - if (dust.type == 86) + if (Main.rand.NextBool(5)) { - dust.noGravity = true; - dust.fadeIn = 0.5f; - dust.velocity *= 2; + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(5) ? 86 : 287, new Vector2(21, 21).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.3f)); + dust.noGravity = false; + dust.scale = Main.rand.NextFloat(0.8f, 1.3f); + if (dust.type == 86) + { + dust.noGravity = true; + dust.fadeIn = 0.5f; + dust.velocity *= 2; + } + dust.alpha = 100; + } + else + { + Color clr = Color.Lerp((Main.rand.NextBool() ? Color.Peru : Color.PeachPuff), Color.Black, Main.rand.NextFloat(0.25f, 0.45f)); + Particle sand = new CustomSpark(Projectile.Center, (Vector2.One * Main.rand.NextFloat(9, 33)).RotatedByRandom(MathHelper.TwoPi), "CalamityMod/Particles/SmallSmoke", true, Main.rand.Next(25, 55 + 1), Projectile.scale * Main.rand.NextFloat(0.08f, 0.14f) * 23, clr, new Vector2(1, Main.rand.NextFloat(0.2f, 2f)), false, extraRotation: Main.rand.NextFloat(-4, 4), spin: Main.rand.NextFloat(-0.8f, 0.8f), affectedByLight: true); + GeneralParticleHandler.SpawnParticle(sand); } - dust.alpha = 100; } for (int i = 0; i < 30; i++) { diff --git a/Projectiles/Magic/PrimordialEarthExplosion.cs b/Projectiles/Magic/PrimordialEarthExplosion.cs index 7a2fc6d42f..3fc8e0e945 100644 --- a/Projectiles/Magic/PrimordialEarthExplosion.cs +++ b/Projectiles/Magic/PrimordialEarthExplosion.cs @@ -28,6 +28,9 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + Vector2 launchVel = Utils.DirectionTo(Projectile.Center, target.Center); + target.MoveNPC(launchVel, 20, true); + if (Projectile.numHits > 0) Projectile.damage = (int)(Projectile.damage * 0.9f); if (Projectile.damage < 1) diff --git a/Projectiles/Magic/PrimordialEarthProjectile.cs b/Projectiles/Magic/PrimordialEarthProjectile.cs index 6a5a77c9ef..83cd70b476 100644 --- a/Projectiles/Magic/PrimordialEarthProjectile.cs +++ b/Projectiles/Magic/PrimordialEarthProjectile.cs @@ -35,7 +35,7 @@ namespace CalamityMod.Projectiles.Magic Projectile.tileCollide = false; Projectile.DamageType = DamageClass.Magic; Projectile.penetrate = -1; - Projectile.extraUpdates = 6; + Projectile.extraUpdates = 9; Projectile.timeLeft = 132; // NOTE: Do not change this. Specific timing is needed for the weapon to function properly. Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Magic if (buffList[playerIndex] == false) { buffList[playerIndex] = true; - player.AddBuff(ModContent.BuffType(), 720); + player.AddBuff(ModContent.BuffType(), 840); int Dusts = 12; float radians = MathHelper.TwoPi / Dusts; @@ -135,7 +135,6 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(SandCloud); } - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + new Vector2(25, 25).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.3f) * Projectile.scale, Main.rand.NextBool(8) ? 262 : 287, -Projectile.velocity * Main.rand.NextFloat(0.1f, 1.3f)); dust2.noGravity = true; dust2.scale = Main.rand.NextFloat(0.4f, 0.7f); @@ -148,36 +147,71 @@ namespace CalamityMod.Projectiles.Magic } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.numHits > 0) - Projectile.damage = (int)(Projectile.damage * 0.95f); - if (Projectile.damage < 1) - Projectile.damage = 1; + float minMult = 0.25f; + int hitsToMinMult = 6; + float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); + if (Projectile.numHits == 0) + { + damageMult += 0.5f; + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound(SoundID.DD2_MonkStaffGroundImpact with { Volume = 0.9f, Pitch = -0.4f + i * 0.25f, MaxInstances = 6 }, Projectile.Center); + for (int i = 0; i < 9; i++) + { + float range = Main.rand.NextFloat(-0.3f, 0.3f); + float power = 1 - Math.Abs(range); + Vector2 vel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(range) * Main.rand.NextFloat(35, 40) * power; + MediumMistParticle SandCloud = new MediumMistParticle(Projectile.Center, vel, Color.Peru, Color.PeachPuff, Main.rand.NextFloat(1.7f, 2.3f), 120f, Main.rand.NextFloat(0.03f, -0.03f)); + GeneralParticleHandler.SpawnParticle(SandCloud); + for (int b = 0; b < 6; b++) + { + Color clr = Color.Lerp((Main.rand.NextBool() ? Color.Peru : Color.PeachPuff), Color.Black, Main.rand.NextFloat(0.25f, 0.45f)); + Particle sand = new CustomSpark(Projectile.Center, vel.RotatedByRandom(0.4f) * Main.rand.NextFloat(0.4f, 0.9f) * power, "CalamityMod/Particles/SmallSmoke", false, Main.rand.Next(25, 35 + 1), Projectile.scale * Main.rand.NextFloat(0.08f, 0.14f) * 7, clr, new Vector2(1, Main.rand.NextFloat(0.2f, 2f)), false, extraRotation: Main.rand.NextFloat(-4, 4), spin: Main.rand.NextFloat(-0.8f, 0.8f), affectedByLight: true); + GeneralParticleHandler.SpawnParticle(sand); + } + } + } + modifiers.SourceDamage *= damageMult; } public override void OnKill(int timeLeft) { if (Projectile.ai[1] == 1) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack * 1.5f, Projectile.owner); + Player Owner = Main.player[Projectile.owner]; + Owner.Calamity().GeneralScreenShakePower = 5f; + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 2.5f), 0, Projectile.owner); SoundStyle explo = new("CalamityMod/Sounds/Item/MagicRockImpact"); SoundEngine.PlaySound(explo with { Volume = 0.75f }, Projectile.Center); - //Particle bolt = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Gold * 0.3f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 1.86f, 15); - //GeneralParticleHandler.SpawnParticle(bolt); Particle bolt2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Gold * 0.55f, "CalamityMod/Particles/BloomRing", Vector2.One, Main.rand.NextFloat(-10f, 10f), 0f, 2.56f, 15); GeneralParticleHandler.SpawnParticle(bolt2); + + Particle orb = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Gold, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.1f, 0.4f * 1.5f, 17); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new CustomPulse(Projectile.Center, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.05f, 0.3f * 1.5f, 17); + GeneralParticleHandler.SpawnParticle(orb2); } for (int i = 0; i < 65; i++) { - Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 262 : 287, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.3f)); - dust.noGravity = false; - dust.scale = Main.rand.NextFloat(0.8f, 1.3f); - if (dust.type == 262) + if (Main.rand.NextBool(4)) { - dust.noGravity = true; - dust.fadeIn = 0.5f; - dust.velocity *= 2; + Dust dust = Dust.NewDustPerfect(Projectile.Center, Main.rand.NextBool(6) ? 262 : 287, new Vector2(7, 7).RotatedByRandom(100) * Main.rand.NextFloat(0.1f, 1.3f)); + dust.noGravity = false; + dust.scale = Main.rand.NextFloat(0.8f, 1.3f); + if (dust.type == 262) + { + dust.noGravity = true; + dust.fadeIn = 0.5f; + dust.velocity *= 2; + } + dust.alpha = 100; + } + else + { + Color clr = Color.Lerp((Main.rand.NextBool() ? Color.Peru : Color.PeachPuff), Color.Black, Main.rand.NextFloat(0.25f, 0.45f)); + Particle sand = new CustomSpark(Projectile.Center, (Vector2.One * Main.rand.NextFloat(6, 15)).RotatedByRandom(MathHelper.TwoPi), "CalamityMod/Particles/SmallSmoke", true, Main.rand.Next(20, 45 + 1), Projectile.scale * Main.rand.NextFloat(0.08f, 0.14f) * 8, clr, new Vector2(1, Main.rand.NextFloat(0.2f, 2f)), false, extraRotation: Main.rand.NextFloat(-4, 4), spin: Main.rand.NextFloat(-0.8f, 0.8f), affectedByLight: true); + GeneralParticleHandler.SpawnParticle(sand); } - dust.alpha = 100; } for (int i = 0; i < 9; i++) { diff --git a/Projectiles/Magic/SHPV.cs b/Projectiles/Magic/SHPV.cs index bb9a52caa4..454e42905e 100644 --- a/Projectiles/Magic/SHPV.cs +++ b/Projectiles/Magic/SHPV.cs @@ -87,17 +87,29 @@ namespace CalamityMod.Projectiles.Magic { if (Timer % 5 == 0f) { - if (Owner.HeldItem.ModItem is SHPC shpc && shpc.storedSoulpower > 0) + if (Owner.HeldItem.ModItem is SHPC shpc) { SoundEngine.PlaySound(CommonCalamitySounds.ELRFireSound, Owner.Center); Vector2 laserPos = TipPosition + Vector2.UnitY.RotatedBy(Projectile.rotation) * Main.rand.NextFloat(-7f, 7f); Vector2 laserVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld) * 20f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserPos, laserVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25f), 3f, Projectile.owner, SoulColors[0]); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), laserPos, laserVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.35f), 3f, Projectile.owner, SoulColors[0]); if (ConsumeSoul) { SoulColors.RemoveAt(0); - shpc.storedSoulpower--; + if (shpc.storedSoulpower > 0) + shpc.storedSoulpower--; + else if (SHPC.FindSoulForAmmo(Owner) != -1) + { + int soulType = SHPC.FindSoulForAmmo(Owner); + Owner.ConsumeItem(soulType); + shpc.storedSoulType = soulType; + shpc.storedSoulpower = SHPC.ShotsPerSoul; + } + else + { + SoulColors.Clear(); + } } ConsumeSoul = !ConsumeSoul; } diff --git a/Projectiles/Magic/Shadowbolt.cs b/Projectiles/Magic/Shadowbolt.cs index 1207adf6cd..d41828d09c 100644 --- a/Projectiles/Magic/Shadowbolt.cs +++ b/Projectiles/Magic/Shadowbolt.cs @@ -75,10 +75,10 @@ namespace CalamityMod.Projectiles.Magic if (reflectionTimer <= 0) { SoundStyle bounce = new("CalamityMod/Sounds/Item/ShadowboltReflect"); - SoundEngine.PlaySound(bounce with { Volume = 0.6f, Pitch = 0f }, platPosWall); + SoundEngine.PlaySound(bounce with { Volume = 0.6f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = -1 }, platPosWall); for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; - Projectile.velocity = (targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX) * 5; + Projectile.velocity = (targetCenter - platPosCenter).SafeNormalize(Vector2.UnitX) * 12; reflecting = false; hasReboundOffPlat = true; time = 10; @@ -121,13 +121,13 @@ namespace CalamityMod.Projectiles.Magic GeneralParticleHandler.SpawnParticle(blastRing); SoundStyle wall = new("CalamityMod/Sounds/Item/ShadowboltWallHit"); - SoundEngine.PlaySound(wall with { Volume = 0.5f, Pitch = 0f }, platPosWall); + SoundEngine.PlaySound(wall with { Volume = 0.5f, Pitch = 0f, MaxInstances = -1 }, platPosWall); reflecting = true; Projectile.extraUpdates = 0; } } - if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn && (Collision.SolidCollision(Projectile.Center, 20, 20) || time > 90)) + if (!hasReboundOffPlat && Projectile.numHits == 0 && !hasSetPlatSpawn && (Collision.SolidCollision(Projectile.Center, 20, 20) || time > 70)) { hasSetPlatSpawn = true; spawnPlat = true; @@ -151,6 +151,8 @@ namespace CalamityMod.Projectiles.Magic { if (time == 14) { + SoundEngine.PlaySound(SoundID.Item72 with { Volume = 0.8f, Pitch = Main.rand.NextFloat(-0.1f, 0.1f), MaxInstances = -1 }, Projectile.Center); + Projectile.velocity = Projectile.velocity.RotatedByRandom(0.15f); for (int i = 0; i < 2; i++) { Particle blastRing = new CustomPulse(Projectile.Center, Vector2.Zero, Color.Indigo, "CalamityMod/Particles/BloomCircle", Vector2.One, Main.rand.NextFloat(-10, 10), 0.3f, 0.75f, 12, true); @@ -176,7 +178,7 @@ namespace CalamityMod.Projectiles.Magic } if (time > 22 && time % 3 == 0) { - Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * 0.1f, false, 18, 0.05f * (hasReboundOffPlat ? 1.1f : 0.5f), Color.Lerp(Color.Indigo, Color.Orchid, 0.25f), new Vector2(0.7f, 1f), true, false, 0.3f); + Particle spark = new GlowSparkParticle(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 10, -Projectile.velocity * 0.1f, false, 18, 0.05f * (hasReboundOffPlat ? 1.1f : 0.5f), Color.Lerp(Color.Indigo, Color.Orchid, 0.25f), new Vector2(0.7f, 2f), true, false, 0.3f); GeneralParticleHandler.SpawnParticle(spark); } if (time > 30 && Main.rand.NextBool(12)) diff --git a/Projectiles/Magic/ShiftingSandsProj.cs b/Projectiles/Magic/ShiftingSandsProj.cs index 60f9c2608a..f5ca2df035 100644 --- a/Projectiles/Magic/ShiftingSandsProj.cs +++ b/Projectiles/Magic/ShiftingSandsProj.cs @@ -21,122 +21,170 @@ namespace CalamityMod.Projectiles.Magic Projectile.width = 18; Projectile.height = 18; Projectile.friendly = true; - Projectile.penetrate = 5; + Projectile.penetrate = 3; Projectile.DamageType = DamageClass.Magic; - Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.tileCollide = false; + Projectile.localNPCHitCooldown = 12; } public override void AI() { - if (Projectile.soundDelay == 0 && Math.Abs(Projectile.velocity.X) + Math.Abs(Projectile.velocity.Y) > 2f) - { - Projectile.soundDelay = 10; - SoundEngine.PlaySound(SoundID.Item20, Projectile.Center); - } - int sand = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.UnusedBrown, 0f, 0f, 100, default, 2f); - Dust dust = Main.dust[sand]; - dust.velocity *= 0.3f; - dust.position.X = Projectile.Center.X + 4f + (float)Main.rand.Next(-4, 5); - dust.position.Y = Projectile.Center.Y + (float)Main.rand.Next(-4, 5); - dust.noGravity = true; + int maxVelocity = 32; + Player player = Main.player[Projectile.owner]; + int height = Main.maxTilesY * 16; + int heightRatio = 0; - if (Main.myPlayer == Projectile.owner && Projectile.ai[0] <= 0f) + if (Projectile.ai[0] >= 0f) + heightRatio = (int)(Projectile.ai[1] / (float)height); + + bool notBeingChanneled = Projectile.ai[0] == -1f || Projectile.ai[0] == -2f; + if (Projectile.penetrate == 1 && Projectile.ai[0] >= 0f && heightRatio == 0) { - Player player = Main.player[Projectile.owner]; - if (player.channel) + Projectile.ai[1] += height; + heightRatio = 1; + Projectile.netUpdate = true; + } + if (Projectile.penetrate == 1 && Projectile.ai[0] == -1f) + { + Projectile.ai[0] = -2f; + Projectile.netUpdate = true; + } + if (heightRatio > 0 || Projectile.ai[0] == -2f) + Projectile.localAI[0] += 1f; + + if (Main.myPlayer == Projectile.owner) + { + if (Projectile.ai[0] >= 0f) { - float speed = 18f; - float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - Projectile.Center.X; - float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - Projectile.Center.Y; - if (player.gravDir == -1f) + if (player.channel && player.HeldItem.shoot == Projectile.type) { - mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - Projectile.Center.Y; - } - Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); - float mouseDist = mouseVec.Length(); - if (Projectile.ai[0] < 0f) - { - Projectile.ai[0] += 1f; - } - if (mouseDist > speed) - { - mouseDist = speed / mouseDist; - mouseVec.X *= mouseDist; - mouseVec.Y *= mouseDist; - int mouseSpeedX = (int)(mouseVec.X * 1000f); - int projSpeedX = (int)(Projectile.velocity.X * 1000f); - int mouseSpeedY = (int)(mouseVec.Y * 1000f); - int projSpeedY = (int)(Projectile.velocity.Y * 1000f); - if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + Vector2 channelPos = Main.MouseWorld; + player.LimitPointToPlayerReachableArea(ref channelPos); + if (Projectile.ai[0] != channelPos.X || Projectile.ai[1] != channelPos.Y) { Projectile.netUpdate = true; + Projectile.ai[0] = channelPos.X; + Projectile.ai[1] = channelPos.Y + (float)(height * heightRatio); } - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; } else { - int mouseSpeedX = (int)(mouseVec.X * 1000f); - int projSpeedX = (int)(Projectile.velocity.X * 1000f); - int mouseSpeedY = (int)(mouseVec.Y * 1000f); - int projSpeedY = (int)(Projectile.velocity.Y * 1000f); - if (mouseSpeedX != projSpeedX || mouseSpeedY != projSpeedY) + Projectile.netUpdate = true; + Projectile.ai[0] = -1f; + Projectile.ai[1] = -1f; + NPC homeTarget = ClosestNPCAtMagicMissileStyle(Projectile.Center, 800f); + if (homeTarget != null) { + int targetIndex = homeTarget.whoAmI; + if (targetIndex != -1) + Projectile.ai[1] = targetIndex; + } + else if (Projectile.velocity.Length() < 2f) + Projectile.velocity = Projectile.DirectionFrom(player.Center) * maxVelocity; + else + Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.Zero) * maxVelocity; + } + } + + if (notBeingChanneled && Projectile.ai[1] == -1f) + { + NPC homeTarget = ClosestNPCAtMagicMissileStyle(Projectile.Center, 800f); + if (homeTarget != null) + { + int targetIndex = homeTarget.whoAmI; + if (targetIndex != -1) + { + Projectile.ai[1] = targetIndex; Projectile.netUpdate = true; } - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; } } - else if (Projectile.ai[0] <= 0f) - { - Projectile.Calamity().conditionalHomingRange = 750f; - Projectile.netUpdate = true; - float speed = 12f; - Vector2 projCenter = Projectile.Center; - float mouseDistX = (float)Main.mouseX + Main.screenPosition.X - projCenter.X; - float mouseDistY = (float)Main.mouseY + Main.screenPosition.Y - projCenter.Y; - if (player.gravDir == -1f) - { - mouseDistY = Main.screenPosition.Y + (float)Main.screenHeight - (float)Main.mouseY - projCenter.Y; - } - Vector2 mouseVec = new Vector2(mouseDistX, mouseDistY); - float mouseDist = mouseVec.Length(); - if (mouseDist <= 2f || Projectile.ai[0] < 0f) - { - projCenter = player.Center; - mouseVec = Projectile.Center - projCenter; - mouseDist = mouseVec.Length(); - } - mouseDist = speed / mouseDist; - mouseVec.X *= mouseDist; - mouseVec.Y *= mouseDist; - Projectile.velocity.X = mouseVec.X; - Projectile.velocity.Y = mouseVec.Y; - if (Projectile.velocity.X == 0f && Projectile.velocity.Y == 0f) - { - Projectile.Kill(); - } - Projectile.ai[0] = 1f; - } } - if (Projectile.velocity.X != 0f || Projectile.velocity.Y != 0f) - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - } - if (Projectile.velocity.Y > 16f) - { - Projectile.velocity.Y = 16f; - } - } - public override bool PreDraw(ref Color lightColor) + Vector2 targetVector = Vector2.Zero; + float chaseLerp = 1f; + if (Projectile.ai[0] > 0f && Projectile.ai[1] > 0f) + targetVector = new Vector2(Projectile.ai[0], Projectile.ai[1] % height); + + if (notBeingChanneled && Projectile.ai[1] >= 0f) + { + Projectile.tileCollide = false; + NPC target = Main.npc[(int)Projectile.ai[1]]; + if (target.CanBeChasedBy()) + { + targetVector = target.Center; + float invFineL = Utils.GetLerpValue(0f, 100f, Projectile.Distance(targetVector), true) * Utils.GetLerpValue(600f, 400f, Projectile.Distance(targetVector), true); + chaseLerp = MathHelper.Lerp(0f, 0.2f, Utils.GetLerpValue(200f, 20f, 1f - invFineL, true)); + } + else + { + Projectile.ai[1] = -1f; + Projectile.netUpdate = true; + } + } + + if (targetVector != Vector2.Zero) + { + if (Projectile.Distance(targetVector) >= 64f) + { + Vector2 distanceVector = targetVector - Projectile.Center; + Vector2 moveVelocity = distanceVector.SafeNormalize(Vector2.Zero); + float velocityMult = Math.Min(maxVelocity, distanceVector.Length()); + moveVelocity *= velocityMult; + if (Projectile.velocity.Length() < 4f) + Projectile.velocity += Projectile.velocity.RotatedBy(MathHelper.PiOver4).SafeNormalize(Vector2.Zero) * 4f; + + Projectile.velocity = Vector2.Lerp(Projectile.velocity, moveVelocity, chaseLerp); + } + else + { + Projectile.velocity *= 0.3f; + Projectile.velocity += (targetVector - Projectile.Center) * 0.3f; + } + + if (Projectile.timeLeft < 60) + Projectile.timeLeft = 60; + } + + if (notBeingChanneled && Projectile.ai[1] < 0f) + { + if (Projectile.velocity.Length() != maxVelocity) + Projectile.velocity = Projectile.velocity.MoveTowards(Projectile.velocity.SafeNormalize(Vector2.UnitY) * maxVelocity, 4f); + + if (Projectile.timeLeft > 300) + Projectile.timeLeft = 300; + } + + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + } + private NPC ClosestNPCAtMagicMissileStyle(Vector2 origin, float maxDistanceToCheck = 800f) { - CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); - return false; + NPC closestTarget = null; + float distance = maxDistanceToCheck; + + for (int i = 0; i < Main.npc.Length; i++) + { + if (Main.npc[i].CanBeChasedBy() && Projectile.localNPCImmunity[i] == 0) + { + float extraDistance = (Main.npc[i].width / 2) + (Main.npc[i].height / 2); + if (Vector2.Distance(origin, Main.npc[i].Center) < distance) + { + distance = Vector2.Distance(origin, Main.npc[i].Center); + closestTarget = Main.npc[i]; + } + } + } + return closestTarget; + } + public override bool OnTileCollide(Vector2 oldVelocity) => Projectile.ai[0] < 0f; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Projectile.ai[0] == -1f) + { + Projectile.ai[1] = -1f; + Projectile.netUpdate = true; + } } public override void OnKill(int timeLeft) @@ -151,10 +199,10 @@ namespace CalamityMod.Projectiles.Magic Projectile.Damage(); SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); int dustAmt = 36; - for (int index = 0; index < dustAmt; index++) + for (int i = 0; i < dustAmt; i++) { Vector2 dustPos = Vector2.Normalize(Projectile.velocity) * new Vector2((float)Projectile.width / 2f, (float)Projectile.height) * 0.75f; - dustPos = dustPos.RotatedBy((double)((float)(index - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; + dustPos = dustPos.RotatedBy((double)((float)(i - (dustAmt / 2 - 1)) * MathHelper.TwoPi / (float)dustAmt), default) + Projectile.Center; Vector2 dustVel = dustPos - Projectile.Center; int sand = Dust.NewDust(dustPos + dustVel, 0, 0, DustID.UnusedBrown, dustVel.X * 1.5f, dustVel.Y * 1.5f, 100, default, 1.2f); Main.dust[sand].noGravity = true; @@ -162,5 +210,11 @@ namespace CalamityMod.Projectiles.Magic Main.dust[sand].velocity = dustVel; } } + + public override bool PreDraw(ref Color lightColor) + { + CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], lightColor, 1); + return false; + } } } diff --git a/Projectiles/Magic/Snowball.cs b/Projectiles/Magic/Snowball.cs index 451b62000a..e62ac2ff5b 100644 --- a/Projectiles/Magic/Snowball.cs +++ b/Projectiles/Magic/Snowball.cs @@ -19,7 +19,6 @@ namespace CalamityMod.Projectiles.Magic Projectile.DamageType = DamageClass.Magic; Projectile.coldDamage = true; Projectile.penetrate = 1; - Projectile.extraUpdates = 1; Projectile.coldDamage = true; } diff --git a/Projectiles/Magic/TearsofHeavenProjectile.cs b/Projectiles/Magic/TearsofHeavenProjectile.cs index c3c2809d12..695d4f8515 100644 --- a/Projectiles/Magic/TearsofHeavenProjectile.cs +++ b/Projectiles/Magic/TearsofHeavenProjectile.cs @@ -62,7 +62,8 @@ namespace CalamityMod.Projectiles.Magic public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(BuffID.OnFire3, 180); + target.AddBuff(BuffID.Frostburn2, 180); } } } diff --git a/Projectiles/Magic/ValkyrieRayBeam.cs b/Projectiles/Magic/ValkyrieRayBeam.cs index d1f2164ad8..a44f2244de 100644 --- a/Projectiles/Magic/ValkyrieRayBeam.cs +++ b/Projectiles/Magic/ValkyrieRayBeam.cs @@ -47,7 +47,7 @@ namespace CalamityMod.Projectiles.Magic // The beam itself still stops on tiles, but its invisible "source" projectile ignores them. Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 4; + Projectile.localNPCHitCooldown = -1; // The beam lasts for only some frames and fades out over that time. Projectile.timeLeft = Lifetime; diff --git a/Projectiles/Magic/ValkyrieRayStaff.cs b/Projectiles/Magic/ValkyrieRayStaff.cs index 0fa15fb048..a84949c126 100644 --- a/Projectiles/Magic/ValkyrieRayStaff.cs +++ b/Projectiles/Magic/ValkyrieRayStaff.cs @@ -35,9 +35,9 @@ namespace CalamityMod.Projectiles.Magic // Calculate how quickly the staff should charge. Charge increases by some number close to 1 every frame. // Speed increasing reforges make this number greater than 1. Slowing reforges make it smaller than 1. if (Projectile.localAI[0] == 0f) - Projectile.localAI[0] = 47f / player.ActiveItem().useTime; + Projectile.localAI[0] = (ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames) / player.ActiveItem().useTime; - // Increment the timer for the staff. If the timer has passed 47, destroy it. + // Increment the timer for the staff. If the timer has passed the total time, destroy it. Projectile.ai[0] += Projectile.localAI[0]; int maxTime = ValkyrieRay.ChargeFrames + ValkyrieRay.CooldownFrames; if (Projectile.ai[0] > maxTime) @@ -127,8 +127,8 @@ namespace CalamityMod.Projectiles.Magic private void FiringEffects(Vector2 center) { - SoundEngine.PlaySound(SoundID.Item28, center); - SoundEngine.PlaySound(SoundID.Item60, center); + SoundEngine.PlaySound(SoundID.Item28 with { Volume = 0.7f }, center); + SoundEngine.PlaySound(SoundID.Item60 with { Volume = 0.7f }, center); int numDust = 36; int dustID = 73; for (int i = 0; i < numDust; ++i) diff --git a/Projectiles/Magic/VitriolicViperSpit.cs b/Projectiles/Magic/VitriolicViperSpit.cs index 3dbd357902..441f6044a2 100644 --- a/Projectiles/Magic/VitriolicViperSpit.cs +++ b/Projectiles/Magic/VitriolicViperSpit.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Magic } if (time > 3) - Projectile.Center += offset * direction; + Projectile.Center += offset * direction * Utils.GetLerpValue(3, 10, time, true); if (time > 3 && targetDist < 1400) { diff --git a/Projectiles/Magic/VoidVortexProj.cs b/Projectiles/Magic/VoidVortexProj.cs index c0a5cfbf3f..314b58ac56 100644 --- a/Projectiles/Magic/VoidVortexProj.cs +++ b/Projectiles/Magic/VoidVortexProj.cs @@ -145,9 +145,12 @@ namespace CalamityMod.Projectiles.Magic Projectile.ExpandHitboxBy(400); Projectile.Damage(); - for (int k = 0; k < 12; k++) + if (Main.myPlayer == Projectile.owner) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType(), Projectile.damage / 6, 0f, Main.myPlayer, 0f, 0f, 3f); + for (int k = 0; k < 12; k++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, new Vector2(10, 10).RotatedByRandom(100) * Main.rand.NextFloat(0.4f, 0.55f), ModContent.ProjectileType(), Projectile.damage / 6, 0f, Main.myPlayer, 0f, 0f, 3f); + } } for (int k = 0; k < 40; k++) { diff --git a/Projectiles/Magic/VolterionHoldout.cs b/Projectiles/Magic/VolterionHoldout.cs index 9fae60413e..aca54af815 100644 --- a/Projectiles/Magic/VolterionHoldout.cs +++ b/Projectiles/Magic/VolterionHoldout.cs @@ -4,6 +4,7 @@ using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; +using ReLogic.Utilities; using Terraria; using Terraria.Audio; using Terraria.GameContent; @@ -26,6 +27,7 @@ namespace CalamityMod.Projectiles.Magic public override string Texture => "CalamityMod/Projectiles/Magic/VolterionHoldout"; public static readonly SoundStyle FireSound = new("CalamityMod/Sounds/Item/VolterionFire") { Volume = 0.35f }; + public SlotId FireSoundSlot; public ref float FlashTimer => ref Projectile.ai[0]; @@ -100,7 +102,9 @@ namespace CalamityMod.Projectiles.Magic if (Owner.CheckMana(Owner.ActiveItem(), -1, true)) { FlashTimer = 4f; - SoundEngine.PlaySound(FireSound, GunTipPosition); + FireSoundSlot = SoundEngine.PlaySound(FireSound, GunTipPosition); + if (Owner.Calamity().GeneralScreenShakePower < 3f) + Owner.Calamity().GeneralScreenShakePower = 3f; // Start from slightly behind the tip Vector2 offsetPos = GunTipPosition - Projectile.velocity.SafeNormalize(Vector2.UnitY) * 18f; @@ -126,6 +130,9 @@ namespace CalamityMod.Projectiles.Magic Projectile.frameCounter = 0; } } + + if (SoundEngine.TryGetActiveSound(FireSoundSlot, out var currentSound) && currentSound.IsPlaying) + currentSound.Position = GunTipPosition; } // Muzzle flash can deal damage diff --git a/Projectiles/Melee/AbyssBladeProjectile.cs b/Projectiles/Melee/AbyssBladeProjectile.cs index 1ea0f6191b..cb0d83bc3f 100644 --- a/Projectiles/Melee/AbyssBladeProjectile.cs +++ b/Projectiles/Melee/AbyssBladeProjectile.cs @@ -159,6 +159,7 @@ namespace CalamityMod.Projectiles.Melee GenericSparkle sparker = new GenericSparkle(Projectile.Center, Vector2.Zero, Color.DodgerBlue, Color.MediumBlue, Main.rand.NextFloat(2.5f, 2.9f) - i * 0.55f, 14, Main.rand.NextFloat(-0.01f, 0.01f), 2.5f); GeneralParticleHandler.SpawnParticle(sparker); } + Projectile.ResetLocalNPCHitImmunity(); Projectile.penetrate = 1; Projectile.damage = (int)(startDamage * 2); // Launched blade deals 200% damage Time = 0; diff --git a/Projectiles/Melee/AncientStar.cs b/Projectiles/Melee/AncientStar.cs index d798f5435c..bc1885c66b 100644 --- a/Projectiles/Melee/AncientStar.cs +++ b/Projectiles/Melee/AncientStar.cs @@ -50,11 +50,6 @@ namespace CalamityMod.Projectiles.Melee } } - if (Projectile.timeLeft < MaxTime - 5) - { - Projectile.tileCollide = true; - } - if (Timer / MaxTime > 0.25f) { Projectile.velocity *= 0.95f; diff --git a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs index cf2aace6b5..ed61618cec 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_ParryHoldout.cs @@ -41,6 +41,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.noEnchantmentVisuals = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.idStaticNPCHitCooldown = 10; + Projectile.timeLeft = (int)MaxTime; } public override bool? CanDamage() => Timer <= ParryTime && AlreadyParried == 0f; @@ -108,7 +109,7 @@ namespace CalamityMod.Projectiles.Melee { if (!initialized) //Initialization { - Projectile.timeLeft = (int)MaxTime; + //Projectile.timeLeft = (int)MaxTime; SoundEngine.PlaySound(SoundID.Item84 with { Volume = SoundID.Item84.Volume * 0.3f }, Projectile.Center); // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction diff --git a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs index 65c5cce750..854b5d2c48 100644 --- a/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs +++ b/Projectiles/Melee/ArkOfTheCosmos_SwungBlade.cs @@ -1,5 +1,6 @@ using System; using System.IO; +using System.Linq; using CalamityMod.Items.Weapons.Melee; using CalamityMod.Particles; using CalamityMod.Sounds; @@ -273,6 +274,15 @@ namespace CalamityMod.Projectiles.Melee float extraRotations = (direction.ToRotation() + MathHelper.PiOver4 > Projectile.velocity.ToRotation()) ? -MathHelper.TwoPi : 0f; Projectile.rotation = MathHelper.Lerp(Projectile.velocity.ToRotation(), direction.ToRotation() + extraRotations, orientateProperly); + if (ChanceMissed == 0f && Owner.controlUseTile && ThrowCompletion > 0.99f) + { + ArkoftheCosmos sword = (Owner.HeldItem.ModItem as ArkoftheCosmos); + Projectile parrier = Main.projectile.FirstOrDefault(p => p.active && p.owner == Owner.whoAmI && p.type == ProjectileType(), null); + if (sword is not null && parrier is null) + { + int parryID = Projectile.NewProjectile(Owner.GetSource_ItemUse(sword.Item), Owner.Center, Owner.DirectionTo(Projectile.Center), ModContent.ProjectileType(), 0, 0, Owner.whoAmI); + } + } } //Sharticles diff --git a/Projectiles/Melee/Blood.cs b/Projectiles/Melee/Blood.cs index d87e1880b7..da2bb26ee6 100644 --- a/Projectiles/Melee/Blood.cs +++ b/Projectiles/Melee/Blood.cs @@ -42,16 +42,6 @@ namespace CalamityMod.Projectiles.Melee CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 600f, 6f, 20f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.075); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.075)); } } diff --git a/Projectiles/Melee/BotanicSpear.cs b/Projectiles/Melee/BotanicSpear.cs index f42ce6103b..c6409abe97 100644 --- a/Projectiles/Melee/BotanicSpear.cs +++ b/Projectiles/Melee/BotanicSpear.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.height = 16; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = -1; + Projectile.penetrate = 2; Projectile.tileCollide = false; Projectile.timeLeft = TimeLeft; Projectile.usesLocalNPCImmunity = true; diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index 8c7e3ac1c3..4f6706afe6 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -25,9 +25,6 @@ namespace CalamityMod.Projectiles.Melee public const float LungeSpeed = 16; public ref float CanBounce => ref Projectile.localAI[0]; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -91,20 +88,14 @@ namespace CalamityMod.Projectiles.Melee Owner.velocity = direction.SafeNormalize(Vector2.UnitX * Owner.direction) * LungeSpeed; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - - private void OnHitEffects(bool cannotLifesteal) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Projectile.ForceNetUpdate(); if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - if (!cannotLifesteal) //trolled - { - Owner.HealPlayer(BrokenBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck - } + Owner.DoLifestealDirect(target, BrokenBiomeBlade.EvilAttunement_Lifesteal, 1.25f); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; diff --git a/Projectiles/Melee/DevilsSunriseCyclone.cs b/Projectiles/Melee/DevilsSunriseCyclone.cs index cab7c87dbf..4e5e3888ab 100644 --- a/Projectiles/Melee/DevilsSunriseCyclone.cs +++ b/Projectiles/Melee/DevilsSunriseCyclone.cs @@ -141,9 +141,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(HitSound, target.Center); target.AddBuff(ModContent.BuffType(), 180); // Heals on each hit - Player own = Main.player[Projectile.owner]; - if (!own.moonLeech) - own.HealPlayer(1); + Main.player[Projectile.owner].DoLifestealDirect(target, 1, 0.75f); // Start slicing the hit enemy if not doing so already if (State != 2f) diff --git a/Projectiles/Melee/DragonRageStaff.cs b/Projectiles/Melee/DragonRageStaff.cs index 29a8413530..5286f392d9 100644 --- a/Projectiles/Melee/DragonRageStaff.cs +++ b/Projectiles/Melee/DragonRageStaff.cs @@ -161,7 +161,7 @@ namespace CalamityMod.Projectiles.Melee { CalamityPlayer modPlayer = Main.player[Projectile.owner].Calamity(); modPlayer.dragonRageHits++; - if (modPlayer.dragonRageHits > 10 && modPlayer.dragonRageCooldown <= 0) + if (modPlayer.dragonRageHits >= 10 && modPlayer.dragonRageCooldown <= 0) { SpawnFireballs(); modPlayer.dragonRageHits = 0; diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 8406697e38..e7800cc539 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -302,11 +302,11 @@ namespace CalamityMod.Projectiles.Melee spawnBoom = false; } - int healPower = Projectile.ai[1] == -1 ? 90 : 80; - int heal = (int)(MathHelper.Clamp(healPower - Projectile.numHits * 75, 1, healPower)); + int healPower = Projectile.ai[1] == -1 ? 60 : 50; + int heal = (int)(MathHelper.Clamp(healPower - Projectile.numHits * 35, 1, healPower)); if (Projectile.numHits < 10) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.2f); } if (Projectile.numHits <= 2) diff --git a/Projectiles/Melee/EmpyreanKnife.cs b/Projectiles/Melee/EmpyreanKnife.cs index 26ee16b06f..89cf2d5927 100644 --- a/Projectiles/Melee/EmpyreanKnife.cs +++ b/Projectiles/Melee/EmpyreanKnife.cs @@ -78,29 +78,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - int heal = (int)Math.Round(info.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.015), 0.75f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/EssenceScythe.cs b/Projectiles/Melee/EssenceScythe.cs index f487a0cd93..64b2e4eba6 100644 --- a/Projectiles/Melee/EssenceScythe.cs +++ b/Projectiles/Melee/EssenceScythe.cs @@ -78,11 +78,8 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - if (target.life <= 0 && target.lifeMax > 5) - { - if (Projectile.owner == Main.myPlayer) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], 8, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, 0f); - } + if (target.life <= 0) + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 8, 0f); } } } diff --git a/Projectiles/Melee/ExobladeProj.cs b/Projectiles/Melee/ExobladeProj.cs index 884824bdbe..90957183db 100644 --- a/Projectiles/Melee/ExobladeProj.cs +++ b/Projectiles/Melee/ExobladeProj.cs @@ -628,17 +628,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.NewProjectile(Projectile.GetSource_FromAI(), target.Center, Vector2.Zero, ModContent.ProjectileType(), explosionDamage, 0f, Projectile.owner); } - if (target.lifeMax <= 5 || Owner.lifeSteal <= 0) - return; - - int healAmt = (int)Math.Round(hit.Damage * 0.04); - if (healAmt > BalancingConstants.LifeStealCap) - healAmt = BalancingConstants.LifeStealCap; - - if (healAmt <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Owner, healAmt, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + Owner.DoLifestealDirect(target, (int)Math.Round(hit.Damage * 0.04), 0.4f); } } diff --git a/Projectiles/Melee/Galaxia_PhoenixsPride.cs b/Projectiles/Melee/Galaxia_PhoenixsPride.cs index c473cb8de7..0e9dd39a3d 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPride.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPride.cs @@ -263,8 +263,7 @@ namespace CalamityMod.Projectiles.Melee if (CurrentState == 1f && Main.myPlayer == Projectile.owner && !AnyProjectiles(ProjectileType())) { Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, Vector2.Zero, ProjectileType(), Projectile.damage, 0f, Projectile.owner, target.whoAmI); - if (proj.ModProjectile is PhoenixsPrideFirewall fire) - fire.Scale = MathHelper.Clamp(target.width / 100f, 0.3f, 1.25f); + (proj.ModProjectile as PhoenixsPrideFirewall).Scale = MathHelper.Clamp(target.width / 100f, 0.3f, 1.25f); } } diff --git a/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs index 2f4a52d81d..90f305fa35 100644 --- a/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs +++ b/Projectiles/Melee/Galaxia_PhoenixsPrideFirewall.cs @@ -1,8 +1,10 @@ using CalamityMod.CalPlayer; using CalamityMod.Graphics.Primitives; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using System; using System.IO; using Terraria; using Terraria.Graphics.Shaders; @@ -11,11 +13,11 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { - public class PhoenixsPrideFirewall : ModProjectile, ILocalizedModType + public class PhoenixsPrideFirewall : ModProjectile, ILocalizedModType, IPixelatedPrimitiveRenderer { public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; - public const int TornadoHeight = 480; + public const int MaxTornadoHeight = 270; public float Scale; // Size of the firewall, scales with NPC width public float fadeOut = 0f; // Used to control the firewall fading in and out at the start and end of its lifespan @@ -32,7 +34,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.alpha = 255; Projectile.scale = Scale; - Projectile.timeLeft = 150; + Projectile.timeLeft = 180; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = FourSeasonsGalaxia.PhoenixAttunement_FlamePillarLocalIFrames; } @@ -40,20 +42,30 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { // Constantly follow its target - // Die if the target is no longer active + // Immediately start fading away if the target is no longer active if (!Target.active) { - Projectile.Kill(); - return; + Projectile.velocity *= 0.975f; + if (Projectile.timeLeft > 15) + Projectile.timeLeft = 15; } else - Projectile.Center = Target.Center + Target.velocity; + Projectile.velocity = (Projectile.velocity * 13f + (Target.Center - Projectile.Center).SafeNormalize(Vector2.Zero) * 24f) / 14f; // Fade in and out at the start and end of its lifespan - if (Projectile.timeLeft > 145) - fadeOut += 0.15f; + if (Projectile.timeLeft > 170) + fadeOut += 0.1f; if (Projectile.timeLeft < 15) fadeOut -= 0.05f; + + // Some smoke on the base + if (Projectile.timeLeft % 3 == 0) + { + MediumMistParticle smoke = new(Projectile.Center, Main.rand.NextVector2Circular(6f, 6f), Color.Orange, Color.DarkOrange, 1.1f, 170f); + GeneralParticleHandler.SpawnParticle(smoke); + SquareParticle spark = new(Projectile.Center, -Vector2.UnitY.RotatedByRandom(MathHelper.PiOver2) * 8f, true, 20, 0.9f, Color.White); + GeneralParticleHandler.SpawnParticle(spark); + } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) @@ -62,46 +74,29 @@ namespace CalamityMod.Projectiles.Melee return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Bottom, - Projectile.Bottom - Vector2.UnitY * TornadoHeight, + Projectile.Bottom - Vector2.UnitY * MaxTornadoHeight, 72, ref _); } - public float WidthFunction(float completionRatio) => 50f * Scale * (completionRatio > 0.4f ? 1f : completionRatio * 2.5f); - - public override bool PreDraw(ref Color lightColor) + public float WidthFunction(float completionRatio) => MathF.Max(50f * Scale * (MathF.Pow(1f - completionRatio, 2) * 2.75f), 0.35f); + public Color ColorFunction(float completionRatio) => Color.Orange * (completionRatio > 0.1f ? 1f : completionRatio * 10f); + public void RenderPixelatedPrimitives(SpriteBatch spritebatch, PixelationPrimitiveLayer layer) { - Main.spriteBatch.EnterShaderRegion(); - GameShaders.Misc["CalamityMod:Bordernado"].UseSaturation(-0.2f); GameShaders.Misc["CalamityMod:Bordernado"].UseOpacity(fadeOut); GameShaders.Misc["CalamityMod:Bordernado"].SetShaderTexture(ModContent.Request("Terraria/Images/Misc/Perlin")); - Vector2[] drawPoints = new Vector2[5]; - Vector2 upwardAscent = Vector2.UnitY * TornadoHeight; + Vector2[] drawPoints = new Vector2[7]; + Vector2 upwardAscent = Vector2.UnitY * MaxTornadoHeight * fadeOut; Vector2 bottom = Projectile.Center; Vector2 top = bottom - upwardAscent; + // Offset is intentionally applied here instead of with an offset function in PrimitiveSettings to make it a bit choppier for (int i = 0; i < drawPoints.Length - 1; i++) - drawPoints[i] = Vector2.Lerp(top, bottom, i / (float)(drawPoints.Length - 1)); + drawPoints[i] = Vector2.Lerp(top + Vector2.UnitX * (MathF.Sin(Main.GameUpdateCount * 0.15f + i) * i * 6f), bottom, i / (float)(drawPoints.Length - 1)); drawPoints[drawPoints.Length - 1] = bottom; - PrimitiveRenderer.RenderTrail(drawPoints, new(WidthFunction, (_) => Color.Orange, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 80); - - Main.spriteBatch.ExitShaderRegion(); - - Texture2D vortexTexture = ModContent.Request("CalamityMod/Projectiles/Boss/OldDukeVortex").Value; - for (int i = 0; i < 90; i++) - { - float angle = MathHelper.TwoPi * i / (25f * Scale) + Main.GlobalTimeWrappedHourly * MathHelper.TwoPi; - Color drawColor = Color.White * 0.04f; - drawColor.A = 0; - Vector2 drawPosition = bottom + angle.ToRotationVector2() * 4f - Main.screenPosition; - - drawPosition += (angle + Main.GlobalTimeWrappedHourly * i / 16f).ToRotationVector2() * 6f; - Main.EntitySpriteDraw(vortexTexture, drawPosition, null, drawColor * fadeOut, angle + MathHelper.PiOver2, vortexTexture.Size() * 0.5f, 0.2f * Scale, SpriteEffects.None, 0); - } - - return false; + PrimitiveRenderer.RenderTrail(drawPoints, new(WidthFunction, ColorFunction, pixelate: true, shader: GameShaders.Misc["CalamityMod:Bordernado"]), 80); } } } diff --git a/Projectiles/Melee/GayBeam.cs b/Projectiles/Melee/GayBeam.cs deleted file mode 100644 index 85cb5f4a85..0000000000 --- a/Projectiles/Melee/GayBeam.cs +++ /dev/null @@ -1,470 +0,0 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Graphics.Primitives; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using System.IO; -using Terraria; -using Terraria.Audio; -using Terraria.GameContent; -using Terraria.Graphics.Shaders; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Projectiles.Melee -{ - public class GayBeam : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - - private const int Alpha = 100; - - private const int TimeLeft = 600; - - private const int TrailLength = 36; - - private const int TotalAfterimages = 12; - - private const int AfterimageOffset = TrailLength / TotalAfterimages; - - private const float MaxVelocity = 24f; - - public override void SetStaticDefaults() - { - ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.TrailCacheLength[Type] = TrailLength; - } - - public override void SetDefaults() - { - Projectile.width = 16; - Projectile.height = 16; - Projectile.friendly = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; - Projectile.timeLeft = TimeLeft; - Projectile.alpha = Alpha; - } - - public override void SendExtraAI(BinaryWriter writer) - { - writer.Write(Projectile.localAI[0]); - writer.Write(Projectile.localAI[1]); - } - - public override void ReceiveExtraAI(BinaryReader reader) - { - Projectile.localAI[0] = reader.ReadSingle(); - Projectile.localAI[1] = reader.ReadSingle(); - } - - public override void AI() - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); - - if (Projectile.ai[2] == 0f) - SoundEngine.PlaySound(SoundID.Item60, Projectile.Center); - - Color color = GetProjectileColor(); - switch ((int)Projectile.ai[0]) - { - case 0: // Red, normal beam - break; - - case 1: // Orange, curve back to player - - int player = (int)Player.FindClosest(Projectile.Center, 1, 1); - Projectile.ai[1] += 1f; - if (Projectile.ai[1] < 360f && Projectile.ai[1] > 60f) - { - float homeSpeed = Projectile.velocity.Length(); - Vector2 vecToPlayer = Main.player[player].Center - Projectile.Center; - vecToPlayer = vecToPlayer.SafeNormalize(Vector2.UnitY); - vecToPlayer *= homeSpeed; - Projectile.velocity = (Projectile.velocity * 29f + vecToPlayer) / 30f; - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY); - Projectile.velocity *= homeSpeed; - } - - if (Projectile.velocity.Length() < MaxVelocity) - { - Projectile.velocity *= 1.01f; - if (Projectile.velocity.Length() > MaxVelocity) - { - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY); - Projectile.velocity *= MaxVelocity; - } - } - - break; - - case 2: // Yellow, split after a certain time - - Projectile.localAI[1] += 1f; - if (Projectile.localAI[1] >= 45f) - { - int numProj = 2; - float rotation = MathHelper.ToRadians(10); - if (Projectile.owner == Main.myPlayer) - { - for (int i = 0; i < numProj; i++) - { - Vector2 perturbedSpeed = Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.Lerp(-rotation, rotation, i / (float)(numProj - 1))); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, perturbedSpeed * MaxVelocity, Projectile.type, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner); - } - } - - Projectile.Kill(); - } - - break; - - case 3: // Lime, home in on player within certain distance - - float inertia = 30f; - float homingSpeed = MaxVelocity; - float minDist = 300f; - if (Main.player[Projectile.owner].active && !Main.player[Projectile.owner].dead) - { - if (Projectile.Distance(Main.player[Projectile.owner].Center) > minDist) - { - Vector2 moveDirection = Projectile.SafeDirectionTo(Main.player[Projectile.owner].Center, Vector2.UnitY); - Projectile.velocity = (Projectile.velocity * (inertia - 1f) + moveDirection * homingSpeed) / inertia; - } - } - else - { - if (Projectile.timeLeft > 30) - Projectile.timeLeft = 30; - } - - break; - - case 4: // Green, home in on enemies - - CalamityUtils.HomeInOnNPC(Projectile, false, 600f, MaxVelocity, 30f); - - break; - - case 5: // Turquoise, speed up and don't collide with tiles - - Projectile.tileCollide = false; - if (Projectile.velocity.Length() < MaxVelocity) - { - Projectile.velocity *= 1.03f; - if (Projectile.velocity.Length() > MaxVelocity) - { - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY); - Projectile.velocity *= MaxVelocity; - } - } - - break; - - case 6: // Cyan, upon death create several turquoise swords - case 7: // Light Blue, slow down on hit - case 8: // Blue, bounce off of tiles and enemies - break; - - case 9: // Purple, speed up and slow down over and over - - if (Projectile.localAI[1] < 30f) - Projectile.velocity *= 0.95f; - else if (Projectile.localAI[1] < 60f) - Projectile.velocity *= 1.07f; - else if (Projectile.localAI[1] == 60f) - Projectile.localAI[1] = -1f; - Projectile.localAI[1] += 1f; - - break; - - case 10: // Fuschia, start slow then get faster - - if (Projectile.localAI[1] == 0f) - { - Projectile.velocity *= 0.1f; - Projectile.localAI[1] += 1f; - } - - if (Projectile.velocity.Length() < MaxVelocity) - { - Projectile.velocity *= 1.05f; - if (Projectile.velocity.Length() > MaxVelocity) - { - Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitY); - Projectile.velocity *= MaxVelocity; - } - } - - break; - - case 11: // Hot Pink, split into fuschia while travelling - - if (Projectile.localAI[1] == 0f) - Projectile.velocity *= 0.333f; - - if (Projectile.localAI[1] >= 45f) - { - Projectile.localAI[1] = 0f; - if (Main.myPlayer == Projectile.owner) - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Projectile.oldVelocity, Projectile.velocity, Projectile.type, (int)Math.Round(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, 10f, 0f); - } - Projectile.localAI[1] += 1f; - - break; - - default: - break; - } - - Projectile.ai[2] += MathHelper.Lerp(1f, 2f, Projectile.ai[0] / 11f); - if (Projectile.ai[2] > 7f) - { - Dust rainbow = Main.dust[Dust.NewDust(new Vector2(Projectile.position.X - Projectile.velocity.X + 2f, Projectile.position.Y + 2f - Projectile.velocity.Y), 8, 8, DustID.RainbowMk2, Projectile.oldVelocity.X, Projectile.oldVelocity.Y, Projectile.alpha, default, 1.25f)]; - rainbow.velocity *= -0.25f; - rainbow.color = color; - rainbow.color.A = 100; - rainbow.scale = Main.rand.NextFloat(1f, 1.25f); - rainbow.fadeIn = Main.rand.NextFloat(0.4f, 1f); - rainbow.noGravity = true; - rainbow.noLightEmittence = true; - - rainbow = Main.dust[Dust.NewDust(new Vector2(Projectile.position.X - Projectile.velocity.X + 2f, Projectile.position.Y + 2f - Projectile.velocity.Y), 8, 8, DustID.RainbowMk2, Projectile.oldVelocity.X, Projectile.oldVelocity.Y, Projectile.alpha, default, 1.25f)]; - rainbow.velocity *= -0.25f; - rainbow.color = color; - rainbow.color.A = 100; - rainbow.scale = Main.rand.NextFloat(1f, 1.25f); - rainbow.fadeIn = Main.rand.NextFloat(0.4f, 1f); - rainbow.noGravity = true; - rainbow.position -= Projectile.velocity * 0.5f; - rainbow.noLightEmittence = true; - - if (Projectile.localAI[0] == 0f) - { - Projectile.scale -= 0.02f; - Projectile.alpha += 5; - if (Projectile.alpha >= Alpha - 5) - { - Projectile.alpha = Alpha; - Projectile.localAI[0] = 1f; - } - } - else if (Projectile.localAI[0] == 1f) - { - Projectile.scale += 0.02f; - Projectile.alpha -= 5; - if (Projectile.alpha <= 0) - { - Projectile.alpha = 0; - Projectile.localAI[0] = 0f; - } - } - } - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 300); - - if (Projectile.ai[0] == 7f) - Projectile.velocity *= 0.5f; - else if (Projectile.ai[0] == 8f) - Projectile.velocity *= -1f; - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 300); - - if (Projectile.ai[0] == 7f) - Projectile.velocity *= 0.5f; - else if (Projectile.ai[0] == 8f) - Projectile.velocity *= -1f; - } - - public override bool OnTileCollide(Vector2 oldVelocity) - { - if (Projectile.ai[0] == 8f) - { - if (Projectile.velocity.X != oldVelocity.X) - Projectile.velocity.X = -oldVelocity.X; - if (Projectile.velocity.Y != oldVelocity.Y) - Projectile.velocity.Y = -oldVelocity.Y; - - return false; - } - - return true; - } - - public Color TrailColor(float completionRatio) - { - float hue = (Main.GlobalTimeWrappedHourly * -0.62f + completionRatio * 1.5f) % 1f; - float brightness = MathHelper.SmoothStep(0.5f, 1f, Utils.GetLerpValue(0.3f, 0f, completionRatio, true)); - float opacity = Utils.GetLerpValue(1f, 0.8f, completionRatio, true) * ((255 - Projectile.alpha) / 255f); - Color color = GetProjectileColor() * opacity; - color.A = (byte)(int)(Utils.GetLerpValue(0f, 0.2f, completionRatio) * 128); - return color; - } - - public float TrailWidth(float completionRatio) - { - float widthInterpolant = Utils.GetLerpValue(0f, 0.25f, completionRatio, true) * Utils.GetLerpValue(1.1f, 0.7f, completionRatio, true); - return MathHelper.SmoothStep(0f, 14f, widthInterpolant) * Projectile.scale; - } - - public override Color? GetAlpha(Color lightColor) => GetProjectileColor(); - - public override bool PreDraw(ref Color lightColor) - { - if (Projectile.timeLeft > TimeLeft - 5) - return false; - - Main.spriteBatch.EnterShaderRegion(); - - GameShaders.Misc["CalamityMod:ArtAttack"].SetShaderTexture(ModContent.Request("CalamityMod/ExtraTextures/Trails/SylvestaffStreak")); - GameShaders.Misc["CalamityMod:ArtAttack"].Apply(); - - PrimitiveRenderer.RenderTrail(Projectile.oldPos, new(TrailWidth, TrailColor, (_) => Projectile.Size * 0.5f, shader: GameShaders.Misc["CalamityMod:ArtAttack"]), TrailLength); - - Main.spriteBatch.ExitShaderRegion(); - - Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - int frameHeight = texture.Height / Main.projFrames[Type]; - int frameY = frameHeight * Projectile.frame; - float scale = Projectile.scale; - Rectangle rectangle = new Rectangle(0, frameY, texture.Width, frameHeight); - Vector2 origin = rectangle.Size() / 2f; - Color alphaColor = Projectile.GetAlpha(lightColor); - - if (CalamityClientConfig.Instance.Afterimages) - { - Vector2 centerOffset = Projectile.Size / 2f; - int totalAfterimages = TotalAfterimages; - for (int i = 0; i < totalAfterimages; i++) - { - int arrayPos = i * AfterimageOffset; - float afterimageRot = Projectile.oldRot[arrayPos]; - SpriteEffects sfxForThisAfterimage = Projectile.oldSpriteDirection[arrayPos] == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; - Vector2 drawPos = Projectile.oldPos[arrayPos] + centerOffset - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - float colorAndSizeScalar = (float)(totalAfterimages - i) / (float)totalAfterimages; - Color color = alphaColor * colorAndSizeScalar; - float afterimageScale = scale * MathHelper.Lerp(0.5f, 1f, colorAndSizeScalar); - Main.spriteBatch.Draw(texture, drawPos, new Rectangle?(rectangle), color, afterimageRot, origin, afterimageScale, sfxForThisAfterimage, 0f); - } - } - else - { - SpriteEffects spriteEffects = SpriteEffects.None; - if (Projectile.spriteDirection == -1) - spriteEffects = SpriteEffects.FlipHorizontally; - - Main.spriteBatch.Draw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), rectangle, alphaColor, Projectile.rotation, origin, scale, spriteEffects, 0f); - } - - return false; - } - - public override void OnKill(int timeLeft) - { - SoundEngine.PlaySound(SoundID.Item10, Projectile.Center); - - Color color = GetProjectileColor(); - switch ((int)Projectile.ai[0]) - { - case 0: // Red - case 1: // Orange - case 2: // Yellow - case 3: // Lime - case 4: // Green - case 5: // Turquoise - break; - - case 6: // Cyan - - for (int x = 0; x < 2; x++) - { - if (Projectile.owner == Main.myPlayer) - { - var source = Projectile.GetSource_FromThis(); - CalamityUtils.ProjectileBarrage(source, Projectile.Center, Projectile.Center, x == 1, 500f, 500f, 0f, 500f, MaxVelocity, Projectile.type, (int)Math.Round(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, false, 0f).ai[0] = 5f; - } - } - - break; - - case 7: // Light Blue - case 8: // Blue - case 9: // Purple - case 10: // Fuschia - case 11: // Hot Pink - default: - break; - } - - int totalDust = 60; - for (int i = 4; i < totalDust + 1; i++) - { - Vector2 oldVel = Projectile.oldVelocity * (totalDust / (float)i); - Dust rainbow = Main.dust[Dust.NewDust(Projectile.oldPosition - oldVel * 0.5f, 8, 8, DustID.RainbowMk2, Projectile.oldVelocity.X, Projectile.oldVelocity.Y, Projectile.alpha)]; - rainbow.color = color; - rainbow.color.A = 100; - rainbow.scale = Main.rand.NextFloat(2.4f, 3.6f); - rainbow.fadeIn = Main.rand.NextFloat(0.4f, 1f); - rainbow.noGravity = true; - rainbow.velocity *= (Main.rand.NextBool() ? 0.05f : 0.5f); - } - } - - private Color GetProjectileColor() - { - Color rainbow = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, Alpha); - Color color = Color.White; - switch ((int)Projectile.ai[0]) - { - case 0: // Red - color = new Color(255, 0, 0, Alpha); - break; - case 1: // Orange - color = new Color(255, 128, 0, Alpha); - break; - case 2: // Yellow - color = new Color(255, 255, 0, Alpha); - break; - case 3: // Lime - color = new Color(128, 255, 0, Alpha); - break; - case 4: // Green - color = new Color(0, 255, 0, Alpha); - break; - case 5: // Turquoise - color = new Color(0, 255, 128, Alpha); - break; - case 6: // Cyan - color = new Color(0, 255, 255, Alpha); - break; - case 7: // Light Blue - color = new Color(0, 128, 255, Alpha); - break; - case 8: // Blue - color = new Color(0, 0, 255, Alpha); - break; - case 9: // Purple - color = new Color(128, 0, 255, Alpha); - break; - case 10: // Fuschia - color = new Color(255, 0, 255, Alpha); - break; - case 11: // Hot Pink - color = new Color(255, 0, 128, Alpha); - break; - default: - break; - } - return Color.Lerp(rainbow, color, (float)Math.Sqrt((MathF.Cos(Projectile.ai[2] / 90f) + 1f) * 0.5f)); - } - } -} diff --git a/Projectiles/Melee/GayBeam.png b/Projectiles/Melee/GayBeam.png deleted file mode 100644 index 50aac5b8b2..0000000000 Binary files a/Projectiles/Melee/GayBeam.png and /dev/null differ diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index a1cf5ba28d..df2af4e30b 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -234,7 +234,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(20 - Projectile.numHits * 12, 1, 20)); if (Projectile.numHits < 10) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.5f); } if (target.CanBeMoved(true) || Main.zenithWorld || target.type == ModContent.NPCType() || (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) diff --git a/Projectiles/Melee/GrandGuardianHoldout.cs b/Projectiles/Melee/GrandGuardianHoldout.cs index d184324240..1b9181626a 100644 --- a/Projectiles/Melee/GrandGuardianHoldout.cs +++ b/Projectiles/Melee/GrandGuardianHoldout.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(5 - Projectile.numHits * 3, 1, 5)); if (Projectile.numHits < 5) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.75f); } int points = 4; diff --git a/Projectiles/Melee/HellionSpike.cs b/Projectiles/Melee/HellionSpike.cs index 7955c988a0..bae234c799 100644 --- a/Projectiles/Melee/HellionSpike.cs +++ b/Projectiles/Melee/HellionSpike.cs @@ -21,11 +21,12 @@ namespace CalamityMod.Projectiles.Melee Projectile.aiStyle = ProjAIStyleID.Beam; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 3; + Projectile.penetrate = 2; + Projectile.MaxUpdates = 2; Projectile.timeLeft = 600; AIType = ProjectileID.SporeCloud; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 8; + Projectile.localNPCHitCooldown = 8 * Projectile.MaxUpdates; } public override void AI() @@ -73,7 +74,7 @@ namespace CalamityMod.Projectiles.Melee var source = Projectile.GetSource_FromThis(); if (Projectile.owner == Main.myPlayer) { - Projectile petal = CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 10f, ProjectileID.FlowerPetal, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, true); + Projectile petal = CalamityUtils.ProjectileBarrage(source, Projectile.Center, targetPos, Main.rand.NextBool(), 800f, 800f, 0f, 800f, 24f, ProjectileID.FlowerPetal, (int)(Projectile.damage * 0.5), Projectile.knockBack * 0.5f, Projectile.owner, false, 0f); if (petal.whoAmI.WithinBounds(Main.maxProjectiles)) { petal.DamageType = DamageClass.Melee; diff --git a/Projectiles/Melee/HellkiteHoldout.cs b/Projectiles/Melee/HellkiteHoldout.cs index 87e4127d6d..d95a2aad4c 100644 --- a/Projectiles/Melee/HellkiteHoldout.cs +++ b/Projectiles/Melee/HellkiteHoldout.cs @@ -424,7 +424,7 @@ namespace CalamityMod.Projectiles.Melee float minMult = 0.25f; int hitsToMinMult = 10; float damageMult = Utils.Remap(pierceReduction, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= (chargedSwing ? (3f * (GFBMulti) + critDamage) : 1) * damageMult; + modifiers.SourceDamage *= (chargedSwing ? (2.9f * GFBMulti + critDamage) : 1) * damageMult; } public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/HolyColliderHoldout.cs b/Projectiles/Melee/HolyColliderHoldout.cs index ae4988b83b..0dba23aa5b 100644 --- a/Projectiles/Melee/HolyColliderHoldout.cs +++ b/Projectiles/Melee/HolyColliderHoldout.cs @@ -5,6 +5,7 @@ using CalamityMod.Items.Weapons.Melee; using CalamityMod.NPCs; using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Boss; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; @@ -333,10 +334,29 @@ namespace CalamityMod.Projectiles.Melee for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; - if (Vector2.Distance(Owner.Center + (new Vector2(100, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))), projectile.Center) <= 100 && projectile.active && projectile.type == ModContent.ProjectileType()) + bool isProviProj = (projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType() || + projectile.type == ModContent.ProjectileType()); + bool isAFireball = (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[0] != 10) || isProviProj; + if (Vector2.Distance(Owner.Center + (new Vector2(60, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))), projectile.Center) <= 150 + Math.Max(projectile.width, projectile.height) && projectile.active && isAFireball) { - projectile.ai[2] = 5; - projectile.owner = Owner.whoAmI; + if (isProviProj) + { + Projectile proj = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), projectile.Center, (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -2.5f, ModContent.ProjectileType(), (int)((Projectile.damage * 0.1) + projectile.damage), Projectile.knockBack, Projectile.owner, 0, 15, 5); + Particle orb2 = new CustomPulse(projectile.Center, Vector2.Zero, Color.Goldenrod, "CalamityMod/Particles/BloomRing", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0, 0.8f, 11); + GeneralParticleHandler.SpawnParticle(orb2); + if (projectile.type == ModContent.ProjectileType()) + projectile.active = false; + else + projectile.Kill(); + } + else + { + projectile.ai[2] = 5; + projectile.owner = Owner.whoAmI; + } } } } @@ -345,7 +365,8 @@ namespace CalamityMod.Projectiles.Melee for (int x = 0; x < Main.maxProjectiles; x++) { Projectile projectile = Main.projectile[x]; - if (Vector2.Distance(Owner.Center + (new Vector2(100, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))), projectile.Center) <= 100 && projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[0] != 10) + bool isAFireball = (projectile.active && projectile.type == ModContent.ProjectileType() && projectile.ai[0] != 10); + if (Vector2.Distance(Owner.Center + (new Vector2(60, 0).RotatedBy(FinalRotation + MathHelper.ToRadians(-45))), projectile.Center) <= 150 && isAFireball) { Vector2 launch = (Owner.Center - Owner.Calamity().mouseWorld).SafeNormalize(Vector2.UnitY) * -2.5f; projectile.velocity += launch; @@ -411,7 +432,7 @@ namespace CalamityMod.Projectiles.Melee } for (int i = 0; i < 4; i++) { - Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -35).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0, target.whoAmI); + Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.Center, (new Vector2(0, -35).RotatedBy(MathHelper.ToRadians(45f))).RotatedBy(MathHelper.ToRadians(90f) * i), ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack, Projectile.owner, 0); } } } diff --git a/Projectiles/Melee/HolyColliderHolyFire.cs b/Projectiles/Melee/HolyColliderHolyFire.cs index fd51d02d91..d5b585955f 100644 --- a/Projectiles/Melee/HolyColliderHolyFire.cs +++ b/Projectiles/Melee/HolyColliderHolyFire.cs @@ -18,7 +18,7 @@ namespace CalamityMod.Projectiles.Melee public bool setStats = true; public static int statMax = 8; public int setStatTimer = statMax; - public int time = 0; + public ref float time => ref Projectile.ai[1]; public override void SetStaticDefaults() { Main.projFrames[Type] = 4; @@ -44,10 +44,13 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { Player Owner = Main.player[Projectile.owner]; - if (Projectile.ai[2] == 5 && time > 10 && Projectile.ai[0] != 10) + int hitTime = 13; // Time to pass before it can be launched + + if (Projectile.ai[2] == 5 && time >= hitTime && Projectile.ai[0] != 10) isLaunched = true; else Projectile.ai[2] = 0; + Projectile.scale = Utils.GetLerpValue(0, 40, Projectile.timeLeft, true); diff --git a/Projectiles/Melee/IllustriousKnife.cs b/Projectiles/Melee/IllustriousKnife.cs index 9f9b9c19d9..d66941830f 100644 --- a/Projectiles/Melee/IllustriousKnife.cs +++ b/Projectiles/Melee/IllustriousKnife.cs @@ -73,31 +73,7 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - - int heal = (int)Math.Round(info.Damage * 0.015); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), (int)Math.Round(hit.Damage * 0.015), 0.4f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Melee/IridescentExcaliburSlash.cs b/Projectiles/Melee/IridescentExcaliburSlash.cs deleted file mode 100644 index a91263e002..0000000000 --- a/Projectiles/Melee/IridescentExcaliburSlash.cs +++ /dev/null @@ -1,254 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Graphics.Primitives; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.GameContent; -using Terraria.GameContent.Drawing; -using Terraria.Graphics.Shaders; -using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; -using CalamityMod.Balancing; -using CalamityMod.Projectiles.Healing; - -namespace CalamityMod.Projectiles.Melee -{ - public class IridescentExcaliburSlash : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - } - - public override void SetDefaults() - { - Projectile.width = 16; - Projectile.height = 16; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.ownerHitCheck = true; - Projectile.ownerHitCheckDistance = 300f; - Projectile.usesOwnerMeleeHitCD = true; - Projectile.stopsDealingDamageAfterPenetrateHits = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = -1; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - - public override void AI() - { - Projectile.localAI[0] += 1f; - Player player = Main.player[Projectile.owner]; - float num = Projectile.localAI[0] / Projectile.ai[1]; - float num2 = Projectile.ai[0]; - float num3 = Projectile.velocity.ToRotation(); - float num4 = (float)Math.PI * num2 * num + num3 + num2 * (float)Math.PI + player.fullRotation; - Projectile.rotation = num4; - float num5 = 1f; - float num6 = 1.2f; - - Projectile.Center = player.RotatedRelativePoint(player.MountedCenter) - Projectile.velocity; - Projectile.scale = num6 + num * num5; - - float colorAIScale = Projectile.localAI[0] / Projectile.ai[1]; - float amount = Utils.Remap(colorAIScale, 0f, 0.6f, 0f, 1f) * Utils.Remap(colorAIScale, 0.6f, 1f, 1f, 0f); - Color rainbow = Color.Lerp(new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), amount); - float num8 = Projectile.rotation + Main.rand.NextFloatDirection() * MathHelper.PiOver2 * 0.7f; - Vector2 vector2 = Projectile.Center + num8.ToRotationVector2() * 84f * Projectile.scale; - Vector2 vector3 = (num8 + Projectile.ai[0] * MathHelper.PiOver2).ToRotationVector2(); - if (Main.rand.NextFloat() * 2f < Projectile.Opacity) - { - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + num8.ToRotationVector2() * (Main.rand.NextFloat() * 80f * Projectile.scale + 20f * Projectile.scale), 278, vector3 * 1f, 100, rainbow, 0.4f); - dust2.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f; - dust2.noGravity = true; - } - - if (Main.rand.NextFloat() * 1.5f < Projectile.Opacity) - Dust.NewDustPerfect(vector2, 43, vector3 * 1f, 100, rainbow * Projectile.Opacity, 1.2f * Projectile.Opacity); - - float num10 = Projectile.rotation + Main.rand.NextFloatDirection() * MathHelper.PiOver2 * 0.7f; - Vector2 vector5 = Projectile.Center + num10.ToRotationVector2() * 84f * Projectile.scale; - Vector2 vector6 = (num10 + Projectile.ai[0] * MathHelper.PiOver2).ToRotationVector2(); - if (Main.rand.NextFloat() < Projectile.Opacity) - { - Dust dust4 = Dust.NewDustPerfect(Projectile.Center + num10.ToRotationVector2() * (Main.rand.NextFloat() * 80f * Projectile.scale + 20f * Projectile.scale), 278, vector6 * 1f, 100, rainbow, 0.4f); - dust4.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f; - dust4.noGravity = true; - } - - if (Main.rand.NextFloat() * 1.5f < Projectile.Opacity) - Dust.NewDustPerfect(vector5, 43, vector6 * 1f, 100, rainbow * Projectile.Opacity, 1.2f * Projectile.Opacity); - - Projectile.scale *= Projectile.ai[2]; - if (Projectile.localAI[0] >= Projectile.ai[1]) - Projectile.Kill(); - - // Enchantment visual bullshit - Vector2 boxPosition = Projectile.position; - int boxWidth = Projectile.width; - int boxHeight = Projectile.height; - for (float i = -MathHelper.PiOver4; i <= MathHelper.PiOver4; i += MathHelper.PiOver2) - { - Rectangle rect = Utils.CenteredRectangle(Projectile.Center + (Projectile.rotation + i).ToRotationVector2() * 70f * Projectile.scale, new Vector2(60f * Projectile.scale, 60f * Projectile.scale)); - Projectile.EmitEnchantmentVisualsAt(rect.TopLeft(), rect.Width, rect.Height); - } - } - - public override bool PreDraw(ref Color lightColor) - { - Vector2 vector = Projectile.Center - Main.screenPosition; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle rectangle = asset.Frame(1, 4); - Vector2 origin = rectangle.Size() / 2f; - float num = Projectile.scale * 1.1f; - SpriteEffects effects = ((!(Projectile.ai[0] >= 0f)) ? SpriteEffects.FlipVertically : SpriteEffects.None); - float num2 = Projectile.localAI[0] / Projectile.ai[1]; - float num3 = Utils.Remap(num2, 0f, 0.6f, 0f, 1f) * Utils.Remap(num2, 0.6f, 1f, 1f, 0f); - float num4 = 0.975f; - float amount = num3; - float fromValue = Lighting.GetColor(Projectile.Center.ToTileCoordinates()).ToVector3().Length() / (float)Math.Sqrt(3D); - fromValue = Utils.Remap(fromValue, 0.2f, 1f, 0f, 1f); - Color color = Color.Lerp(new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), amount); - Main.spriteBatch.Draw(asset, vector, rectangle, color * fromValue * num3, Projectile.rotation + Projectile.ai[0] * MathHelper.PiOver4 * -1f * (1f - num2), origin, num, effects, 0f); - Color color2 = Color.Lerp(new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), amount); - Color color3 = Color.Lerp(new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), amount); - Color color4 = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) * num3 * 0.5f; - Color color5 = color4 * fromValue * 0.5f; - Main.spriteBatch.Draw(asset, vector, rectangle, color5 * 0.15f, Projectile.rotation + Projectile.ai[0] * 0.01f, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, rectangle, color3 * fromValue * num3 * 0.3f, Projectile.rotation, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, rectangle, color2 * fromValue * num3 * 0.5f, Projectile.rotation, origin, num * num4, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) * 0.6f * num3, Projectile.rotation + Projectile.ai[0] * 0.01f, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) * 0.5f * num3, Projectile.rotation + Projectile.ai[0] * -0.05f, origin, num * 0.8f, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB) * 0.4f * num3, Projectile.rotation + Projectile.ai[0] * -0.1f, origin, num * 0.6f, effects, 0f); - float num5 = num * 0.75f; - Texture2D value = TextureAssets.Extra[98].Value; - Color shineColor = color3 * Projectile.Opacity * 0.5f; - Vector2 origin2 = value.Size() / 2f; - float num9 = Utils.GetLerpValue(0f, 0.5f, num2, clamped: true) * Utils.GetLerpValue(1f, 0.5f, num2, clamped: true); - Vector2 vector3 = new Vector2((Vector2.One * num5).X * 0.5f, (new Vector2(0f, Utils.Remap(num2, 0f, 1f, 3f, 0f)) * num5).X) * num9; - Vector2 vector2 = new Vector2((Vector2.One * num5).Y * 0.5f, (new Vector2(0f, Utils.Remap(num2, 0f, 1f, 3f, 0f)) * num5).Y) * num9; - shineColor *= num9; - for (float num6 = 0f; num6 < 12f; num6 += 1f) - { - float num7 = Projectile.rotation + Projectile.ai[0] * num6 * -MathHelper.TwoPi * 0.025f + Utils.Remap(num2, 0f, 0.6f, 0f, 0.95504415f) * Projectile.ai[0]; - Vector2 drawpos = vector + num7.ToRotationVector2() * ((float)asset.Width * 0.5f - 6f) * num; - float num8 = num6 / 12f; - - Color color6 = new Color(255, 255, 255, 0) * num3 * num8 * 0.5f; - color6 *= num9; - Main.EntitySpriteDraw(value, drawpos, null, shineColor, MathHelper.PiOver2 + num7, origin2, vector3, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, shineColor, 0f + num7, origin2, vector2, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, color6, MathHelper.PiOver2 + num7, origin2, vector3 * 0.6f, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, color6, 0f + num7, origin2, vector2 * 0.6f, SpriteEffects.None); - } - - Vector2 drawpos2 = vector + (Projectile.rotation + Utils.Remap(num2, 0f, 0.6f, 0f, 0.95504415f) * Projectile.ai[0]).ToRotationVector2() * ((float)asset.Width * 0.5f - 4f) * num; - Color color7 = new Color(255, 255, 255, 0) * num3 * 0.5f; - color7 *= num9; - Main.EntitySpriteDraw(value, drawpos2, null, shineColor, MathHelper.PiOver2 + Projectile.rotation, origin2, vector3, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, shineColor, 0f + Projectile.rotation, origin2, vector2, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, color7, MathHelper.PiOver2 + Projectile.rotation, origin2, vector3 * 0.6f, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, color7, 0f + Projectile.rotation, origin2, vector2 * 0.6f, SpriteEffects.None); - - return false; - } - - public override void CutTiles() - { - Vector2 startPoint = (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2() * 60f * Projectile.scale; - Vector2 endPoint = (Projectile.rotation + MathHelper.PiOver4).ToRotationVector2() * 60f * Projectile.scale; - float projectileSize = 60f * Projectile.scale; - Utils.PlotTileLine(Projectile.Center + startPoint, Projectile.Center + endPoint, projectileSize, DelegateMethods.CutTiles); - } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.HitDirectionOverride = (Main.player[Projectile.owner].Center.X < target.Center.X) ? 1 : -1; - - Vector2 positionInWorld = Main.rand.NextVector2FromRectangle(target.Hitbox); - ParticleOrchestraSettings particleOrchestraSettings = default(ParticleOrchestraSettings); - particleOrchestraSettings.PositionInWorld = positionInWorld; - ParticleOrchestraSettings settings = particleOrchestraSettings; - switch (Main.rand.Next(5)) - { - default: - case 0: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.NightsEdge, settings, Projectile.owner); - break; - - case 1: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TrueNightsEdge, settings, Projectile.owner); - break; - - case 2: - settings.MovementVector = Projectile.velocity; - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TerraBlade, settings, Projectile.owner); - break; - - case 3: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.Excalibur, settings, Projectile.owner); - break; - - case 4: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TrueExcalibur, settings, Projectile.owner); - break; - } - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float coneLength = 94f * Projectile.scale; - float scale = MathHelper.TwoPi / 25f * Projectile.ai[0]; - float maximumAngle = MathHelper.PiOver4; - float coneRotation = Projectile.rotation + scale; - if (targetHitbox.IntersectsConeSlowMoreAccurate(Projectile.Center, coneLength, coneRotation, maximumAngle)) - return true; - - float rotation = Utils.Remap(Projectile.localAI[0], Projectile.ai[1] * 0.3f, Projectile.ai[1] * 0.5f, 1f, 0f); - if (rotation > 0f) - { - float coneRotation2 = coneRotation - MathHelper.PiOver4 * Projectile.ai[0] * rotation; - if (targetHitbox.IntersectsConeSlowMoreAccurate(Projectile.Center, coneLength, coneRotation2, maximumAngle)) - return true; - } - - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 60); - - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 60); - - int heal = (int)Math.Round(info.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } - } -} diff --git a/Projectiles/Melee/IridescentExcaliburSlash.png b/Projectiles/Melee/IridescentExcaliburSlash.png deleted file mode 100644 index 9a31d6718a..0000000000 Binary files a/Projectiles/Melee/IridescentExcaliburSlash.png and /dev/null differ diff --git a/Projectiles/Melee/IridescentExcaliburSlash2.cs b/Projectiles/Melee/IridescentExcaliburSlash2.cs deleted file mode 100644 index 54728381f9..0000000000 --- a/Projectiles/Melee/IridescentExcaliburSlash2.cs +++ /dev/null @@ -1,231 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Graphics.Primitives; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.GameContent; -using Terraria.GameContent.Drawing; -using Terraria.Graphics.Shaders; -using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; - -namespace CalamityMod.Projectiles.Melee -{ - public class IridescentExcaliburSlash2 : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/Melee/IridescentExcaliburSlash"; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - } - - public override void SetDefaults() - { - Projectile.width = 16; - Projectile.height = 16; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.ownerHitCheck = true; - Projectile.ownerHitCheckDistance = 300f; - Projectile.usesOwnerMeleeHitCD = true; - Projectile.stopsDealingDamageAfterPenetrateHits = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 3; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - - public override void AI() - { - Projectile.localAI[0] += 1f; - Player player = Main.player[Projectile.owner]; - float num = Projectile.localAI[0] / Projectile.ai[1]; - float num2 = Projectile.ai[0]; - float num3 = Projectile.velocity.ToRotation(); - float num4 = (float)Math.PI * num2 * num + num3 + num2 * (float)Math.PI + player.fullRotation; - Projectile.rotation = num4; - float num5 = 0.8f; - float num6 = 1.1f; - - Projectile.Center = player.RotatedRelativePoint(player.MountedCenter) - Projectile.velocity; - Projectile.scale = num6 + num * num5; - - float colorAIScale = Projectile.localAI[0] / Projectile.ai[1]; - float amount = Utils.Remap(colorAIScale, 0f, 0.6f, 0f, 1f) * Utils.Remap(colorAIScale, 0.6f, 1f, 1f, 0f); - Color rainbow = Color.Lerp(new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), amount); - float num8 = Projectile.rotation + Main.rand.NextFloatDirection() * MathHelper.PiOver2 * 0.7f; - Vector2 vector2 = Projectile.Center + num8.ToRotationVector2() * 84f * Projectile.scale; - Vector2 vector3 = (num8 + Projectile.ai[0] * MathHelper.PiOver2).ToRotationVector2(); - if (Main.rand.NextFloat() * 2f < Projectile.Opacity) - { - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + num8.ToRotationVector2() * (Main.rand.NextFloat() * 80f * Projectile.scale + 20f * Projectile.scale), 278, vector3 * 1f, 100, rainbow, 0.4f); - dust2.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f; - dust2.noGravity = true; - } - - if (Main.rand.NextFloat() * 1.5f < Projectile.Opacity) - Dust.NewDustPerfect(vector2, 43, vector3 * 1f, 100, rainbow * Projectile.Opacity, 1.2f * Projectile.Opacity); - - float num10 = Projectile.rotation + Main.rand.NextFloatDirection() * MathHelper.PiOver2 * 0.7f; - Vector2 vector5 = Projectile.Center + num10.ToRotationVector2() * 84f * Projectile.scale; - Vector2 vector6 = (num10 + Projectile.ai[0] * MathHelper.PiOver2).ToRotationVector2(); - if (Main.rand.NextFloat() < Projectile.Opacity) - { - Dust dust4 = Dust.NewDustPerfect(Projectile.Center + num10.ToRotationVector2() * (Main.rand.NextFloat() * 80f * Projectile.scale + 20f * Projectile.scale), 278, vector6 * 1f, 100, rainbow, 0.4f); - dust4.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f; - dust4.noGravity = true; - } - - if (Main.rand.NextFloat() * 1.5f < Projectile.Opacity) - Dust.NewDustPerfect(vector5, 43, vector6 * 1f, 100, rainbow * Projectile.Opacity, 1.2f * Projectile.Opacity); - - Projectile.scale *= Projectile.ai[2]; - if (Projectile.localAI[0] >= Projectile.ai[1]) - Projectile.Kill(); - - // Enchantment visual bullshit - Vector2 boxPosition = Projectile.position; - int boxWidth = Projectile.width; - int boxHeight = Projectile.height; - for (float i = -MathHelper.PiOver4; i <= MathHelper.PiOver4; i += MathHelper.PiOver2) - { - Rectangle rect = Utils.CenteredRectangle(Projectile.Center + (Projectile.rotation + i).ToRotationVector2() * 70f * Projectile.scale, new Vector2(60f * Projectile.scale, 60f * Projectile.scale)); - Projectile.EmitEnchantmentVisualsAt(rect.TopLeft(), rect.Width, rect.Height); - } - } - - public override bool PreDraw(ref Color lightColor) - { - Vector2 vector = Projectile.Center - Main.screenPosition; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle rectangle = asset.Frame(1, 4); - Vector2 origin = rectangle.Size() / 2f; - float num = Projectile.scale * 1.1f; - SpriteEffects effects = ((!(Projectile.ai[0] >= 0f)) ? SpriteEffects.FlipVertically : SpriteEffects.None); - float num2 = Projectile.localAI[0] / Projectile.ai[1]; - float num3 = Utils.Remap(num2, 0f, 0.6f, 0f, 1f) * Utils.Remap(num2, 0.6f, 1f, 1f, 0f); - float num4 = 0.975f; - float amount = num3; - float fromValue = Lighting.GetColor(Projectile.Center.ToTileCoordinates()).ToVector3().Length() / (float)Math.Sqrt(3D); - fromValue = Utils.Remap(fromValue, 0.2f, 1f, 0f, 1f); - Color color = Color.Lerp(new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), amount); - Main.spriteBatch.Draw(asset, vector, rectangle, color * fromValue * num3, Projectile.rotation + Projectile.ai[0] * MathHelper.PiOver4 * -1f * (1f - num2), origin, num, effects, 0f); - Color color2 = Color.Lerp(new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), amount); - Color color3 = Color.Lerp(new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB), new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB), amount); - Color color4 = new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB) * num3 * 0.5f; - color4.A = (byte)(((float)(int)color4.A * (1f - fromValue)) * 0.5f); - Color color5 = color4 * fromValue * 0.5f; - Main.spriteBatch.Draw(asset, vector, rectangle, color5 * 0.15f, Projectile.rotation + Projectile.ai[0] * 0.01f, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, rectangle, color3 * fromValue * num3 * 0.3f, Projectile.rotation, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, rectangle, color2 * fromValue * num3 * 0.5f, Projectile.rotation, origin, num * num4, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB) * 0.6f * num3, Projectile.rotation + Projectile.ai[0] * 0.01f, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB) * 0.5f * num3, Projectile.rotation + Projectile.ai[0] * -0.05f, origin, num * 0.8f, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(255 - Main.DiscoR, 255 - Main.DiscoG, 255 - Main.DiscoB) * 0.4f * num3, Projectile.rotation + Projectile.ai[0] * -0.1f, origin, num * 0.6f, effects, 0f); - float num5 = num * 0.75f; - Texture2D value = TextureAssets.Extra[98].Value; - Color shineColor = color3 * Projectile.Opacity * 0.5f; - shineColor.A /= 2; - Vector2 origin2 = value.Size() / 2f; - float num9 = Utils.GetLerpValue(0f, 0.5f, num2, clamped: true) * Utils.GetLerpValue(1f, 0.5f, num2, clamped: true); - Vector2 vector3 = new Vector2((Vector2.One * num5).X * 0.5f, (new Vector2(0f, Utils.Remap(num2, 0f, 1f, 3f, 0f)) * num5).X) * num9; - Vector2 vector2 = new Vector2((Vector2.One * num5).Y * 0.5f, (new Vector2(0f, Utils.Remap(num2, 0f, 1f, 3f, 0f)) * num5).Y) * num9; - shineColor *= num9; - for (float num6 = 0f; num6 < 12f; num6 += 1f) - { - float num7 = Projectile.rotation + Projectile.ai[0] * num6 * -MathHelper.TwoPi * 0.025f + Utils.Remap(num2, 0f, 0.6f, 0f, 0.95504415f) * Projectile.ai[0]; - Vector2 drawpos = vector + num7.ToRotationVector2() * ((float)asset.Width * 0.5f - 6f) * num; - float num8 = num6 / 12f; - - Color color6 = new Color(255, 255, 255, 0) * num3 * num8 * 0.5f; - color6 *= num9; - Main.EntitySpriteDraw(value, drawpos, null, shineColor, MathHelper.PiOver2 + num7, origin2, vector3, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, shineColor, 0f + num7, origin2, vector2, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, color6, MathHelper.PiOver2 + num7, origin2, vector3 * 0.6f, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, color6, 0f + num7, origin2, vector2 * 0.6f, SpriteEffects.None); - } - - Vector2 drawpos2 = vector + (Projectile.rotation + Utils.Remap(num2, 0f, 0.6f, 0f, 0.95504415f) * Projectile.ai[0]).ToRotationVector2() * ((float)asset.Width * 0.5f - 4f) * num; - Color color7 = new Color(255, 255, 255, 0) * num3 * 0.5f; - color7 *= num9; - Main.EntitySpriteDraw(value, drawpos2, null, shineColor, MathHelper.PiOver2 + Projectile.rotation, origin2, vector3, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, shineColor, 0f + Projectile.rotation, origin2, vector2, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, color7, MathHelper.PiOver2 + Projectile.rotation, origin2, vector3 * 0.6f, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, color7, 0f + Projectile.rotation, origin2, vector2 * 0.6f, SpriteEffects.None); - - return false; - } - - public override void CutTiles() - { - Vector2 startPoint = (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2() * 60f * Projectile.scale; - Vector2 endPoint = (Projectile.rotation + MathHelper.PiOver4).ToRotationVector2() * 60f * Projectile.scale; - float projectileSize = 60f * Projectile.scale; - Utils.PlotTileLine(Projectile.Center + startPoint, Projectile.Center + endPoint, projectileSize, DelegateMethods.CutTiles); - } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.HitDirectionOverride = (Main.player[Projectile.owner].Center.X < target.Center.X) ? 1 : -1; - - Vector2 positionInWorld = Main.rand.NextVector2FromRectangle(target.Hitbox); - ParticleOrchestraSettings particleOrchestraSettings = default(ParticleOrchestraSettings); - particleOrchestraSettings.PositionInWorld = positionInWorld; - ParticleOrchestraSettings settings = particleOrchestraSettings; - switch (Main.rand.Next(5)) - { - default: - case 0: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.NightsEdge, settings, Projectile.owner); - break; - - case 1: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TrueNightsEdge, settings, Projectile.owner); - break; - - case 2: - settings.MovementVector = Projectile.velocity; - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TerraBlade, settings, Projectile.owner); - break; - - case 3: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.Excalibur, settings, Projectile.owner); - break; - - case 4: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TrueExcalibur, settings, Projectile.owner); - break; - } - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float coneLength = 94f * Projectile.scale; - float scale = MathHelper.TwoPi / 25f * Projectile.ai[0]; - float maximumAngle = MathHelper.PiOver4; - float coneRotation = Projectile.rotation + scale; - if (targetHitbox.IntersectsConeSlowMoreAccurate(Projectile.Center, coneLength, coneRotation, maximumAngle)) - return true; - - float rotation = Utils.Remap(Projectile.localAI[0], Projectile.ai[1] * 0.3f, Projectile.ai[1] * 0.5f, 1f, 0f); - if (rotation > 0f) - { - float coneRotation2 = coneRotation - MathHelper.PiOver4 * Projectile.ai[0] * rotation; - if (targetHitbox.IntersectsConeSlowMoreAccurate(Projectile.Center, coneLength, coneRotation2, maximumAngle)) - return true; - } - - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 60); - } - } -} diff --git a/Projectiles/Melee/IridescentExcaliburSlash3.cs b/Projectiles/Melee/IridescentExcaliburSlash3.cs deleted file mode 100644 index b370bdf8b5..0000000000 --- a/Projectiles/Melee/IridescentExcaliburSlash3.cs +++ /dev/null @@ -1,238 +0,0 @@ -using System.Collections.Generic; -using CalamityMod.Graphics.Primitives; -using Microsoft.Xna.Framework; -using Microsoft.Xna.Framework.Graphics; -using System; -using Terraria; -using Terraria.GameContent; -using Terraria.GameContent.Drawing; -using Terraria.Graphics.Shaders; -using Terraria.ModLoader; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.Buffs.StatDebuffs; - -namespace CalamityMod.Projectiles.Melee -{ - public class IridescentExcaliburSlash3 : ModProjectile, ILocalizedModType - { - public new string LocalizationCategory => "Projectiles.Melee"; - public override string Texture => "CalamityMod/Projectiles/Melee/IridescentExcaliburSlash"; - - public override void SetStaticDefaults() - { - Main.projFrames[Type] = 4; - } - - public override void SetDefaults() - { - Projectile.width = 16; - Projectile.height = 16; - Projectile.friendly = true; - Projectile.tileCollide = false; - Projectile.ignoreWater = true; - Projectile.ownerHitCheck = true; - Projectile.ownerHitCheckDistance = 300f; - Projectile.usesOwnerMeleeHitCD = true; - Projectile.stopsDealingDamageAfterPenetrateHits = true; - Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = 3; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; - } - - public override void AI() - { - Projectile.localAI[0] += 1f; - Player player = Main.player[Projectile.owner]; - float num = Projectile.localAI[0] / Projectile.ai[1]; - float num2 = Projectile.ai[0]; - float num3 = Projectile.velocity.ToRotation(); - float num4 = (float)Math.PI * num2 * num + num3 + num2 * (float)Math.PI + player.fullRotation; - Projectile.rotation = num4; - float num5 = 0.6f; - float num6 = 1f; - - Projectile.Center = player.RotatedRelativePoint(player.MountedCenter) - Projectile.velocity; - Projectile.scale = num6 + num * num5; - - float colorAIScale = Projectile.localAI[0] / Projectile.ai[1]; - float amount = Utils.Remap(colorAIScale, 0f, 0.6f, 0f, 1f) * Utils.Remap(colorAIScale, 0.6f, 1f, 1f, 0f); - Color rainbow = Color.Lerp(new Color(255 - (Math.Abs(128 - Main.DiscoR) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoG) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoB) * 2 - 1)), - new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1), amount); - - float num8 = Projectile.rotation + Main.rand.NextFloatDirection() * MathHelper.PiOver2 * 0.7f; - Vector2 vector2 = Projectile.Center + num8.ToRotationVector2() * 84f * Projectile.scale; - Vector2 vector3 = (num8 + Projectile.ai[0] * MathHelper.PiOver2).ToRotationVector2(); - if (Main.rand.NextFloat() * 2f < Projectile.Opacity) - { - Dust dust2 = Dust.NewDustPerfect(Projectile.Center + num8.ToRotationVector2() * (Main.rand.NextFloat() * 80f * Projectile.scale + 20f * Projectile.scale), 278, vector3 * 1f, 100, rainbow, 0.4f); - dust2.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f; - dust2.noGravity = true; - } - - if (Main.rand.NextFloat() * 1.5f < Projectile.Opacity) - Dust.NewDustPerfect(vector2, 43, vector3 * 1f, 100, rainbow * Projectile.Opacity, 1.2f * Projectile.Opacity); - - float num10 = Projectile.rotation + Main.rand.NextFloatDirection() * MathHelper.PiOver2 * 0.7f; - Vector2 vector5 = Projectile.Center + num10.ToRotationVector2() * 84f * Projectile.scale; - Vector2 vector6 = (num10 + Projectile.ai[0] * MathHelper.PiOver2).ToRotationVector2(); - if (Main.rand.NextFloat() < Projectile.Opacity) - { - Dust dust4 = Dust.NewDustPerfect(Projectile.Center + num10.ToRotationVector2() * (Main.rand.NextFloat() * 80f * Projectile.scale + 20f * Projectile.scale), 278, vector6 * 1f, 100, rainbow, 0.4f); - dust4.fadeIn = 0.4f + Main.rand.NextFloat() * 0.15f; - dust4.noGravity = true; - } - - if (Main.rand.NextFloat() * 1.5f < Projectile.Opacity) - Dust.NewDustPerfect(vector5, 43, vector6 * 1f, 100, rainbow * Projectile.Opacity, 1.2f * Projectile.Opacity); - - Projectile.scale *= Projectile.ai[2]; - if (Projectile.localAI[0] >= Projectile.ai[1]) - Projectile.Kill(); - - // Enchantment visual bullshit - Vector2 boxPosition = Projectile.position; - int boxWidth = Projectile.width; - int boxHeight = Projectile.height; - for (float i = -MathHelper.PiOver4; i <= MathHelper.PiOver4; i += MathHelper.PiOver2) - { - Rectangle rect = Utils.CenteredRectangle(Projectile.Center + (Projectile.rotation + i).ToRotationVector2() * 70f * Projectile.scale, new Vector2(60f * Projectile.scale, 60f * Projectile.scale)); - Projectile.EmitEnchantmentVisualsAt(rect.TopLeft(), rect.Width, rect.Height); - } - } - - public override bool PreDraw(ref Color lightColor) - { - Vector2 vector = Projectile.Center - Main.screenPosition; - Texture2D asset = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Rectangle rectangle = asset.Frame(1, 4); - Vector2 origin = rectangle.Size() / 2f; - float num = Projectile.scale * 1.1f; - SpriteEffects effects = ((!(Projectile.ai[0] >= 0f)) ? SpriteEffects.FlipVertically : SpriteEffects.None); - float num2 = Projectile.localAI[0] / Projectile.ai[1]; - float num3 = Utils.Remap(num2, 0f, 0.6f, 0f, 1f) * Utils.Remap(num2, 0.6f, 1f, 1f, 0f); - float num4 = 0.975f; - float amount = num3; - float fromValue = Lighting.GetColor(Projectile.Center.ToTileCoordinates()).ToVector3().Length() / (float)Math.Sqrt(3D); - fromValue = Utils.Remap(fromValue, 0.2f, 1f, 0f, 1f); - - Color color = Color.Lerp(new Color(255 - (Math.Abs(128 - Main.DiscoR) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoG) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoB) * 2 - 1)), - new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1), amount); - Main.spriteBatch.Draw(asset, vector, rectangle, color * fromValue * num3, Projectile.rotation + Projectile.ai[0] * MathHelper.PiOver4 * -1f * (1f - num2), origin, num, effects, 0f); - Color color2 = Color.Lerp(new Color(255 - (Math.Abs(128 - Main.DiscoR) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoG) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoB) * 2 - 1)), - new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1), amount); - Color color3 = Color.Lerp(new Color(255 - (Math.Abs(128 - Main.DiscoR) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoG) * 2 - 1), 255 - (Math.Abs(128 - Main.DiscoB) * 2 - 1)), - new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1), amount); - - Color color4 = new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1) * num3 * 0.5f; - color4.A = (byte)((float)(int)color4.A * (1f - fromValue)); - Color color5 = color4 * fromValue * 0.5f; - Main.spriteBatch.Draw(asset, vector, rectangle, color5 * 0.15f, Projectile.rotation + Projectile.ai[0] * 0.01f, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, rectangle, color3 * fromValue * num3 * 0.3f, Projectile.rotation, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, rectangle, color2 * fromValue * num3 * 0.5f, Projectile.rotation, origin, num * num4, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1) * 0.6f * num3, Projectile.rotation + Projectile.ai[0] * 0.01f, origin, num, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1) * 0.5f * num3, Projectile.rotation + Projectile.ai[0] * -0.05f, origin, num * 0.8f, effects, 0f); - Main.spriteBatch.Draw(asset, vector, asset.Frame(1, 4, 0, 3), new Color(Math.Abs(128 - Main.DiscoR) * 2 - 1, Math.Abs(128 - Main.DiscoG) * 2 - 1, Math.Abs(128 - Main.DiscoB) * 2 - 1) * 0.4f * num3, Projectile.rotation + Projectile.ai[0] * -0.1f, origin, num * 0.6f, effects, 0f); - float num5 = num * 0.75f; - Texture2D value = TextureAssets.Extra[98].Value; - Color shineColor = color3 * Projectile.Opacity * 0.5f; - shineColor.A = 0; - Vector2 origin2 = value.Size() / 2f; - float num9 = Utils.GetLerpValue(0f, 0.5f, num2, clamped: true) * Utils.GetLerpValue(1f, 0.5f, num2, clamped: true); - Vector2 vector3 = new Vector2((Vector2.One * num5).X * 0.5f, (new Vector2(0f, Utils.Remap(num2, 0f, 1f, 3f, 0f)) * num5).X) * num9; - Vector2 vector2 = new Vector2((Vector2.One * num5).Y * 0.5f, (new Vector2(0f, Utils.Remap(num2, 0f, 1f, 3f, 0f)) * num5).Y) * num9; - shineColor *= num9; - for (float num6 = 0f; num6 < 12f; num6 += 1f) - { - float num7 = Projectile.rotation + Projectile.ai[0] * num6 * -MathHelper.TwoPi * 0.025f + Utils.Remap(num2, 0f, 0.6f, 0f, 0.95504415f) * Projectile.ai[0]; - Vector2 drawpos = vector + num7.ToRotationVector2() * ((float)asset.Width * 0.5f - 6f) * num; - float num8 = num6 / 12f; - - Color color6 = new Color(255, 255, 255, 0) * num3 * num8 * 0.5f; - color6 *= num9; - Main.EntitySpriteDraw(value, drawpos, null, shineColor, MathHelper.PiOver2 + num7, origin2, vector3, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, shineColor, 0f + num7, origin2, vector2, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, color6, MathHelper.PiOver2 + num7, origin2, vector3 * 0.6f, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos, null, color6, 0f + num7, origin2, vector2 * 0.6f, SpriteEffects.None); - } - - Vector2 drawpos2 = vector + (Projectile.rotation + Utils.Remap(num2, 0f, 0.6f, 0f, 0.95504415f) * Projectile.ai[0]).ToRotationVector2() * ((float)asset.Width * 0.5f - 4f) * num; - Color color7 = new Color(255, 255, 255, 0) * num3 * 0.5f; - color7 *= num9; - Main.EntitySpriteDraw(value, drawpos2, null, shineColor, MathHelper.PiOver2 + Projectile.rotation, origin2, vector3, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, shineColor, 0f + Projectile.rotation, origin2, vector2, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, color7, MathHelper.PiOver2 + Projectile.rotation, origin2, vector3 * 0.6f, SpriteEffects.None); - Main.EntitySpriteDraw(value, drawpos2, null, color7, 0f + Projectile.rotation, origin2, vector2 * 0.6f, SpriteEffects.None); - - return false; - } - - public override void CutTiles() - { - Vector2 startPoint = (Projectile.rotation - MathHelper.PiOver4).ToRotationVector2() * 60f * Projectile.scale; - Vector2 endPoint = (Projectile.rotation + MathHelper.PiOver4).ToRotationVector2() * 60f * Projectile.scale; - float projectileSize = 60f * Projectile.scale; - Utils.PlotTileLine(Projectile.Center + startPoint, Projectile.Center + endPoint, projectileSize, DelegateMethods.CutTiles); - } - - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - modifiers.HitDirectionOverride = (Main.player[Projectile.owner].Center.X < target.Center.X) ? 1 : -1; - - Vector2 positionInWorld = Main.rand.NextVector2FromRectangle(target.Hitbox); - ParticleOrchestraSettings particleOrchestraSettings = default(ParticleOrchestraSettings); - particleOrchestraSettings.PositionInWorld = positionInWorld; - ParticleOrchestraSettings settings = particleOrchestraSettings; - switch (Main.rand.Next(5)) - { - default: - case 0: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.NightsEdge, settings, Projectile.owner); - break; - - case 1: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TrueNightsEdge, settings, Projectile.owner); - break; - - case 2: - settings.MovementVector = Projectile.velocity; - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TerraBlade, settings, Projectile.owner); - break; - - case 3: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.Excalibur, settings, Projectile.owner); - break; - - case 4: - ParticleOrchestrator.RequestParticleSpawn(clientOnly: false, ParticleOrchestraType.TrueExcalibur, settings, Projectile.owner); - break; - } - } - - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) - { - float coneLength = 94f * Projectile.scale; - float scale = MathHelper.TwoPi / 25f * Projectile.ai[0]; - float maximumAngle = MathHelper.PiOver4; - float coneRotation = Projectile.rotation + scale; - if (targetHitbox.IntersectsConeSlowMoreAccurate(Projectile.Center, coneLength, coneRotation, maximumAngle)) - return true; - - float rotation = Utils.Remap(Projectile.localAI[0], Projectile.ai[1] * 0.3f, Projectile.ai[1] * 0.5f, 1f, 0f); - if (rotation > 0f) - { - float coneRotation2 = coneRotation - MathHelper.PiOver4 * Projectile.ai[0] * rotation; - if (targetHitbox.IntersectsConeSlowMoreAccurate(Projectile.Center, coneLength, coneRotation2, maximumAngle)) - return true; - } - - return false; - } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 600); - target.AddBuff(ModContent.BuffType(), 60); - } - } -} diff --git a/Projectiles/Melee/JudgementProj.cs b/Projectiles/Melee/JudgementProj.cs index 583ad48e1e..9065cf775f 100644 --- a/Projectiles/Melee/JudgementProj.cs +++ b/Projectiles/Melee/JudgementProj.cs @@ -1,4 +1,5 @@ using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -26,7 +27,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.timeLeft = 450; Projectile.DamageType = DamageClass.Melee; - Projectile.extraUpdates = 9; + Projectile.extraUpdates = 14; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } @@ -49,10 +50,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.scale += 0.0026f; hitboxSize += 0.4525f; Projectile.velocity *= 0.995f; - // Spawn 3 - if (time % 50 == 0 && time > 10) + // Spawn 2 + if (time % 85 == 0 && time > 10) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(hitboxSize * 0.8f, hitboxSize * 0.8f) - Projectile.velocity * 2, (-Projectile.velocity * 3).RotatedByRandom(0.9f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.2f), 3f, Projectile.owner, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center + Main.rand.NextVector2Circular(hitboxSize * 0.8f, hitboxSize * 0.8f) - Projectile.velocity * 2, (-Projectile.velocity * 3).RotatedByRandom(0.9f), ModContent.ProjectileType(), (int)(Projectile.damage * 0.35f), 3f, Projectile.owner, 0f); } } else @@ -80,7 +81,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.rand.NextBool(3)) { - Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(hitboxSize, hitboxSize) - Projectile.velocity * 2, 66); + Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(hitboxSize, hitboxSize) - Projectile.velocity * 2, ModContent.DustType()); trailDust.scale = Main.rand.NextFloat(0.7f, 0.85f) - (time < 150 ? 0 : time * 0.001f); trailDust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.85f, 1.5f); trailDust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; @@ -102,11 +103,10 @@ namespace CalamityMod.Projectiles.Melee { Texture2D tex = ModContent.Request(Texture).Value; float waveFade = Utils.GetLerpValue(0, 300, Projectile.timeLeft); - Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * fadeOut, Projectile.rotation, tex.Size() / 2f, new Vector2(1 - (0.2f * waveFade), 1 + (0.45f * waveFade)) * Projectile.scale, SpriteEffects.None, 0); + for (int i = 0; i < 5; i++) + Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition + (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * 9 * i, null, mainColor with { A = 0 } * fadeOut * 0.6f, Projectile.rotation, tex.Size() / 2f, new Vector2(1 - (0.2f * waveFade) + 0.01f * i, 1 + (0.45f * waveFade) - 0.06f * i) * Projectile.scale, SpriteEffects.None, 0); return false; } - - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (Projectile.numHits > 0) diff --git a/Projectiles/Melee/MaceFlails/BallOFuguProj.cs b/Projectiles/Melee/MaceFlails/BallOFuguProj.cs index afbe2c194e..304031057f 100644 --- a/Projectiles/Melee/MaceFlails/BallOFuguProj.cs +++ b/Projectiles/Melee/MaceFlails/BallOFuguProj.cs @@ -70,12 +70,18 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails if (SpikeCount > 0) { SoundEngine.PlaySound(BallOFugu.BlowSound, Projectile.Center); - Particle BlowParticle = new CustomPulse(Projectile.Center, Vector2.Zero, SpikeColor, "CalamityMod/Particles/ShatteredExplosion", Vector2.One, Main.rand.NextFloat(0, MathHelper.TwoPi), 0f, 0.05f + 0.005f * SpikeCount, 12); - GeneralParticleHandler.SpawnParticle(BlowParticle); + + for (int i = -4; i < 5; i++) + { + Vector2 maxScale = new Vector2(Main.rand.NextFloat(1f, 1.2f), Main.rand.NextFloat(0.6f, 0.75f)) * (i % 2 == 0 ? 1f : 1.35f); + float rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(30f * i); + CustomPulse spike = new CustomPulse(Projectile.Center, Vector2.One, SpikeColor, "CalamityMod/Particles/BlastCone", maxScale, rotation, 1f, 0.5f, 12); + GeneralParticleHandler.SpawnParticle(spike); + } for (int i = 0; i < SpikeCount; i++) { - Vector2 velocity = Main.rand.NextVector2Unit() * Main.rand.NextFloat(6f, 7.2f); + Vector2 velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(MathHelper.ToRadians(105f)) * Main.rand.NextFloat(6f, 7.2f); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * SpikeDamage), Projectile.knockBack * SpikeKnockback, Projectile.owner); } } diff --git a/Projectiles/Melee/MaceFlails/TumbleweedFlail.cs b/Projectiles/Melee/MaceFlails/TumbleweedFlail.cs index d1da4b4c20..c24c63a25c 100644 --- a/Projectiles/Melee/MaceFlails/TumbleweedFlail.cs +++ b/Projectiles/Melee/MaceFlails/TumbleweedFlail.cs @@ -29,6 +29,8 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails public override float RetractAcceleration => 4f; public static float MaxAuraTime = 60f; + private bool hasDetached = false; + private int detachDelay = 0; public ref float AuraScale => ref Projectile.ai[2]; @@ -54,6 +56,13 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails sand.velocity = CurrentFlailState == FlailState.Spinning ? Main.rand.NextVector2Unit() * 1.5f : Projectile.velocity * 0.25f; } + // Force the flail to stay in launch state for a few frames after detaching to prevent spam-click abuse at point-blank + if (detachDelay > 0) + { + detachDelay--; + CurrentFlailState = detachDelay == 0 ? FlailState.ForcedRetracting : FlailState.LaunchingForward; + } + if (CurrentFlailState == FlailState.Spinning) { Projectile.ownerHitCheck = false; // Dust aura can hit through walls @@ -94,7 +103,21 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails Main.EntitySpriteDraw(Aura, position, null, drawColor, Main.GlobalTimeWrappedHourly * 0.5f + (i * i * 0.03f), Aura.Size() * 0.5f, AuraScale - (i * 0.03f), SpriteEffects.None, 0); } } - return base.PreDraw(ref lightColor); + + if (hasDetached) + { + DrawChain(); + return false; + } + else + return base.PreDraw(ref lightColor); + } + + public override bool? CanDamage() + { + if (hasDetached) + return false; + return base.CanDamage(); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) @@ -123,7 +146,11 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails if (Projectile.owner == Main.myPlayer) Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity, ModContent.ProjectileType(), (int)(Projectile.damage * LaunchDamage), Projectile.knockBack, Projectile.owner, CurrentFlailState == FlailState.LaunchingForward ? 0f : 1f); - Projectile.Kill(); + hasDetached = true; + if ((CurrentFlailState == FlailState.LaunchingForward || CurrentFlailState == FlailState.Ricochet) && StateTimer < 6) + detachDelay = 6; + else + CurrentFlailState = FlailState.ForcedRetracting; } } } diff --git a/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs index 43b21f426c..408eca4e75 100644 --- a/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs +++ b/Projectiles/Melee/MaceFlails/UrchinMaceProj.cs @@ -24,7 +24,7 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails // This flail only runs through one state (spin), thereby making most parameters unnecessary to fill out public override int AssociatedItemID => ModContent.ItemType(); public override int SpinIFrames => 15; - public override float SpinHitboxRadius => 64f; + public override float SpinHitboxRadius => 56f; public override float SpinVerticalFactor => 1f; // This flail moves circular public override float LaunchSpeed => 22f; @@ -134,17 +134,17 @@ namespace CalamityMod.Projectiles.Melee.MaceFlails Texture2D whirlpoolTexture = TextureAssets.Projectile[ModContent.ProjectileType()].Value; float WindupProgress = MathHelper.Clamp(StateTimer, 0, MaxWindup) / MaxWindup; - float whirlpoolScale = MathHelper.Clamp(WindupProgress * 3f - 0.4f, 0f, 1f) * 2f; + float whirlpoolScale = MathHelper.Clamp(WindupProgress * 3f - 0.4f, 0f, 1f) * 1.6f; float whirlpoolOpacity = WindupProgress * 0.2f + MathF.Sin(Main.GlobalTimeWrappedHourly * 3f) * 0.1f; float whirlpoolRotation = StateTimer * 0.34f * Owner.direction; SpriteEffects flip = Owner.direction < 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; - Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity * 0.3f, whirlpoolRotation * 1.2f, whirlpoolTexture.Size() / 2f, whirlpoolScale, flip, 0); - Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity, whirlpoolRotation, whirlpoolTexture.Size() / 2f, whirlpoolScale, flip, 0); + Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity * 0.3f, whirlpoolRotation * 1.2f, whirlpoolTexture.Size() * 0.5f, whirlpoolScale, flip); + Main.EntitySpriteDraw(whirlpoolTexture, Owner.MountedCenter - Main.screenPosition, null, Lighting.GetColor((int)Owner.MountedCenter.X / 16, (int)Owner.MountedCenter.Y / 16) * whirlpoolOpacity, whirlpoolRotation, whirlpoolTexture.Size() * 0.5f, whirlpoolScale, flip); Vector2 handleOrigin = new Vector2(0, maceTexture.Height); float maceRotation = Projectile.rotation + MathHelper.PiOver4; - Main.EntitySpriteDraw(maceTexture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), maceRotation, handleOrigin, Projectile.scale, SpriteEffects.None, 0); + Main.EntitySpriteDraw(maceTexture, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), maceRotation, handleOrigin, Projectile.scale, SpriteEffects.None); return false; } } diff --git a/Projectiles/Melee/MajesticGuardHoldout.cs b/Projectiles/Melee/MajesticGuardHoldout.cs index b336a0b32d..1ec5cb2f5f 100644 --- a/Projectiles/Melee/MajesticGuardHoldout.cs +++ b/Projectiles/Melee/MajesticGuardHoldout.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(7 - Projectile.numHits * 5, 1, 7)); if (Projectile.numHits < 5) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal); } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); diff --git a/Projectiles/Melee/MantisClawHoldout.cs b/Projectiles/Melee/MantisClawHoldout.cs index 190f752a77..41b861553a 100644 --- a/Projectiles/Melee/MantisClawHoldout.cs +++ b/Projectiles/Melee/MantisClawHoldout.cs @@ -1,21 +1,14 @@ -using CalamityMod.Projectiles.Typeless; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using CalamityMod.Items.BaseItems; -using Terraria.ModLoader; +using System; +using CalamityMod.Items.Weapons.Melee; +using CalamityMod.Particles; using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; -using CalamityMod.Balancing; +using Terraria; using Terraria.Audio; -using CalamityMod.Items.Weapons.Melee; -using System; -using CalamityMod.Particles; -using Terraria.DataStructures; -using System.Collections.Generic; -using CalamityMod.Graphics.Primitives; -using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -23,7 +16,7 @@ namespace CalamityMod.Projectiles.Melee { bool AnimationCooldown = false; - float JetDamageMultiplier => 7.5f; + float JetDamageMultiplier => 6.5f; int SlashSpeed => 6; int BlastChargeUses => 3; @@ -37,6 +30,12 @@ namespace CalamityMod.Projectiles.Melee public float BubbleSize = 0f; public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Items/Weapons/Melee/MantisClaws"; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.DamageType = DamageClass.Melee; + } public override void ResetStyle() { if (AnimationCooldown) @@ -71,7 +70,7 @@ namespace CalamityMod.Projectiles.Melee // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction Projectile.NewProjectile(Projectile.GetSource_FromThis(), Owner.Center + new Vector2(20, 0).RotatedBy(Projectile.rotation), - Owner.DirectionTo(Owner.Calamity().mouseWorld) * 30, ModContent.ProjectileType(), (int)(Projectile.damage * JetDamageMultiplier), 7, Owner.whoAmI); + Owner.DirectionTo(Owner.Calamity().mouseWorld) * 30, ModContent.ProjectileType(), (int)(Projectile.damage * JetDamageMultiplier), 7, Owner.whoAmI, 0f, 40f); for (int i = 0; i < 9; i++) { @@ -129,7 +128,7 @@ namespace CalamityMod.Projectiles.Melee Owner.Calamity().mouseWorldListener = true; // 14NOV2024: Ozzatron: clamped mouse position unnecessary, only used for direction - Projectile slash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.DirectionTo(Owner.Calamity().mouseWorld) * 6f, ModContent.ProjectileType(), Projectile.damage, 4f, Owner.whoAmI); + Projectile slash = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, Owner.DirectionTo(Owner.Calamity().mouseWorld) * 6f, ModContent.ProjectileType(), Projectile.damage, 2f, Owner.whoAmI); slash.rotation = Owner.AngleTo(Owner.Calamity().mouseWorld) + MathHelper.ToRadians(Main.rand.NextFloat(-25, 25)); } diff --git a/Projectiles/Melee/MantisClawJet.cs b/Projectiles/Melee/MantisClawJet.cs index 87821016d3..5e9bee31aa 100644 --- a/Projectiles/Melee/MantisClawJet.cs +++ b/Projectiles/Melee/MantisClawJet.cs @@ -39,7 +39,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 60; Projectile.timeLeft = TimerCap; - Projectile.knockBack = 2; Projectile.tileCollide = false; Projectile.width = 20; Projectile.height = 20; @@ -47,7 +46,6 @@ namespace CalamityMod.Projectiles.Melee Projectile.penetrate = -1; Projectile.extraUpdates = 5; Projectile.DamageType = DamageClass.Melee; - Projectile.ai[1] = 40; } public override void OnSpawn(IEntitySource source) @@ -64,16 +62,10 @@ namespace CalamityMod.Projectiles.Melee Projectile.ai[0]++; } - public override bool? CanDamage() - { - return true; - } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Player owner = Main.player[Projectile.owner]; - if (Main.rand.Next(100) < owner.GetWeaponCrit(owner.ActiveItem()) + 20) - modifiers.SetCrit(); + modifiers.SetCrit(); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Melee/MantisClawSlash.cs b/Projectiles/Melee/MantisClawSlash.cs index bdf5b9b823..a0783efbce 100644 --- a/Projectiles/Melee/MantisClawSlash.cs +++ b/Projectiles/Melee/MantisClawSlash.cs @@ -1,51 +1,37 @@ -using CalamityMod.Projectiles.Typeless; +using System.Collections.Generic; +using CalamityMod.Buffs.DamageOverTime; using Microsoft.Xna.Framework; -using Terraria; -using Terraria.ID; -using CalamityMod.Items.BaseItems; -using Terraria.ModLoader; -using CalamityMod.Projectiles.BaseProjectiles; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; -using CalamityMod.Balancing; -using Terraria.Audio; -using CalamityMod.Items.Weapons.Melee; -using System; -using CalamityMod.Particles; +using Terraria; using Terraria.DataStructures; -using System.Collections.Generic; -using CalamityMod.Graphics.Primitives; -using Terraria.Graphics.Shaders; -using CalamityMod.Buffs.DamageOverTime; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { public class MantisClawSlash : ModProjectile, ILocalizedModType { - public int TimerCap => 20; - public new string LocalizationCategory => "Projectiles.Melee"; public override string Texture => "CalamityMod/Particles/SlashSmear"; + private const int TimerCap = 20; Color startColor; Color endColor; + int dir = 1; public override void SetDefaults() { Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 60; Projectile.timeLeft = TimerCap; - Projectile.knockBack = 2; Projectile.tileCollide = false; Projectile.width = 256; Projectile.height = 256; Projectile.friendly = true; Projectile.penetrate = -1; - Projectile.DamageType = DamageClass.Melee; + Projectile.DamageType = TrueMeleeDamageClass.Instance; } - int dir = 1; - public override void OnSpawn(IEntitySource source) { Projectile.scale = 0f; @@ -53,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.rand.NextBool(2)) dir = -1; - // i cherry picked five specific colors to make a similar but different palette to the claws themselves + // I cherry picked five specific colors to make a similar but different palette to the claws themselves // of those five, the projectile lerps between two, randomly chosen when the projectile is spawned List ColorList = [ @@ -89,23 +75,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = Projectile.velocity.RotatedBy(MathHelper.ToRadians(3f) * dir); Projectile.ai[1]++; - Projectile.ai[0] = MathHelper.Lerp(Projectile.ai[0], MathHelper.TwoPi * dir, 0.15f); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(ModContent.BuffType(), 180); - } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - } - - public override bool? CanDamage() - { - return true; - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); public override bool PreDraw(ref Color lightColor) { @@ -116,7 +90,6 @@ namespace CalamityMod.Projectiles.Melee Main.EntitySpriteDraw(tex.Value, Projectile.Center - Main.screenPosition, tex.Frame(), Color.Lerp(startColor, endColor, Projectile.ai[1] / TimerCap).MultiplyRGBA(new Color(255, 255, 255, 0f)), Projectile.rotation - (dir == -1 ? MathHelper.ToRadians(-135f) : MathHelper.ToRadians(180f)) + Projectile.ai[0], tex.Size() / 2, MathHelper.Lerp(0.6f, 1f, i) * Projectile.scale, dir == 1 ? SpriteEffects.None : SpriteEffects.FlipVertically); } - return false; } } diff --git a/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs b/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs index fb19dc0660..cc6e39ef9c 100644 --- a/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs +++ b/Projectiles/Melee/MendedBiomeBlade_DecaysRetortDash.cs @@ -24,15 +24,13 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; - Projectile.width = Projectile.height = 8; + Projectile.width = Projectile.height = 80; Projectile.tileCollide = false; Projectile.friendly = true; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 60; Projectile.timeLeft = 20; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs index 7a7fc8cb16..68bc6ca463 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMight.cs @@ -61,7 +61,7 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float collisionPoint = 0f; - float bladeLength = 100 * Projectile.scale; + float bladeLength = 105 * Projectile.scale; float bladeWidth = 20 * Projectile.scale; return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Projectile.Center + (direction * bladeLength), bladeWidth, ref collisionPoint); } @@ -171,7 +171,7 @@ namespace CalamityMod.Projectiles.Melee //Manage position and rotation - Projectile.scale = 1 + Empowerment / maxEmpowerment * 1.5f; + Projectile.scale = 1 + Empowerment / maxEmpowerment * 1.85f; oldDirection = direction; direction = direction.RotatedBy(MathHelper.Clamp(Empowerment * 1.1f / maxEmpowerment, 0.45f, 1f) * MathHelper.PiOver4 * 0.20f); @@ -222,6 +222,8 @@ namespace CalamityMod.Projectiles.Melee modifiers.SourceDamage *= MathHelper.Lerp(1f, TrueBiomeBlade.HolyAttunement_ThrowDamageBoost, Empowerment / maxEmpowerment); else modifiers.SourceDamage *= MathHelper.Lerp(TrueBiomeBlade.HolyAttunement_BaseSwingDamageMult, TrueBiomeBlade.HolyAttunement_FullSwingDamageMult, Empowerment / maxEmpowerment); + + modifiers.HitDirectionOverride = (Owner.Center.X > target.Center.X).ToDirectionInt(); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs b/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs index d2ada56839..a9e9b8c3b8 100644 --- a/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs +++ b/Projectiles/Melee/MendedBiomeBlade_HeavensMonolith.cs @@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.timeLeft = 102; Projectile.scale = Scale; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.idStaticNPCHitCooldown = 20; Projectile.hide = true; } diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs index 56033def56..966f0d858e 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs @@ -30,9 +30,6 @@ namespace CalamityMod.Projectiles.Melee private Vector2 PowerLungeStart; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -140,10 +137,7 @@ namespace CalamityMod.Projectiles.Melee Owner.GiveUniversalIFrames(TrueBiomeBlade.EvilAttunement_SlashIFrames); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - - private void OnHitEffects(bool cannotLifesteal) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (ChargedUp) return; @@ -153,10 +147,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - if (!cannotLifesteal) //trolled - { - Owner.HealPlayer(TrueBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck - } + Owner.DoLifestealDirect(target, TrueBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; diff --git a/Projectiles/Melee/MonstrousKnife.cs b/Projectiles/Melee/MonstrousKnife.cs index 41b96a3f76..26a473b776 100644 --- a/Projectiles/Melee/MonstrousKnife.cs +++ b/Projectiles/Melee/MonstrousKnife.cs @@ -47,28 +47,6 @@ namespace CalamityMod.Projectiles.Melee } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * Main.rand.NextFloat(0.05f, 0.1f)); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - int heal = (int)Math.Round(info.Damage * Main.rand.NextFloat(0.05f, 0.1f)); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, 1, 3f); } } diff --git a/Projectiles/Melee/NebulashFlail.cs b/Projectiles/Melee/NebulashFlail.cs index 04c51a2b4f..0e71521e37 100644 --- a/Projectiles/Melee/NebulashFlail.cs +++ b/Projectiles/Melee/NebulashFlail.cs @@ -21,7 +21,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.DamageType = DamageClass.MeleeNoSpeed; Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 2; + Projectile.localNPCHitCooldown = 6; } public override Color SpecialDrawColor => new(255, 200, 0); public override int ExudeDustType => ModContent.DustType(); diff --git a/Projectiles/Melee/OrderbringerBeam.cs b/Projectiles/Melee/OrderbringerBeam.cs index ea5a3dc017..2fc3736a21 100644 --- a/Projectiles/Melee/OrderbringerBeam.cs +++ b/Projectiles/Melee/OrderbringerBeam.cs @@ -1,9 +1,7 @@ -using System; -using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Particles; using Microsoft.Xna.Framework; using Terraria; -using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; @@ -30,7 +28,7 @@ namespace CalamityMod.Projectiles.Melee Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = -1; - Projectile.extraUpdates = 6; + Projectile.extraUpdates = 40; Projectile.timeLeft = 180; Projectile.DamageType = DamageClass.Melee; Projectile.usesLocalNPCImmunity = true; @@ -39,17 +37,16 @@ namespace CalamityMod.Projectiles.Melee public override void AI() { - if (time == 0) - { - mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; - } + Player player = Main.player[Projectile.owner]; + mainColor = player.Calamity().lightRGB; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; Player Owner = Main.player[Projectile.owner]; float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); - if (Projectile.timeLeft % 3 == 0 && targetDist < 1400f) + if (Projectile.timeLeft % 12 == 0 && targetDist < 1400f) { - Particle spark = new SparkParticle(Projectile.Center - Projectile.velocity * 3, -Projectile.velocity * 0.05f, false, 17, 1.5f, mainColor * 0.7f); + Particle spark = new CustomSpark(Projectile.Center, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 23, 0.25f, mainColor * 0.75f, new Vector2(1f, 7.35f), true, true, shrinkSpeed: 0.2f, glowOpacity: 0.7f); GeneralParticleHandler.SpawnParticle(spark); } time++; @@ -62,7 +59,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 180); + target.AddBuff(ModContent.BuffType(), 180); if (Projectile.numHits < 1) { Particle orb = new GlowSparkParticle(target.Center, Projectile.velocity.SafeNormalize(Vector2.UnitY), false, 12, 0.07f, mainColor, new Vector2(1.5f, 0.8f), true); diff --git a/Projectiles/Melee/OrderbringerWaveProj.cs b/Projectiles/Melee/OrderbringerWaveProj.cs index d38407612a..c75a37a4ae 100644 --- a/Projectiles/Melee/OrderbringerWaveProj.cs +++ b/Projectiles/Melee/OrderbringerWaveProj.cs @@ -1,14 +1,11 @@ using System; -using Microsoft.Xna.Framework; -using Terraria; -using Terraria.Audio; -using Terraria.ID; -using CalamityMod.Particles; -using Terraria.ModLoader; -using CalamityMod.Projectiles.Ranged; -using Microsoft.Xna.Framework.Graphics; -using System.ComponentModel; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ModLoader; namespace CalamityMod.Projectiles.Melee { @@ -32,21 +29,23 @@ namespace CalamityMod.Projectiles.Melee Projectile.tileCollide = false; Projectile.timeLeft = 450; Projectile.DamageType = DamageClass.Melee; - Projectile.extraUpdates = 10; + Projectile.extraUpdates = 22; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; } public override void AI() { - Vector2 topCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(100f)) * Projectile.scale) * 157; - Vector2 bottomCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-100f)) * Projectile.scale) * 157; + Vector2 topCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(125f)) * Projectile.scale) * 190; + Vector2 bottomCorner = Projectile.Center + (Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-125f)) * Projectile.scale) * 190; + + Player player = Main.player[Projectile.owner]; + mainColor = player.Calamity().lightRGB; if (time == 0) { Projectile.scale = 0.0875f; - Projectile.velocity *= 0.9f; - mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + Projectile.velocity *= 1.25f; } Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; @@ -67,19 +66,20 @@ namespace CalamityMod.Projectiles.Melee { if (Main.rand.NextBool(3)) { - Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(hitboxSize, hitboxSize) - Projectile.velocity * 2, 66); - trailDust.scale = Main.rand.NextFloat(0.7f, 0.85f) - (time < 150 ? 0 : time * 0.001f); + Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(hitboxSize * 1.25f, hitboxSize * 1.25f) - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 25, ModContent.DustType()); + trailDust.scale = Main.rand.NextFloat(1.6f, 1.95f) - (time < 150 ? 0 : time * 0.001f); trailDust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.85f, 1.5f); - trailDust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + trailDust.color = mainColor; trailDust.noGravity = true; + trailDust.fadeIn = 2f; } - if (time % 9 == 0) + if (time % 9 == 0 && time < 200) { - Particle orb = new GlowSparkParticle(topCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(170f)), false, 15, Main.rand.NextFloat(0.03f, 0.055f) * Utils.GetLerpValue(250, 150, time, true), mainColor, new Vector2(1, 0.8f), true, false, 0.3f); - GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new GlowSparkParticle(bottomCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-170f)), false, 15, Main.rand.NextFloat(0.03f, 0.055f) * Utils.GetLerpValue(250, 150, time, true), mainColor, new Vector2(1, 0.8f), true, false, 0.3f); - GeneralParticleHandler.SpawnParticle(orb2); + Particle spark = new CustomSpark(topCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(-170f)), "CalamityMod/Particles/BloomCircle", false, 18, 0.35f, mainColor * 0.75f, new Vector2(1f, 2.5f), true, true, shrinkSpeed: 0.2f, glowOpacity: 0.7f); + GeneralParticleHandler.SpawnParticle(spark); + Particle spark2 = new CustomSpark(bottomCorner, Projectile.velocity.SafeNormalize(Vector2.UnitY).RotatedBy(MathHelper.ToRadians(170f)), "CalamityMod/Particles/BloomCircle", false, 18, 0.35f, mainColor * 0.75f, new Vector2(1f, 2.5f), true, true, shrinkSpeed: 0.2f, glowOpacity: 0.7f); + GeneralParticleHandler.SpawnParticle(spark2); } if (Main.rand.NextBool(12)) { @@ -90,25 +90,22 @@ namespace CalamityMod.Projectiles.Melee } } - fadeOut = Utils.GetLerpValue(0, 180, Projectile.timeLeft, true); - time++; } public override bool PreDraw(ref Color lightColor) { Texture2D tex = ModContent.Request(Texture).Value; - float waveFade = Utils.GetLerpValue(0, 300, Projectile.timeLeft); - for (int i = 1; i < 6; i++) // Weird for loop because of squash code - Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, mainColor with { A = 0 } * fadeOut, Projectile.rotation, tex.Size() / 2f, new Vector2(1 - (i * 0.2f * waveFade), 1 + (i * 0.35f * waveFade)) * Projectile.scale * 1.1f, SpriteEffects.None, 0); + float waveFade = (float)Math.Pow(Utils.GetLerpValue(0, 250, Projectile.timeLeft, true), 2); + float waveFade2 = (float)Math.Pow(Utils.GetLerpValue(0, 80, Projectile.timeLeft, true), 2); + for (int i = 1; i < 15; i++) // Weird for loop because of squash code + Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 6f * i, null, mainColor with { A = 0 } * waveFade * (1 - 0.1f * i), Projectile.rotation, tex.Size() / 2f, new Vector2(1.1f * MathHelper.Lerp(waveFade2, 1, 0.3f), 0.6f + (1 - waveFade) * 0.8f) * Projectile.scale * 1.1f, SpriteEffects.None, 0); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 300); - if (damageMult < 1.3f && damageDone > 2) - damageMult += 0.325f; + target.AddBuff(ModContent.BuffType(), 300); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) diff --git a/Projectiles/Melee/PwnagehammerProj.cs b/Projectiles/Melee/PwnagehammerProj.cs index 3f656010c7..5235f02946 100644 --- a/Projectiles/Melee/PwnagehammerProj.cs +++ b/Projectiles/Melee/PwnagehammerProj.cs @@ -92,7 +92,8 @@ namespace CalamityMod.Projectiles.Melee else SoundEngine.PlaySound(UseSound with { Pitch = EmpoweredHammer * 0.1f - 0.2f }, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); + if (Main.myPlayer == Projectile.owner) + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f); return false; } diff --git a/Projectiles/Melee/RedtideWhirlpool.cs b/Projectiles/Melee/RedtideWhirlpool.cs index 0b983a87b8..56cfea6532 100644 --- a/Projectiles/Melee/RedtideWhirlpool.cs +++ b/Projectiles/Melee/RedtideWhirlpool.cs @@ -14,10 +14,15 @@ namespace CalamityMod.Projectiles.Melee public new string LocalizationCategory => "Projectiles.Melee"; public Player Owner => Main.player[Projectile.owner]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + public override void SetDefaults() { - Projectile.width = 60; - Projectile.height = 60; + Projectile.width = Projectile.height = 60; Projectile.friendly = true; Projectile.DamageType = DamageClass.Melee; Projectile.ignoreWater = true; @@ -42,29 +47,29 @@ namespace CalamityMod.Projectiles.Melee Dust dust = Dust.NewDustPerfect(dustPos, 176, (angle - MathHelper.PiOver2 * Math.Sign(Projectile.velocity.X)).ToRotationVector2() * 8f + Projectile.velocity, Scale: Main.rand.NextFloat(1.6f, 3f)); dust.noGravity = true; } - - Vector2 trailOffset = Projectile.velocity.SafeNormalize(Vector2.Zero).RotatedBy(MathHelper.PiOver2) * Main.rand.NextFloat(40f, 48f); - Dust trail = Dust.NewDustPerfect(Projectile.Center + trailOffset, 176, Main.rand.NextVector2Circular(0.2f, 0.2f)); - trail.noGravity = true; - trail.scale = Main.rand.NextFloat(0.8f, 3f); - trail.alpha = Main.rand.Next(120, 180 + 1); - trail = Dust.NewDustPerfect(Projectile.Center - trailOffset, 176, Main.rand.NextVector2Circular(0.2f, 0.2f)); - trail.noGravity = true; - trail.scale = Main.rand.NextFloat(0.8f, 3f); - trail.alpha = Main.rand.Next(120, 180 + 1); } public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - SpriteEffects flip = Math.Sign(Projectile.velocity.X) < 0 ? SpriteEffects.None : SpriteEffects.FlipHorizontally; + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.3f, Projectile.rotation * 1.2f, texture.Size() * 0.5f, 1.2f, flip); + Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.4f, Projectile.rotation, texture.Size() * 0.5f, 1.6f, flip); - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.3f, Projectile.rotation * 1.2f, texture.Size() / 2f, 1.5f, flip, 0); - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, null, lightColor * 0.4f, Projectile.rotation, texture.Size() / 2f, 2f, flip, 0); - + // Custom afterimage + for (int i = 1; i < Projectile.oldPos.Length; i++) + { + float afterimageRot = Projectile.oldRot[i]; + Vector2 drawPos = Projectile.oldPos[i] + texture.Size() * 0.5f - Main.screenPosition; + float intensity = MathHelper.Lerp(0.01f, 0.1f, 1f - i / (float)Projectile.oldPos.Length); + + Main.EntitySpriteDraw(texture, drawPos, null, lightColor * intensity, afterimageRot, texture.Size() * 0.5f, 1.6f, flip); + } return false; } + + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 56f, targetHitbox); + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override void OnKill(int timeLeft) diff --git a/Projectiles/Melee/RespiteblockHoldout.cs b/Projectiles/Melee/RespiteblockHoldout.cs index d999e088e3..4ec0e55ed9 100644 --- a/Projectiles/Melee/RespiteblockHoldout.cs +++ b/Projectiles/Melee/RespiteblockHoldout.cs @@ -113,13 +113,7 @@ namespace CalamityMod.Projectiles.Melee SoundStyle fire = new("CalamityMod/Sounds/Item/WulfrumKnifeTileHit", 2); SoundEngine.PlaySound(fire with { Volume = 0.55f, Pitch = 0.3f }, Projectile.Center); - - if (player.moonLeech || player.lifeSteal <= 0f || target.lifeMax <= 5) - return; - - int heal = Main.rand.NextBool(4) ? 2 : 1; - player.lifeSteal -= heal; - player.HealPlayer(heal); + player.DoLifestealDirect(target, Main.rand.NextBool(4) ? 2 : 1, 0.75f); } public void PlayChainsawSounds() diff --git a/Projectiles/Melee/SeekingScorcherProj.cs b/Projectiles/Melee/SeekingScorcherProj.cs index 8b7f83e462..2d5274a83c 100644 --- a/Projectiles/Melee/SeekingScorcherProj.cs +++ b/Projectiles/Melee/SeekingScorcherProj.cs @@ -28,8 +28,9 @@ namespace CalamityMod.Projectiles.Melee public static float CrystalBounceDamageMult = 2f; // Exponential scaling for multiple bounces but capped at max bounces public static float CrystalBounceSpeedMult = 1.25f; public static int MaxBounces = 3; - public const float MaxNPCHomingRange = 1200f; // 75 tiles - public const float MaxAxeHomingRange = 800f; // 50 tiles + public const float MaxNPCHomingRange = 960f; // 60 tiles + up to 3x empowerment boosts + public const float MaxAxeHomingRange = 640f; // 40 tiles + up to 2x empowerment boosts + public const float BonusRangePerEmpowerment = 80f; // 5 tiles private List PreviousNPCs = new List() { -1 }; public Player Owner => Main.player[Projectile.owner]; @@ -126,6 +127,9 @@ namespace CalamityMod.Projectiles.Melee // Cause the axe that just hit to be empowered and counts as a bounce proj.damage = Math.Clamp((int)(proj.damage * CrystalBounceDamageMult), 0, (int)(proj.originalDamage * MathF.Pow(CrystalBounceDamageMult, MaxBounces))); proj.velocity = proj.velocity.RotatedBy(Main.rand.NextBool() ? MathHelper.ToRadians(Main.rand.NextFloat(108f, 162f)) : MathHelper.ToRadians(Main.rand.NextFloat(-162f, -108f))) * CrystalBounceSpeedMult; + if (proj.MaxUpdates < 5) + proj.MaxUpdates++; + proj.ai[1] -= 30f; proj.ai[2] = -1f; proj.netUpdate = true; @@ -270,7 +274,7 @@ namespace CalamityMod.Projectiles.Melee return; } - float range = MaxNPCHomingRange; + float range = MaxNPCHomingRange + BonusRangePerEmpowerment * (Projectile.MaxUpdates - 2); int targetNPC = -1; foreach (NPC target in Main.ActiveNPCs) { @@ -289,7 +293,7 @@ namespace CalamityMod.Projectiles.Melee { // Will only try to bounce towards nearby axes if there are nearby enemies as to not waste axe hits // The last usable pierce will never be spent on an axe since it would then just return to the player - float range2 = MaxAxeHomingRange; + float range2 = MaxAxeHomingRange + BonusRangePerEmpowerment * (Projectile.MaxUpdates - 2); int targetAxe = -1; foreach (Projectile proj in Main.ActiveProjectiles) { @@ -326,6 +330,7 @@ namespace CalamityMod.Projectiles.Melee { // Swiftly move back towards the player; also make it avoid naturally despawning Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * Projectile.velocity.Length(); + Projectile.MaxUpdates = 2; Projectile.timeLeft = 2; // Delete the Projectile if it touches its owner or too far away. diff --git a/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs b/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs index 6c829928f4..3960a33083 100644 --- a/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs +++ b/Projectiles/Melee/Spears/BotanicPiercerProjectile.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void SetDefaults() { Projectile.width = Projectile.height = 40; - Projectile.DamageType = DamageClass.Melee; //Dictates whether this is a melee-class weapon. + Projectile.DamageType = TrueMeleeDamageClass.Instance; Projectile.timeLeft = 90; Projectile.friendly = true; Projectile.hostile = false; @@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Melee.Spears Projectile.penetrate = -1; Projectile.ownerHitCheck = true; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = 8; } public override float InitialSpeed => 3f; diff --git a/Projectiles/Melee/Spears/GildedProboscisProj.cs b/Projectiles/Melee/Spears/GildedProboscisProj.cs index 76bbf419ed..f0967784f6 100644 --- a/Projectiles/Melee/Spears/GildedProboscisProj.cs +++ b/Projectiles/Melee/Spears/GildedProboscisProj.cs @@ -44,15 +44,7 @@ namespace CalamityMod.Projectiles.Melee.Spears public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 240); - - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.01)); } } } 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/StarofJudgement.cs b/Projectiles/Melee/StarofJudgement.cs index 7d8e9fb74c..fb825f10b1 100644 --- a/Projectiles/Melee/StarofJudgement.cs +++ b/Projectiles/Melee/StarofJudgement.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; using Microsoft.Xna.Framework.Graphics; using System; using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; namespace CalamityMod.Projectiles.Melee { @@ -40,31 +41,37 @@ namespace CalamityMod.Projectiles.Melee { if (time == 0) { - Projectile.scale = (Projectile.ai[2] == 1 ? 0.75f : 0.5f); mainColor = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; + Projectile.scale = (Projectile.ai[2] == 1 ? 0.75f : 0.5f); if (Projectile.ai[2] == 1) { - Projectile.localNPCHitCooldown = 7; - Projectile.penetrate = 4; + Projectile.localNPCHitCooldown = -1; + Projectile.penetrate = 1; + Projectile.extraUpdates = 1; } } Projectile.rotation += (Projectile.velocity.X + MathF.Abs(Projectile.velocity.Y) * Projectile.direction) * 0.01f; if (Projectile.ai[2] == 1) { - CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 25, MathHelper.Clamp(30 - time, 15, 30)); - if (Main.rand.NextBool(4) && Projectile.numHits < 1) + if (time > 18) { - Particle spark = new GlowOrbParticle(Projectile.Center + Main.rand.NextVector2Circular(7, 7) - Projectile.velocity, -Projectile.velocity * Main.rand.NextFloat(0.5f, 0.8f), false, 13, 1f, mainColor * 0.5f); + CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 25, MathHelper.Clamp(30 - time, 15, 30)); + } + else + Projectile.velocity = Projectile.velocity.RotatedBy(0.085f * Projectile.ai[1]); + if (time % 2 == 0) + { + Particle spark = new CustomSpark(Projectile.Center, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 13, 0.35f, mainColor * 0.75f, new Vector2(0.8f, 1.35f), true, false, shrinkSpeed: 0.3f); GeneralParticleHandler.SpawnParticle(spark); } } - else if (time > 15) + if (Projectile.ai[2] != 1 && time > 10) { CalamityUtils.HomeInOnNPC(Projectile, true, 700f * (Projectile.numHits > 1 ? 2 : 1), 20, 20f * (Projectile.numHits > 1 ? 5 : 1)); if (Main.rand.NextBool(3)) { - Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5) - Projectile.velocity, 66); + Dust trailDust = Dust.NewDustPerfect(Projectile.Center + Main.rand.NextVector2Circular(5, 5) - Projectile.velocity, ModContent.DustType()); trailDust.scale = Main.rand.NextFloat(0.7f, 0.85f); trailDust.velocity = -Projectile.velocity * Main.rand.NextFloat(0.3f, 0.5f); trailDust.color = Main.rand.NextBool() ? Color.MediumPurple : Color.MediumOrchid; @@ -84,18 +91,19 @@ namespace CalamityMod.Projectiles.Melee Vector2 rotationPoint = texture.Size() * 0.5f; CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], drawColor * 0.5f, 1, texture, true, true); Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, drawRotation, rotationPoint, Projectile.scale, SpriteEffects.None); + Main.EntitySpriteDraw(texture, drawPosition, null, Color.White with { A = 0 }, drawRotation, rotationPoint, Projectile.scale * 0.8f, SpriteEffects.None); return false; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - int buffType = Projectile.ai[2] == 1f ? ModContent.BuffType() : ModContent.BuffType(); - target.AddBuff(buffType, 60); + if (!target.CanBeChasedBy()) + Projectile.penetrate++; if (Projectile.ai[2] == 0) { Projectile.timeLeft = 180; time = 0; - Projectile.velocity *= 1.2f; + Projectile.velocity *= 1.1f; } } public override void OnKill(int timeLeft) diff --git a/Projectiles/Melee/StarofOrder.cs b/Projectiles/Melee/StarofOrder.cs new file mode 100644 index 0000000000..958b843c75 --- /dev/null +++ b/Projectiles/Melee/StarofOrder.cs @@ -0,0 +1,117 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Dusts; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Melee +{ + public class StarofOrder : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Melee"; + public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public ref float time => ref Projectile.ai[0]; + public Color mainColor; + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + ProjectileID.Sets.TrailCacheLength[Type] = 12; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + public override void SetDefaults() + { + Projectile.width = 44; + Projectile.height = 44; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = 4; + Projectile.tileCollide = false; + Projectile.timeLeft = 180; + Projectile.DamageType = DamageClass.Melee; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 7; + } + + public override void AI() + { + Player player = Main.player[Projectile.owner]; + mainColor = player.Calamity().lightRGB; + if (time == 0) + { + Projectile.scale = Main.rand.NextFloat(0.65f, 0.8f); + } + float sine = (float)Math.Sin(time * 0.575f * Projectile.scale / MathHelper.Pi); + + Projectile.rotation = 0.25f * sine; + if (time < 20) + { + Projectile.extraUpdates = 1; + Projectile.velocity = Projectile.velocity.RotatedBy(-Projectile.ai[1] * 0.05f); + } + else + { + Projectile.extraUpdates = 0; + CalamityUtils.HomeInOnNPC(Projectile, true, 900f, 25, MathHelper.Clamp(30 - time, 15, 30)); + } + if (time % 2 == 0 && Projectile.numHits < 1) + { + Particle spark = new CustomSpark(Projectile.Center, Projectile.velocity * 0.2f, "CalamityMod/Particles/BloomCircle", false, 13, 0.35f, mainColor * 0.75f, new Vector2(0.8f, 1.35f), true, false, shrinkSpeed: 0.3f); + GeneralParticleHandler.SpawnParticle(spark); + } + + time++; + } + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + Color drawColor = Color.Lerp(mainColor, Color.White, 0.2f) with { A = 0 }; + float drawRotation = Projectile.rotation; + Vector2 rotationPoint = texture.Size() * 0.5f; + //CalamityUtils.DrawAfterimagesCentered(Projectile, ProjectileID.Sets.TrailingMode[Type], drawColor * 0.5f, 1, texture, true, true); + bool roted = true; + for (int i = 0; i < 5; i++) + { + Main.EntitySpriteDraw(texture, drawPosition, null, drawColor, (roted ? 0 : MathHelper.PiOver2) + Projectile.rotation, rotationPoint, new Vector2(1 - 0.12f * i, 1 + 0.75f * i) * Projectile.scale * 0.2f * Main.rand.NextFloat(0.8f, 1.1f), SpriteEffects.None); + if (roted && i == 4) + { + i = -1; + roted = false; + } + } + return false; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + int buffType = ModContent.BuffType(); + target.AddBuff(buffType, 60); + + if (Projectile.ai[2] == 0) + { + Projectile.timeLeft = 180; + time = 0; + Projectile.velocity *= 1.2f; + } + } + public override void OnKill(int timeLeft) + { + int points = 4; + float radians = MathHelper.TwoPi / points; + Vector2 spinningPoint = Vector2.Normalize(new Vector2(-1f, -1f).RotatedBy(Projectile.rotation)); + for (int k = 0; k < points; k++) + { + Vector2 velocity = spinningPoint.RotatedBy(radians * k).RotatedBy(-0.45f); + Dust dust = Dust.NewDustPerfect(Projectile.Center + velocity * 2, ModContent.DustType(), velocity * 8); + dust.scale = 3.5f; + dust.color = mainColor; + dust.noGravity = true; + dust.fadeIn = 6f; + } + } + } +} diff --git a/Projectiles/Melee/StellarStrikerHoldout.cs b/Projectiles/Melee/StellarStrikerHoldout.cs index fbe8a21069..55223e03c3 100644 --- a/Projectiles/Melee/StellarStrikerHoldout.cs +++ b/Projectiles/Melee/StellarStrikerHoldout.cs @@ -220,7 +220,7 @@ namespace CalamityMod.Projectiles.Melee if (spawnBoom) { Vector2 spawnSpot = target.Center + new Vector2(Main.rand.NextFloat(-550, 550), Main.rand.NextFloat(-750, -950)); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage * 2, Projectile.knockBack, Projectile.owner, 0, 0, 7); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnSpot, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5f), Projectile.knockBack, Projectile.owner, 0, 0, 7); spawnBoom = false; } diff --git a/Projectiles/Melee/TerratomereHoldoutProj.cs b/Projectiles/Melee/TerratomereHoldoutProj.cs index 4be39fcdda..a4ce26890d 100644 --- a/Projectiles/Melee/TerratomereHoldoutProj.cs +++ b/Projectiles/Melee/TerratomereHoldoutProj.cs @@ -277,19 +277,6 @@ namespace CalamityMod.Projectiles.Melee #endregion Drawing #region Hit Effects and Collision - - public void OnHitHealEffect(int damage) - { - int heal = (int)Math.Round(damage * 0.025); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); - } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { float point = 0f; @@ -300,9 +287,7 @@ namespace CalamityMod.Projectiles.Melee public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), Terratomere.TrueMeleeGlacialStateTime); - - if (target.lifeMax > 5) - OnHitHealEffect(hit.Damage); + Owner.DoLifestealDirect(target, (int)Math.Round(hit.Damage * 0.025), 0.75f); // Create a slash creator on top of the hit target. int slashCreatorID = ModContent.ProjectileType(); @@ -312,12 +297,6 @@ namespace CalamityMod.Projectiles.Melee Owner.ownedProjectileCounts[slashCreatorID]++; } } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), Terratomere.TrueMeleeGlacialStateTime); - OnHitHealEffect(info.Damage); - } #endregion Hit Effects and Collision } } diff --git a/Projectiles/Melee/TriactisHammerExplosion.cs b/Projectiles/Melee/TriactisHammerExplosion.cs index af160569b0..bafc5da605 100644 --- a/Projectiles/Melee/TriactisHammerExplosion.cs +++ b/Projectiles/Melee/TriactisHammerExplosion.cs @@ -84,7 +84,11 @@ namespace CalamityMod.Projectiles.Melee public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 640f, targetHitbox); - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.HitDirectionOverride = (Owner.Center.X < target.Center.X).ToDirectionInt(); + modifiers.SourceDamage *= Utils.Remap(Projectile.numHits, 0, 10, 1f, 0.1f, true); + } internal float WidthFunction(float completionRatio) => MathHelper.Clamp(CalamityUtils.Convert01To010(completionRatio * 2), 0.2f, 1f) * 4f; internal Color ColorFunction(float completionRatio) => Color.White; diff --git a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs index 68dda29ff5..50216466a3 100644 --- a/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs +++ b/Projectiles/Melee/TrueArkOfTheAncients_SwungBlade.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Melee public override void SetDefaults() { - Projectile.DamageType = DamageClass.MeleeNoSpeed; + Projectile.DamageType = TrueMeleeNoSpeedDamageClass.Instance; Projectile.width = Projectile.height = 60; Projectile.width = Projectile.height = 60; Projectile.tileCollide = false; diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs index 47863bc102..cd19d30216 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs @@ -57,10 +57,7 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(Spark); } - if (Owner.moonLeech) - return; - - Owner.HealPlayer(OmegaBiomeBlade.SuperPogoAttunementSliceLifesteal); + Owner.DoLifestealDirect(target, OmegaBiomeBlade.SuperPogoAttunementSliceLifesteal, 0.75f); } public override bool PreDraw(ref Color lightColor) //OMw to reuse way too much code from the entangling vines diff --git a/Projectiles/Melee/UrchinSpikeFugu.cs b/Projectiles/Melee/UrchinSpikeFugu.cs index 249d92ad9a..f96645ac3e 100644 --- a/Projectiles/Melee/UrchinSpikeFugu.cs +++ b/Projectiles/Melee/UrchinSpikeFugu.cs @@ -46,8 +46,11 @@ namespace CalamityMod.Projectiles.Melee Projectile.velocity = (Projectile.velocity * 20f + idealVelocity) / 21f; Projectile.velocity = Projectile.velocity.MoveTowards(idealVelocity, 2f); } + else if (Time >= 48f) + Projectile.velocity *= 0.9f; - if (Main.rand.NextBool(8)) + int dustRate = (int)MathF.Max(Utils.Remap(Time, 0f, 12f, 20f, 4f), Utils.Remap(Time, 60f, 90f, 4f, 20f)); + if (Main.rand.NextBool(dustRate)) { Dust offTrail = Dust.NewDustPerfect(Projectile.Center, 171, Main.rand.NextVector2Circular(0.2f, 0.2f)); offTrail.noGravity = true; diff --git a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs index 067878f5a1..8e5be19829 100644 --- a/Projectiles/Melee/Yoyos/LaceratorYoyo.cs +++ b/Projectiles/Melee/Yoyos/LaceratorYoyo.cs @@ -2,6 +2,7 @@ using System.Linq; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Items.Weapons.Melee; +using CalamityMod.NPCs; using CalamityMod.Projectiles.Healing; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; @@ -13,23 +14,17 @@ using CalamityMod.Particles; namespace CalamityMod.Projectiles.Melee.Yoyos { + // Although normally yoyos are automatically exempted from pierce resist, + // the damage logic for the buzzsaw briefly clobbers aiStyle, necessitating a manual pierce resist exception. + [PierceResistException] public class LaceratorYoyo : ModProjectile { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public const int MaxUpdates = 3; - private static int CircleRes = 60; - private static int VertRes = 4; - private static int SpikeCount = 8; - - private float circleProgress = 0; - private float verticalProgress = 1; - private bool goingUp = false; public float chargeProgress = 0; - private bool sawHit = false; private bool spawnedBlood = false; - private int sawDir = 0; public override void SetStaticDefaults() @@ -63,6 +58,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos chargeProgress = 1; if (chargeProgress > 0) { + // Handles damage logic for the buzzsaw visual if (Main.player[Projectile.owner].miscCounter % 5 == 0 && Projectile.FinalExtraUpdate() && chargeProgress > 0.05f) { spawnedBlood = false; @@ -71,7 +67,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos Projectile.height = 196; Projectile.Center = Projectile.position; Projectile.originalDamage = Projectile.damage; - Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 1f, chargeProgress)); + Projectile.damage = (int)(Projectile.damage * MathHelper.Lerp(0, 0.75f, chargeProgress)); sawHit = true; Projectile.usesIDStaticNPCImmunity = true; Projectile.aiStyle = -1; @@ -108,11 +104,10 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { if (sawHit) { - target.AddBuff(ModContent.BuffType(), 60); Vector2 bloodpos = Projectile.Center + Projectile.DirectionTo(target.Center) * 84; if (!spawnedBlood && Main.rand.NextBool() && chargeProgress > 0.2f && target.Hitbox.Contains(bloodpos.ToPoint())) { - Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 1, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_OnHit(target), bloodpos, Projectile.DirectionTo(target.Center).RotatedBy(sawDir * MathHelper.PiOver2 * 0.9f).RotatedByRandom(0.1f) * Main.rand.NextFloat(3f, 5f), ModContent.ProjectileType(), 4, 0f, Projectile.owner); spawnedBlood = true; } return; diff --git a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs index 83942f5fa5..b96f270a03 100644 --- a/Projectiles/Melee/Yoyos/QuagmireYoyo.cs +++ b/Projectiles/Melee/Yoyos/QuagmireYoyo.cs @@ -12,6 +12,7 @@ namespace CalamityMod.Projectiles.Melee.Yoyos { public override LocalizedText DisplayName => CalamityUtils.GetItemName(); public const int MaxUpdates = 2; + public ref float Timer => ref Projectile.localAI[2]; public override void SetStaticDefaults() { @@ -34,19 +35,17 @@ namespace CalamityMod.Projectiles.Melee.Yoyos public override void AI() { + Timer++; if ((Projectile.position - Main.player[Projectile.owner].position).Length() > 3200f) //200 blocks Projectile.Kill(); if (Main.rand.NextBool(5 * MaxUpdates)) Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.JungleSpore, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); if (Projectile.owner == Main.myPlayer) { - if (Main.rand.NextBool(10 * MaxUpdates)) + if (Timer % (10 * MaxUpdates) == 0) { - Projectile spore = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * Main.rand.NextFloat(0.15f, 0.35f) + Vector2.UnitX.RotatedByRandom(MathHelper.Pi), ProjectileID.SporeGas + Main.rand.Next(3), (int)(Projectile.damage * 0.5), Projectile.knockBack, Projectile.owner); + Projectile spore = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * Main.rand.NextFloat(0.15f, 0.35f) + Vector2.UnitX.RotatedByRandom(MathHelper.Pi), ProjectileID.SporeGas + Main.rand.Next(3), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); spore.DamageType = DamageClass.MeleeNoSpeed; - spore.usesLocalNPCImmunity = true; - spore.usesIDStaticNPCImmunity = false; - spore.localNPCHitCooldown = 30; } } } diff --git a/Projectiles/Ranged/BallistaGreatArrow.cs b/Projectiles/Ranged/BallistaGreatArrow.cs index 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/BloodBoilerFire.cs b/Projectiles/Ranged/BloodBoilerFire.cs index 5a1869b20e..87e63d5d6e 100644 --- a/Projectiles/Ranged/BloodBoilerFire.cs +++ b/Projectiles/Ranged/BloodBoilerFire.cs @@ -198,7 +198,7 @@ namespace CalamityMod.Projectiles.Ranged { if (improvedHeal) { - BloodstoneHealOrb.Heal(player, 8); + BloodstoneHealOrb.Heal(player, 6); } Projectile.Kill(); diff --git a/Projectiles/Ranged/BloodfireArrowProj.cs b/Projectiles/Ranged/BloodfireArrowProj.cs index 4ccc6336d3..a793e5aad8 100644 --- a/Projectiles/Ranged/BloodfireArrowProj.cs +++ b/Projectiles/Ranged/BloodfireArrowProj.cs @@ -117,12 +117,6 @@ namespace CalamityMod.Projectiles.Ranged Player player = Main.player[Projectile.owner]; player.lifeRegenTime += 2; - if (player.moonLeech) - return; - - if (target.lifeMax <= 5) - return; - float lifeRatio = (float)player.statLife / player.statLifeMax2; float averageHealAmount = MathHelper.Lerp(4.0f, 0.5f, lifeRatio); // Average heal increases from 1/2 to 4 HP based on missing health int guaranteedHeal = (int)averageHealAmount; @@ -130,11 +124,7 @@ namespace CalamityMod.Projectiles.Ranged float chanceOfOneMoreHP = averageHealAmount - guaranteedHeal; bool bonusHeal = Main.rand.NextFloat() < chanceOfOneMoreHP; int finalHeal = guaranteedHeal + (bonusHeal ? 1 : 0); - if (finalHeal > BalancingConstants.LifeStealCap) - finalHeal = BalancingConstants.LifeStealCap; - - if (finalHeal > 0) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], finalHeal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + player.SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, finalHeal, 0.5f); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Ranged/BuzzkillHoldout.cs b/Projectiles/Ranged/BuzzkillHoldout.cs index 04c8fdb96e..c10454ba39 100644 --- a/Projectiles/Ranged/BuzzkillHoldout.cs +++ b/Projectiles/Ranged/BuzzkillHoldout.cs @@ -82,13 +82,16 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle ShootSound = new("CalamityMod/Sounds/Item/SawShot", 2) { PitchVariance = 0.1f, Volume = 0.4f + SawPower * 0.5f }; SoundEngine.PlaySound(ShootSound, GunTipPosition); - float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower) / 1.5f; // The damage must be divided by 1.5 to offset the holdout having 1.5x base damage. - int sawPierce = (int)MathHelper.Lerp(2f, 6f, SawPower); int sawLevel = (SawPower >= 1f).ToInt() + (SawPower >= 0.25f).ToInt(); + if (Main.myPlayer == Projectile.owner) + { + float sawDamageMult = MathHelper.Lerp(1f, 5f, SawPower) / 1.5f; // The damage must be divided by 1.5 to offset the holdout having 1.5x base damage. + int sawPierce = (int)MathHelper.Lerp(2f, 6f, SawPower); - Projectile buzzsaw = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * Owner.ActiveItem().shootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * sawDamageMult), (int)(Projectile.knockBack * (sawDamageMult / 2)), Main.myPlayer, sawLevel); - buzzsaw.penetrate = sawPierce; - buzzsaw.rotation = Main.rand.NextFloat(0f, MathHelper.TwoPi); + Projectile buzzsaw = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, Projectile.velocity.SafeNormalize(Vector2.UnitY) * Owner.ActiveItem().shootSpeed, ModContent.ProjectileType(), (int)(Projectile.damage * sawDamageMult), (int)(Projectile.knockBack * (sawDamageMult / 2)), Main.myPlayer, sawLevel); + buzzsaw.penetrate = sawPierce; + buzzsaw.rotation = Main.rand.NextFloat(0f, MathHelper.TwoPi); + } NoSawOnHoldout = true; OffsetLengthFromArm -= 4f + 12f * SawPower; diff --git a/Projectiles/Ranged/CardHeart.cs b/Projectiles/Ranged/CardHeart.cs index 368d219ab7..0ce2fd9a85 100644 --- a/Projectiles/Ranged/CardHeart.cs +++ b/Projectiles/Ranged/CardHeart.cs @@ -59,17 +59,7 @@ namespace CalamityMod.Projectiles.Ranged } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.01), 0.4f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Ranged/DragonsBreathFlames.cs b/Projectiles/Ranged/DragonsBreathFlames.cs index d6a65bac8e..cec31f3c36 100644 --- a/Projectiles/Ranged/DragonsBreathFlames.cs +++ b/Projectiles/Ranged/DragonsBreathFlames.cs @@ -229,7 +229,18 @@ namespace CalamityMod.Projectiles.Ranged target.AddBuff(ModContent.BuffType(), 240); } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.ai[1] == 1 ? 4 : Projectile.width + Time * 0.1f, targetHitbox); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + Player Owner = Main.player[Projectile.owner]; + if (Time <= 1) + { + float _ = float.NaN; + return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, Owner.Center, Projectile.width, ref _); + } + else + return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.ai[1] == 1 ? 4 : Projectile.width + Time * 0.1f, targetHitbox); + } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { if (Projectile.numHits > 0) diff --git a/Projectiles/Ranged/FirestormCannonHoldout.cs b/Projectiles/Ranged/FirestormCannonHoldout.cs new file mode 100644 index 0000000000..9b1b5d20bc --- /dev/null +++ b/Projectiles/Ranged/FirestormCannonHoldout.cs @@ -0,0 +1,164 @@ +using System; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class FirestormCannonHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 16f; + public override float BaseOffsetY => -5f; + public override float OffsetYDownwards => 5f; + public override Vector2 GunTipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.35f; + + public static readonly SoundStyle WarningSound = new SoundStyle("CalamityMod/Sounds/Item/FireImplosion") with { Volume = 0.75f }; + public static readonly SoundStyle OverheatSound = new("CalamityMod/Sounds/Item/HeliumFlashSteamRelease"); + public SlotId WarningSlot; + public ref float Timer => ref Projectile.ai[0]; + private int BuiltHeat => (Owner.ActiveItem().ModItem as FirestormCannon).BuiltUpHeat; + private bool displayOverheat = false; + private const int WarningTime = FirestormCannon.OverheatLevel - 100; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Ranged; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + public override void KillHoldoutLogic() + { + // What kills the holdout: + // Dead, CCed, Cursed, etc. + // Not holding the item + // Right-clicking (Can kill it early) (Does not work if in overheat state) + // Completely cooling while not firing + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type || + (Owner.Calamity().mouseRight && !displayOverheat) || (BuiltHeat == 0 && !Main.mouseLeft)) + { + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warn)) + warn.Stop(); + + Projectile.Kill(); + } + } + + public override void HoldoutAI() + { + // Timer should only increment while firing and not overheated + if (Main.mouseLeft && Owner.Calamity().flareGunOverheat == 0) + Timer++; + else + Timer = 0; + + // Once holding the fire button down long enough, start actually firing + if (Timer >= 30) + { + // For some reason using ActiveItem() here breaks its functionality while being held on the cursor + (Owner.HeldItem.ModItem as FirestormCannon).BuiltUpHeat++; + + // Overheat yourself if you fire too long + if (BuiltHeat >= FirestormCannon.OverheatLevel) + { + WarningSlot = SoundEngine.PlaySound(OverheatSound, Owner.Center); + for (int e = 0; e < 7; e++) + { + Vector2 dustVel = -Projectile.rotation.ToRotationVector2().RotatedByRandom(MathHelper.Pi * 0.15f) * Main.rand.NextFloat(3.8f, 5.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.Flare, dustVel, Scale: 1.5f); + dust.noGravity = true; + } + + // Overheat damage ignores defense and is undodgeable, also inflicts On Fire + Owner.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FlareGunOverheat").ToNetworkText(Owner.name)), FirestormCannon.OverheatDamage, 1, dodgeable: false, scalingArmorPenetration: 1f, knockback: 0f); + Owner.AddBuff(BuffID.OnFire, FirestormCannon.OverheatCooldown); + Owner.Calamity().flareGunOverheat = FirestormCannon.OverheatCooldown; + displayOverheat = true; + return; + } + + // Play a warning sound + if (BuiltHeat == WarningTime) + { + WarningSlot = SoundEngine.PlaySound(WarningSound, Owner.Center); + } + + // Controls the escalating firing speed + float firingLerp = Utils.GetLerpValue(0, 90, Timer - 30, true); + int firingFrequency = (int)MathHelper.Lerp(HeldItem.useTime, HeldItem.useTime / 2, firingLerp); + // Actually fire shtuff + if (Timer % firingFrequency == 0) + { + SoundEngine.PlaySound(SoundID.Item11 with { Volume = 0.8f }, Owner.Center); + if (Main.myPlayer == Projectile.owner) + { + Owner.PickAmmo(HeldItem, out int flareType, out _, out _, out _, out _, Main.rand.Next(100) >= 70); + Vector2 velocity = Projectile.velocity.RotatedByRandom(MathHelper.Pi * 0.04f * (1f + firingLerp * 0.5f)) * Owner.ActiveItem().shootSpeed; + Projectile flare = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, velocity, flareType, Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f, 1f); + flare.penetrate = 3; + flare.MaxUpdates = 2; + flare.timeLeft = 600; + flare.DamageType = DamageClass.Ranged; + flare.usesIDStaticNPCImmunity = false; + flare.usesLocalNPCImmunity = true; + flare.localNPCHitCooldown = 30 * 2; + } + } + } + + // Reset overheat draw color once the heat passes below the warning indicator + if (BuiltHeat < WarningTime) + displayOverheat = false; + // Draw smoke effect while overheated + if (displayOverheat && Main.rand.NextBool(3)) + { + HeavySmokeParticle smoke = new(GunTipPosition, -Vector2.UnitY * 7.5f, Color.DarkGray, 25, 0.4f, 0.75f); + GeneralParticleHandler.SpawnParticle(smoke); + } + // Constantly move the warning sound on top of the player + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warning) && warning.IsPlaying) + warning.Position = Projectile.Center; + } + + // Pan-searing mechanic; reduces heat a bit + public override bool? CanDamage() => BuiltHeat >= 120 && Owner.Calamity().flareGunOverheat == 0; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire, 300); + (Owner.HeldItem.ModItem as FirestormCannon).BuiltUpHeat -= 6; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Color tintColor = displayOverheat ? Color.Black : + BuiltHeat >= WarningTime ? Color.Lerp(Color.Tomato, Color.White, MathF.Abs(MathF.Sin(Owner.miscCounter * MathHelper.Pi / 30f))) : Color.Tomato; + + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity(Utils.GetLerpValue(0, WarningTime, BuiltHeat, true) * 0.45f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(tintColor); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + return false; + } + } +} diff --git a/Projectiles/Ranged/Flash.cs b/Projectiles/Ranged/Flash.cs index a5eb54f88e..861de2d98c 100644 --- a/Projectiles/Ranged/Flash.cs +++ b/Projectiles/Ranged/Flash.cs @@ -23,73 +23,21 @@ namespace CalamityMod.Projectiles.Ranged Projectile.penetrate = -1; Projectile.timeLeft = 5; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = -1; } public override void AI() { Lighting.AddLight(Projectile.Center, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f, (255 - Projectile.alpha) * 0.5f / 255f); Color dustColor = Projectile.ai[1] == 1f ? CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f) : default; - bool xflag = false; - bool yflag = false; - if (Projectile.velocity.X < 0f && Projectile.position.X < Projectile.ai[0]) - { - xflag = true; - } - if (Projectile.velocity.X > 0f && Projectile.position.X > Projectile.ai[0]) - { - xflag = true; - } - if (Projectile.velocity.Y < 0f && Projectile.position.Y < Projectile.ai[1]) - { - yflag = true; - } - if (Projectile.velocity.Y > 0f && Projectile.position.Y > Projectile.ai[1]) - { - yflag = true; - } - if (xflag && yflag) - { - Projectile.Kill(); - } - float projTimer = 25f; - if (Projectile.ai[0] > 180f) - { - projTimer -= (Projectile.ai[0] - 180f) / 2f; - } - if (projTimer <= 0f) - { - projTimer = 0f; - Projectile.Kill(); - } - projTimer *= 0.7f; - Projectile.ai[0] += 4f; - int timerCounter = 0; - while ((float)timerCounter < projTimer) - { - float rand1 = (float)Main.rand.Next(-30, 31); - float rand2 = (float)Main.rand.Next(-30, 31); - float rand3 = (float)Main.rand.Next(9, 27); - float randAdjust = (float)Math.Sqrt((double)(rand1 * rand1 + rand2 * rand2)); - randAdjust = rand3 / randAdjust; - rand1 *= randAdjust; - rand2 *= randAdjust; - int flashDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.PortalBoltTrail, 0f, 0f, 100, dustColor, 2f); - Dust dust = Main.dust[flashDust]; - dust.noGravity = true; - dust.position.X = Projectile.Center.X; - dust.position.Y = Projectile.Center.Y; - dust.position.X += (float)Main.rand.Next(-10, 11); - dust.position.Y += (float)Main.rand.Next(-10, 11); - dust.velocity.X = rand1; - dust.velocity.Y = rand2; - timerCounter++; - } - } + float randRot = Main.rand.NextFloat(MathHelper.TwoPi); - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - target.AddBuff(BuffID.Confused, 300); + for (int i = 0; i < 4; i++) + { + Vector2 dustVel = Vector2.UnitX.RotatedBy(MathHelper.PiOver2 * i + randRot) * 3f; + Dust flashDust = Dust.NewDustPerfect(Projectile.Center, DustID.PortalBoltTrail, dustVel, 100, dustColor, 1.5f); + flashDust.noGravity = true; + } } } } diff --git a/Projectiles/Ranged/FossilShard.cs b/Projectiles/Ranged/FossilShard.cs index 04c56abf8c..03a853f3db 100644 --- a/Projectiles/Ranged/FossilShard.cs +++ b/Projectiles/Ranged/FossilShard.cs @@ -23,11 +23,10 @@ namespace CalamityMod.Projectiles.Ranged { if (Projectile.ai[1] != 1f) { - if (Projectile.velocity.Y <= 0f) - Projectile.velocity.Y = 0.1f; - Projectile.velocity.Y *= 1.05f; + if (Projectile.velocity.Y <= -2f) + Projectile.velocity.Y = -2f; } - + Projectile.velocity.Y += 0.025f; Projectile.rotation += Projectile.velocity.Y; } diff --git a/Projectiles/Ranged/HalleysComet.cs b/Projectiles/Ranged/HalleysComet.cs index be4ba1de28..1bed54d8eb 100644 --- a/Projectiles/Ranged/HalleysComet.cs +++ b/Projectiles/Ranged/HalleysComet.cs @@ -77,7 +77,10 @@ namespace CalamityMod.Projectiles.Ranged public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 450); + //Doze - I gave this long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + //Both Elf Melter and Flamethrower in vanilla do 20 seconds of their debuff. This is done to match. + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(20)); SoundEngine.PlaySound(HalleysInferno.Hit, Projectile.Center); // Dust emission on hit diff --git a/Projectiles/Ranged/HydraHead.cs b/Projectiles/Ranged/HydraHead.cs index f6439a1330..f40a49a417 100644 --- a/Projectiles/Ranged/HydraHead.cs +++ b/Projectiles/Ranged/HydraHead.cs @@ -147,7 +147,7 @@ namespace CalamityMod.Projectiles.Ranged //Calculation for damage and co Owner.PickAmmo(heldItem, out _, out float itemVelocity, out int itemDamage, out float itemKB, out _); int type = ModContent.ProjectileType(); - for (int i = 0; i < 3; i++) + for (int i = 0; i < Hydra.BulletsPerShot - 1; i++) { Vector2 spreadDirection = shootDirection.RotatedByRandom(MathHelper.ToRadians(Hydra.ShotSpread / 2f)); float spreadVelocity = itemVelocity * Main.rand.NextFloat(1f, 1.4f); diff --git a/Projectiles/Ranged/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/NullShot.cs b/Projectiles/Ranged/NullShot.cs index 8decdde947..3410ecfb79 100644 --- a/Projectiles/Ranged/NullShot.cs +++ b/Projectiles/Ranged/NullShot.cs @@ -179,27 +179,34 @@ namespace CalamityMod.Projectiles.Ranged if (Utils.Distance(Main.player[Projectile.owner].Center, target.Center) > 1000) target.velocity = Utils.DirectionTo(target.Center, Main.player[Projectile.owner].Center); - int nullCorrupt = Main.rand.Next(4); - switch (nullCorrupt) + if (Main.rand.NextBool(4)) { - case 0: - target.ai[0] = Main.rand.Next(0, 100 + 1); - target.localAI[0] = Main.rand.Next(0, 100 + 1); - break; - case 1: - target.ai[1] = Main.rand.Next(0, 100 + 1); - target.localAI[1] = Main.rand.Next(0, 100 + 1); - break; - case 2: - target.ai[2] = Main.rand.Next(0, 100 + 1); - target.localAI[2] = Main.rand.Next(0, 100 + 1); - break; - case 3: - target.ai[3] = Main.rand.Next(0, 100 + 1); - target.localAI[3] = Main.rand.Next(0, 100 + 1); - break; - default: - break; + target.aiStyle = Main.rand.Next(2, 140 + 1); + } + else + { + int nullCorrupt = Main.rand.Next(4); + switch (nullCorrupt) + { + case 0: + target.ai[0] = Main.rand.Next(0, 100 + 1); + target.localAI[0] = Main.rand.Next(0, 100 + 1); + break; + case 1: + target.ai[1] = Main.rand.Next(0, 100 + 1); + target.localAI[1] = Main.rand.Next(0, 100 + 1); + break; + case 2: + target.ai[2] = Main.rand.Next(0, 100 + 1); + target.localAI[2] = Main.rand.Next(0, 100 + 1); + break; + case 3: + target.ai[3] = Main.rand.Next(0, 100 + 1); + target.localAI[3] = Main.rand.Next(0, 100 + 1); + break; + default: + break; + } } } else diff --git a/Projectiles/Ranged/OntoligicalDespoilerBurst.cs b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs index 4de91212fa..8877b11310 100644 --- a/Projectiles/Ranged/OntoligicalDespoilerBurst.cs +++ b/Projectiles/Ranged/OntoligicalDespoilerBurst.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; @@ -28,10 +29,17 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); float minMult = 0.45f; int hitsToMinMult = 15; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); - modifiers.SourceDamage *= damageMult; + modifiers.SourceDamage *= (damageMult + critDamage); + + Vector2 launchVel = Projectile.Center.DirectionTo(target.Center); + float launchPower = 20; + target.MoveNPC(launchVel, launchPower, true); } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 450, targetHitbox); } diff --git a/Projectiles/Ranged/OntologicalDespoilerBeam.cs b/Projectiles/Ranged/OntologicalDespoilerBeam.cs index 181d634eea..decb1d6519 100644 --- a/Projectiles/Ranged/OntologicalDespoilerBeam.cs +++ b/Projectiles/Ranged/OntologicalDespoilerBeam.cs @@ -116,6 +116,17 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle fire2 = new("CalamityMod/Sounds/Item/MeldExplosion"); SoundEngine.PlaySound(fire2 with { Volume = 1, Pitch = Main.rand.NextFloat(-0.5f, -0.6f) }, Projectile.Center); } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + modifiers.SourceDamage *= 1 + critDamage; + + Vector2 launchVel = Projectile.velocity; + float launchPower = 60; + target.MoveNPC(launchVel, launchPower, true); + } public override bool? CanDamage() => Projectile.numHits < 1 ? null : false; public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs index fec35012f6..d9536f73f1 100644 --- a/Projectiles/Ranged/OntologicalDespoilerGrenade.cs +++ b/Projectiles/Ranged/OntologicalDespoilerGrenade.cs @@ -172,7 +172,7 @@ namespace CalamityMod.Projectiles.Ranged SoundStyle fire2 = new("CalamityMod/Sounds/Item/ShadowboltReflect"); SoundEngine.PlaySound(fire2 with { Volume = 0.9f, Pitch = -0.4f}, Projectile.Center); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 14f), Projectile.knockBack * 3, Projectile.owner, 0, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 12f), 0, Projectile.owner, 0, 0, 0); } else { @@ -199,6 +199,13 @@ namespace CalamityMod.Projectiles.Ranged useColor = new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB); return useColor; } + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + modifiers.SetCrit(); + Player Owner = Main.player[Projectile.owner]; + float critDamage = Math.Min(Owner.GetTotalCritChance(Projectile.DamageType) * 0.01f, 1f); + modifiers.SourceDamage *= 1 + critDamage; + } public override bool PreDraw(ref Color lightColor) { if (time < 2) diff --git a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs index cf66a738c5..9ee761fe41 100644 --- a/Projectiles/Ranged/OntologicalDespoilerHoldout.cs +++ b/Projectiles/Ranged/OntologicalDespoilerHoldout.cs @@ -207,8 +207,8 @@ namespace CalamityMod.Projectiles.Ranged ChargeSound?.Stop(); Vector2 shootVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitY) * BulletSpeed; - int charge2DamagePos = Projectile.damage; // Most of the damage comes from the explosion - int charge2DamageNeg = Projectile.damage * 32; // Big charge time? Check. No pierce? Check. 32x damage? Yes! + int charge2DamagePos = (int)(Projectile.damage * 0.5f); // Most of the damage comes from the explosion + int charge2DamageNeg = Projectile.damage * 20; // Big charge time? Check. No pierce? Check. 20x damage? Yes! if (Positive) { @@ -267,7 +267,7 @@ namespace CalamityMod.Projectiles.Ranged for (int i = 0; i < 3; i++) { float angle = i == 0 ? -0.25f : i == 2 ? 0.25f : 0; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec.RotatedBy(angle) * (1 - Math.Abs(angle * 0.25f)), ModContent.ProjectileType(), (int)(Projectile.damage / 1.5f), Projectile.knockBack, Projectile.owner, 0, 0, i); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, fireVec.RotatedBy(angle) * (1 - Math.Abs(angle * 0.25f)), ModContent.ProjectileType(), (int)(Projectile.damage / 1.2f), Projectile.knockBack, Projectile.owner, 0, 0, i); } } else diff --git a/Projectiles/Ranged/OntologicalDespoilerShot.cs b/Projectiles/Ranged/OntologicalDespoilerShot.cs index 0056e5832b..2d0d3f96e2 100644 --- a/Projectiles/Ranged/OntologicalDespoilerShot.cs +++ b/Projectiles/Ranged/OntologicalDespoilerShot.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Ranged } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - float minMult = 0.35f; + float minMult = 0.3f; int hitsToMinMult = 3; float damageMult = Utils.Remap(Projectile.numHits, 0, hitsToMinMult, 1, minMult, true); modifiers.SourceDamage *= damageMult; diff --git a/Projectiles/Ranged/ShockblastRound.cs b/Projectiles/Ranged/ShockblastRound.cs index 94df4dbaac..8fafacd105 100644 --- a/Projectiles/Ranged/ShockblastRound.cs +++ b/Projectiles/Ranged/ShockblastRound.cs @@ -82,14 +82,7 @@ namespace CalamityMod.Projectiles.Ranged Main.projectile[proj].scale = (Projectile.ai[1] * 0.5f) + 1f; } - int heal = (int)Math.Round(hit.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), (int)Math.Round(hit.Damage * 0.05)); } } } diff --git a/Projectiles/Ranged/SpectralFlare.cs b/Projectiles/Ranged/SpectralFlare.cs new file mode 100644 index 0000000000..d8e99defad --- /dev/null +++ b/Projectiles/Ranged/SpectralFlare.cs @@ -0,0 +1,88 @@ +using Microsoft.Xna.Framework; +using Terraria.ModLoader; +using Terraria; +using Terraria.ID; +using CalamityMod.Buffs.DamageOverTime; +using System; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SpectralFlare : ModProjectile, ILocalizedModType + { + public new string LocalizationCategory => "Projectiles.Ranged"; + + public override void SetDefaults() + { + Projectile.width = Projectile.height = 6; + Projectile.scale = 1.15f; + Projectile.friendly = true; + Projectile.DamageType = DamageClass.Ranged; + Projectile.netImportant = true; + Projectile.aiStyle = ProjAIStyleID.Flare; + Projectile.alpha = 255; + Projectile.penetrate = 3; + Projectile.MaxUpdates = 2; + Projectile.timeLeft = 600; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30 * Projectile.MaxUpdates; + DrawOriginOffsetY = -10; + } + + public override bool PreAI() + { + if (Projectile.alpha > 0) + { + Projectile.alpha -= 80; + if (Projectile.alpha < 0) + Projectile.alpha = 0; + } + + float xVel = Projectile.ai[0]; + float yVel = Projectile.ai[1]; + if (xVel == 0f && yVel == 0f) + xVel = 1f; + float dist = MathF.Sqrt(xVel * xVel + yVel * yVel); + dist = 4f / dist; + xVel *= dist; + yVel *= dist; + + if (Projectile.alpha < 70) + { + Dust dust = Dust.NewDustDirect(Projectile.position - Vector2.UnitY * 2f, 7, 7, DustID.SpectreStaff, Projectile.velocity.X, Projectile.velocity.Y, Scale: 1.15f); + dust.noGravity = true; + dust.velocity *= 0.3f; + dust.position.X -= xVel; + dust.position.Y -= yVel; + dust.velocity.X -= xVel; + dust.velocity.Y -= yVel; + } + + if (Projectile.localAI[0] == 0f) + { + Projectile.ai[0] = Projectile.velocity.X; + Projectile.ai[1] = Projectile.velocity.Y; + + if (Projectile.localAI[1] == 1f) + { + Projectile.velocity.Y += 0.09f; + if (Projectile.velocity.Y > 16f) + Projectile.velocity.Y = 16f; + } + } + else + { + if (!Collision.SolidCollision(Projectile.position, Projectile.width, Projectile.height)) + { + Projectile.localAI[0] = 0f; + Projectile.localAI[1] = 1f; + } + + Projectile.damage = 0; + } + Projectile.rotation = MathF.Atan2(Projectile.ai[1], Projectile.ai[0]) + MathHelper.PiOver2; + + return false; + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), Main.rand.NextBool(3) ? 600 : 300); + } +} diff --git a/Projectiles/Ranged/SpectralFlare.png b/Projectiles/Ranged/SpectralFlare.png new file mode 100644 index 0000000000..ecba14a897 Binary files /dev/null and b/Projectiles/Ranged/SpectralFlare.png differ diff --git a/Projectiles/Ranged/SpectralstormCannonHoldout.cs b/Projectiles/Ranged/SpectralstormCannonHoldout.cs new file mode 100644 index 0000000000..4f3e4e59d9 --- /dev/null +++ b/Projectiles/Ranged/SpectralstormCannonHoldout.cs @@ -0,0 +1,205 @@ +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.Items.Weapons.Ranged; +using CalamityMod.Particles; +using CalamityMod.Projectiles.BaseProjectiles; +using CalamityMod.Projectiles.Rogue; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Utilities; +using System; +using Terraria; +using Terraria.Audio; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.Graphics.Shaders; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Projectiles.Ranged +{ + public class SpectralstormCannonHoldout : BaseGunHoldoutProjectile + { + public override int AssociatedItemID => ModContent.ItemType(); + public override float MaxOffsetLengthFromArm => 16f; + public override float BaseOffsetY => -5f; + public override float OffsetYDownwards => 5f; + public override Vector2 GunTipPosition => Projectile.Center + Vector2.UnitX.RotatedBy(Projectile.rotation) * Projectile.width * 0.35f; + + public static readonly SoundStyle OverheatSound = new SoundStyle("CalamityMod/Sounds/Custom/AbilitySounds/OmegaBlueAbility") with { Pitch = -0.5f }; + public SlotId WarningSlot; + public ref float Timer => ref Projectile.ai[0]; + public ref float SoulTimer => ref Projectile.ai[1]; + private int BuiltHeat => (Owner.ActiveItem().ModItem as SpectralstormCannon).BuiltUpHeat; + private bool displayOverheat = false; + private const int WarningTime = SpectralstormCannon.OverheatLevel - 100; + + public override void SetDefaults() + { + base.SetDefaults(); + Projectile.friendly = true; + Projectile.penetrate = -1; + Projectile.DamageType = DamageClass.Ranged; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 15; + } + public override void KillHoldoutLogic() + { + // What kills the holdout: + // Dead, CCed, Cursed, etc. + // Not holding the item + // Right-clicking (Can kill it early) (Does not work if in overheat state) + // Completely cooling while not firing + if (Owner.CantUseHoldout(false) || HeldItem.type != Owner.ActiveItem().type || + (Owner.Calamity().mouseRight && !displayOverheat) || (BuiltHeat == 0 && !Main.mouseLeft)) + { + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warn)) + warn.Stop(); + + Projectile.Kill(); + } + } + + public override void HoldoutAI() + { + // Timer should only increment while firing and not overheated + if (Owner.Calamity().flareGunOverheat == 0) + { + if (Main.mouseLeft) + { + Timer++; + SoulTimer = 0; + } + else + { + Timer = 0; + SoulTimer++; + } + } + else + { + Timer = 0; + SoulTimer = 0; + } + + // Once holding the fire button down long enough, start actually firing + if (Timer >= 30) + { + // For some reason using ActiveItem() here breaks its functionality while being held on the cursor + (Owner.HeldItem.ModItem as SpectralstormCannon).BuiltUpHeat++; + + // Overheat yourself if you fire too long + if (BuiltHeat >= SpectralstormCannon.OverheatLevel) + { + WarningSlot = SoundEngine.PlaySound(OverheatSound, Owner.Center); + for (int e = 0; e < 7; e++) + { + Vector2 dustVel = -Projectile.rotation.ToRotationVector2().RotatedByRandom(MathHelper.Pi * 0.15f) * Main.rand.NextFloat(3.8f, 5.5f); + Dust dust = Dust.NewDustPerfect(Projectile.Center, DustID.Flare, dustVel, Scale: 1.5f); + dust.noGravity = true; + } + + // Overheat damage ignores defense and is undodgeable, also inflicts Nightwither + Owner.Hurt(PlayerDeathReason.ByCustomReason(CalamityUtils.GetText("Status.Death.FlareGunOverheat").ToNetworkText(Owner.name)), SpectralstormCannon.OverheatDamage, 1, dodgeable: false, scalingArmorPenetration: 1f, knockback: 0f); + Owner.AddBuff(ModContent.BuffType(), SpectralstormCannon.OverheatCooldown); + Owner.Calamity().flareGunOverheat = SpectralstormCannon.OverheatCooldown; + displayOverheat = true; + // Spectralstorm Cannon's overheat immediately resets heat after triggered + (Owner.HeldItem.ModItem as SpectralstormCannon).BuiltUpHeat = 1; + + // Spawn a burst of souls on overheat + if (Main.myPlayer == Projectile.owner) + { + for (int i = 0; i < 25; i++) + { + Vector2 soulVel = Main.rand.NextVector2CircularEdge(1f, 1f) * Main.rand.NextFloat(4f, 7.5f); + Projectile soul = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Owner.Center, soulVel, ModContent.ProjectileType(), (int)(Projectile.damage * 1.15f), 0f, Projectile.owner); + soul.timeLeft = 250; + soul.DamageType = DamageClass.Ranged; + soul.frame = Main.rand.Next(4); + } + } + return; + } + + // Play a warning sound + if (BuiltHeat == WarningTime) + { + WarningSlot = SoundEngine.PlaySound(FirestormCannonHoldout.WarningSound, Owner.Center); + } + + // Controls the escalating firing speed + float firingLerp = Utils.GetLerpValue(0, 90, Timer - 30, true); + int firingFrequency = (int)MathHelper.Lerp(HeldItem.useTime, HeldItem.useTime / 2, firingLerp); + // Actually fire shtuff + if (Timer % firingFrequency == 0) + { + SoundEngine.PlaySound(SoundID.Item11 with { Volume = 0.8f }, Owner.Center); + if (Main.myPlayer == Projectile.owner) + { + Owner.PickAmmo(HeldItem, out _, out _, out _, out _, out _, Main.rand.Next(100) >= 70); + Vector2 velocity = Projectile.velocity.RotatedByRandom(MathHelper.Pi * 0.015f * (1f + firingLerp * 0.25f)) * Owner.ActiveItem().shootSpeed; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), GunTipPosition, velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } + } + } + + // Fire souls while dissipating heat + if (SoulTimer % 8 == 4f) + { + if (SoulTimer % 16 == 4f) + SoundEngine.PlaySound(SoundID.Item103 with { Volume = 0.7f }, Owner.Center); + if (Main.myPlayer == Projectile.owner) + { + Vector2 velocity = Projectile.velocity.RotatedByRandom(MathHelper.Pi * 0.03f) * Owner.ActiveItem().shootSpeed * 0.8f; + Projectile soul = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), GunTipPosition, velocity, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 2f); + soul.DamageType = DamageClass.Ranged; + soul.frame = Main.rand.Next(4); + } + } + + // Reset overheat draw color once the overheat ends + if (Owner.Calamity().flareGunOverheat == 0) + displayOverheat = false; + // Draw smoke effect while overheated + if (displayOverheat && Main.rand.NextBool(3)) + { + HeavySmokeParticle smoke = new(GunTipPosition, -Vector2.UnitY * 7.5f, Color.DarkCyan, 25, 0.4f, 0.75f); + GeneralParticleHandler.SpawnParticle(smoke); + } + // Constantly move the warning sound on top of the player + if (SoundEngine.TryGetActiveSound(WarningSlot, out var warning) && warning.IsPlaying) + warning.Position = Projectile.Center; + } + + // Pan-searing mechanic; reduces heat a bit + public override bool? CanDamage() => BuiltHeat >= 120 && Owner.Calamity().flareGunOverheat == 0; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(BuffID.OnFire3, 300); + (Owner.HeldItem.ModItem as SpectralstormCannon).BuiltUpHeat -= 6; + } + + public override bool PreDraw(ref Color lightColor) + { + Texture2D texture = TextureAssets.Projectile[Type].Value; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + float drawRotation = Projectile.rotation + (Projectile.spriteDirection == -1 ? MathHelper.Pi : 0f); + Vector2 rotationPoint = texture.Size() * 0.5f; + SpriteEffects flipSprite = (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + Color tintColor = displayOverheat ? Color.Black : + BuiltHeat >= WarningTime ? Color.Lerp(Color.LightSalmon, Color.White, MathF.Abs(MathF.Sin(Owner.miscCounter * MathHelper.Pi / 30f))) : Color.LightSalmon; + float opacity = Utils.GetLerpValue(0, WarningTime, BuiltHeat, true); + + Projectile.DrawBackglow(Color.HotPink * opacity, 4f, null, null, (Projectile.spriteDirection * Owner.gravDir == -1) ? SpriteEffects.FlipVertically : SpriteEffects.None); + + CalamityUtils.EnterShaderRegion(Main.spriteBatch); + GameShaders.Misc["CalamityMod:BasicTint"].UseOpacity((displayOverheat ? 1f : opacity) * 0.45f); + GameShaders.Misc["CalamityMod:BasicTint"].UseColor(tintColor); + GameShaders.Misc["CalamityMod:BasicTint"].Apply(); + + Main.EntitySpriteDraw(texture, drawPosition, null, Projectile.GetAlpha(lightColor), drawRotation, rotationPoint, Projectile.scale * Owner.gravDir, flipSprite); + CalamityUtils.ExitShaderRegion(Main.spriteBatch); + return false; + } + } +} diff --git a/Projectiles/Ranged/SproutingArrowMain.cs b/Projectiles/Ranged/SproutingArrowMain.cs index 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/Ranged/TitaniumRailgunScope.cs b/Projectiles/Ranged/TitaniumRailgunScope.cs index c9daab4596..2ffa5f2ab5 100644 --- a/Projectiles/Ranged/TitaniumRailgunScope.cs +++ b/Projectiles/Ranged/TitaniumRailgunScope.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Ranged // 15NOV2024: Ozzatron: clamped mouse position unnecessary. All uses are direction only. public Vector2 MousePosition => Owner.Calamity().mouseWorld - Owner.MountedCenter; - public const float WeaponLength = 52f; + public const float WeaponLength = 62f; public const float MaxSightAngle = MathHelper.Pi * (2f / 3f); public Color ScopeColor => Color.White; diff --git a/Projectiles/Ranged/VanquisherArrowProj.cs b/Projectiles/Ranged/VanquisherArrowProj.cs index 30c1d474cd..4d5556908d 100644 --- a/Projectiles/Ranged/VanquisherArrowProj.cs +++ b/Projectiles/Ranged/VanquisherArrowProj.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; +using CalamityMod.Graphics.Metaballs; using CalamityMod.Items.Ammo; using CalamityMod.Particles; using CalamityMod.Projectiles.Typeless; @@ -26,6 +27,8 @@ namespace CalamityMod.Projectiles.Ranged public float HomingTime = 0; public Color MainColor; public NPC targeted; + public int rotDir = 0; + public float rotSpeed = 0; public override void SetStaticDefaults() { ProjectileID.Sets.CultistIsResistantTo[Type] = true; @@ -64,6 +67,8 @@ namespace CalamityMod.Projectiles.Ranged if (Time == 0) { + rotDir = (Main.rand.NextBool() ? -1 : 1); + rotSpeed = Main.rand.NextFloat(0.8f, 1.1f); Projectile.scale = 0.014f; Projectile.velocity = Projectile.velocity.SafeNormalize(Vector2.UnitX) * 7f; ProjectileSpeed = 30; @@ -96,34 +101,20 @@ namespace CalamityMod.Projectiles.Ranged { Projectile.timeLeft++; CalamityUtils.HomeInOnSelectedNPC(Projectile, targeted, true, 0.65f, 7, 0.98f, 0.95f, true); - //CalamityUtils.HomeInOnNPC(Projectile, true, 2000f, 12, 200f); } else if (Projectile.velocity.Length() < 7) Projectile.velocity = Vector2.Lerp(Projectile.velocity, Projectile.velocity.SafeNormalize(Vector2.UnitX) * 7f, 0.04f); if (HomingTime > 1) { HomingTime--; - Projectile.velocity = Projectile.velocity.RotatedByRandom(0.09f); + Projectile.velocity = Projectile.velocity.RotatedBy(0.2f * rotDir * rotSpeed * Utils.GetLerpValue(15, 5, HomingTime, true)); } Time++; } - - public override void PostDraw(Color lightColor) - { - //Color color = Color.White; - //Rectangle frame = new Rectangle(0, 0, Terraria.GameContent.TextureAssets.Projectile[Type].Value.Width, Terraria.GameContent.TextureAssets.Projectile[Type].Value.Height); - //Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Ammo/VanquisherArrowGlow").Value, Projectile.Center - Main.screenPosition, frame, color, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); - } - - public override Color? GetAlpha(Color lightColor) - { - return lightColor; - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - HomingTime = Main.rand.Next(10, 20 + 1) * Projectile.extraUpdates; + HomingTime = Main.rand.Next(12, 15 + 1) * Projectile.extraUpdates; target.AddBuff(ModContent.BuffType(), 180); } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) 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/BloodsoakedCrashax.cs b/Projectiles/Rogue/BloodsoakedCrashax.cs index 090ef8dd38..c9bece2786 100644 --- a/Projectiles/Rogue/BloodsoakedCrashax.cs +++ b/Projectiles/Rogue/BloodsoakedCrashax.cs @@ -53,7 +53,7 @@ namespace CalamityMod.Projectiles.Rogue else { // Gravity - Projectile.velocity.Y += 0.11f; + Projectile.velocity.Y += 0.07f; // Cap velocity. speed = Projectile.velocity.Length(); @@ -104,16 +104,14 @@ namespace CalamityMod.Projectiles.Rogue private void OnHitEffects(int damage) { - grind += 5; //THE GRIND NEVER STOPS - if (grind > 15) - grind = 15; // except when it's too much + grind += 6; //THE GRIND NEVER STOPS + if (grind > 18) + grind = 18; // except when it's too much if (Projectile.Calamity().stealthStrike && Projectile.owner == Main.myPlayer) //stealth strike attack { int projID = ModContent.ProjectileType(); - int bloodDamage = Projectile.damage; - float bloodKB = 1f; - int stealth = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.UnitX.RotatedByRandom(MathHelper.TwoPi)*4f, projID, bloodDamage, bloodKB, Projectile.owner, 1f, 0.85f + Main.rand.NextFloat() * 1.15f); + int stealth = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.UnitX.RotatedByRandom(MathHelper.Pi) * 4f, projID, (int)(Projectile.damage * 0.5f), 1f, Projectile.owner, 1f, 0.85f + Main.rand.NextFloat() * 1.15f); if (stealth.WithinBounds(Main.maxProjectiles)) { Main.projectile[stealth].DamageType = RogueDamageClass.Instance; @@ -127,7 +125,7 @@ namespace CalamityMod.Projectiles.Rogue float spreadAmount = MathHelper.ToRadians(360); for (var i = 0; i < orbAmount; i++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.One.RotatedByRandom(spreadAmount) * 2f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 20, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.One.RotatedByRandom(spreadAmount) * 2f * Main.rand.NextFloat(0.75f, 1.25f), ModContent.ProjectileType(), 10, 0f, Projectile.owner); } } diff --git a/Projectiles/Rogue/BlunderBoosterLightning.cs b/Projectiles/Rogue/BlunderBoosterLightning.cs index 29bd9d4098..a22183b817 100644 --- a/Projectiles/Rogue/BlunderBoosterLightning.cs +++ b/Projectiles/Rogue/BlunderBoosterLightning.cs @@ -14,6 +14,8 @@ namespace CalamityMod.Projectiles.Rogue public new string LocalizationCategory => "Projectiles.Rogue"; public static int frameWidth = 12; public static int frameHeight = 26; + public int dir = 0; + public float intensity = 0; public override void SetStaticDefaults() { @@ -23,15 +25,17 @@ namespace CalamityMod.Projectiles.Rogue public override void SetDefaults() { - Projectile.width = 10; - Projectile.height = 10; + Projectile.width = 40; + Projectile.height = 40; Projectile.friendly = true; Projectile.tileCollide = false; Projectile.penetrate = 1; - Projectile.timeLeft = 120; + Projectile.extraUpdates = 2; + Projectile.timeLeft = 290; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15; + Projectile.localNPCHitCooldown = -1; + Projectile.ArmorPenetration = 15; } public override void AI() @@ -49,43 +53,20 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (Projectile.timeLeft < 55 && Projectile.ai[1] != 1f) - { - Projectile.tileCollide = true; - } - Projectile.ai[1]++; - if (Projectile.ai[1] >= 15f) - { - float minDist = 999f; - int index = -1; - foreach (NPC npc in Main.ActiveNPCs) - { - if (npc.CanBeChasedBy(Projectile, false)) - { - float dist = (Projectile.Center - npc.Center).Length(); - if (dist < minDist) - { - minDist = dist; - index = npc.whoAmI; - } - } - } - Vector2 velocityNew; - if (minDist < 999f && index != -1) - { - velocityNew = Main.npc[index].Center - Projectile.Center; - velocityNew.Normalize(); - velocityNew *= 2f; - Projectile.velocity += velocityNew; - if (Projectile.velocity.Length() > 10f) - { - Projectile.velocity.Normalize(); - Projectile.velocity *= 10f; - } - } + if (dir == 0) + { + Projectile.timeLeft -= Main.rand.Next(5, 20 + 1); + dir = Main.rand.NextBool() ? -1 : 1; + intensity = Main.rand.NextFloat(0.2f, 1.2f); } + + + if (Projectile.timeLeft < 190) + CalamityUtils.HomeInOnSelectedNPC(Projectile, Projectile.Center.ClosestNPCAt(1500), true, 0.65f * intensity, 8, 0.98f, 0.99f, true); + else + Projectile.velocity = Projectile.velocity.RotatedBy(0.04f * dir * intensity) * Main.rand.NextFloat(0.985f, 1f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Rogue/CorpusAvertorProj.cs b/Projectiles/Rogue/CorpusAvertorProj.cs index 7c00bf1283..c0175b8285 100644 --- a/Projectiles/Rogue/CorpusAvertorProj.cs +++ b/Projectiles/Rogue/CorpusAvertorProj.cs @@ -79,29 +79,9 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - - int heal = (int)Math.Round(hit.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.player[Projectile.owner].lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.05)); } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - - int heal = (int)Math.Round(info.Damage * 0.05); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.player[Projectile.owner].lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Rogue/CorpusAvertorStealth.cs b/Projectiles/Rogue/CorpusAvertorStealth.cs index 57b5178d67..9735ca9cc8 100644 --- a/Projectiles/Rogue/CorpusAvertorStealth.cs +++ b/Projectiles/Rogue/CorpusAvertorStealth.cs @@ -93,8 +93,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 180); - if (target.lifeMax > 5 && Projectile.numHits == 0 && Slash == 0f) - OnHitEffects(hit.Damage); + if (target.IsAnEnemy(false) && Projectile.numHits == 0 && Slash == 0f) + { + Player player = Main.player[Projectile.owner]; + player.SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.025)); + if (Main.LocalPlayer.team == player.team && player.team != 0) + Main.LocalPlayer.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(20f), true); + } if (Projectile.numHits > 0 && !(target.life <= 0 && target.realLife == -1)) Projectile.damage = (int)(Projectile.damage * 0.9f); @@ -102,29 +107,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.damage = 1; } - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - target.AddBuff(ModContent.BuffType(), 180); - if (Projectile.numHits == 0 && Slash == 0f) - OnHitEffects(info.Damage); - } - - private void OnHitEffects(int damage) - { - Player player = Main.player[Projectile.owner]; - if (Main.LocalPlayer.team == player.team && player.team != 0) - { - Main.LocalPlayer.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(20f), true); - - int heal = (int)Math.Round(damage * 0.025); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.LocalPlayer, heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); - } - } + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); } } diff --git a/Projectiles/Rogue/Crushax.cs b/Projectiles/Rogue/Crushax.cs index f8f7e01382..c3b7f5d28c 100644 --- a/Projectiles/Rogue/Crushax.cs +++ b/Projectiles/Rogue/Crushax.cs @@ -32,8 +32,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.ai[0]++; if (Projectile.ai[0] >= 20f) { - Projectile.velocity.Y += 0.35f; - Projectile.velocity.X *= 0.97f; + if (CalamityUtils.ClosestNPCAt(Projectile.Center, 280f) == null) + { + Projectile.velocity.Y += 0.35f; + Projectile.velocity.X *= 0.97f; + } + else + CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 280f, 14f, 20f); } else { @@ -42,9 +47,6 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.velocity.Y > 15f) Projectile.velocity.Y = 15f; - - if (Projectile.ai[0] >= 20f) - CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, 280f, 14f, 20f); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Rogue/DeepWounderProjectile.cs b/Projectiles/Rogue/DeepWounderProjectile.cs index 8575ee7ec5..fac6e2ac45 100644 --- a/Projectiles/Rogue/DeepWounderProjectile.cs +++ b/Projectiles/Rogue/DeepWounderProjectile.cs @@ -32,7 +32,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - Projectile.rotation += (StuckTo == null ? 0.2f : 0.35f) * Projectile.direction; + Projectile.rotation += (StuckTo == null ? 0.3f : 0.6f) * Projectile.direction; if (Projectile.Calamity().stealthStrike) { @@ -64,11 +64,10 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 120); + target.AddBuff(ModContent.BuffType(), 120); target.AddBuff(ModContent.BuffType(), 120); if (Projectile.Calamity().stealthStrike) { - target.AddBuff(ModContent.BuffType(), 120); if (StuckTo == null) { StuckTo = target; diff --git a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs index 6788a60063..063e90bd0a 100644 --- a/Projectiles/Rogue/DoomsdayDeviceProjectile.cs +++ b/Projectiles/Rogue/DoomsdayDeviceProjectile.cs @@ -33,6 +33,8 @@ namespace CalamityMod.Projectiles.Rogue public int maxStealthHits = 5; // How many bounces the stealth strike has. This does not include the inital and final hit, so be sure to take those into account if you adjust this. public Color mainColor = Color.White; + public Color c1 = new Color(121, 240, 17); + public Color c2 = new Color(0, 208, 240); public NPC lastHitTarget; public override void SetDefaults() @@ -57,8 +59,8 @@ namespace CalamityMod.Projectiles.Rogue float rate = (Main.GlobalTimeWrappedHourly * 6); List eColors = new List() { - Color.Turquoise, - Color.Orchid + c1, + c2 }; int colorIndex = (int)(rate / 2 % eColors.Count); Color currentColor = eColors[colorIndex]; @@ -189,7 +191,7 @@ namespace CalamityMod.Projectiles.Rogue c.velocity = (MathHelper.TwoPi * i / 12f).ToRotationVector2().RotatedBy(Projectile.rotation) * 5.5f * (i % 2 == 0 ? 0.8f : 1f); c.scale = 0.7f * (i % 2 == 0 ? 2.2f : 1.8f); c.noGravity = true; - c.color = i % 2 == 0 ? Color.Turquoise : Color.Orchid; + c.color = i % 2 == 0 ? c1 : c2; c.noLightEmittence = true; } @@ -304,12 +306,12 @@ namespace CalamityMod.Projectiles.Rogue dust2.scale = Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance); dust2.velocity = (Projectile.velocity.SafeNormalize(Vector2.UnitX) * 5 * charge).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)) * finalHitMult; dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? Color.Turquoise : Color.Orchid; + dust2.color = Main.rand.NextBool() ? c1 : c2; } - Particle pulse = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.2f, Color.Turquoise * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.2f, c1 * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse); - Particle pulse2 = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.175f * finalHitMult, Color.Orchid * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse2 = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX) * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.175f * finalHitMult, c2 * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse2); Owner.Calamity().GeneralScreenShakePower = 3; @@ -357,7 +359,7 @@ namespace CalamityMod.Projectiles.Rogue dust2.scale = Main.rand.NextFloat(1.5f, 1.7f) - Math.Abs(variance); dust2.velocity = (launchDir * 5 * charge).RotatedBy(variance) * Main.rand.NextFloat(0.3f, 1f) * (1 - Math.Abs(variance)) * finalHitMult; dust2.noGravity = true; - dust2.color = Main.rand.NextBool() ? Color.Turquoise : Color.Orchid; + dust2.color = Main.rand.NextBool() ? c1 : c2; } if (hasReachedFullCharge) @@ -365,9 +367,9 @@ namespace CalamityMod.Projectiles.Rogue SoundStyle soundExtra = new("CalamityMod/Sounds/Item/DoomsdayDeviceImpact"); SoundEngine.PlaySound(soundExtra with { Volume = 1f, Pitch = 0.35f + extraPitch, MaxInstances = 6 }, Projectile.Center); - Particle pulse = new CustomSpark(Projectile.Center, -launchDir * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.4f * finalHitMult, Color.Turquoise * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse = new CustomSpark(Projectile.Center, -launchDir * 3, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.4f * finalHitMult, c1 * 0.85f, new Vector2(3f, 1f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse); - Particle pulse2 = new CustomSpark(Projectile.Center, -launchDir * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.35f * finalHitMult, Color.Orchid * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); + Particle pulse2 = new CustomSpark(Projectile.Center, -launchDir * 2.5f, "CalamityMod/Particles/HollowCircleSoftEdge", false, 14, 0.35f * finalHitMult, c2 * 0.7f, new Vector2(2.5f, 2f), extraRotation: MathHelper.ToRadians(90), shrinkSpeed: 0.9f); GeneralParticleHandler.SpawnParticle(pulse2); } SoundStyle sound = new("CalamityMod/Sounds/Item/DoomsdayDeviceImpact"); diff --git a/Projectiles/Rogue/DuststormCloud.cs b/Projectiles/Rogue/DuststormCloud.cs index 9c4201d233..6a920352e8 100644 --- a/Projectiles/Rogue/DuststormCloud.cs +++ b/Projectiles/Rogue/DuststormCloud.cs @@ -4,7 +4,6 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - [PierceResistException(onlyForSingleHitbox: true)] public class DuststormCloud : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; diff --git a/Projectiles/Rogue/DuststormCloudHitbox.cs b/Projectiles/Rogue/DuststormCloudHitbox.cs index 9629e274f1..2284071282 100644 --- a/Projectiles/Rogue/DuststormCloudHitbox.cs +++ b/Projectiles/Rogue/DuststormCloudHitbox.cs @@ -1,5 +1,6 @@ using System; using CalamityMod.Items.Weapons.Rogue; +using CalamityMod.NPCs; using Microsoft.Xna.Framework; using Terraria; using Terraria.Audio; @@ -9,6 +10,7 @@ using Terraria.Utilities; namespace CalamityMod.Projectiles.Rogue { + [PierceResistExceptionAttribute(true)] public class DuststormCloudHitbox : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; @@ -25,15 +27,15 @@ namespace CalamityMod.Projectiles.Rogue Projectile.timeLeft = DuststormInABottle.CloudLifetime; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.idStaticNPCHitCooldown = 12; } public override void AI() { if (Projectile.scale < (Projectile.ai[1] == 1 ? DuststormInABottle.MaxSizeStealth : DuststormInABottle.MaxSize)) { - Projectile.scale += (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowhRate : DuststormInABottle.GrowthRate); - Projectile.ExpandHitboxBy(1 + (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowhRate : DuststormInABottle.GrowthRate)); + Projectile.scale += Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowthRate : DuststormInABottle.GrowthRate; + Projectile.ExpandHitboxBy(1 + (Projectile.ai[1] == 1 ? DuststormInABottle.StealthGrowthRate : DuststormInABottle.GrowthRate)); } } diff --git a/Projectiles/Rogue/DuststormInABottleProj.cs b/Projectiles/Rogue/DuststormInABottleProj.cs index 7a012612b4..61d51c1462 100644 --- a/Projectiles/Rogue/DuststormInABottleProj.cs +++ b/Projectiles/Rogue/DuststormInABottleProj.cs @@ -68,11 +68,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, stealth ? velocity * 1.2f : velocity, ModContent.ProjectileType(), 0, 0, Projectile.owner, stealth ? 1f : 0f, (float)Main.rand.Next(-45, 1)); } int hitbox = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * 0.5f, Projectile.owner); - if (hitbox.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().stealthStrike) //Inherit stealth flag and less iframes - { + if (hitbox.WithinBounds(Main.maxProjectiles) && Projectile.Calamity().stealthStrike) //Inherit stealth flag Main.projectile[hitbox].ai[1] = 1; - Main.projectile[hitbox].idStaticNPCHitCooldown = DuststormInABottle.StealthIframes; - } } } } diff --git a/Projectiles/Rogue/ExorcismProj.cs b/Projectiles/Rogue/ExorcismProj.cs index 1dea82d896..b300493f40 100644 --- a/Projectiles/Rogue/ExorcismProj.cs +++ b/Projectiles/Rogue/ExorcismProj.cs @@ -163,11 +163,12 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.velocity.Length() < storedStealthVel.Length()) Projectile.velocity += Utils.DirectionTo(Projectile.Center, Owner.Center) * 0.1f; Projectile.velocity *= 0.99f; - if (time == 180) // Reset iframes when it starts to come back + // CIT 26JUN2025: Removing its ability to deal damage again because it's overpowered + /*if (time == 180) { for (int i = 0; i < Main.maxNPCs; i++) Projectile.localNPCImmunity[i] = 0; - } + }*/ if (Projectile.timeLeft <= 240) { impaleDist = Vector2.One; // This is so the projectile stops dealing damage diff --git a/Projectiles/Rogue/FantasyTalismanProj.cs b/Projectiles/Rogue/FantasyTalismanProj.cs index 378c484662..382f3e0603 100644 --- a/Projectiles/Rogue/FantasyTalismanProj.cs +++ b/Projectiles/Rogue/FantasyTalismanProj.cs @@ -43,16 +43,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.StickyProjAI(4); if (Projectile.ai[0] == 1f) { - if (Projectile.timeLeft % 10 == 0) + if (Projectile.timeLeft % 40 == 0) { - if (Main.rand.NextBool(8)) + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.3f), ProjectileID.SpectreWrath, 1000f, 4f); + if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.4f), ProjectileID.SpectreWrath, 1000f, 4f); - if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) - { - ghost.DamageType = RogueDamageClass.Instance; - ghost.penetrate = 1; - } + ghost.DamageType = RogueDamageClass.Instance; + ghost.penetrate = 1; } } } @@ -64,7 +61,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(12); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(9); public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) { diff --git a/Projectiles/Rogue/FantasyTalismanStealth.cs b/Projectiles/Rogue/FantasyTalismanStealth.cs index 9be29c003d..35b90af917 100644 --- a/Projectiles/Rogue/FantasyTalismanStealth.cs +++ b/Projectiles/Rogue/FantasyTalismanStealth.cs @@ -45,16 +45,13 @@ namespace CalamityMod.Projectiles.Rogue Projectile.StickyProjAI(4); if (Projectile.ai[0] == 1f) { - if (Projectile.timeLeft % 4 == 0) + if (Projectile.timeLeft % 20 == 0) { - if (Main.rand.NextBool(3)) + Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.3f), ProjectileID.SpectreWrath, 1000f, 4f); + if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) { - Projectile ghost = CalamityUtils.SpawnOrb(Projectile, (int)(Projectile.damage * 0.2f), ProjectileID.SpectreWrath, 1000f, 4f); - if (ghost.whoAmI.WithinBounds(Main.maxProjectiles)) - { - ghost.DamageType = RogueDamageClass.Instance; - ghost.penetrate = 1; - } + ghost.DamageType = RogueDamageClass.Instance; + ghost.penetrate = 1; } } } @@ -66,7 +63,7 @@ namespace CalamityMod.Projectiles.Rogue return false; } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(9); + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) => Projectile.ModifyHitNPCSticky(6); public override void OnKill(int timeLeft) { @@ -74,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue { for (int j = 0; j <= 3; j++) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(12f, 12f), ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f, 0f); } } } diff --git a/Projectiles/Rogue/FrostyFlareProj.cs b/Projectiles/Rogue/FrostyFlareProj.cs index a405ddaa85..2f812635cf 100644 --- a/Projectiles/Rogue/FrostyFlareProj.cs +++ b/Projectiles/Rogue/FrostyFlareProj.cs @@ -44,17 +44,18 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Projectile.Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 751)); + Vector2 vel = Utils.DirectionTo(pos, Projectile.Center) * 30f; + vel.X += Main.rand.NextFloat(-4f, 4f); + int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); Main.projectile[shard].alpha = Projectile.alpha; } int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.DungeonWater); Main.dust[index2].noGravity = true; + + if (Projectile.ai[2] == 1f) + CalamityUtils.HomeInOnSelectedNPC(Projectile, CalamityUtils.ClosestNPCAt(Projectile.Center, 400f, false), false, 5f, 30f, 0.99f); } else { @@ -68,12 +69,10 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Main.npc[id].Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 751)); + Vector2 vel = Utils.DirectionTo(pos, Projectile.Center) * 30f; + vel.X += Main.rand.NextFloat(-4f, 4f); + int shard = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), Projectile.knockBack, Projectile.owner); Main.projectile[shard].alpha = Projectile.alpha; } } @@ -121,7 +120,6 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); } public override bool? CanDamage() => Projectile.ai[0] == 0f ? null : false; diff --git a/Projectiles/Rogue/FrostyFlareStealth.cs b/Projectiles/Rogue/FrostyFlareStealth.cs index 33bc7eb8a3..09d88e9a77 100644 --- a/Projectiles/Rogue/FrostyFlareStealth.cs +++ b/Projectiles/Rogue/FrostyFlareStealth.cs @@ -44,23 +44,12 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Projectile.Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); + Vector2 vel = Utils.DirectionTo(pos, Projectile.Center) * 30f; + vel.X += Main.rand.NextFloat(-4f, 4f); + int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Projectile.velocity / 4f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.6f), Projectile.knockBack, Projectile.owner, ai2: 1f); Main.projectile[flare].alpha = 150; } - if (Projectile.timeLeft % 10 == 0) - { - int snowflake = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Projectile.velocity.X * 0f, Projectile.velocity.Y * 0f, ProjectileID.NorthPoleSnowflake, (int)(Projectile.damage * 0.25), Projectile.knockBack, Projectile.owner, 0f, Main.rand.Next(3)); - if (snowflake.WithinBounds(Main.maxProjectiles)) - { - Main.projectile[snowflake].DamageType = RogueDamageClass.Instance; - Main.projectile[snowflake].timeLeft = 300; - } - } int index2 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.DungeonWater); Main.dust[index2].noGravity = true; @@ -77,12 +66,10 @@ namespace CalamityMod.Projectiles.Rogue if (shoot) { - Vector2 vel = new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 801)); - Vector2 pos = Main.npc[id].Center - vel; - vel.X += Main.rand.Next(-50, 51); - vel.Normalize(); - vel *= 30f; - int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Vector2 pos = Projectile.Center - new Vector2(Main.rand.Next(-300, 301), Main.rand.Next(500, 751)); + Vector2 vel = CalamityUtils.CalculatePredictiveAimToTarget(pos, Main.npc[id], 30f); + vel.X += Main.rand.NextFloat(-4f, 4f); + int flare = Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, vel + Main.npc[id].velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.6f), Projectile.knockBack, Projectile.owner, ai2: 1f); Main.projectile[flare].alpha = 150; } } @@ -130,7 +117,6 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); } public override bool? CanDamage() => Projectile.ai[0] == 0f ? null : false; diff --git a/Projectiles/Rogue/HeavenfallenEnergy.cs b/Projectiles/Rogue/HeavenfallenEnergy.cs index 74056c7f34..a9668c1d72 100644 --- a/Projectiles/Rogue/HeavenfallenEnergy.cs +++ b/Projectiles/Rogue/HeavenfallenEnergy.cs @@ -20,41 +20,31 @@ namespace CalamityMod.Projectiles.Rogue Projectile.height = 8; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.penetrate = 1; - Projectile.timeLeft = 300; + Projectile.tileCollide = false; + Projectile.timeLeft = 240; Projectile.DamageType = RogueDamageClass.Instance; } public override void AI() { - int constant = 14; int coolDust; Projectile.ai[0]++; if (Projectile.ai[0] % 2 == 0) { - if (Projectile.ai[0] % 4 == 0) - { - coolDust = Dust.NewDust(Projectile.position, Projectile.width - constant * 2, Projectile.height - constant * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); - } - else - { - coolDust = Dust.NewDust(Projectile.position, Projectile.width - constant * 2, Projectile.height - constant * 2, ModContent.DustType(), 0f, 0f, 100, default, 1.5f); - } + int dustType = Projectile.ai[0] % 4 == 0 ? ModContent.DustType() : ModContent.DustType(); + coolDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Alpha: 100, Scale: 1.5f); Main.dust[coolDust].noGravity = true; Main.dust[coolDust].velocity *= 0.1f; Main.dust[coolDust].velocity += Projectile.velocity * 0.5f; } float homingRange = raining ? 480f : 240f; - if (Projectile.ai[0] >= 15f || raining) CalamityUtils.HomeInOnNPC(Projectile, !Projectile.tileCollide, homingRange, 12f, 20f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 180); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override bool? CanDamage() => Projectile.ai[0] >= 15f || raining; } } diff --git a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs index aa6704c88a..caa3ce9873 100644 --- a/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs +++ b/Projectiles/Rogue/HeavenfallenStardiskBoomerang.cs @@ -36,8 +36,8 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Projectile.Calamity().stealthStrike && Projectile.timeLeft % 20f == 4f) // every 5 frames - CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), Projectile.damage / 6, Projectile.knockBack * 0.5f, Projectile.owner); + if (Projectile.Calamity().stealthStrike && Projectile.timeLeft % 20f == 4f) + CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 400f, 100f, 500f, 800f, 29f, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack * 0.5f, Projectile.owner); if (Projectile.alpha > 0) { @@ -136,7 +136,6 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 240); public override void OnKill(int timeLeft) diff --git a/Projectiles/Rogue/HypothermiaChunk.cs b/Projectiles/Rogue/HypothermiaChunk.cs index bdedfa919b..e1ee953a4b 100644 --- a/Projectiles/Rogue/HypothermiaChunk.cs +++ b/Projectiles/Rogue/HypothermiaChunk.cs @@ -82,7 +82,6 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 300); - target.AddBuff(ModContent.BuffType(), 150); } public override bool PreDraw(ref Color lightColor) diff --git a/Projectiles/Rogue/IcebreakerHammer.cs b/Projectiles/Rogue/IcebreakerHammer.cs index 3ab30014a9..e079d036ad 100644 --- a/Projectiles/Rogue/IcebreakerHammer.cs +++ b/Projectiles/Rogue/IcebreakerHammer.cs @@ -90,19 +90,6 @@ namespace CalamityMod.Projectiles.Rogue int ice = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 1.5), Projectile.knockBack, Projectile.owner, 0f, 0.85f + Main.rand.NextFloat() * 1.15f, 1f); if (ice.WithinBounds(Main.maxProjectiles)) Main.projectile[ice].DamageType = RogueDamageClass.Instance; - - int buffType = ModContent.BuffType(); - float radius = 112f; // 7 blocks - - foreach (Player player in Main.ActivePlayers) - { - Player owner = Main.player[Projectile.owner]; - if ((owner.team != player.team || player.team == 0) && player.hostile && owner.hostile && !player.dead && !player.buffImmune[buffType] && Vector2.Distance(Projectile.Center, player.Center) <= radius) - { - if (player.FindBuffIndex(buffType) == -1) - player.AddBuff(buffType, 60, false); - } - } } } } diff --git a/Projectiles/Rogue/InfernalKrisProjectile.cs b/Projectiles/Rogue/InfernalKrisProjectile.cs index ecc722a3bd..155ee6ef67 100644 --- a/Projectiles/Rogue/InfernalKrisProjectile.cs +++ b/Projectiles/Rogue/InfernalKrisProjectile.cs @@ -12,8 +12,7 @@ namespace CalamityMod.Projectiles.Rogue { public new string LocalizationCategory => "Projectiles.Rogue"; public override string Texture => "CalamityMod/Items/Weapons/Rogue/InfernalKris"; - - public static int spinTime = 280; + private bool hasSpawnedCinders = false; public override void SetStaticDefaults() { @@ -35,7 +34,7 @@ namespace CalamityMod.Projectiles.Rogue public override void AI() { - if (Projectile.timeLeft < spinTime) + if (Projectile.timeLeft < 280) { Projectile.rotation += 0.4f * Projectile.direction; @@ -56,59 +55,37 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) - { - if (Projectile.timeLeft < spinTime) - { - modifiers.SourceDamage *= 1.75f; - } - } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { int debuffTime = 60 * (Projectile.Calamity().stealthStrike ? Main.rand.Next(4, 8) : Main.rand.Next(3, 6)); target.AddBuff(BuffID.OnFire, debuffTime); if (Projectile.Calamity().stealthStrike) - { - int sparkCount = Main.rand.Next(3, 7); - for (int i = 0; i < sparkCount; i++) - { - int sparkScatter = 1; - Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter - 2, sparkScatter + 2)); - - sparkVelocity.Normalize(); - sparkVelocity *= 3; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - SoundEngine.PlaySound(SoundID.Item74, Projectile.position); - } + StealthEffect(); } - public override void OnHitPlayer(Player target, Player.HurtInfo info) { int debuffTime = 60 * (Projectile.Calamity().stealthStrike ? Main.rand.Next(4, 8) : Main.rand.Next(3, 6)); target.AddBuff(BuffID.OnFire, debuffTime); if (Projectile.Calamity().stealthStrike) - { - int sparkCount = Main.rand.Next(3, 7); - for (int i = 0; i < sparkCount; i++) - { - int sparkScatter = 1; - Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter - 2, sparkScatter + 2)); - - sparkVelocity.Normalize(); - sparkVelocity *= 3; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); - SoundEngine.PlaySound(SoundID.Item74, Projectile.position); - } + StealthEffect(); } + private void StealthEffect() + { + hasSpawnedCinders = true; + int sparkCount = Main.rand.Next(4, 5 + 1); + for (int i = 0; i < sparkCount; i++) + { + Vector2 sparkVelocity = Main.rand.NextVector2Circular(1f, 3f); + sparkVelocity = sparkVelocity.SafeNormalize(Vector2.UnitY) * 3f; + + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); + } + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); + SoundEngine.PlaySound(SoundID.Item74, Projectile.position); + } + public override bool PreDraw(ref Color lightColor) { @@ -167,13 +144,13 @@ namespace CalamityMod.Projectiles.Rogue public override void OnKill(int timeLeft) { - if (Projectile.Calamity().stealthStrike) + if (Projectile.Calamity().stealthStrike && !hasSpawnedCinders) { - int sparkCount = Main.rand.Next(3, 7); + int sparkCount = Main.rand.Next(4, 5+1); for (int i = 0; i < sparkCount; i++) { - int sparkScatter = 1; - Vector2 sparkVelocity = new Vector2(Main.rand.NextFloat(-sparkScatter, sparkScatter), Main.rand.NextFloat(-sparkScatter, sparkScatter)); + Vector2 sparkVelocity = Main.rand.NextVector2Circular(1f, 3f); + sparkVelocity = sparkVelocity.SafeNormalize(Vector2.UnitY) * 3f; if (Projectile.ai[0] != 0) { @@ -184,14 +161,9 @@ namespace CalamityMod.Projectiles.Rogue sparkVelocity.Y *= -1; } - sparkVelocity.X += Projectile.ai[0]; - sparkVelocity.Y += Projectile.ai[1]; - sparkVelocity.Normalize(); - sparkVelocity *= 3; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sparkVelocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), 0, Projectile.owner, 0, 0); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), 0, Projectile.owner, 0, 0); SoundEngine.PlaySound(SoundID.Item74, Projectile.position); } } diff --git a/Projectiles/Rogue/InfestedClawmerangProj.cs b/Projectiles/Rogue/InfestedClawmerangProj.cs index d7f2386bdb..e420a236a8 100644 --- a/Projectiles/Rogue/InfestedClawmerangProj.cs +++ b/Projectiles/Rogue/InfestedClawmerangProj.cs @@ -37,12 +37,8 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft % 15 == 0 && Projectile.owner == Main.myPlayer) { - Vector2 vector62 = Main.player[Projectile.owner].Center - Projectile.Center; - Vector2 vector63 = vector62 * -1f; - vector63.Normalize(); - vector63 *= (float)Main.rand.Next(45, 65) * 0.1f; - vector63 = vector63.RotatedBy((Main.rand.NextDouble() - 0.5) * 1.5707963705062866, default); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, vector63.X, vector63.Y, ModContent.ProjectileType(), (int)(Projectile.damage * 0.1), Projectile.knockBack * 0.2f, Projectile.owner, -10f, 0f); + Vector2 sporeVel = Utils.DirectionFrom(Projectile.Center, Main.player[Projectile.owner].Center).RotatedByRandom(MathHelper.Pi) * Main.rand.NextFloat(4.5f, 6.5f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, sporeVel, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), 1f, Projectile.owner, -10f, 1f); } } } diff --git a/Projectiles/Rogue/InkBombProjectile.cs b/Projectiles/Rogue/InkBombProjectile.cs index 7f9f6b90cc..4163e97a2c 100644 --- a/Projectiles/Rogue/InkBombProjectile.cs +++ b/Projectiles/Rogue/InkBombProjectile.cs @@ -10,6 +10,7 @@ namespace CalamityMod.Projectiles.Rogue public class InkBombProjectile : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; + public static readonly SoundStyle Explode = new("CalamityMod/Sounds/Custom/PlantyMushMine", 3); public override void SetDefaults() { Projectile.width = 14; @@ -49,10 +50,10 @@ namespace CalamityMod.Projectiles.Rogue private void CreateInk() { Player player = Main.player[Projectile.owner]; - SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - for (int i = 0; i < 20; i++) + SoundEngine.PlaySound(SoundID.NPCHit25, Projectile.Center); + for (int i = 0; i < 4; i++) { - int damage = (int)player.GetTotalDamage().ApplyTo(22); + int damage = (int)player.GetTotalDamage().ApplyTo(32); int inkID = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(2f, 2f), ModContent.ProjectileType(), damage, 7, Projectile.owner, Main.rand.Next(3) + 1); Main.projectile[inkID].timeLeft += Main.rand.Next(-15, 15 + 1); diff --git a/Projectiles/Rogue/InkCloud.cs b/Projectiles/Rogue/InkCloud.cs index b45ad2b89a..7313d4b6e1 100644 --- a/Projectiles/Rogue/InkCloud.cs +++ b/Projectiles/Rogue/InkCloud.cs @@ -20,8 +20,8 @@ namespace CalamityMod.Projectiles.Rogue Projectile.tileCollide = true; Projectile.ignoreWater = true; Projectile.timeLeft = 100; - Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = -1; + Projectile.usesIDStaticNPCImmunity = true; + Projectile.idStaticNPCHitCooldown = 15; Projectile.DamageType = RogueDamageClass.Instance; } @@ -37,7 +37,7 @@ namespace CalamityMod.Projectiles.Rogue { if (!target.friendly) { - target.AddBuff(BuffID.Confused, 300); + target.AddBuff(BuffID.Confused, 60); } } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Confused, 300); diff --git a/Projectiles/Rogue/LeonidCometSmall.cs b/Projectiles/Rogue/LeonidCometSmall.cs index 9bcf7cc54e..6835ca8f01 100644 --- a/Projectiles/Rogue/LeonidCometSmall.cs +++ b/Projectiles/Rogue/LeonidCometSmall.cs @@ -28,19 +28,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.alpha = 255; } - public override bool PreDraw(ref Color lightColor) - { - Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); - return false; - } - - public override void PostDraw(Color lightColor) - { - Texture2D tex = ModContent.Request("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow").Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); - } - public override void AI() { Projectile.alpha -= 25; @@ -55,15 +42,10 @@ namespace CalamityMod.Projectiles.Rogue }); if (Main.rand.NextBool()) { - int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); + int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.3f); Main.dust[index].noGravity = true; } - if (Main.rand.NextBool()) - { - int index = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Smoke, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.6f); - Main.dust[index].noGravity = true; - } - int index1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), 1.2f); + int index1 = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f)); Main.dust[index1].noGravity = true; Main.dust[index1].velocity *= 2f; Main.dust[index1].velocity += Projectile.velocity; @@ -84,11 +66,14 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation += Projectile.velocity.X * 0.1f; } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override void OnKill(int timeLeft) { if (Projectile.owner != Main.myPlayer) return; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 3, 0f, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage / 2, 0f, Projectile.owner); Projectile.ai[1] = -1f; Projectile.position = Projectile.Center; Projectile.width = Projectile.height = 40; @@ -124,8 +109,16 @@ namespace CalamityMod.Projectiles.Rogue } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); + public override bool PreDraw(ref Color lightColor) + { + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, CalamityUtils.ColorSwap(LeonidProgenitor.blueColor, LeonidProgenitor.purpleColor, 1f), Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); + return false; + } + public override void PostDraw(Color lightColor) + { + Texture2D tex = ModContent.Request("CalamityMod/Items/Weapons/Rogue/LeonidProgenitorGlow").Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Color.White, Projectile.rotation, tex.Size() / 2, Projectile.scale, SpriteEffects.None, 0); + } } } diff --git a/Projectiles/Rogue/LeonidProgenitorBombshell.cs b/Projectiles/Rogue/LeonidProgenitorBombshell.cs index 507789ee06..606bf24ff4 100644 --- a/Projectiles/Rogue/LeonidProgenitorBombshell.cs +++ b/Projectiles/Rogue/LeonidProgenitorBombshell.cs @@ -51,7 +51,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.netUpdate = true; } } - Projectile.velocity.Y += 0.2f; + Projectile.velocity.Y += 0.2f / (float)Projectile.MaxUpdates; } Projectile.rotation += Projectile.velocity.X * 0.1f; } @@ -76,45 +76,35 @@ namespace CalamityMod.Projectiles.Rogue { int flash = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), Projectile.damage, 0f, Projectile.owner, 0f, 1f); if (flash.WithinBounds(Main.maxProjectiles)) - { Main.projectile[flash].DamageType = RogueDamageClass.Instance; - } - - Vector2 pos = new Vector2(Projectile.Center.X + Projectile.width * 0.5f + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); - Vector2 velocity = (Projectile.Center - pos) / 40f; - int dmg = Projectile.damage / 2; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, velocity, ModContent.ProjectileType(), dmg, Projectile.knockBack, Projectile.owner, 0f, 0.5f + (float)Main.rand.NextDouble() * 0.3f); } } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 240); - StealthStrikeEffect(); + SpawnExtraProjectiles(target); } public override void OnHitPlayer(Player target, Player.HurtInfo info) { target.AddBuff(ModContent.BuffType(), 240); - StealthStrikeEffect(); + SpawnExtraProjectiles(target); } - private void StealthStrikeEffect() + private void SpawnExtraProjectiles(Entity target) { - if (!Projectile.Calamity().stealthStrike || Main.myPlayer != Projectile.owner) - return; - - Vector2 spinningpoint = new Vector2(0f, 6f); - float radian45 = MathHelper.ToRadians(45f); - int cometAmt = 5; - float cometSpread = -(radian45 * 2f) / (cometAmt - 1f); - for (int projIndex = 0; projIndex < cometAmt; ++projIndex) + Vector2 pos = new Vector2(target.Center.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); + Vector2 meteorVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 20f, 3); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), pos, meteorVel, ModContent.ProjectileType(), Projectile.damage / 2, Projectile.knockBack, Projectile.owner, 0f, 0.5f + Main.rand.NextFloat() * 0.3f); + + if (Projectile.Calamity().stealthStrike) { - int index2 = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, spinningpoint.RotatedBy((double)radian45 + (double)cometSpread * (double)projIndex, new Vector2()), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, -1f); - Projectile proj = Main.projectile[index2]; - for (int index3 = 0; index3 < Projectile.localNPCImmunity.Length; ++index3) + for (int i = 0; i < 5; i++) { - proj.localNPCImmunity[index3] = Projectile.localNPCImmunity[index3]; + Vector2 cometPos = new Vector2(target.Center.X + Main.rand.Next(-100, 101), target.Center.Y - 150f - Main.rand.Next(30)); + Vector2 cometVel = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(pos, target, 18f, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), cometPos, cometVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, -1f); } } } diff --git a/Projectiles/Rogue/LeviathanTooth.cs b/Projectiles/Rogue/LeviathanTooth.cs index 2851230620..c08c51506d 100644 --- a/Projectiles/Rogue/LeviathanTooth.cs +++ b/Projectiles/Rogue/LeviathanTooth.cs @@ -23,18 +23,13 @@ namespace CalamityMod.Projectiles.Rogue public bool canDamage = true; public bool canStick = true; public Vector2 vibrate = Vector2.Zero; - public int stuckTimer = 120; + public int stuckTimer = 180; public Vector2 placementCenter; float placementDistance; Vector2 placementVelocity; public Vector2 storedVelocity; public bool collideWithTiles = true; - - public bool jawline = true; // Tooth direction for the stealthstrike - public Vector2 startingVel; public bool toothDirection = false; - public Vector2 chomp = Vector2.Zero; - public bool chomping = true; public override void SetStaticDefaults() { ProjectileID.Sets.TrailCacheLength[Type] = 8; @@ -48,39 +43,42 @@ namespace CalamityMod.Projectiles.Rogue Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.penetrate = -1; - Projectile.extraUpdates = 2; + Projectile.extraUpdates = 3; Projectile.tileCollide = false; Projectile.timeLeft = 600; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = -1; + Projectile.noEnchantmentVisuals = true; } public override void AI() { + Lighting.AddLight(Projectile.Center, Color.Lerp(Color.Red, Color.White, 0.85f).ToVector3() * 0.5f * Utils.GetLerpValue(255, 0, Projectile.alpha, true)); if (time == 0) { stuckTimer = Main.rand.Next(100, 120 + 1); - startingVel = Projectile.velocity; if (Projectile.ai[1] < 4) toothDirection = Main.rand.NextBool(); } if (!stuckInTarget && !stuckInGround) { - if (!Projectile.Calamity().stealthStrike) + if (Projectile.velocity.Length() > 5 && time > 30 && Projectile.numHits == 0) + Projectile.velocity *= 0.97f; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; + if ((time % 2 == 0 || !canStick) && time > 5) { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if ((time % 2 == 0 || !canStick) && time > 15) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3 + Main.rand.NextVector2Circular(6, 6), 5, (-Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.4f)); - dust.noGravity = true; - } - if (time > 90 && canStick) - { - Projectile.velocity.Y += 0.03f; - if (Projectile.velocity.Y > 0) - Projectile.velocity.X *= 0.99f; - } + Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3 + Main.rand.NextVector2Circular(6, 6), 5, (-Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedByRandom(0.3f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.4f) * (canStick ? 1 : 1.3f)); + dust.noGravity = true; + Particle blood = new CustomSpark(Projectile.Center, -Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedByRandom(canStick ? 0.3f : 0.1f) * Main.rand.NextFloat(5f, 8f), "CalamityMod/Particles/LargeBloom", + false, 8, Main.rand.NextFloat(0.055f, 0.07f), Color.Lerp(Color.DarkRed, Color.Black, Main.rand.NextFloat(0, 0.5f)) * 0.7f, new Vector2(0.7f, 1f), false, shrinkSpeed: 0.8f); + GeneralParticleHandler.SpawnParticle(blood); + } + if (time > 90 && canStick) + { + Projectile.velocity.Y += 0.03f; + if (Projectile.velocity.Y > 0) + Projectile.velocity.X *= 0.99f; } } else if (stuckInTarget) @@ -107,7 +105,8 @@ namespace CalamityMod.Projectiles.Rogue vibrate = Vector2.Zero; canStick = false; collideWithTiles = true; - Projectile.velocity = storedVelocity * 1.3f; + Projectile.velocity = storedVelocity; + Projectile.extraUpdates = 4; stuckInTarget = false; for (int i = 0; i <= 7; i++) @@ -130,117 +129,33 @@ namespace CalamityMod.Projectiles.Rogue Projectile.rotation = storedVelocity.ToRotation() + MathHelper.PiOver2; } - if (Projectile.Calamity().stealthStrike) - { - collideWithTiles = false; - if (time > 15 && (Projectile.ai[1] == 4 ? Projectile.timeLeft > 60 : time < 40)) - { - for (int i = 0; i < (Projectile.ai[1] == 4 ? 2 : 1); i++) - { - Dust dust = Dust.NewDustPerfect(Projectile.Center - Projectile.velocity.SafeNormalize(Vector2.UnitX) * 3 + Main.rand.NextVector2Circular(6, 6), 5, (-Projectile.velocity.SafeNormalize(Vector2.UnitX) * 4).RotatedByRandom(0.5f) * Main.rand.NextFloat(0.1f, 0.8f), 100, default, Main.rand.NextFloat(0.8f, 1.6f)); - dust.noGravity = true; - } - } - if (Projectile.ai[1] == 4) - { - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver4; - int jawDir = jawline ? 1 : -1; - Vector2 spawnPos = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.ToRadians(90f * jawDir)) * 170; - Vector2 jawVel = Projectile.velocity.SafeNormalize(Vector2.UnitX).RotatedBy(MathHelper.ToRadians(90f * jawDir)) * 17; - if (time > 10 && Projectile.timeLeft >= 60) - { - if (time % 3 == 0) - { - Projectile tooth = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), spawnPos, jawVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack / 12, Projectile.owner, 0, 0, Projectile.velocity.X > 0 ? 1 : -1); - tooth.Calamity().stealthStrike = true; - tooth.timeLeft = 120; - tooth.extraUpdates = 0; - tooth.usesIDStaticNPCImmunity = true; - tooth.usesLocalNPCImmunity = false; - tooth.idStaticNPCHitCooldown = 5; - tooth.ai[1] = Main.rand.Next(1, 3 + 1); - jawline = !jawline; - } - if (time % 2 == 0) - { - Particle spark = new AltSparkParticle(Projectile.Center - Projectile.velocity * 0.5f, Projectile.velocity * 0.01f, false, 15, 1f, Color.DarkRed * 0.4f); - GeneralParticleHandler.SpawnParticle(spark); - } - if (Projectile.timeLeft == 60) - Projectile.velocity *= 0.5f; - } - else if (Projectile.timeLeft <= 60) - { - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 60, 255, 0)); - Projectile.velocity *= 0.95f; - } - } - else - { - Projectile.rotation = startingVel.ToRotation() + MathHelper.ToRadians(270f); - if (Projectile.timeLeft > 90) - { - Projectile.velocity.X = MathHelper.Lerp(Projectile.velocity.X, -startingVel.X * 1.3f, 0.045f); - Projectile.velocity.Y = MathHelper.Lerp(Projectile.velocity.Y, -startingVel.Y * 1.3f, 0.045f); - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 120, 90, 255, 0)); - } - else - { - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 30, 255, 0)); - Projectile.velocity *= 0.9f; - } - if (time > 40) - { - if (!chomping) - { - chomp.X = MathHelper.Lerp(chomp.X, startingVel.X * 3, 0.2f); - chomp.Y = MathHelper.Lerp(chomp.Y, startingVel.Y * 3, 0.2f); - } - else - { - chomp.X = MathHelper.Lerp(chomp.X, 0, 0.2f); - chomp.Y = MathHelper.Lerp(chomp.Y, 0, 0.2f); - } - if (time % 18 == 0) - chomping = !chomping; - } - - } - } - time++; - if (collideWithTiles && Collision.SolidCollision(Projectile.Center, 4, 4)) // Vanilla tile collision messes with velocity so we use this instead { canDamage = false; - if (Projectile.timeLeft > 180) - Projectile.timeLeft = 180; + Projectile.timeLeft = 180; stuckInGround = true; storedVelocity = Projectile.velocity.SafeNormalize(Vector2.UnitX); Projectile.velocity = Vector2.Zero; SoundStyle sound = new("CalamityMod/Sounds/NPCHit/RavagerRockPillarHit1"); SoundEngine.PlaySound(sound with { Volume = 0.25f, Pitch = Main.rand.NextFloat(-0.3f, -0.6f) }, Projectile.Center); collideWithTiles = false; - } - if (!Projectile.Calamity().stealthStrike) - Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 60, 255, 0)); + Projectile.alpha = (int)(Utils.Remap(Projectile.timeLeft, 0, 60, 255, 0)); + time++; } public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (Projectile.Calamity().stealthStrike) - modifiers.SourceDamage *= Projectile.ai[1] == 4 ? 0.6f : 0.5f; - else - modifiers.SourceDamage *= target == chosenTarget ? 1 : (canStick ? 0.2f : 0.5f); + modifiers.SourceDamage *= target == chosenTarget ? 1 : (canStick ? 0.2f : 0.5f); } public override bool? CanDamage() => canDamage ? null : false; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (target == chosenTarget || Projectile.Calamity().stealthStrike) + if (target == chosenTarget) target.AddBuff(ModContent.BuffType(), 180); - if (!stuckInTarget && canStick && !Projectile.Calamity().stealthStrike) + if (!stuckInTarget && canStick) { if (Projectile.timeLeft < 400) Projectile.timeLeft = 400; @@ -266,10 +181,10 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.ai[1] == 4) tex = ModContent.Request("CalamityMod/Projectiles/Melee/GreenWater").Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + vibrate + chomp, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, toothDirection ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + vibrate, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, toothDirection ? SpriteEffects.FlipHorizontally : SpriteEffects.None, 0); return false; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Calamity().stealthStrike ? 50 : 18, targetHitbox); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, 18, targetHitbox); } } diff --git a/Projectiles/Rogue/LeviathanToothStealth.cs b/Projectiles/Rogue/LeviathanToothStealth.cs new file mode 100644 index 0000000000..d727b1a8a8 --- /dev/null +++ b/Projectiles/Rogue/LeviathanToothStealth.cs @@ -0,0 +1,201 @@ +using System; +using CalamityMod.Buffs.DamageOverTime; +using CalamityMod.NPCs; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.Audio; +using Terraria.ID; +using Terraria.ModLoader; +using static Terraria.Player; + +namespace CalamityMod.Projectiles.Rogue +{ + [PierceResistException] + public class LeviathanToothStealth : ModProjectile, ILocalizedModType + { + public override string Texture => "CalamityMod/Projectiles/Rogue/LeviathanTooth"; + public new string LocalizationCategory => "Projectiles.Rogue"; + public ref float time => ref Projectile.ai[0]; + + public bool canDamage = false; + public bool isTopJaw = false; + public float topJawRot = 0; + public float bottomJawRot = 0; + public int jawSlamTime = 25; + public bool spawnedDust = false; + public int jawLength = 750; + public int hitTimer = 0; + public Player Owner => Main.player[Projectile.owner]; + public override void SetStaticDefaults() + { + ProjectileID.Sets.TrailCacheLength[Type] = 8; + ProjectileID.Sets.TrailingMode[Type] = 2; + } + + public override void SetDefaults() + { + Projectile.width = 2; + Projectile.height = 2; + Projectile.friendly = true; + Projectile.ignoreWater = true; + Projectile.penetrate = -1; + Projectile.extraUpdates = 0; + Projectile.tileCollide = false; + Projectile.timeLeft = 180; + Projectile.DamageType = RogueDamageClass.Instance; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 8; + Projectile.ArmorPenetration = 25; + Projectile.noEnchantmentVisuals = true; + } + + public override void AI() + { + if (hitTimer > 0) + hitTimer--; + if (time == 0) + { + topJawRot = -MathHelper.PiOver4; + bottomJawRot = MathHelper.PiOver4; + } + topJawRot *= 0.95f; + bottomJawRot *= 0.95f; + float openingRot = 0.5f; + if (time <= 10) + { + float lerpValue = 1 - (float)Math.Pow(Utils.GetLerpValue(10, 0, time, true), 2); + topJawRot = MathHelper.Lerp(-MathHelper.PiOver4, -MathHelper.PiOver4 - openingRot, lerpValue); + bottomJawRot = MathHelper.Lerp(MathHelper.PiOver4, MathHelper.PiOver4 + openingRot, lerpValue); + } + else + { + float lerpValue = (float)Math.Pow(Utils.GetLerpValue(11, jawSlamTime, time, true), 4); + topJawRot = MathHelper.Lerp(-MathHelper.PiOver4 - openingRot, 0, lerpValue); + bottomJawRot = MathHelper.Lerp(MathHelper.PiOver4 + openingRot, 0, lerpValue); + } + + if (time < jawSlamTime * 1.5f) + { + Owner.direction = Projectile.direction; + if (time < jawSlamTime) + { + Projectile.Center = Owner.Center; + Projectile.velocity = Owner.Center.DirectionTo(Owner.Calamity().mouseWorld) * 0.01f; + } + Owner.itemTime = Owner.itemAnimation = 2; + Vector2 toMouse = Owner.Center.DirectionTo(Owner.Calamity().mouseWorld); + Owner.SetCompositeArmFront(true, CompositeArmStretchAmount.Full, toMouse.ToRotation() + topJawRot * Owner.direction + MathHelper.PiOver2 * -Owner.direction + (Owner.direction == -1 ? MathHelper.Pi : 0)); + Owner.SetCompositeArmBack(true, CompositeArmStretchAmount.Full, toMouse.ToRotation() + bottomJawRot * Owner.direction + MathHelper.PiOver2 * -Owner.direction + (Owner.direction == -1 ? MathHelper.Pi : 0)); + } + if (time == jawSlamTime) + { + Owner.Calamity().GeneralScreenShakePower = 5f; + Owner.Calamity().ConsumeStealthByAttacking(); + SoundStyle crunch = new("CalamityMod/Sounds/NPCKilled/PerfSmallDeath"); + for (int i = 0; i < 3; i++) + SoundEngine.PlaySound(crunch with { Volume = 0.4f, Pitch = -0.1f * i, MaxInstances = 3 }, Projectile.Center); + SoundStyle crunch2 = new("CalamityMod/Sounds/NPCHit/RavagerHurt3"); + for (int i = 0; i < 2; i++) + SoundEngine.PlaySound(crunch2 with { Volume = 0.8f, Pitch = -0.4f * i, MaxInstances = 2 }, Projectile.Center); + canDamage = true; + } + + Projectile.Opacity = (float)Math.Pow(Utils.GetLerpValue(0, 40, Projectile.timeLeft, true), 4); + if (Projectile.Opacity <= 0.4f) + canDamage = false; + time++; + spawnedDust = false; + } + + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) + { + float damageMult = 1; + if (hitTimer != 0) + damageMult = 0.2f; + bool jawsJustSlammed = (time >= jawSlamTime && time <= jawSlamTime + 8); + modifiers.SourceDamage *= (jawsJustSlammed ? 12 : 1) * damageMult; + if (hitTimer == 0) + hitTimer = Projectile.localNPCHitCooldown; + + if (target.CanBeMoved(true)) + target.velocity *= 0.05f; + } + public override bool? CanDamage() => canDamage ? null : false; + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + target.AddBuff(ModContent.BuffType(), 300); + } + + public override bool PreDraw(ref Color lightColor) + { + if (time == 0) + return false; + + Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Vector2 startPoint = Projectile.Center; + int distance = jawLength; + int travelLength = 35; + Vector2 endPoint = Projectile.Center + Projectile.velocity.SafeNormalize(Vector2.UnitX) * distance; + Vector2 direction = Projectile.velocity.SafeNormalize(Vector2.UnitX); + + for (int t = -1; t <= 1; t += 2) + { + SpriteEffects spriteFx = (!isTopJaw) ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + Color drawColor = Projectile.GetAlpha(lightColor); + int toothNum = 0; + for (int i = 0; i < distance; i += travelLength) + { + if (((isTopJaw && Projectile.direction == -1) || (!isTopJaw && Projectile.direction == 1)) && i == 0) + i += (int)(travelLength * 0.5f); + + float jawRot = (isTopJaw ? topJawRot : bottomJawRot); + float scale = (Projectile.scale + 0.35f - 0.02f * toothNum); + float slamLerp = (float)Math.Pow(Utils.GetLerpValue(0, jawSlamTime * 1.5f, time, true), 4); + float sine = ((float)Math.Pow((float)Math.Sin((time + toothNum * 3) / 10), 4)) * slamLerp; + Vector2 drawPos = (startPoint + i * direction.RotatedBy(jawRot)) + direction.RotatedBy(MathHelper.PiOver2 * (isTopJaw ? 1 : -1)) * (-25 * scale - 65 * sine * scale); + Vector2 toMouse = Projectile.velocity.SafeNormalize(Vector2.UnitX); + Vector2 finalDrawPos = drawPos + toMouse.RotatedBy(jawRot) * 5 * (1 - slamLerp) + Main.rand.NextVector2Circular(14, 14) * (time >= jawSlamTime ? Utils.GetLerpValue(jawSlamTime + 30, jawSlamTime, time, true) : 0); + float rotation = Projectile.velocity.ToRotation() + (jawRot) + (isTopJaw ? MathHelper.Pi : 0); + float toothOpacity = Math.Min((float)Math.Pow(Utils.GetLerpValue(0, toothNum, time, true), 3), Projectile.Opacity); + Main.EntitySpriteDraw(tex, finalDrawPos - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, toothOpacity) * toothOpacity, rotation, new Vector2(tex.Width / 2, tex.Height), new Vector2(1f, 1) * scale, spriteFx, 0); + toothNum++; + + if (!spawnedDust && toothNum > 1) + { + Dust dust = Dust.NewDustPerfect(finalDrawPos, 5, (rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2)).RotatedByRandom(0.5f).RotatedBy(1.2f * (isTopJaw ? -1 : 1)) * Main.rand.NextFloat(5f, 8f), 100, default, Main.rand.NextFloat(1.1f, 1.9f) * scale); + dust.noGravity = true; + dust.alpha = (int)(255 * (1 - toothOpacity)); + Particle blood = new CustomSpark(finalDrawPos, (rotation.ToRotationVector2().RotatedBy(MathHelper.PiOver2)).RotatedByRandom(0.4f).RotatedBy(1.2f * (isTopJaw ? -1 : 1)) * Main.rand.NextFloat(5f, 8f), "CalamityMod/Particles/LargeBloom", + false, 8, Main.rand.NextFloat(0.065f, 0.08f) * scale, Color.Lerp(Color.DarkRed, Color.Black, Main.rand.NextFloat(0, 0.5f)) * 0.7f * toothOpacity, new Vector2(1f, 1f), false, shrinkSpeed: 0.9f); + GeneralParticleHandler.SpawnParticle(blood); + + Lighting.AddLight(finalDrawPos, Color.Lerp(Color.Red, Color.White, 0.85f).ToVector3() * 1.2f * toothOpacity); + } + } + isTopJaw = (t == -1); + } + spawnedDust = true; // Make sure effect spawning isn't happening based on frame rate + + return false; + } + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) + { + if (!canDamage) + return false; + + Player Owner = Main.player[Projectile.owner]; + Vector2 start = Projectile.Center; + float length = jawLength; + float size = 165; + float _ = float.NaN; + bool hit = Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), start, start + Projectile.velocity.SafeNormalize(Vector2.UnitX) * length, size, ref _); + return (hit); + + return CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Calamity().stealthStrike ? 50 : 18, targetHitbox); + } + } +} diff --git a/Projectiles/Rogue/LostSoulFriendly.cs b/Projectiles/Rogue/LostSoulFriendly.cs index 1976f6b70e..d0f71b3f6f 100644 --- a/Projectiles/Rogue/LostSoulFriendly.cs +++ b/Projectiles/Rogue/LostSoulFriendly.cs @@ -54,7 +54,7 @@ namespace CalamityMod.Projectiles.Rogue // Reduce damage of projectiles if more than the cap are active public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { - if (!Projectile.CountsAsClass()) + if (Projectile.DamageType == DamageClass.Generic) { int cap = 10; float capDamageFactor = 0.05f; diff --git a/Projectiles/Rogue/MangroveChakramProjectile.cs b/Projectiles/Rogue/MangroveChakramProjectile.cs index 81f4212305..4bed2c6456 100644 --- a/Projectiles/Rogue/MangroveChakramProjectile.cs +++ b/Projectiles/Rogue/MangroveChakramProjectile.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Projectiles.Rogue Lighting.AddLight(Projectile.Center, 0f, 0.25f, 0f); if (Main.rand.NextBool(5)) - Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.JungleSpore, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); + Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, DustID.ChlorophyteWeapon, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f); if (Projectile.Calamity().stealthStrike) { @@ -39,8 +39,8 @@ namespace CalamityMod.Projectiles.Rogue if (Projectile.timeLeft < 240) Projectile.Kill(); - Projectile.localAI[0] += Main.rand.Next(0, 3); - if (Projectile.localAI[0] >= 10f) + Projectile.localAI[0] += Main.rand.Next(1, 3); + if (Projectile.localAI[0] >= 20f) { Projectile.localAI[0] = 0f; Vector2 flowerSpawnPosition = Projectile.Center + Main.rand.NextVector2Square(-10f, 10f); @@ -58,7 +58,6 @@ namespace CalamityMod.Projectiles.Rogue } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Venom, 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(BuffID.Venom, 120); } } diff --git a/Projectiles/Rogue/MeteorFistProj.cs b/Projectiles/Rogue/MeteorFistProj.cs index cc694bad98..13e1a8b6f4 100644 --- a/Projectiles/Rogue/MeteorFistProj.cs +++ b/Projectiles/Rogue/MeteorFistProj.cs @@ -110,9 +110,6 @@ namespace CalamityMod.Projectiles.Rogue return false; } public override bool? CanDamage() => Projectile.numHits == 0 ? null : false; - - // Fuck off stupid Vile Spits - public override bool? CanHitNPC(NPC target) => NPCID.Sets.ProjectileNPC[target.type] ? false : null; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(BuffID.OnFire, 120); diff --git a/Projectiles/Rogue/PlaguedFuelPackCloud.cs b/Projectiles/Rogue/PlaguedFuelPackCloud.cs index 24e2dfa9d1..5c968220db 100644 --- a/Projectiles/Rogue/PlaguedFuelPackCloud.cs +++ b/Projectiles/Rogue/PlaguedFuelPackCloud.cs @@ -6,32 +6,42 @@ using Terraria.ModLoader; namespace CalamityMod.Projectiles.Rogue { - [PierceResistException] public class PlaguedFuelPackCloud : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Rogue"; + public int dir = 0; + public float intensity = 0; + public override void SetStaticDefaults() + { + ProjectileID.Sets.CultistIsResistantTo[Type] = true; + } public override void SetDefaults() { Projectile.width = 28; Projectile.height = 24; Projectile.friendly = true; Projectile.alpha = 0; - Projectile.penetrate = -1; - Projectile.tileCollide = true; + Projectile.penetrate = 1; + Projectile.tileCollide = false; Projectile.ignoreWater = true; - Projectile.timeLeft = 120; + Projectile.timeLeft = 390; + Projectile.extraUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 6; + Projectile.localNPCHitCooldown = -1; Projectile.DamageType = RogueDamageClass.Instance; - Projectile.ArmorPenetration = 5; + Projectile.ArmorPenetration = 10; } public override void AI() { if (Projectile.timeLeft < 50) Projectile.alpha += 5; - if (Projectile.timeLeft < 75) - Projectile.velocity *= 0.95f; + if (dir == 0) + { + Projectile.timeLeft -= Main.rand.Next(5, 20 + 1); + dir = Main.rand.NextBool() ? -1 : 1; + intensity = Main.rand.NextFloat(0.2f, 1.2f); + } if (Main.rand.NextBool(150)) { @@ -40,6 +50,11 @@ namespace CalamityMod.Projectiles.Rogue Main.dust[dust].velocity *= 1.2f; Main.dust[dust].velocity.Y -= 0.15f; } + + if (Projectile.timeLeft < 290) + CalamityUtils.HomeInOnSelectedNPC(Projectile, Projectile.Center.ClosestNPCAt(1000), true, 0.65f * intensity, 6, 0.98f, 0.995f, true); + else + Projectile.velocity = Projectile.velocity.RotatedBy(0.006f * dir * intensity) * Main.rand.NextFloat(0.985f, 1f); } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 240); diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index 2942d3ed40..a935577557 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -55,20 +55,8 @@ namespace CalamityMod.Projectiles.Rogue // Heal the player and disappear when touching them. if (Projectile.Hitbox.Intersects(Owner.Hitbox)) { - if (!Owner.moonLeech && AbleToHealOwner) - { - int heal = Projectile.Calamity().stealthStrike ? 40 : 3; - - if (Main.LocalPlayer.lifeSteal <= 0f) - { - Projectile.Kill(); - return; - } - - Main.LocalPlayer.lifeSteal -= heal; - Owner.HealPlayer(heal); - } - + if (AbleToHealOwner) + Owner.DoLifestealDirect(null, Projectile.Calamity().stealthStrike ? 40 : 3, 0.4f); Projectile.Kill(); } } diff --git a/Projectiles/Rogue/SamsaraSlicerProjectile.cs b/Projectiles/Rogue/SamsaraSlicerProjectile.cs index 1433f615a4..6d50d7f4ce 100644 --- a/Projectiles/Rogue/SamsaraSlicerProjectile.cs +++ b/Projectiles/Rogue/SamsaraSlicerProjectile.cs @@ -54,7 +54,6 @@ namespace CalamityMod.Projectiles.Rogue { width = 20; height = 20; - return base.TileCollideStyle(ref width, ref height, ref fallThrough, ref hitboxCenterFrac); } @@ -219,8 +218,6 @@ namespace CalamityMod.Projectiles.Rogue } else { - //Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); - Main.EntitySpriteDraw(ModContent.Request("CalamityMod/Items/Weapons/Rogue/SamsaraSlicerGlow").Value, Projectile.Center - Main.screenPosition + randVec, tex.Frame(), new Color(0f, 1f, 0f, 0f), Projectile.rotation, tex.Frame().Center(), 1f, SpriteEffects.None); } return false; diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index fa631e61cb..7193fa5ca1 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -131,14 +131,7 @@ namespace CalamityMod.Projectiles.Rogue SpawnOnStealthStrikeBullets(); // Give on-heal effects from stealth strikes. - int heal = (int)Math.Round(hit.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ProjectileID.VampireHeal, (int)Math.Round(hit.Damage * 0.005), 0.5f); } public override void OnHitPlayer(Player target, Player.HurtInfo info) @@ -150,16 +143,6 @@ namespace CalamityMod.Projectiles.Rogue // Spawn a bloom of bullets. SpawnOnStealthStrikeBullets(); - - // Give on-heal effects from stealth strikes. - int heal = (int)Math.Round(info.Damage * 0.01); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ProjectileID.VampireHeal, BalancingConstants.LifeStealRange); } internal float WidthFunction(float completionRatio) diff --git a/Projectiles/Rogue/ShinobiBladeProjectile.cs b/Projectiles/Rogue/ShinobiBladeProjectile.cs index 8ce4a2584a..60c026f0be 100644 --- a/Projectiles/Rogue/ShinobiBladeProjectile.cs +++ b/Projectiles/Rogue/ShinobiBladeProjectile.cs @@ -71,14 +71,8 @@ namespace CalamityMod.Projectiles.Rogue SoundEngine.PlaySound(WulfrumKnife.TileHitSound, Projectile.Center); } - if (target.life <= 0 && target.lifeMax > 5) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], 10, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, 0f); - } - - public override void OnHitPlayer(Player target, Player.HurtInfo info) - { - if (target.statLife <= 0) - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], 10, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, 0f); + if (target.life <= 0) + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 10, 0f); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Rogue/TalonSmallProj.cs b/Projectiles/Rogue/TalonSmallProj.cs index 017bdfe455..1694f4b37d 100644 --- a/Projectiles/Rogue/TalonSmallProj.cs +++ b/Projectiles/Rogue/TalonSmallProj.cs @@ -43,19 +43,18 @@ namespace CalamityMod.Projectiles.Rogue // spawn dust if (Main.rand.NextBool(5)) { - int dustType = Main.rand.NextBool() ? DustID.Chlorophyte : DustID.UnusedBrown; + int dustType = Main.rand.NextBool() ? DustID.Chlorophyte : DustID.Ash; Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, dustType, Projectile.velocity.X * 0.5f, Projectile.velocity.Y * 0.5f, Scale: 0.9f); } - // freely spins instead of facing forwards - Projectile.rotation += 0.26f; + Projectile.rotation = Projectile.velocity.ToRotation(); Projectile.spriteDirection = Projectile.direction = (Projectile.velocity.X > 0).ToDirectionInt(); Projectile.ai[0]++; } private void ApplySineVelocity(Vector2 baseVelocity) { - float radians = Projectile.ai[1] * (float)Math.Sin(-MathHelper.PiOver2 + 0.25f * Projectile.ai[0]); + float radians = Projectile.ai[1] * (float)Math.Sin(-MathHelper.PiOver2 + 0.25f * Projectile.ai[0]) * 0.5f; Projectile.velocity = baseVelocity.RotatedBy(radians); } @@ -71,7 +70,9 @@ namespace CalamityMod.Projectiles.Rogue public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; - Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); + Color draw = Color.Lerp(lightColor, Color.White, 0.5f); + SpriteEffects sp = Projectile.ai[1] == -1 ? SpriteEffects.FlipVertically : SpriteEffects.None; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(draw), Projectile.rotation, tex.Size() / 2f, Projectile.scale, sp, 0); return false; } } diff --git a/Projectiles/Rogue/TotalMeltdown.cs b/Projectiles/Rogue/TotalMeltdown.cs index 48e2eb7e92..f439d9122b 100644 --- a/Projectiles/Rogue/TotalMeltdown.cs +++ b/Projectiles/Rogue/TotalMeltdown.cs @@ -20,7 +20,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.penetrate = -1; Projectile.timeLeft = Main.projFrames[Type] * 5; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 30; + Projectile.localNPCHitCooldown = -1; } public override void AI() diff --git a/Projectiles/Rogue/TotalityFlask.cs b/Projectiles/Rogue/TotalityFlask.cs index 545f479c5b..e4ca68525c 100644 --- a/Projectiles/Rogue/TotalityFlask.cs +++ b/Projectiles/Rogue/TotalityFlask.cs @@ -79,7 +79,7 @@ namespace CalamityMod.Projectiles.Rogue Dust dust2 = Main.dust[index3]; dust2.velocity *= 3f; } - int tarAmt = Main.rand.Next(2, 4); + int tarAmt = Projectile.Calamity().stealthStrike ? 5 : Main.rand.Next(2, 3+1); for (int t = 0; t < tarAmt; t++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); diff --git a/Projectiles/Rogue/TotalityTar.cs b/Projectiles/Rogue/TotalityTar.cs index 98d51d5ec5..c9b92c8d76 100644 --- a/Projectiles/Rogue/TotalityTar.cs +++ b/Projectiles/Rogue/TotalityTar.cs @@ -79,23 +79,16 @@ namespace CalamityMod.Projectiles.Rogue { SoundEngine.PlaySound(SoundID.Item74, Projectile.position); Vector2 vector2 = new Vector2(20f, 20f); - for (int index = 0; index < 3; ++index) + for (int i = 0; i < 3; ++i) Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.SpookyWood, 0.0f, 0.0f, 0, Color.Red, 1f); - for (int index1 = 0; index1 < 5; ++index1) + for (int j = 0; j < 5; ++j) { - int index2 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Smoke, 0.0f, 0.0f, 100, new Color(), 1.5f); - Dust dust = Main.dust[index2]; - dust.velocity *= 1.4f; - } - for (int index1 = 0; index1 < 10; ++index1) - { - int index2 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Torch, 0.0f, 0.0f, 100, new Color(), 2.5f); - Dust dust1 = Main.dust[index2]; - dust1.noGravity = true; - dust1.velocity *= 5f; - int index3 = Dust.NewDust(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Torch, 0.0f, 0.0f, 100, new Color(), 1.5f); - Dust dust2 = Main.dust[index3]; - dust2.velocity *= 3f; + Dust smoke = Dust.NewDustDirect(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Smoke, 0.0f, 0.0f, 100, new Color(), 1.5f); + smoke.velocity *= 1.4f; + + Dust fire = Dust.NewDustDirect(Projectile.Center - vector2 / 2f, (int)vector2.X, (int)vector2.Y, DustID.Torch, 0.0f, 0.0f, 100, new Color(), 2.5f); + fire.noGravity = true; + fire.velocity *= 5f; } int fireAmt = Main.rand.Next(2, 4); if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Rogue/ValariBoomerang.cs b/Projectiles/Rogue/ValariBoomerang.cs index 9db3525406..f285f7f0ae 100644 --- a/Projectiles/Rogue/ValariBoomerang.cs +++ b/Projectiles/Rogue/ValariBoomerang.cs @@ -145,7 +145,6 @@ namespace CalamityMod.Projectiles.Rogue Projectile.velocity.Y -= acceleration; } - // Delete the projectile if it touches its owner. if (Main.myPlayer == Projectile.owner) if (Projectile.Hitbox.Intersects(owner.Hitbox)) @@ -198,8 +197,6 @@ namespace CalamityMod.Projectiles.Rogue { OnHitEffects(target); target.AddBuff(BuffID.Frostburn2, 120); - if (Projectile.Calamity().stealthStrike) - target.AddBuff(ModContent.BuffType(), 45); } public override bool OnTileCollide(Vector2 oldVelocity) diff --git a/Projectiles/Rogue/WhitewaterProj.cs b/Projectiles/Rogue/WhitewaterProj.cs index cd84b2652d..35c966e664 100644 --- a/Projectiles/Rogue/WhitewaterProj.cs +++ b/Projectiles/Rogue/WhitewaterProj.cs @@ -164,7 +164,6 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.Hitbox.Intersects(Owner.Hitbox)) { - Projectile.Kill(); if (Projectile.Calamity().stealthStrike) { foreach (Projectile p in Main.ActiveProjectiles) @@ -175,8 +174,9 @@ namespace CalamityMod.Projectiles.Rogue p.timeLeft = 30; } } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.3f), Projectile.knockBack, Projectile.owner, 0f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType(), (int)(Projectile.damage * 0.25f), Projectile.knockBack, Projectile.owner, 0f, 0f); } + Projectile.Kill(); } } } diff --git a/Projectiles/Rogue/WhitewaterSpear.cs b/Projectiles/Rogue/WhitewaterSpear.cs index c16a59f091..c0967afa4f 100644 --- a/Projectiles/Rogue/WhitewaterSpear.cs +++ b/Projectiles/Rogue/WhitewaterSpear.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Rogue Projectile.extraUpdates = 5; Projectile.DamageType = RogueDamageClass.Instance; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 15 * Projectile.MaxUpdates; + Projectile.localNPCHitCooldown = 20 * Projectile.MaxUpdates; } public override void AI() diff --git a/Projectiles/Rogue/WulfrumKnifeProj.cs b/Projectiles/Rogue/WulfrumKnifeProj.cs index 4f6a26f038..8265a8eec9 100644 --- a/Projectiles/Rogue/WulfrumKnifeProj.cs +++ b/Projectiles/Rogue/WulfrumKnifeProj.cs @@ -25,10 +25,26 @@ namespace CalamityMod.Projectiles.Rogue ProjectileID.Sets.TrailingMode[Type] = 0; } - public static int Lifetime = 950; + public static int Lifetime = 1200; public float LifetimeCompletion => MathHelper.Clamp((Lifetime - Projectile.timeLeft) / (float)Lifetime, 0f, 1f); public float StealthEffectOpacity => MathHelper.Clamp(1 - LifetimeCompletion, 0f, 1f); + public float StuckEnemyID + { + get { return Projectile.ai[0]; } + set { Projectile.ai[0] = value; } + } + public float StuckEnemyDistance + { + get { return Projectile.ai[1]; } + set { Projectile.ai[1] = value; } + } + public float StuckEnemyRotation + { + get { return Projectile.ai[2]; } + set { Projectile.ai[2] = value; } + } + public override void SetDefaults() { Projectile.width = 12; @@ -41,11 +57,42 @@ namespace CalamityMod.Projectiles.Rogue Projectile.extraUpdates = 5; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 1; + Projectile.stopsDealingDamageAfterPenetrateHits = true; } public override void AI() { + if (StuckEnemyID > 0) + { + Projectile.tileCollide = false; + if (!Main.npc[(int)StuckEnemyID-1].active) + { + Projectile.Kill(); + return; + } + Projectile.Center = Main.npc[(int)StuckEnemyID-1].Center + Vector2.UnitX.RotatedBy(StuckEnemyRotation) * StuckEnemyDistance; + return; + } + if (StuckEnemyID == -1) + { + var player = Main.player[Projectile.owner]; + Projectile.velocity = Projectile.DirectionTo(player.Center) * 10f; + Projectile.rotation = Projectile.velocity.ToRotation() - MathHelper.PiOver2; + if (Main.rand.NextBool(3)) + { + Vector2 dustCenter = Projectile.Center + Main.rand.NextVector2Circular(4f, 4f); + + Dust chust = Dust.NewDustPerfect(dustCenter, 15, -Projectile.velocity * Main.rand.NextFloat(0.2f, 0.1f), Scale: Main.rand.NextFloat(1.2f, 1.8f)); + chust.noGravity = true; + } + if (Projectile.Distance(player.Center) < 16) + { + player.Calamity().rogueStealth += player.Calamity().rogueStealthMax * 0.067f; + Projectile.Kill(); + } + return; + } Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; Projectile.velocity *= 0.998f; @@ -92,6 +139,10 @@ namespace CalamityMod.Projectiles.Rogue public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { SoundEngine.PlaySound(WulfrumKnife.TileHitSound, Projectile.Center); + Projectile.timeLeft = Lifetime; + StuckEnemyID = target.whoAmI+1; + StuckEnemyDistance = Projectile.Distance(target.Center); + StuckEnemyRotation = Projectile.DirectionFrom(target.Center).ToRotation(); } public override bool OnTileCollide(Vector2 oldVelocity) @@ -118,7 +169,7 @@ namespace CalamityMod.Projectiles.Rogue Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; float opacitey = StealthEffectOpacity; - if (Projectile.Calamity().stealthStrike) + if (Projectile.Calamity().stealthStrike && StuckEnemyID == 0) { Main.spriteBatch.End(); Main.spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.Additive, Main.DefaultSamplerState, DepthStencilState.None, Main.Rasterizer, null, Main.GameViewMatrix.TransformationMatrix); diff --git a/Projectiles/Summon/AmphibiansGuitarHoldout.cs b/Projectiles/Summon/AmphibiansGuitarHoldout.cs index 966171311f..0b2a688865 100644 --- a/Projectiles/Summon/AmphibiansGuitarHoldout.cs +++ b/Projectiles/Summon/AmphibiansGuitarHoldout.cs @@ -4,6 +4,7 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.GameContent; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -23,6 +24,7 @@ namespace CalamityMod.Projectiles.Summon private static readonly int MinionType = ModContent.ProjectileType(); + public override void SetStaticDefaults() => ProjectileID.Sets.MinionTargettingFeature[Type] = true; public override void SetDefaults() { Projectile.width = Projectile.height = 50; diff --git a/Projectiles/Summon/AmphibiansGuitarMinion.cs b/Projectiles/Summon/AmphibiansGuitarMinion.cs index ddfab3cd17..5f026779bb 100644 --- a/Projectiles/Summon/AmphibiansGuitarMinion.cs +++ b/Projectiles/Summon/AmphibiansGuitarMinion.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Summon SoundStyle spawnSound = new("CalamityMod/Sounds/Item/AmphibiansGuitarSummon"); SoundEngine.PlaySound(spawnSound with { Volume = 0.8f, Pitch = (GuitarSprite == 2 || GuitarSprite == 5) ? -0.15f : 0f }, Projectile.Center); - ShootTimer = GuitarSprite * 10f; + ShootTimer = GuitarSprite * 12f; _hasSpawned = true; } @@ -68,7 +68,7 @@ namespace CalamityMod.Projectiles.Summon if (Target != null) { bool bigShot = ShootCount % 3 == 0; - if (ShootTimer > 80f && Main.myPlayer == Projectile.owner) + if (ShootTimer > 96f && Main.myPlayer == Projectile.owner) { for (int i = 0; i < (bigShot ? 3 : 1); i++) { @@ -76,7 +76,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.NewProjectile( Projectile.GetSource_FromThis(), Projectile.Center, - CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, 18f * (1f - Math.Abs(rot))).RotatedBy(rot), + CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, Target, (bigShot ? 36f : 25f) * (1f - Math.Abs(rot))).RotatedBy(rot), ProjectileType(), Projectile.damage, Projectile.knockBack, @@ -140,8 +140,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/AmphibiansGuitarProjectile.cs b/Projectiles/Summon/AmphibiansGuitarProjectile.cs index 5782e66785..535762ab1d 100644 --- a/Projectiles/Summon/AmphibiansGuitarProjectile.cs +++ b/Projectiles/Summon/AmphibiansGuitarProjectile.cs @@ -33,21 +33,20 @@ namespace CalamityMod.Projectiles.Summon Projectile.width = 54; Projectile.height = 44; Projectile.timeLeft = 150; - Projectile.localNPCHitCooldown = 20; Projectile.friendly = true; Projectile.tileCollide = false; + Projectile.penetrate = 1; Projectile.usesLocalNPCImmunity = true; - Projectile.penetrate = -1; - Projectile.extraUpdates = 0; + Projectile.localNPCHitCooldown = 20; } public override void AI() { if (time == 0) { - if (IsHatNote) - Projectile.penetrate = 1; if (Projectile.ai[2] == 5) - Projectile.extraUpdates = 1; + { + Projectile.penetrate = 3; + } } Projectile.scale = 1.6f * Utils.GetLerpValue(-5, 20, time, true); Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; diff --git a/Projectiles/Summon/ApexShark.cs b/Projectiles/Summon/ApexShark.cs index e0063dc6e0..3bef24a545 100644 --- a/Projectiles/Summon/ApexShark.cs +++ b/Projectiles/Summon/ApexShark.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 8; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -239,6 +240,8 @@ namespace CalamityMod.Projectiles.Summon } + public override bool MinionContactDamage() => HitCooldown == 0; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (Main.rand.NextBool(3)) @@ -253,14 +256,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; HitCooldown = 20; } - - public override bool? CanHitNPC(NPC target) - { - if (HitCooldown == 0) - { - return null; - } - return false; - } } } diff --git a/Projectiles/Summon/AquaticStarMinion.cs b/Projectiles/Summon/AquaticStarMinion.cs index f060849af8..3377e232ea 100644 --- a/Projectiles/Summon/AquaticStarMinion.cs +++ b/Projectiles/Summon/AquaticStarMinion.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -70,6 +71,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.ChargingMinionAI(1200f, 1500f, 2200f, 150f, 0, 24f, 15f, 4f, new Vector2(0f, -60f), 12f, 12f, false, false, 1); } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/AstrageldonSummon.cs b/Projectiles/Summon/AstrageldonSummon.cs index 795b62514b..c5a3c69c48 100644 --- a/Projectiles/Summon/AstrageldonSummon.cs +++ b/Projectiles/Summon/AstrageldonSummon.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -209,6 +210,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) diff --git a/Projectiles/Summon/AstralProbeSummon.cs b/Projectiles/Summon/AstralProbeSummon.cs index 64de6fe834..d9743cab03 100644 --- a/Projectiles/Summon/AstralProbeSummon.cs +++ b/Projectiles/Summon/AstralProbeSummon.cs @@ -40,6 +40,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -150,8 +151,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/BabyBloodCrawler.cs b/Projectiles/Summon/BabyBloodCrawler.cs index c3b33c47d2..3416df2b66 100644 --- a/Projectiles/Summon/BabyBloodCrawler.cs +++ b/Projectiles/Summon/BabyBloodCrawler.cs @@ -9,12 +9,13 @@ namespace CalamityMod.Projectiles.Summon public class BabyBloodCrawler : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public static int bloodCooldown = 0; + public int bloodCooldown = 0; public float dust = 0f; public override void SetStaticDefaults() { Main.projFrames[Type] = 11; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -36,7 +37,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; Projectile.MaxUpdates = 2; Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 33 * Projectile.MaxUpdates; + Projectile.localNPCHitCooldown = 30 * Projectile.MaxUpdates; } public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) @@ -96,23 +97,20 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(target.Center); - - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(target.Center); - - private void OnHitEffects(Vector2 targetPos) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(target); + public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(target); + private void OnHitEffects(Entity target) { if (bloodCooldown == 0) { - bloodCooldown = 17; - int projAmt = 2; - var source = Projectile.GetSource_FromThis(); - for (int n = 0; n < projAmt; n++) - { - CalamityUtils.ProjectileRain(source, targetPos, 400f, 100f, 400f, 700f, 29f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack * Main.rand.NextFloat(0.7f, 1f), Projectile.owner); - } + bloodCooldown = 15; + Vector2 spawnPos = target.Center + Vector2.UnitX * Main.rand.NextFloat(-100f, 100f) - Vector2.UnitY * Main.rand.NextFloat(400f, 700f); + Vector2 velocity = CalamityUtils.CalculatePredictiveAimToTargetMaxUpdates(spawnPos, target, 25f, 2); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPos, velocity, ModContent.ProjectileType(), (int)(Projectile.damage * 0.5f), Projectile.knockBack, Projectile.owner); } } } diff --git a/Projectiles/Summon/BelladonnaSpirit.cs b/Projectiles/Summon/BelladonnaSpirit.cs index 5d99e1cd20..d4cd8ae282 100644 --- a/Projectiles/Summon/BelladonnaSpirit.cs +++ b/Projectiles/Summon/BelladonnaSpirit.cs @@ -106,8 +106,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/BlackDragonHead.cs b/Projectiles/Summon/BlackDragonHead.cs index 3bca4cd7c6..875ad6599a 100644 --- a/Projectiles/Summon/BlackDragonHead.cs +++ b/Projectiles/Summon/BlackDragonHead.cs @@ -216,6 +216,8 @@ namespace CalamityMod.Projectiles.Summon } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.ShadowFlame, 300); } } diff --git a/Projectiles/Summon/BlackHawkSummon.cs b/Projectiles/Summon/BlackHawkSummon.cs index a3b25021a1..93d42c501c 100644 --- a/Projectiles/Summon/BlackHawkSummon.cs +++ b/Projectiles/Summon/BlackHawkSummon.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 6; } public override void SetDefaults() @@ -299,9 +300,6 @@ namespace CalamityMod.Projectiles.Summon } } - //Does no contact damage - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/BloodSpit.cs b/Projectiles/Summon/BloodSpit.cs index 89167493d4..d3784b56ab 100644 --- a/Projectiles/Summon/BloodSpit.cs +++ b/Projectiles/Summon/BloodSpit.cs @@ -28,7 +28,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 6; Projectile.DamageType = DamageClass.Summon; - Projectile.Calamity().BloodstoneOrbValue = 20; //Bloodstone Orb lifesteal. May want to go back to regular lifesteal. + Projectile.Calamity().BloodstoneOrbValue = 12; //Bloodstone Orb lifesteal. May want to go back to regular lifesteal. } public override void AI() diff --git a/Projectiles/Summon/BrimstoneFireSummon.cs b/Projectiles/Summon/BrimstoneFireSummon.cs index d3399e3df5..5c72c4c722 100644 --- a/Projectiles/Summon/BrimstoneFireSummon.cs +++ b/Projectiles/Summon/BrimstoneFireSummon.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.extraUpdates = 3; Projectile.timeLeft = 50; Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 9; + Projectile.idStaticNPCHitCooldown = 12; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/BrimstoneLaserSummon.cs b/Projectiles/Summon/BrimstoneLaserSummon.cs index 4e5fda6383..69c063bd29 100644 --- a/Projectiles/Summon/BrimstoneLaserSummon.cs +++ b/Projectiles/Summon/BrimstoneLaserSummon.cs @@ -16,26 +16,24 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { - Projectile.width = Projectile.height = 2; + Projectile.width = Projectile.height = 10; Projectile.aiStyle = ProjAIStyleID.Arrow; + AIType = ProjectileID.CursedBullet; Projectile.friendly = true; Projectile.ignoreWater = true; Projectile.alpha = 120; Projectile.timeLeft = 300; - AIType = ProjectileID.DeathLaser; + Projectile.extraUpdates = 2; Projectile.DamageType = DamageClass.Summon; } public override void AI() { Lighting.AddLight(Projectile.Center, Projectile.Opacity * 0.5f, Projectile.Opacity * 0.05f, Projectile.Opacity * 0.05f); - Projectile.velocity.X *= 1.05f; - Projectile.velocity.Y *= 1.05f; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 120); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 120); public override Color? GetAlpha(Color lightColor) => new Color(250, 50, 50, Projectile.alpha); diff --git a/Projectiles/Summon/CalamarisLamentMinion.cs b/Projectiles/Summon/CalamarisLamentMinion.cs index dd9d517abe..057b2ccb67 100644 --- a/Projectiles/Summon/CalamarisLamentMinion.cs +++ b/Projectiles/Summon/CalamarisLamentMinion.cs @@ -54,13 +54,13 @@ namespace CalamityMod.Projectiles.Summon } else { - if (Main.rand.NextBool(600)) + if (Main.rand.NextBool(800)) { SoundStyle glubNoise = Main.rand.NextBool() ? SoundID.Zombie35 : SoundID.Zombie34; SoundStyle trollBirdChirpingSound = SoundID.Zombie16; - // 1/200th chance to do a bird chirping sound. - SoundEngine.PlaySound(Main.rand.NextBool(200) ? trollBirdChirpingSound : glubNoise, Projectile.Center); + // 1/2000th chance to do a bird chirping sound. + SoundEngine.PlaySound(Main.rand.NextBool(2000) ? trollBirdChirpingSound : glubNoise, Projectile.Center); } } diff --git a/Projectiles/Summon/CalamarisLamentProjectile.cs b/Projectiles/Summon/CalamarisLamentProjectile.cs index 56f317b73b..c4ad77518b 100644 --- a/Projectiles/Summon/CalamarisLamentProjectile.cs +++ b/Projectiles/Summon/CalamarisLamentProjectile.cs @@ -38,7 +38,10 @@ namespace CalamityMod.Projectiles.Summon Projectile.ignoreWater = true; Projectile.usesLocalNPCImmunity = true; } - + public override bool? CanHitNPC(NPC target) + { + return target.CanBeChasedBy() ? null : false; + } public override void AI() { if (TargetShot is not null && TargetShot.active) diff --git a/Projectiles/Summon/Calamitamini.cs b/Projectiles/Summon/Calamitamini.cs index a7c0bfb1ec..f1c755a738 100644 --- a/Projectiles/Summon/Calamitamini.cs +++ b/Projectiles/Summon/Calamitamini.cs @@ -210,25 +210,23 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.ai[1] > 0f) { - Projectile.ai[1] += (float)Main.rand.Next(1, 4); + Projectile.ai[1] += Main.rand.Next(2, 3+1); } - if (Projectile.ai[1] > 110f) + if (Projectile.ai[1] > 100f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; } if (Projectile.ai[0] == 0f) { - float projSpeed = 8f; + float projSpeed = 10f; int projType = ModContent.ProjectileType(); if (foundTarget && Projectile.ai[1] == 0f) { Projectile.ai[1] += 1f; if (Main.myPlayer == Projectile.owner && Collision.CanHitLine(Projectile.Center, Projectile.width, Projectile.height, targetVec, 0, 0)) { - Vector2 velocity = targetVec - Projectile.Center; - velocity.Normalize(); - velocity *= projSpeed; + Vector2 velocity = Utils.DirectionTo(Projectile.Center, targetVec) * projSpeed; Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, velocity, projType, Projectile.damage, Projectile.knockBack, Projectile.owner); Projectile.netUpdate = true; } @@ -245,7 +243,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/Cataclymini.cs b/Projectiles/Summon/Cataclymini.cs index dabd888069..b67690cdcc 100644 --- a/Projectiles/Summon/Cataclymini.cs +++ b/Projectiles/Summon/Cataclymini.cs @@ -239,7 +239,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, yStart, texture.Width, frameHeight)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2(texture.Width / 2f, frameHeight / 2f), Projectile.scale, SpriteEffects.None, 0); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/Catastromini.cs b/Projectiles/Summon/Catastromini.cs index 1766bdf8be..956f049214 100644 --- a/Projectiles/Summon/Catastromini.cs +++ b/Projectiles/Summon/Catastromini.cs @@ -35,6 +35,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.idStaticNPCHitCooldown = 8; Projectile.DamageType = DamageClass.Summon; } + public override bool MinionContactDamage() => Projectile.ai[0] == 2f; public override void AI() { diff --git a/Projectiles/Summon/CausticStaffSummon.cs b/Projectiles/Summon/CausticStaffSummon.cs index ca75b21aa9..501472f410 100644 --- a/Projectiles/Summon/CausticStaffSummon.cs +++ b/Projectiles/Summon/CausticStaffSummon.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -285,7 +286,5 @@ namespace CalamityMod.Projectiles.Summon } public override bool OnTileCollide(Vector2 oldVelocity) => false; - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/CelestialAxeMinion.cs b/Projectiles/Summon/CelestialAxeMinion.cs index 888c97d688..932f8ec4fb 100644 --- a/Projectiles/Summon/CelestialAxeMinion.cs +++ b/Projectiles/Summon/CelestialAxeMinion.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -75,6 +76,9 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, null, Projectile.GetAlpha(lightColor), Projectile.rotation, tex.Size() / 2f, Projectile.scale, SpriteEffects.None, 0); return false; } + + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 60); diff --git a/Projectiles/Summon/CinderBlossom.cs b/Projectiles/Summon/CinderBlossom.cs index d594e5ff50..d6125c9863 100644 --- a/Projectiles/Summon/CinderBlossom.cs +++ b/Projectiles/Summon/CinderBlossom.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -89,7 +90,5 @@ namespace CalamityMod.Projectiles.Summon DelayBetweenShooting++; } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/CorroslimeMinion.cs b/Projectiles/Summon/CorroslimeMinion.cs index 06d676e565..9fd7296ef8 100644 --- a/Projectiles/Summon/CorroslimeMinion.cs +++ b/Projectiles/Summon/CorroslimeMinion.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -80,6 +81,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/CosmicEnergySpiral.cs b/Projectiles/Summon/CosmicEnergySpiral.cs index bc06a90b67..14049b2ad4 100644 --- a/Projectiles/Summon/CosmicEnergySpiral.cs +++ b/Projectiles/Summon/CosmicEnergySpiral.cs @@ -221,7 +221,5 @@ namespace CalamityMod.Projectiles.Summon { return new Color(Main.DiscoR, Main.DiscoG, Main.DiscoB, 255); } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/CosmicViperSummon.cs b/Projectiles/Summon/CosmicViperSummon.cs index 747eb5e5c6..d99e8910ec 100644 --- a/Projectiles/Summon/CosmicViperSummon.cs +++ b/Projectiles/Summon/CosmicViperSummon.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 3; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 3; } public override void SetDefaults() @@ -307,8 +308,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/CosmilampMinion.cs b/Projectiles/Summon/CosmilampMinion.cs index a3f6adb628..1d7269474d 100644 --- a/Projectiles/Summon/CosmilampMinion.cs +++ b/Projectiles/Summon/CosmilampMinion.cs @@ -148,8 +148,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation, origin, Projectile.scale, direction, 0); return false; } - - // The lamps themselves do not do damage, but they do store damage for the sake of shooting projectiles. - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/CrimslimeMinion.cs b/Projectiles/Summon/CrimslimeMinion.cs index 2ce626218e..934db01829 100644 --- a/Projectiles/Summon/CrimslimeMinion.cs +++ b/Projectiles/Summon/CrimslimeMinion.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -80,6 +81,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Texture2D texture2D13 = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/DaedalusGolem.cs b/Projectiles/Summon/DaedalusGolem.cs index dfcfa3f201..5a47080b5d 100644 --- a/Projectiles/Summon/DaedalusGolem.cs +++ b/Projectiles/Summon/DaedalusGolem.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 18; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -297,7 +298,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 0; } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/DankCreeperMinion.cs b/Projectiles/Summon/DankCreeperMinion.cs index 98dadc21e2..4aedb83069 100644 --- a/Projectiles/Summon/DankCreeperMinion.cs +++ b/Projectiles/Summon/DankCreeperMinion.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -208,6 +209,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (Projectile.owner == Main.myPlayer) diff --git a/Projectiles/Summon/DazzlingStabber.cs b/Projectiles/Summon/DazzlingStabber.cs index 1cb53d08e3..4322dbb52a 100644 --- a/Projectiles/Summon/DazzlingStabber.cs +++ b/Projectiles/Summon/DazzlingStabber.cs @@ -303,7 +303,9 @@ namespace CalamityMod.Projectiles.Summon } public override void OnHitPlayer(Player target, Player.HurtInfo info) => target.AddBuff(ModContent.BuffType(), 180); - public override bool? CanDamage() => attackCooldown == 0 ? null : false; + + public override bool? CanDamage() => (attackCooldown == 0 ? base.CanDamage() : false); + public override bool PreDraw(ref Color lightColor) { Texture2D tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/DeathstareEyeball.cs b/Projectiles/Summon/DeathstareEyeball.cs index 6ef2b94958..9cdbf33a3e 100644 --- a/Projectiles/Summon/DeathstareEyeball.cs +++ b/Projectiles/Summon/DeathstareEyeball.cs @@ -24,6 +24,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.NeedsUUID[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; @@ -169,7 +170,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(pupilTexture, pupilDrawPosition, null, Projectile.GetAlpha(lightColor), PupilAngle, pupilTexture.Size() * 0.5f, PupilScale, SpriteEffects.None); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/DormantBrimseekerBab.cs b/Projectiles/Summon/DormantBrimseekerBab.cs index f26f66f14a..183b6108fc 100644 --- a/Projectiles/Summon/DormantBrimseekerBab.cs +++ b/Projectiles/Summon/DormantBrimseekerBab.cs @@ -26,12 +26,10 @@ namespace CalamityMod.Projectiles.Summon } public override void SetStaticDefaults() { - Main.projFrames[Type] = 8; - + Main.projPet[Type] = true; ProjectileID.Sets.TrailCacheLength[Type] = 7; ProjectileID.Sets.TrailingMode[Type] = 2; - ProjectileID.Sets.MinionSacrificable[Type] = true; } @@ -153,6 +151,9 @@ namespace CalamityMod.Projectiles.Summon } Lighting.AddLight(Projectile.Center, Color.Red.ToVector3()); } + + public override bool MinionContactDamage() => true; + public override void PostDraw(Color lightColor) { if ((Projectile.ai[0] > 0f && Projectile.ai[0] <= MaxChargeTime && Projectile.velocity.Length() >= 8f) || SeekingTarget) diff --git a/Projectiles/Summon/EXPLODINGFROG.cs b/Projectiles/Summon/EXPLODINGFROG.cs index a54e7caea0..dc5e5ecb1f 100644 --- a/Projectiles/Summon/EXPLODINGFROG.cs +++ b/Projectiles/Summon/EXPLODINGFROG.cs @@ -1,6 +1,10 @@ -using CalamityMod.Buffs.DamageOverTime; +using System; +using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.StatDebuffs; +using CalamityMod.Dusts; +using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -11,8 +15,8 @@ namespace CalamityMod.Projectiles.Summon public class EXPLODINGFROG : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public const float MinExplodeDistance = 120f; - public const float ExplodeWaitTime = 45f; + public const float MinExplodeDistance = 96f; + public const float ExplodeWaitTime = 120f; public const float ExplosionAngleVariance = 0.8f; public override void SetStaticDefaults() { @@ -35,6 +39,11 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { + if (Projectile.ai[1] == 0) + { + Projectile.ai[0] = 75; + Projectile.ai[1] = 1; + } if (Projectile.frameCounter++ > 5) { Projectile.frame++; @@ -46,39 +55,56 @@ namespace CalamityMod.Projectiles.Summon } Player player = Main.player[Projectile.owner]; bool canExplode = Projectile.Center.ClosestNPCAt(MinExplodeDistance) != null; - if (player.HasMinionAttackTargetNPC) + if (player.HasMinionAttackTargetNPC && !canExplode) { canExplode = Main.npc[player.MinionAttackTargetNPC].Distance(Projectile.Center) < MinExplodeDistance; } - if (canExplode) + if (Projectile.ai[0] < ExplodeWaitTime) Projectile.ai[0]++; if (Projectile.ai[0] >= ExplodeWaitTime) { - if (Main.myPlayer == Projectile.owner) + if (canExplode) { - // Goop projectiles - for (int i = 0; i < 3; i++) + if (Main.myPlayer == Projectile.owner) { + Vector2 rotOffset = -Vector2.UnitY; + if (player.HasMinionAttackTargetNPC && Main.npc[player.MinionAttackTargetNPC].Distance(Projectile.Center) < MinExplodeDistance + Math.Max(Main.npc[player.MinionAttackTargetNPC].width * 0.5f, Main.npc[player.MinionAttackTargetNPC].height * 0.5f)) + rotOffset = (Projectile.DirectionTo(Main.npc[player.MinionAttackTargetNPC].Center)); + else + { + var tar = Projectile.Center.ClosestNPCAt(MinExplodeDistance); + if (tar != null) + rotOffset = (Projectile.DirectionTo(tar.Center)); + } + // Goop projectiles + Vector2 direction = Vector2.Lerp(-Vector2.UnitY, rotOffset, 0.25f).SafeNormalize(-Vector2.UnitY); + for (int i = 0; i < 3; i++) + { + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + } Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, + (direction * Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), + ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, - new Vector2(0f, -Main.rand.NextFloat(6f, 10f)).RotatedByRandom(ExplosionAngleVariance), - ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + // WoF vomit sound. + SoundEngine.PlaySound(SoundID.NPCDeath13, Projectile.Center); + Projectile.ai[0] = 0; + + //do a little hop + if (Projectile.velocity.Length() < 0.1f) + Projectile.velocity.Y -= 5; } - // WoF vomit sound. - SoundEngine.PlaySound(SoundID.NPCDeath13, Projectile.Center); - Projectile.Kill(); } Projectile.velocity.Y += 0.5f; @@ -91,12 +117,55 @@ namespace CalamityMod.Projectiles.Summon public override bool? CanDamage() => false; // Don't die on tile collision - public override bool OnTileCollide(Vector2 oldVelocity) => false; + public override bool OnTileCollide(Vector2 oldVelocity) + { + Projectile.velocity *= 0.8f; + return false; + } public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) { fallThrough = false; return true; } + private static Texture2D GlowOutline = null; + public static Texture2D GetGlowOutline() + { + if (GlowOutline == null) + { + var texture = ModContent.Request("CalamityMod/Projectiles/Summon/EXPLODINGFROG").Value; + GlowOutline = new Texture2D(Main.graphics.GraphicsDevice, texture.Width, texture.Height); + + var BaseArray = new Color[GlowOutline.Width * GlowOutline.Height]; + var ColorArray = new Color[GlowOutline.Width * GlowOutline.Height]; + texture.GetData(BaseArray); + for (var i = 0; i < BaseArray.Length; i++) + { + ColorArray[i] = new Color(255, 255, 255) * (((float)BaseArray[i].A) / 255f); + } + GlowOutline.SetData(ColorArray); + } + return GlowOutline; + } + + public void ApplyGlowOutline(Texture2D tex, Rectangle? frame = null, float rotationOffset = 0, float borderPixels = 1, float opacity = 1) + { + Color color = Color.GreenYellow; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(2, 0) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width,frame.Value.Height) *0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(0, 2) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width, frame.Value.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(-2, 0) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width, frame.Value.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition + new Vector2(0, -2) * borderPixels, frame, color * opacity, Projectile.rotation - rotationOffset, new Vector2(frame.Value.Width, frame.Value.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + } + public override bool PreDraw(ref Color lightColor) + { + var tex = GetGlowOutline(); + var frame = tex.Frame(1, 5, 0, Projectile.frame); + ApplyGlowOutline(tex, frame, 0, MathF.Pow(Math.Clamp((Projectile.ai[0]-90)/(ExplodeWaitTime-90), 0, 1), 2),1); + + Lighting.AddLight(Projectile.Center, Color.GreenYellow.ToVector3()*(MathF.Pow(Math.Clamp((Projectile.ai[0] - 90) / (ExplodeWaitTime - 90), 0, 1), 2))); + tex = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Main.EntitySpriteDraw(tex, Projectile.Center - Main.screenPosition, frame, lightColor * Projectile.Opacity, Projectile.rotation, new Vector2(frame.Width, frame.Height) * 0.5f, Projectile.scale, (Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None), 0); + return false; + } } } diff --git a/Projectiles/Summon/EndoCooperBody.cs b/Projectiles/Summon/EndoCooperBody.cs index bab1116e24..487ec89ec1 100644 --- a/Projectiles/Summon/EndoCooperBody.cs +++ b/Projectiles/Summon/EndoCooperBody.cs @@ -351,12 +351,12 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition, frame, Color.LightSkyBlue, Projectile.rotation, Projectile.Size / 2, 1f, SpriteEffects.None, 0); } + public override bool MinionContactDamage() => AttackMode == 2; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { target.AddBuff(ModContent.BuffType(), 60); target.AddBuff(ModContent.BuffType(), 180); } - - public override bool? CanDamage() => AttackMode == 2; } } diff --git a/Projectiles/Summon/EndoHydraHead.cs b/Projectiles/Summon/EndoHydraHead.cs index cb231e8ac5..968be80d0a 100644 --- a/Projectiles/Summon/EndoHydraHead.cs +++ b/Projectiles/Summon/EndoHydraHead.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 5; + Main.projPet[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 0; ProjectileID.Sets.TrailCacheLength[Type] = 20; ProjectileID.Sets.MinionSacrificable[Type] = true; @@ -241,6 +242,5 @@ namespace CalamityMod.Projectiles.Summon 0); return false; } - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/EyeOfNightSummon.cs b/Projectiles/Summon/EyeOfNightSummon.cs index ffeccfa56a..d5e9b86981 100644 --- a/Projectiles/Summon/EyeOfNightSummon.cs +++ b/Projectiles/Summon/EyeOfNightSummon.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public const int ShootRate = 60; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -117,7 +118,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.velocity = (destination - Projectile.Center).SafeNormalize(Vector2.Zero) * flySpeed; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/FieryDraconid.cs b/Projectiles/Summon/FieryDraconid.cs index f93412f81f..995ee2a810 100644 --- a/Projectiles/Summon/FieryDraconid.cs +++ b/Projectiles/Summon/FieryDraconid.cs @@ -235,7 +235,7 @@ namespace CalamityMod.Projectiles.Summon modifiers.FinalDamage *= YharonsKindleStaff.ReboundRamDamageFactor; } - public override bool? CanDamage() => Projectile.localAI[0] > 1f; + public override bool MinionContactDamage() => Projectile.localAI[0] > 1f; public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Summon/FlarebatMinion.cs b/Projectiles/Summon/FlarebatMinion.cs index 66e1a5b87b..5231d03c3b 100644 --- a/Projectiles/Summon/FlarebatMinion.cs +++ b/Projectiles/Summon/FlarebatMinion.cs @@ -76,6 +76,14 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[0]++; } + // Teleport to the owner if abnormally far away + if (!Projectile.WithinRange(Owner.Center, 2000f)) + { + Projectile.position = Owner.Center; + Projectile.velocity *= 0.3f; + Projectile.netUpdate = true; + } + CurrentBehavior.Invoke(); Projectile.rotation = Projectile.rotation.AngleTowards(MathHelper.ToRadians(Projectile.velocity.X * 3f), 0.2f); Projectile.spriteDirection = MathF.Sign(Projectile.velocity.X); @@ -118,14 +126,14 @@ namespace CalamityMod.Projectiles.Summon // The first stage is redirecting towards the target. if (!AttackState.HasFlag(AttackBehaviorFlags.HasDashed) && Vector2.Dot(Projectile.DirectionTo(Target.Center), Projectile.velocity.SafeNormalize(-Vector2.UnitY)) < 0.96f) { - Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(Target.Center).ToRotation(), 0.08f).ToRotationVector2() * - Utils.Remap(Projectile.DistanceSQ(Target.Center), 6400f, 0f, 12f, 0f); + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(Target.Center).ToRotation(), 0.095f).ToRotationVector2() * + Utils.Remap(Projectile.DistanceSQ(Target.Center), 6400f, 0f, 14f, 0f); } // When it's whithin a distnce and it hasn't dashed yet, it'll dash. else if (!AttackState.HasFlag(AttackBehaviorFlags.HasDashed) && Projectile.DistanceSQ(Target.Center) < 57600f) { - Projectile.velocity = Projectile.DirectionTo(Target.Center) * 15f; + Projectile.velocity = Projectile.DirectionTo(Target.Center) * 19f; AttackState |= AttackBehaviorFlags.HasDashed; Projectile.netUpdate = true; @@ -162,8 +170,8 @@ namespace CalamityMod.Projectiles.Summon // When it has arrived to it at a distance, reset the state and start over. if (AttackState.HasFlag(AttackBehaviorFlags.IsReturningToOwner)) { - Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(IdlePosition).ToRotation(), 0.08f).ToRotationVector2() * - Utils.Remap(Projectile.DistanceSQ(IdlePosition), 6400f, 0f, 12f, 0f); + Projectile.velocity = Projectile.velocity.ToRotation().AngleTowards(Projectile.DirectionTo(IdlePosition).ToRotation(), 0.095f).ToRotationVector2() * + Utils.Remap(Projectile.DistanceSQ(IdlePosition), 6400f, 0f, 14f, 0f); if (Projectile.DistanceSQ(IdlePosition) < 6400f) { diff --git a/Projectiles/Summon/FleshBallMinion.cs b/Projectiles/Summon/FleshBallMinion.cs index 3125b8f324..4de9b04216 100644 --- a/Projectiles/Summon/FleshBallMinion.cs +++ b/Projectiles/Summon/FleshBallMinion.cs @@ -125,6 +125,8 @@ namespace CalamityMod.Projectiles.Summon #endregion + public override bool MinionContactDamage() => true; + public override void OnSpawn(IEntitySource source) => IFrames = 30; // Prevent immediate death on tile collision, and slow down on tile collision. diff --git a/Projectiles/Summon/FrostBlossom.cs b/Projectiles/Summon/FrostBlossom.cs index c430427aad..9174f55597 100644 --- a/Projectiles/Summon/FrostBlossom.cs +++ b/Projectiles/Summon/FrostBlossom.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -88,7 +89,5 @@ namespace CalamityMod.Projectiles.Summon } } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/GammaHead.cs b/Projectiles/Summon/GammaHead.cs index c769643882..a521a54858 100644 --- a/Projectiles/Summon/GammaHead.cs +++ b/Projectiles/Summon/GammaHead.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -264,7 +265,5 @@ namespace CalamityMod.Projectiles.Summon return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/GastricBelcher.cs b/Projectiles/Summon/GastricBelcher.cs index 12856293d4..c4523cdeee 100644 --- a/Projectiles/Summon/GastricBelcher.cs +++ b/Projectiles/Summon/GastricBelcher.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -162,7 +163,7 @@ namespace CalamityMod.Projectiles.Summon //If farther than 200 pixels, move toward it if (targetDist > 200f) { - float speedMult = (targetDist > 400f) ? 12f : (targetDist > 250) ? 6f : 3f; + float speedMult = (targetDist > 400f) ? 16f : (targetDist > 250) ? 9f : 5f; vecToTarget *= speedMult; Projectile.velocity = (Projectile.velocity * 40f + vecToTarget) / 41f; } @@ -242,7 +243,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.ai[1] += Main.rand.Next(1, 4); } //Set the minion to be ready for attack - if (Projectile.ai[1] > 90f) + if (Projectile.ai[1] > 100f) { Projectile.ai[1] = 0f; Projectile.netUpdate = true; @@ -264,25 +265,23 @@ namespace CalamityMod.Projectiles.Summon //Increment the attack counter Projectile.ai[1]++; - int projType = ModContent.ProjectileType(); - //Calculate the general velocity Vector2 velocity = targetVec - Projectile.Center; velocity.Normalize(); //Add some inaccuracy for the vomit projectiles - float vomitSpeedMult = 16f; + float vomitSpeedMult = 20f; Vector2 vomitVel = velocity * vomitSpeedMult; vomitVel.Y += Main.rand.NextFloat(-30f, 30f) * 0.05f; vomitVel.X += Main.rand.NextFloat(-30f, 30f) * 0.05f; //Fire the vomit projectile - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vomitVel, projType, Projectile.damage, Projectile.knockBack, Projectile.owner, Main.rand.Next(3), 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, vomitVel, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, Main.rand.Next(3), 0f); - //Fire 5 bubbles for every three attacks + //Fire 3 bubbles for every three attacks if (bubbleCounter++ % 3 == 2) { - for (int projCount = 0; projCount < 5; projCount++) + for (int projCount = 0; projCount < 3; projCount++) { //Add a shotgun spread to the bubbles float bubbleSpeedMult = 14f; @@ -298,9 +297,6 @@ namespace CalamityMod.Projectiles.Summon } } - //This minion does no contact damage - public override bool? CanDamage() => false; - public override bool PreDraw(ref Color lightColor) { Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; diff --git a/Projectiles/Summon/GastricBelcherVomit.cs b/Projectiles/Summon/GastricBelcherVomit.cs index f5c7e0265a..164a628baa 100644 --- a/Projectiles/Summon/GastricBelcherVomit.cs +++ b/Projectiles/Summon/GastricBelcherVomit.cs @@ -21,9 +21,9 @@ namespace CalamityMod.Projectiles.Summon Projectile.friendly = true; Projectile.width = Projectile.height = 18; Projectile.timeLeft = 300; - Projectile.penetrate = 3; - Projectile.usesIDStaticNPCImmunity = true; - Projectile.idStaticNPCHitCooldown = 10; + Projectile.penetrate = 2; + Projectile.usesLocalNPCImmunity = true; + Projectile.localNPCHitCooldown = 30; Projectile.DamageType = DamageClass.Summon; } diff --git a/Projectiles/Summon/GhostFire.cs b/Projectiles/Summon/GhostFire.cs index d4f5d8136a..5517dc5ad6 100644 --- a/Projectiles/Summon/GhostFire.cs +++ b/Projectiles/Summon/GhostFire.cs @@ -36,7 +36,10 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } public override bool? CanDamage() => ableToHit ? (bool?)null : false; - + public override bool? CanHitNPC(NPC target) + { + return target.CanBeChasedBy() ? null : false; + } public override void AI() { Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Summon/HauntedDishes.cs b/Projectiles/Summon/HauntedDishes.cs index c37e9eca65..ece47484a5 100644 --- a/Projectiles/Summon/HauntedDishes.cs +++ b/Projectiles/Summon/HauntedDishes.cs @@ -15,9 +15,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 19; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 19; } public override void SetDefaults() @@ -566,8 +567,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override bool TileCollideStyle(ref int width, ref int height, ref bool fallThrough, ref Vector2 hitboxCenterFrac) { fallThrough = false; diff --git a/Projectiles/Summon/HermitCrabMinion.cs b/Projectiles/Summon/HermitCrabMinion.cs index c40b5a5741..444d3c756a 100644 --- a/Projectiles/Summon/HermitCrabMinion.cs +++ b/Projectiles/Summon/HermitCrabMinion.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 9; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -359,6 +360,8 @@ namespace CalamityMod.Projectiles.Summon return true; } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/HerringAI.cs b/Projectiles/Summon/HerringAI.cs index 1c5e8e6087..54ae7836db 100644 --- a/Projectiles/Summon/HerringAI.cs +++ b/Projectiles/Summon/HerringAI.cs @@ -19,6 +19,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -94,6 +95,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override bool OnTileCollide(Vector2 oldVelocity) => false; } } diff --git a/Projectiles/Summon/IceSentry.cs b/Projectiles/Summon/IceSentry.cs index 204cf095bf..83cce4898f 100644 --- a/Projectiles/Summon/IceSentry.cs +++ b/Projectiles/Summon/IceSentry.cs @@ -93,12 +93,10 @@ namespace CalamityMod.Projectiles.Summon rememberTarget = Collision.CanHit(Projectile.Center, 0, 0, npc.position, npc.width, npc.height); if (rememberTarget && Projectile.owner == Main.myPlayer) { - Vector2 speed = npc.Center - Projectile.Center; - speed.Normalize(); - speed *= 8f; + Vector2 iceSpeed = CalamityUtils.CalculatePredictiveAimToTarget(Projectile.Center, npc, 12f * (Utils.GetLerpValue(0f, 1000f, Vector2.Distance(Projectile.Center, npc.Center)) + 1)); if (Projectile.ai[1] >= 300f) - speed = speed.RotatedBy(MathHelper.ToRadians(Main.rand.Next(-5, 6))) * 1.5f + npc.velocity / 2f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, speed + npc.velocity / 2f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + iceSpeed = iceSpeed.RotatedByRandom(MathHelper.Pi * 0.025f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, iceSpeed, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } } } @@ -132,7 +130,6 @@ namespace CalamityMod.Projectiles.Summon if (possibleTarget > 0) { - //Main.NewText("new target acquired"); Projectile.ai[0] = possibleTarget; Projectile.ai[1] = 0f; Projectile.netUpdate = true; diff --git a/Projectiles/Summon/IgneousBlade.cs b/Projectiles/Summon/IgneousBlade.cs index 4bff9cf79d..cb17cbe72a 100644 --- a/Projectiles/Summon/IgneousBlade.cs +++ b/Projectiles/Summon/IgneousBlade.cs @@ -1,107 +1,194 @@ -using System.IO; +using System; +using System.IO; using CalamityMod.Buffs.Summon; -using CalamityMod.CalPlayer; +using CalamityMod.Items.Weapons.Summon; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; +using Terraria.Graphics; +using Terraria.Graphics.Shaders; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon { + //Based off Virid Vanguard projectile code for circling and drawing logic public class IgneousBlade : ModProjectile, ILocalizedModType { public new string LocalizationCategory => "Projectiles.Summon"; - public bool Firing = false; + public enum AIState + { + CircleOwner, + TransitionToLaunch, + LaunchAtPos + } + + public int BladeIndex; + + public VertexStrip TrailDrawer; + + public Vector2 ChargeStartingPosition; + + public float BladeHoverOffsetAngle + { + get + { + float projectileCounts = Owner.ownedProjectileCounts[Type]; + if (projectileCounts <= 1f) + projectileCounts = 1f; + + return MathHelper.TwoPi * BladeIndex / projectileCounts + AITimer / 10f; + } + } + + public AIState CurrentState + { + get => (AIState)Projectile.ai[0]; + set => Projectile.ai[0] = (int)value; + } + + public Player Owner => Main.player[Projectile.owner]; + + public ref float AITimer => ref Projectile.ai[1]; + + public ref float BladeGleamInterpolant => ref Projectile.localAI[0]; + + public Vector2 ChargeTargetPos = Vector2.Zero; + public Vector2 ChargeStartPos = Vector2.Zero; + public override void SetStaticDefaults() { - ProjectileID.Sets.TrailingMode[Type] = 0; - ProjectileID.Sets.TrailCacheLength[Type] = 7; + ProjectileID.Sets.MinionSacrificable[Type] = true; + ProjectileID.Sets.TrailingMode[Type] = 2; + ProjectileID.Sets.TrailCacheLength[Type] = 45; } public override void SetDefaults() { - Projectile.width = 52; - Projectile.height = 86; + + Projectile.width = 84; + Projectile.height = 84; Projectile.netImportant = true; Projectile.friendly = true; Projectile.ignoreWater = true; - Projectile.minionSlots = 1f; - Projectile.timeLeft = 18000; + Projectile.timeLeft = 90000; Projectile.penetrate = -1; Projectile.usesLocalNPCImmunity = true; Projectile.localNPCHitCooldown = 7; Projectile.tileCollide = false; - Projectile.timeLeft *= 5; Projectile.minion = true; + Projectile.minionSlots = 1f; Projectile.DamageType = DamageClass.Summon; + Projectile.stopsDealingDamageAfterPenetrateHits = true; } + public override void SendExtraAI(BinaryWriter writer) { - writer.Write(Firing); + writer.Write(BladeIndex); + writer.WriteVector2(ChargeStartingPosition); } + public override void ReceiveExtraAI(BinaryReader reader) { - Firing = reader.ReadBoolean(); + BladeIndex = reader.ReadInt32(); + ChargeStartingPosition = reader.ReadVector2(); } + + public override void AI() { - Player player = Main.player[Projectile.owner]; - CalamityPlayer modPlayer = player.Calamity(); - bool isProperProjectile = Projectile.type == ModContent.ProjectileType(); - player.AddBuff(ModContent.BuffType(), 3600); - if (isProperProjectile) + // Decide whether the minion should still exist. + HandleMinionBools(); + + // Reset extra updates. + Projectile.MaxUpdates = 1; + + // Have the gleam interpolant dissipate. + BladeGleamInterpolant = MathHelper.Lerp(BladeGleamInterpolant, 0f, 0.1f); + if (BladeGleamInterpolant <= 0.02f) + BladeGleamInterpolant = 0f; + + NPC potentialTarget = Projectile.Center.MinionHoming(ViridVanguard.MaxTargetingDistance, Owner); + switch (CurrentState) { - if (player.dead) - { - modPlayer.igneousExaltation = false; - } - if (modPlayer.igneousExaltation) - { - Projectile.timeLeft = 2; - } + case AIState.CircleOwner: + CircleOwner(); + break; + case AIState.TransitionToLaunch: + ChargeTargetPos = Owner.Calamity().mouseWorld; + ChargeStartPos = Owner.Center; + CurrentState = AIState.LaunchAtPos; + AITimer = 0; + Projectile.penetrate = 50; + LaunchAtTargetPos(); + break; + case AIState.LaunchAtPos: + LaunchAtTargetPos(); + break; } - // Orbiting. 1 = Shooting - if (!Firing) + AITimer++; + } + + public void CircleOwner() + { + Vector2 hoverDestination = Owner.Center + BladeHoverOffsetAngle.ToRotationVector2() * (AITimer < 0 ? MathHelper.Lerp(200, 100, 1 - (-AITimer) / IgneousExaltation.ChargeCooldown) : 100f); + Projectile.Center = Vector2.Lerp(Projectile.Center, hoverDestination, 0.04f).MoveTowards(hoverDestination, 20f); + Projectile.velocity *= 0.8f; + + // Teleport to the owner if sufficiently far away. + if (!Projectile.WithinRange(Owner.Center, 3200f)) { - const float outwardPosition = 180f; - Projectile.Center = player.Center + Projectile.ai[0].ToRotationVector2() * outwardPosition + Vector2.UnitY * player.gfxOffY; - Projectile.rotation = Projectile.ai[0] + MathHelper.PiOver2 + MathHelper.PiOver4; - Projectile.ai[0] -= MathHelper.ToRadians(4f); + Projectile.Center = hoverDestination; + Projectile.netUpdate = true; } - else + + // Aim away from the target. + Projectile.rotation = Projectile.AngleFrom(Owner.Center) + MathHelper.PiOver2; + } + + public void LaunchAtTargetPos() + { + Projectile.damage = Projectile.originalDamage; + if (Projectile.penetrate > 40) //First 10 hits do 2x damage + Projectile.damage *= 2; + int chargeTime = IgneousExaltation.ChargeDuration * 2; + int chargeLength = 2000; + float circleWidth = Math.Min(75, Owner.ownedProjectileCounts[Type] * 4); + var CurrentPlace = Vector2.Lerp(ChargeStartPos, ChargeStartPos + ChargeStartPos.DirectionTo(ChargeTargetPos) * chargeLength, MathF.Pow(AITimer / chargeTime, 3)); + Projectile.Center = CurrentPlace + BladeHoverOffsetAngle.ToRotationVector2() * Math.Max(MathHelper.Lerp(100f, 25f, AITimer / 10f), circleWidth); + Projectile.rotation = Projectile.AngleFrom(CurrentPlace) + MathHelper.PiOver2; + if (AITimer >= chargeTime) { - if (Projectile.penetrate == -1) //limit penetration for worm memes - Projectile.penetrate = 3; - - Projectile.ai[0]--; - if (Projectile.ai[0] == 1) - Projectile.Kill(); - - if (Projectile.ai[0] % 10f == 9f) - { - for (int i = 0; i < 20; i++) - { - float angle = MathHelper.TwoPi / 20f * i; - Dust dust = Dust.NewDustPerfect(Projectile.position + angle.ToRotationVector2().RotatedBy(Projectile.rotation) * new Vector2(14f, 21f), 6); - dust.velocity = angle.ToRotationVector2().RotatedBy(Projectile.rotation) * 2f; - dust.noGravity = true; - } - } + Projectile.damage = Projectile.originalDamage; + AITimer = -IgneousExaltation.ChargeCooldown; + CurrentState = AIState.CircleOwner; + Projectile.penetrate = -1; } } + + public void HandleMinionBools() + { + Owner.AddBuff(ModContent.BuffType(), 3600); + if (Projectile.type == ModContent.ProjectileType()) + { + if (Owner.dead) + Owner.Calamity().igneousExaltation = false; + + if (Owner.Calamity().igneousExaltation) + Projectile.timeLeft = 2; + } + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - if (Firing) - { + if (Projectile.penetrate >= 40 && CurrentState != AIState.CircleOwner) //The first 10 hits per launch can spawn blades if (Main.myPlayer == Projectile.owner) { - Projectile.ai[0] = 50; - for (int i = 0; i < 3; i++) + for (int i = 0; i < 1; i++) { - Vector2 spawnPosition = target.Center - new Vector2(0f, 550f).RotatedByRandom(MathHelper.ToRadians(8f)); - Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, Vector2.Normalize(target.Center - spawnPosition) * 24f, ModContent.ProjectileType(), + Vector2 spawnPosition = Projectile.Center - new Vector2(0f, 550f).RotatedByRandom(MathHelper.TwoPi); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), spawnPosition, Vector2.Normalize(Projectile.Center - spawnPosition) * 24f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); } for (int i = 0; i < Main.rand.Next(28, 41); i++) @@ -113,44 +200,65 @@ namespace CalamityMod.Projectiles.Summon } Projectile.netUpdate = true; } - } + base.OnHitNPC(target, hit, damageDone); } - public override void OnKill(int timeLeft) + public Color TrailColorFunction(float completionRatio) { - for (int j = 0; j < 40; j++) - { - Dust dust = Dust.NewDustDirect(Projectile.position, Projectile.width, Projectile.height, DustID.Torch); - dust.velocity = Vector2.UnitY * Main.rand.NextFloat(3f, 5.5f) * Main.rand.NextBool().ToDirectionInt(); - dust.noGravity = true; - } + float opacity = (float)Math.Pow(Utils.GetLerpValue(1f, 0.45f, completionRatio, true), 4D) * Projectile.Opacity * 0.48f; + var redColor = new Color(166, 46, 61); + return Color.Lerp(redColor, new(64, 51, 66), MathHelper.Clamp(completionRatio * 1.4f, 0f, 1f)) * opacity; } + + public float TrailWidthFunction(float completionRatio) => Projectile.height * (1f - completionRatio) * 0.3f; + public override bool PreDraw(ref Color lightColor) { - if (Firing) + Texture2D texture = Terraria.GameContent.TextureAssets.Projectile[Type].Value; + Rectangle frame = texture.Frame(1, Main.projFrames[Type], 0, Projectile.frame); + Vector2 origin = frame.Size() * 0.5f; + Vector2 drawPosition = Projectile.Center - Main.screenPosition; + SpriteEffects direction = Projectile.spriteDirection == 1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; + + + // Draw the afterimage trail. + TrailDrawer ??= new(); + GameShaders.Misc["EmpressBlade"].UseImage0("Images/Extra_201"); + GameShaders.Misc["EmpressBlade"].UseImage1("Images/Extra_193"); + GameShaders.Misc["EmpressBlade"].UseShaderSpecificData(new Vector4(1f, 0f, 0f, 0.6f)); + GameShaders.Misc["EmpressBlade"].Apply(null); + TrailDrawer.PrepareStrip(Projectile.oldPos, Projectile.oldRot, TrailColorFunction, TrailWidthFunction, Projectile.Size * 0.5f - Main.screenPosition, Projectile.oldPos.Length, true); + TrailDrawer.DrawTrail(); + Main.pixelShader.CurrentTechnique.Passes[0].Apply(); + + // Draw the blade. + float outlineOpacity = 1; + float outlineWidth = 1; + if ((CurrentState == AIState.CircleOwner && AITimer < 0)) { - Texture2D texture = ModContent.Request("CalamityMod/Projectiles/Summon/IgneousBlade").Value; - - Rectangle rectangle = new Rectangle(0, 0, texture.Width, texture.Height); - - if (Lighting.NotRetro) - { - for (int i = 0; i < Projectile.oldPos.Length; i++) - { - Vector2 drawPos = Projectile.oldPos[i] + Projectile.Size / 2f - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY); - Color color = Color.Lerp(Color.White, Color.Red, i / (float)Projectile.oldPos.Length) * - ((Projectile.oldPos.Length - i) / (float)Projectile.oldPos.Length); - float scale = MathHelper.Lerp(Projectile.scale * 1.35f, Projectile.scale * 0.6f, i / (float)Projectile.oldPos.Length); - Main.EntitySpriteDraw(texture, drawPos, new Rectangle?(rectangle), color, - Projectile.rotation, - rectangle.Size() / 2f, scale, SpriteEffects.None, 0); - } - } - Main.EntitySpriteDraw(texture, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Rectangle?(rectangle), Color.White, - Projectile.rotation, - rectangle.Size() / 2f, 1.35f, SpriteEffects.None, 0); - return false; + outlineWidth = Math.Clamp(MathF.Pow(1 - (AITimer) / -IgneousExaltation.ChargeCooldown, 3), 0, 100); + outlineOpacity = 0.75f; } - return true; + var outlineTex = IgneousExaltation.GetBladeOutlineTex(); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(2, 0) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(0, 2) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(-2, 0) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(outlineTex, drawPosition + new Vector2(0, -2) * outlineWidth, frame, new Color(166, 46, 61) * outlineOpacity, Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + Main.EntitySpriteDraw(texture, drawPosition, frame, Projectile.GetAlpha(lightColor), Projectile.rotation - MathHelper.PiOver4, origin, Projectile.scale, direction, 0); + + // Draw the gleam at the tip of the blade. + Texture2D shineTex = ModContent.Request("CalamityMod/Particles/HalfStar").Value; + Vector2 shineScale = new Vector2(1.67f, 3f) * Projectile.scale; + shineScale *= MathHelper.Lerp(0.9f, 1.1f, (float)Math.Cos(Main.GlobalTimeWrappedHourly * 7.4f + Projectile.identity) * 0.5f + 0.5f); + + Vector2 lensFlareWorldPosition = Projectile.Center + (Projectile.rotation - MathHelper.PiOver2).ToRotationVector2() * Projectile.width * Projectile.scale * 0.88f; + Color lensFlareColor = Color.Lerp(Color.LimeGreen, Color.Yellow, 0.23f) with { A = 0 } * BladeGleamInterpolant; + Main.EntitySpriteDraw(shineTex, lensFlareWorldPosition - Main.screenPosition, null, lensFlareColor, 0f, shineTex.Size() * 0.5f, shineScale * 0.6f, 0, 0); + Main.EntitySpriteDraw(shineTex, lensFlareWorldPosition - Main.screenPosition, null, lensFlareColor, MathHelper.PiOver2, shineTex.Size() * 0.5f, shineScale, 0, 0); + + // Reset textures for shaders, since they're only defined once at load-time in vanilla. + GameShaders.Misc["EmpressBlade"].UseImage0("Images/Extra_209"); + GameShaders.Misc["EmpressBlade"].UseImage1("Images/Extra_210"); + return false; } } } diff --git a/Projectiles/Summon/IgneousBladeStrike.cs b/Projectiles/Summon/IgneousBladeStrike.cs index 6762bec590..56459f6c93 100644 --- a/Projectiles/Summon/IgneousBladeStrike.cs +++ b/Projectiles/Summon/IgneousBladeStrike.cs @@ -1,6 +1,10 @@ -using Microsoft.Xna.Framework; +using System; +using CalamityMod.Items.Weapons.Summon; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; +using Terraria.GameContent; using Terraria.ID; using Terraria.ModLoader; namespace CalamityMod.Projectiles.Summon @@ -18,8 +22,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetDefaults() { Projectile.friendly = true; - Projectile.width = 86; - Projectile.height = 36; + Projectile.width = 50; + Projectile.height = 50; Projectile.ignoreWater = true; Projectile.tileCollide = false; Projectile.usesLocalNPCImmunity = true; @@ -27,6 +31,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.timeLeft = 360; Projectile.alpha = 127; Projectile.DamageType = DamageClass.Summon; + Projectile.penetrate = 1; + Projectile.extraUpdates = 1; } public override void AI() @@ -44,5 +50,18 @@ namespace CalamityMod.Projectiles.Summon } SoundEngine.PlaySound(SoundID.Item14, Projectile.Center); } + + public override bool PreDraw(ref Color lightColor) + { + + var AllWhiteTexture = IgneousExaltation.GetBladeOutlineTex(); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(0,2) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size()*0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(2, 0) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(0, -2) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + Main.spriteBatch.Draw(AllWhiteTexture, Projectile.Center + new Vector2(-2, 0) - Main.screenPosition, null, new Color(166, 46, 61), Projectile.rotation, AllWhiteTexture.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + var tex = TextureAssets.Projectile[Type].Value; + Main.spriteBatch.Draw(tex, Projectile.Center - Main.screenPosition, null, lightColor, Projectile.rotation, tex.Size() * 0.5f, Projectile.scale * 1f, SpriteEffects.None, 1f); + return false; + } } } diff --git a/Projectiles/Summon/LiliesOfFinalityAriane.cs b/Projectiles/Summon/LiliesOfFinalityAriane.cs index 7139fe46db..ae5957be13 100644 --- a/Projectiles/Summon/LiliesOfFinalityAriane.cs +++ b/Projectiles/Summon/LiliesOfFinalityAriane.cs @@ -150,8 +150,6 @@ namespace CalamityMod.Projectiles.Summon return true; } - public override bool? CanDamage() => false; - #endregion #region AI diff --git a/Projectiles/Summon/LiliesOfFinalityElster.cs b/Projectiles/Summon/LiliesOfFinalityElster.cs index 3d52276011..5e67a36e07 100644 --- a/Projectiles/Summon/LiliesOfFinalityElster.cs +++ b/Projectiles/Summon/LiliesOfFinalityElster.cs @@ -146,8 +146,6 @@ namespace CalamityMod.Projectiles.Summon return true; } - public override bool? CanDamage() => false; - #endregion #region AI diff --git a/Projectiles/Summon/MidnightSunUFO.cs b/Projectiles/Summon/MidnightSunUFO.cs index c809587298..502494bb28 100644 --- a/Projectiles/Summon/MidnightSunUFO.cs +++ b/Projectiles/Summon/MidnightSunUFO.cs @@ -20,6 +20,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.TrailCacheLength[Type] = 4; ProjectileID.Sets.TrailingMode[Type] = 0; } @@ -39,8 +41,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.DamageType = DamageClass.Summon; } - public override bool? CanDamage() => false; - public override void AI() { Lighting.AddLight(Projectile.Center, Color.SkyBlue.ToVector3()); diff --git a/Projectiles/Summon/MiniSandShark.cs b/Projectiles/Summon/MiniSandShark.cs index fd1ef345c5..8bf960074c 100644 --- a/Projectiles/Summon/MiniSandShark.cs +++ b/Projectiles/Summon/MiniSandShark.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.Summon public override void OnKill(int timeLeft) // When the projectile hits an enemy, it'll make a dust impact effect. { SoundEngine.PlaySound(SoundID.Item14, Projectile.position); - for (int dustIndex = 0; dustIndex < 36; dustIndex++) + for (int dustIndex = 0; dustIndex < 18; dustIndex++) { Dust.NewDust(Projectile.Center, Projectile.width, diff --git a/Projectiles/Summon/PhantomGuy.cs b/Projectiles/Summon/PhantomGuy.cs index a86a9b90d6..90f0b0cbae 100644 --- a/Projectiles/Summon/PhantomGuy.cs +++ b/Projectiles/Summon/PhantomGuy.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -229,7 +230,5 @@ namespace CalamityMod.Projectiles.Summon { return new Color(100, 250, 250, Projectile.alpha); } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/PinkButterfly.cs b/Projectiles/Summon/PinkButterfly.cs index 62400663b8..46df273110 100644 --- a/Projectiles/Summon/PinkButterfly.cs +++ b/Projectiles/Summon/PinkButterfly.cs @@ -15,6 +15,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -245,7 +246,5 @@ namespace CalamityMod.Projectiles.Summon Main.EntitySpriteDraw(texture2D13, Projectile.Center - Main.screenPosition + new Vector2(0f, Projectile.gfxOffY), new Microsoft.Xna.Framework.Rectangle?(new Rectangle(0, y6, texture2D13.Width, framing)), Projectile.GetAlpha(lightColor), Projectile.rotation, new Vector2((float)texture2D13.Width / 2f, (float)framing / 2f), Projectile.scale, spriteEffects, 0); return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/PlaguebringerMK2.cs b/Projectiles/Summon/PlaguebringerMK2.cs index 45bb6d1396..01e795d795 100644 --- a/Projectiles/Summon/PlaguebringerMK2.cs +++ b/Projectiles/Summon/PlaguebringerMK2.cs @@ -14,7 +14,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; - ProjectileID.Sets.MinionTargettingFeature[Type] = true; + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; } public override void SetDefaults() @@ -128,7 +129,5 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 0; } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/PowerfulRaven.cs b/Projectiles/Summon/PowerfulRaven.cs index 379971a921..6efe8f8276 100644 --- a/Projectiles/Summon/PowerfulRaven.cs +++ b/Projectiles/Summon/PowerfulRaven.cs @@ -17,6 +17,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 5; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -148,5 +149,7 @@ namespace CalamityMod.Projectiles.Summon } Projectile.direction = Projectile.spriteDirection = (Projectile.velocity.X > 0).ToDirectionInt(); } + + public override bool MinionContactDamage() => true; } } diff --git a/Projectiles/Summon/PuffWarrior.cs b/Projectiles/Summon/PuffWarrior.cs index 91dc1aa0a2..887fc8d6bd 100644 --- a/Projectiles/Summon/PuffWarrior.cs +++ b/Projectiles/Summon/PuffWarrior.cs @@ -30,6 +30,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 10; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -199,6 +200,8 @@ namespace CalamityMod.Projectiles.Summon } } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (EnemyFailureCooldown > 0) diff --git a/Projectiles/Summon/PurpleButterfly.cs b/Projectiles/Summon/PurpleButterfly.cs index 790c60d81a..b7a03a55bc 100644 --- a/Projectiles/Summon/PurpleButterfly.cs +++ b/Projectiles/Summon/PurpleButterfly.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -87,6 +88,8 @@ namespace CalamityMod.Projectiles.Summon Projectile.ChargingMinionAI(1200f, 1500f, 2400f, 150f, 0, 25f, 20f, 9f, new Vector2(0f, -60f), 30f, 15f, true, true); } + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { SpriteEffects spriteEffects = Projectile.spriteDirection == -1 ? SpriteEffects.FlipHorizontally : SpriteEffects.None; diff --git a/Projectiles/Summon/SageNeedle.cs b/Projectiles/Summon/SageNeedle.cs index 0efecc2a3b..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/SageSpirit.cs b/Projectiles/Summon/SageSpirit.cs index c7925c58ac..c621a77e78 100644 --- a/Projectiles/Summon/SageSpirit.cs +++ b/Projectiles/Summon/SageSpirit.cs @@ -25,6 +25,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -191,8 +192,5 @@ namespace CalamityMod.Projectiles.Summon } } } - - // The spirit itself should not do direct damage. - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/SandnadoMinion.cs b/Projectiles/Summon/SandnadoMinion.cs index 4fcc69068f..d9f2fb1c4b 100644 --- a/Projectiles/Summon/SandnadoMinion.cs +++ b/Projectiles/Summon/SandnadoMinion.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 6; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -81,12 +82,12 @@ namespace CalamityMod.Projectiles.Summon { if (CheckForSpawning == false) { - int dustAmount = 75; - for (int dustIndex = 0; dustIndex < dustAmount; dustIndex++) + int dustAmount = 25; + for (int d = 0; d < dustAmount; d++) { - float angle = MathHelper.TwoPi / dustAmount * dustIndex; + float angle = MathHelper.TwoPi / dustAmount * d; Vector2 velocity = angle.ToRotationVector2() * Main.rand.NextFloat(5f, 6.5f); - Dust spawnDust = Dust.NewDustPerfect(Projectile.Center, 85, velocity); + Dust.NewDustPerfect(Projectile.Center, DustID.UnusedBrown, velocity); } CheckForSpawning = true; } @@ -165,8 +166,6 @@ namespace CalamityMod.Projectiles.Summon TimerForShooting++; } - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/SarosAura.cs b/Projectiles/Summon/SarosAura.cs index e626a5ea77..c9721af9e7 100644 --- a/Projectiles/Summon/SarosAura.cs +++ b/Projectiles/Summon/SarosAura.cs @@ -128,8 +128,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/SeashineSwordProj.cs b/Projectiles/Summon/SeashineSwordProj.cs index 61917656be..d8e21def52 100644 --- a/Projectiles/Summon/SeashineSwordProj.cs +++ b/Projectiles/Summon/SeashineSwordProj.cs @@ -316,6 +316,6 @@ namespace CalamityMod.Projectiles.Summon float _ = float.NaN; return Collision.CheckAABBvLineCollision(targetHitbox.TopLeft(), targetHitbox.Size(), Projectile.Center, tipPosition, 30 * Projectile.scale, ref _); } - public override bool? CanDamage() => (isAttacking && attackTimer > bladeValue && Projectile.ai[0] != 0) ? null : false; + public override bool? CanDamage() => isAttacking && attackTimer > bladeValue && Projectile.ai[0] != 0; } } diff --git a/Projectiles/Summon/SeekerSummonProj.cs b/Projectiles/Summon/SeekerSummonProj.cs index 19acb71cf0..c3dbaf6c1c 100644 --- a/Projectiles/Summon/SeekerSummonProj.cs +++ b/Projectiles/Summon/SeekerSummonProj.cs @@ -16,6 +16,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 5; + Main.projPet[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; } @@ -159,5 +160,7 @@ namespace CalamityMod.Projectiles.Summon else if (Projectile.velocity.Length() < 28f) Projectile.velocity = Projectile.SafeDirectionTo(target.Center) * 29f; } + + public override bool MinionContactDamage() => true; } } diff --git a/Projectiles/Summon/SepulcherMinion.cs b/Projectiles/Summon/SepulcherMinion.cs index 61ce1510ae..88a2cc9289 100644 --- a/Projectiles/Summon/SepulcherMinion.cs +++ b/Projectiles/Summon/SepulcherMinion.cs @@ -693,6 +693,8 @@ namespace CalamityMod.Projectiles.Summon #endregion + public override bool MinionContactDamage() => true; + public override bool? CanHitNPC(NPC target) { if (target.type == ModContent.NPCType()) diff --git a/Projectiles/Summon/Shellfish.cs b/Projectiles/Summon/Shellfish.cs index c49d18530f..be18d29396 100644 --- a/Projectiles/Summon/Shellfish.cs +++ b/Projectiles/Summon/Shellfish.cs @@ -424,7 +424,7 @@ namespace CalamityMod.Projectiles.Summon return null; } - public override bool? CanDamage() => Projectile.ai[0] == 0f; + public override bool MinionContactDamage() => Projectile.ai[0] == 0f; public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { diff --git a/Projectiles/Summon/SiriusMinion.cs b/Projectiles/Summon/SiriusMinion.cs index 8078ce92df..32bc089bd1 100644 --- a/Projectiles/Summon/SiriusMinion.cs +++ b/Projectiles/Summon/SiriusMinion.cs @@ -120,8 +120,6 @@ namespace CalamityMod.Projectiles.Summon public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/SkeletalDragonMother.cs b/Projectiles/Summon/SkeletalDragonMother.cs index 533f5934b4..1d93cc03e1 100644 --- a/Projectiles/Summon/SkeletalDragonMother.cs +++ b/Projectiles/Summon/SkeletalDragonMother.cs @@ -138,5 +138,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.frame = 0; } } + + public override bool MinionContactDamage() => true; } } diff --git a/Projectiles/Summon/SmallSkeletonMinion.cs b/Projectiles/Summon/SmallSkeletonMinion.cs index 2cc5640838..d5be045715 100644 --- a/Projectiles/Summon/SmallSkeletonMinion.cs +++ b/Projectiles/Summon/SmallSkeletonMinion.cs @@ -15,9 +15,10 @@ namespace CalamityMod.Projectiles.Summon public int Variant; public override void SetStaticDefaults() { + Main.projFrames[Type] = 7; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 7; } public override void SetDefaults() @@ -171,6 +172,9 @@ namespace CalamityMod.Projectiles.Summon } return true; } + + public override bool MinionContactDamage() => true; + public override bool PreDraw(ref Color lightColor) { Rectangle frame = new Rectangle(Variant * Projectile.width, Projectile.frame * Projectile.height, Projectile.width, Projectile.height); diff --git a/Projectiles/Summon/SolarGod.cs b/Projectiles/Summon/SolarGod.cs index 890f7bbf8c..47b224fc2b 100644 --- a/Projectiles/Summon/SolarGod.cs +++ b/Projectiles/Summon/SolarGod.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -128,7 +129,5 @@ namespace CalamityMod.Projectiles.Summon } public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/SolarPixie.cs b/Projectiles/Summon/SolarPixie.cs index 3ca4ff1c0f..b3c3595cc5 100644 --- a/Projectiles/Summon/SolarPixie.cs +++ b/Projectiles/Summon/SolarPixie.cs @@ -11,6 +11,7 @@ namespace CalamityMod.Projectiles.Summon public new string LocalizationCategory => "Projectiles.Summon"; public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -129,7 +130,5 @@ namespace CalamityMod.Projectiles.Summon } public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/StellarTorusSummon.cs b/Projectiles/Summon/StellarTorusSummon.cs index 0be79f013e..8a178d4edc 100644 --- a/Projectiles/Summon/StellarTorusSummon.cs +++ b/Projectiles/Summon/StellarTorusSummon.cs @@ -32,6 +32,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 4; + Main.projPet[Type] = true; ProjectileID.Sets.DrawScreenCheckFluff[Type] = 12000; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; @@ -272,7 +273,5 @@ namespace CalamityMod.Projectiles.Summon return false; } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/StormjawBaby.cs b/Projectiles/Summon/StormjawBaby.cs index dfa4c71d3b..5c67d408c2 100644 --- a/Projectiles/Summon/StormjawBaby.cs +++ b/Projectiles/Summon/StormjawBaby.cs @@ -18,9 +18,10 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projFrames[Type] = 10; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; - Main.projFrames[Type] = 10; } public override void SetDefaults() @@ -557,7 +558,5 @@ namespace CalamityMod.Projectiles.Summon Main.gore[index].velocity *= 0.1f; } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/TacticalPlagueJet.cs b/Projectiles/Summon/TacticalPlagueJet.cs index 0fad924ff2..854d66152b 100644 --- a/Projectiles/Summon/TacticalPlagueJet.cs +++ b/Projectiles/Summon/TacticalPlagueJet.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 3; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -59,8 +60,6 @@ namespace CalamityMod.Projectiles.Summon FalseGun.DamageType = DamageClass.Summon; } - public override bool? CanDamage() => false; - public override void AI() { Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Summon/TundraFlameBlossom.cs b/Projectiles/Summon/TundraFlameBlossom.cs index 8d7d4333ea..cfd486db17 100644 --- a/Projectiles/Summon/TundraFlameBlossom.cs +++ b/Projectiles/Summon/TundraFlameBlossom.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -109,8 +110,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.netUpdate = true; } - public override bool? CanDamage() => false; - #endregion } } diff --git a/Projectiles/Summon/Umbrella/MagicHat.cs b/Projectiles/Summon/Umbrella/MagicHat.cs index 367a495d61..c75ea5de51 100644 --- a/Projectiles/Summon/Umbrella/MagicHat.cs +++ b/Projectiles/Summon/Umbrella/MagicHat.cs @@ -116,9 +116,6 @@ namespace CalamityMod.Projectiles.Summon.Umbrella // Glowmask effect public override Color? GetAlpha(Color lightColor) => new Color(200, 200, 200, 200); - // No contact damage - public override bool? CanDamage() => false; - // Draw over players public override void DrawBehind(int index, List behindNPCsAndTiles, List behindNPCs, List behindProjectiles, List overPlayers, List overWiresUI) => overPlayers.Add(index); diff --git a/Projectiles/Summon/VileFeederSummon.cs b/Projectiles/Summon/VileFeederSummon.cs index d17ed5e292..5c57c0fb08 100644 --- a/Projectiles/Summon/VileFeederSummon.cs +++ b/Projectiles/Summon/VileFeederSummon.cs @@ -18,6 +18,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 3; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -146,25 +147,19 @@ namespace CalamityMod.Projectiles.Summon if (Projectile.owner == Main.myPlayer) { if (eaterCooldown > 0) - eaterCooldown -= Main.rand.Next(1, 3); + eaterCooldown--; if (eaterCooldown <= 0) { - int projNumber = Main.rand.Next(1, 3); - for (int index2 = 0; index2 < projNumber; index2++) - { - float xVector = (float)Main.rand.Next(-35, 36) * 0.02f; - float yVector = (float)Main.rand.Next(-35, 36) * 0.02f; - xVector *= 10f; - yVector *= 10f; - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, xVector, yVector, ModContent.ProjectileType(), (int)(Projectile.damage * 1.25f), Projectile.knockBack, Projectile.owner); - } - eaterCooldown = 80; + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Main.rand.NextVector2Circular(7f, 7f), ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner); + eaterCooldown = Projectile.localNPCHitCooldown; } } } } + public override bool MinionContactDamage() => true; + public override void ModifyHitNPC(NPC target, ref NPC.HitModifiers modifiers) { Player player = Main.player[Projectile.owner]; diff --git a/Projectiles/Summon/ViridVanguardBlade.cs b/Projectiles/Summon/ViridVanguardBlade.cs index d8180d7698..ce229a590f 100644 --- a/Projectiles/Summon/ViridVanguardBlade.cs +++ b/Projectiles/Summon/ViridVanguardBlade.cs @@ -57,6 +57,8 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; + ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; ProjectileID.Sets.TrailingMode[Type] = 2; ProjectileID.Sets.TrailCacheLength[Type] = 45; @@ -91,6 +93,8 @@ namespace CalamityMod.Projectiles.Summon ChargeStartingPosition = reader.ReadVector2(); } + public override bool MinionContactDamage() => true; + public override void AI() { // Decide whether the minion should still exist. diff --git a/Projectiles/Summon/VoidConcentrationAura.cs b/Projectiles/Summon/VoidConcentrationAura.cs index 91487ce95c..1d9f07ff49 100644 --- a/Projectiles/Summon/VoidConcentrationAura.cs +++ b/Projectiles/Summon/VoidConcentrationAura.cs @@ -91,5 +91,7 @@ namespace CalamityMod.Projectiles.Summon return; timer++; } + + public override bool MinionContactDamage() => true; } } diff --git a/Projectiles/Summon/WhiteDragonHead.cs b/Projectiles/Summon/WhiteDragonHead.cs index 421192a221..6a02f6f326 100644 --- a/Projectiles/Summon/WhiteDragonHead.cs +++ b/Projectiles/Summon/WhiteDragonHead.cs @@ -214,6 +214,8 @@ namespace CalamityMod.Projectiles.Summon return false; } + public override bool MinionContactDamage() => true; + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(BuffID.Frostburn2, 300); } } diff --git a/Projectiles/Summon/WitherBlossom.cs b/Projectiles/Summon/WitherBlossom.cs index 833562f02a..fdb893d419 100644 --- a/Projectiles/Summon/WitherBlossom.cs +++ b/Projectiles/Summon/WitherBlossom.cs @@ -20,6 +20,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { + Main.projPet[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -59,7 +60,5 @@ namespace CalamityMod.Projectiles.Summon } } } - - public override bool? CanDamage() => false; } } diff --git a/Projectiles/Summon/WulfrumDroid.cs b/Projectiles/Summon/WulfrumDroid.cs index cc8d4f7eee..eb1096612e 100644 --- a/Projectiles/Summon/WulfrumDroid.cs +++ b/Projectiles/Summon/WulfrumDroid.cs @@ -99,6 +99,7 @@ namespace CalamityMod.Projectiles.Summon public override void SetStaticDefaults() { Main.projFrames[Type] = 12; + Main.projPet[Type] = true; ProjectileID.Sets.MinionSacrificable[Type] = true; ProjectileID.Sets.MinionTargettingFeature[Type] = true; } @@ -118,6 +119,7 @@ namespace CalamityMod.Projectiles.Summon Projectile.minion = true; Projectile.DamageType = DamageClass.Summon; Initialized = 0f; + BuffModeBuffer = 15; } //Returns the npc if targetable, returns null if not @@ -164,15 +166,37 @@ namespace CalamityMod.Projectiles.Summon if (Owner.Calamity().mouseRight && Owner.HeldItem.type == ModContent.ItemType()) { - if (BuffModeBuffer > 0) + if (Owner.itemTime == Owner.itemTimeMax) + { + if (BuffModeBuffer == 15) + BuffModeBuffer--; + if (BuffModeBuffer == -15) + BuffModeBuffer++; + } + if (BuffModeBuffer < 15 && BuffModeBuffer >= 0) { BuffModeBuffer--; - Projectile.netUpdate = true; + if (BuffModeBuffer == 0) + BuffModeBuffer = -15; } + if (BuffModeBuffer > -15 && BuffModeBuffer <= 0) + { + BuffModeBuffer++; + if (BuffModeBuffer == 0) + BuffModeBuffer = 15; + } + Projectile.netUpdate = true; + } + + else if (BuffModeBuffer > 0 && BuffModeBuffer < 15) + { + BuffModeBuffer++; + } + else if (BuffModeBuffer < 0 && BuffModeBuffer > -15) + { + BuffModeBuffer--; } - else if (BuffModeBuffer < 15) - BuffModeBuffer = 15; bool buffMode = BuffModeBuffer <= 0; @@ -368,8 +392,7 @@ namespace CalamityMod.Projectiles.Summon { ShootTimer = ShootDelay; - // 1/3 chance to directly recharge the Rover Drive shield by 1 point - if (Main.rand.NextBool(3) && modPlayer.roverDrive && modPlayer.RoverDriveShieldDurability < RoverDrive.ShieldDurabilityMax) + if (modPlayer.roverDrive && modPlayer.RoverDriveShieldDurability < RoverDrive.ShieldDurabilityMax) { CalamityPlayer buffedCalPlayer = playerToBuff.Calamity(); buffedCalPlayer.RoverDriveShieldDurability++; @@ -508,8 +531,6 @@ namespace CalamityMod.Projectiles.Summon } } - public override bool? CanDamage() => false; - public override void SendExtraAI(BinaryWriter writer) { writer.Write(BuffModeBuffer); diff --git a/Projectiles/Turret/IceShot.cs b/Projectiles/Turret/IceShot.cs index bef1dc5cb2..8f970f9d8e 100644 --- a/Projectiles/Turret/IceShot.cs +++ b/Projectiles/Turret/IceShot.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Projectiles.Turret } public override void OnHitPlayer(Player target, Player.HurtInfo info) { - target.AddBuff(ModContent.BuffType(), 30); + target.AddBuff(BuffID.Frozen, 30); target.AddBuff(BuffID.Frostburn, 180); if (Projectile.hostile && Main.netMode == NetmodeID.MultiplayerClient) //hostile version pierces through players in multiplayer return; diff --git a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs index c4e2de0393..3082837b88 100644 --- a/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs +++ b/Projectiles/Typeless/BlazingStarThatDoesNotHeal.cs @@ -101,6 +101,8 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), 60 * 5); + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); } } diff --git a/Projectiles/Typeless/CryonicShield.cs b/Projectiles/Typeless/CryonicShield.cs index e3e6320565..78a369f2b2 100644 --- a/Projectiles/Typeless/CryonicShield.cs +++ b/Projectiles/Typeless/CryonicShield.cs @@ -83,10 +83,7 @@ namespace CalamityMod.Projectiles.Typeless Player player = Main.player[Projectile.owner]; CalamityPlayer modPlayer = player.Calamity(); if (!modPlayer.CryoStoneVanity) - { target.AddBuff(BuffID.Frostburn2, 180); - target.AddBuff(ModContent.BuffType(), 30); - } } public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => CalamityUtils.CircularHitboxCollision(Projectile.Center, Projectile.Size.Length() * 0.5f, targetHitbox); diff --git a/Projectiles/Typeless/FlameLickedBarrage.cs b/Projectiles/Typeless/FlameLickedBarrage.cs index f94d416372..0169f45ec6 100644 --- a/Projectiles/Typeless/FlameLickedBarrage.cs +++ b/Projectiles/Typeless/FlameLickedBarrage.cs @@ -57,7 +57,9 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 90); + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); } public override void OnHitPlayer(Player target, Player.HurtInfo info) diff --git a/Projectiles/Typeless/FlameLickedHellblast.cs b/Projectiles/Typeless/FlameLickedHellblast.cs index 944ca206b1..3e2e579ae4 100644 --- a/Projectiles/Typeless/FlameLickedHellblast.cs +++ b/Projectiles/Typeless/FlameLickedHellblast.cs @@ -89,7 +89,9 @@ namespace CalamityMod.Projectiles.Typeless public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - target.AddBuff(ModContent.BuffType(), 90); + //Doze - I gave all parry accessories long debuff infliction times due to the lack of weapons that inflict debuffs for a decent time, and the scarcity of using the parry + //Most common vanilla debuffs have a way to inflict them for 15, 20, or even 30 seconds + target.AddBuff(ModContent.BuffType(), CalamityUtils.SecondsToFrames(15)); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Typeless/FlashBolt.cs b/Projectiles/Typeless/FlashBolt.cs index 3f86de4862..dedd6b3d94 100644 --- a/Projectiles/Typeless/FlashBolt.cs +++ b/Projectiles/Typeless/FlashBolt.cs @@ -1,5 +1,9 @@ -using CalamityMod.Particles; +using System; +using CalamityMod.Dusts; +using CalamityMod.Particles; using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.Audio; using Terraria.ID; @@ -12,9 +16,16 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; public int time = 0; - public float colorValue = 0; - public float sizeMult = 1; + public int dir = 0; + bool setAltPlace = false; + public Vector2 altPlace; + public Player Owner => Main.player[Projectile.owner]; public bool invalidTarget => (Projectile.ai[0] < 0f || Projectile.ai[0] > 199f); + public bool simplify => Projectile.ai[1] > 0f; + public override void SetStaticDefaults() + { + ProjectileID.Sets.DrawScreenCheckFluff[Type] = 10000; + } public override void SetDefaults() { Projectile.width = 60; @@ -24,22 +35,20 @@ namespace CalamityMod.Projectiles.Typeless Projectile.ignoreWater = true; Projectile.DamageType = AverageDamageClass.Instance; Projectile.penetrate = 1; // Survives through its first hit by "cheating" and incrementing its own pierce counter - Projectile.extraUpdates = 75; - Projectile.timeLeft = 200; + Projectile.extraUpdates = 0; + Projectile.timeLeft = 2; } - public override void AI() { - Player Owner = Main.player[Projectile.owner]; + // If the target is dead, remove them as a target and hit anything + NPC target = (invalidTarget ? null : Main.npc[(int)Projectile.ai[0]]); + if (target == null || !target.active || target.life <= 0) + Projectile.ai[0] = -1; + // Visibility/Sound toggle on acc visibility bool visible = Owner.Calamity().arcFlashRingVisual; - colorValue = MathHelper.Lerp(colorValue, 50, 0.025f); - Color usedColor = Color.Lerp(Color.Cyan, Color.Orchid, Utils.GetLerpValue(0, 50, colorValue)); - - if (time == 0) + if (time == 0 && Projectile.ai[0] != -1 && !simplify) { - colorValue += Main.rand.Next(0, 20); - sizeMult = 1; if (visible) { SoundStyle fire = new("CalamityMod/Sounds/Item/ArcFlash"); @@ -47,71 +56,91 @@ namespace CalamityMod.Projectiles.Typeless } } - // If the target is dead, remove them as a target and hit anything - NPC target = (invalidTarget ? null : Main.npc[(int)Projectile.ai[0]]); - if (target == null || !target.active || target.life <= 0) - Projectile.ai[0] = -1; - - float targetDist = Vector2.Distance(Owner.Center, Projectile.Center); - - Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2; - if (targetDist < 1400f) - { - Vector2 pos = Projectile.Center - Projectile.velocity * 15; - if (Projectile.timeLeft % 4 == 0) - { - Particle spark2 = new BoltParticle(pos, -Projectile.velocity * 0.05f, false, 30, 0.6f * sizeMult, usedColor * (visible ? 1 : 0.25f), new Vector2(1.8f, 0.8f), true, true, false, 0.3f); - GeneralParticleHandler.SpawnParticle(spark2); - } - if (Main.rand.NextBool(35)) - { - Particle spark2 = new BoltParticle(pos, Projectile.velocity.RotatedByRandom(0.6f) * Main.rand.NextFloat(0.3f, 1.9f), false, 23, Main.rand.NextFloat(0.2f, 0.25f) * sizeMult, usedColor * (visible ? 1 : 0.3f), new Vector2(1.8f, 0.8f), true, true, false, 0.3f); - GeneralParticleHandler.SpawnParticle(spark2); - } - if (Main.rand.NextBool(10) && visible) - { - Particle spark2 = new CustomSpark(pos, Projectile.velocity * Main.rand.NextFloat(-0.4f, 0.4f), "CalamityMod/Particles/DrainLineBloom", false, 80, Main.rand.NextFloat(1.2f, 1.3f) * sizeMult, usedColor * (visible ? 1 : 0.3f), new Vector2(1, 4), true, true); - GeneralParticleHandler.SpawnParticle(spark2); - } - if (time % 5 == 0 && visible) - { - Dust dust = Dust.NewDustPerfect(pos, 278, new Vector2(5, 5).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(0.45f, 0.6f)); - dust.noGravity = true; - dust.color = usedColor; - } - } - if (Projectile.numHits > 0) - { - sizeMult *= 0.97f; - } time++; } + public override bool PreDraw(ref Color lightColor) + { + if (!setAltPlace) + { + NPC target = (invalidTarget ? null : Main.npc[(int)Projectile.ai[0]]); + if (target == null || !target.active || target.life <= 0) + Projectile.ai[0] = -1; + if (target != null && Projectile.ai[0] != -1) + { + float size = (Math.Min(target.width, target.height) * 0.35f) + 10; + altPlace = Projectile.Center + Main.rand.NextVector2Circular(size, size); + } + setAltPlace = true; + } + + if (simplify || !Owner.Calamity().arcFlashRingVisual) + return false; + + Texture2D tex = ModContent.Request("CalamityMod/Particles/BloomCircle").Value; + + if (dir == 0) + dir = Main.rand.NextBool() ? -1 : 1; + + int distance = (int)(600 + (altPlace.Y - Owner.Center.Y)); + int travelAmount = 10; + Vector2 currentPos = altPlace; + Vector2 lastPos = currentPos; + bool zap = false; // Swapping the direction of the bolt + Color drawColor = Color.White; + float lifeLerp = (Projectile.numHits == 0 ? 1 : (float)Math.Pow(Utils.GetLerpValue(-5, 15, Projectile.timeLeft, true), 3)); + int angleSwapTimer = 0; + int angleSwapMax = 7; + for (int i = 0; i < distance; i += travelAmount) + { + float angleLerp = Math.Min(Utils.GetLerpValue(angleSwapMax, 0, angleSwapTimer, true), Utils.GetLerpValue(0, angleSwapMax, angleSwapTimer, true)); + float endLerp = Utils.GetLerpValue(0, distance, i, true); + drawColor = Color.Lerp(Color.Cyan, Color.Orchid, endLerp); + Main.EntitySpriteDraw(tex, currentPos - Main.screenPosition, null, drawColor with { A = 0 }, lastPos.DirectionTo(currentPos).ToRotation() + MathHelper.PiOver2, new Vector2(tex.Width / 2, tex.Height / 2), new Vector2((2.5f - 1.5f * angleLerp) * lifeLerp * Math.Max(endLerp, 0.25f), 1 + 2f * angleLerp) * 0.2f, SpriteEffects.None); + lastPos = currentPos; + currentPos -= new Vector2(travelAmount * 1.5f * endLerp * dir * (zap ? -1 : 1) * lifeLerp, travelAmount); + angleSwapTimer++; + if (angleSwapTimer >= angleSwapMax) { zap = !zap; angleSwapTimer = 0; } + } + return false; + } public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { - // Stops the projectile from deleting itself, while maintaining the masquerade - Projectile.penetrate++; - - //colorValue = Main.rand.Next(0, 10); target.AddBuff(BuffID.Electrified, 180); - Projectile.timeLeft = 25; - Player Owner = Main.player[Projectile.owner]; - if (Owner.Calamity().arcFlashRingVisual && Projectile.numHits == 0) + if (!simplify) { - Vector2 pos = target.Center; - for (int i = 0; i < 10; i++) + // Stops the projectile from deleting itself, while maintaining the masquerade + Projectile.penetrate++; + + Projectile.timeLeft = 15; + if (Projectile.numHits == 0) { - Particle spark2 = new BoltParticle(pos, new Vector2(8, 8).RotatedByRandom(100) * Main.rand.NextFloat(0.3f, 1.9f), true, 13, Main.rand.NextFloat(0.2f, 0.3f) * sizeMult, Main.rand.NextBool(5) ? Color.Cyan : Color.Orchid, new Vector2(1.8f, 0.8f), true, true, false, 0.8f); - GeneralParticleHandler.SpawnParticle(spark2); - Dust dust = Dust.NewDustPerfect(pos, 278, new Vector2(14, 14).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(0.8f, 0.9f)); - dust.noGravity = false; - dust.color = Main.rand.NextBool(5) ? Color.Cyan : Color.Orchid; + if (!setAltPlace) + { + if (target != null && Projectile.ai[0] != -1) + { + float size = (Math.Min(target.width, target.height) * 0.35f) + 10; + altPlace = Projectile.Center + Main.rand.NextVector2Circular(size, size); + } + setAltPlace = true; + } + Vector2 pos = altPlace; + if (Owner.Calamity().arcFlashRingVisual) + { + for (int i = 0; i < 10; i++) + { + Dust dust = Dust.NewDustPerfect(pos, ModContent.DustType(), new Vector2(18, 18).RotatedByRandom(100) * Main.rand.NextFloat(0.5f, 1f), 0, default, Main.rand.NextFloat(1.3f, 1.5f) * 3); + dust.noGravity = true; + dust.color = Main.rand.NextBool(3) ? Color.Cyan : Color.Orchid; + dust.fadeIn = 7.5f; + } + Particle orb = new CustomPulse(pos, Vector2.Zero, Color.Orchid, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.68f, 0.5f, 14); + GeneralParticleHandler.SpawnParticle(orb); + Particle orb2 = new CustomPulse(pos, Vector2.Zero, Color.White * 0.8f, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.225f, 0.2f, 14); + GeneralParticleHandler.SpawnParticle(orb2); + } + Particle pulse2 = new CustomPulse(pos, Vector2.Zero, Color.Cyan * (Owner.Calamity().arcFlashRingVisual ? 1 : 0.6f), "CalamityMod/Particles/BloomRing", new Vector2(1, 1), 0, 0.3f, 0.95f, 10); + GeneralParticleHandler.SpawnParticle(pulse2); } - Particle pulse2 = new CustomPulse(pos, Vector2.Zero, Color.Orchid, "CalamityMod/Particles/HighResFoggyCircleHardEdge", new Vector2(1, 1), 0, 0f, 0.0715f, 10); - GeneralParticleHandler.SpawnParticle(pulse2); - Particle orb = new CustomPulse(pos, Vector2.Zero, Color.Orchid, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.78f, 0.5f, 14); - GeneralParticleHandler.SpawnParticle(orb); - Particle orb2 = new CustomPulse(pos, Vector2.Zero, Color.White, "CalamityMod/Particles/LargeBloom", new Vector2(1, 1), Main.rand.NextFloat(-10, 10), 0.325f, 0.2f, 14); - GeneralParticleHandler.SpawnParticle(orb2); } } public override bool? CanHitNPC(NPC target) @@ -120,7 +149,7 @@ namespace CalamityMod.Projectiles.Typeless return null; return false; } - public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.numHits > 0 ? false : CalamityUtils.CircularHitboxCollision(Projectile.Center, 60 * sizeMult, targetHitbox); + public override bool? Colliding(Rectangle projHitbox, Rectangle targetHitbox) => Projectile.numHits > 0 ? false : base.Colliding(projHitbox, targetHitbox); public override bool? CanCutTiles() => false; } } diff --git a/Projectiles/Typeless/FungalClumpMinion.cs b/Projectiles/Typeless/FungalClumpMinion.cs index 5094d26e31..977f810951 100644 --- a/Projectiles/Typeless/FungalClumpMinion.cs +++ b/Projectiles/Typeless/FungalClumpMinion.cs @@ -231,20 +231,7 @@ namespace CalamityMod.Projectiles.Typeless } } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if (Main.player[Projectile.owner].moonLeech) - return; - - int heal = (int)Math.Round(damageDone * 0.25); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange, BalancingConstants.LifeStealAccessoryCooldownMultiplier); - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), 1, 2f); public override bool OnTileCollide(Vector2 oldVelocity) => false; diff --git a/Projectiles/Typeless/HydrothermalSmoke.cs b/Projectiles/Typeless/HydrothermalSmoke.cs index 7d0236bda1..1fda4b4a77 100644 --- a/Projectiles/Typeless/HydrothermalSmoke.cs +++ b/Projectiles/Typeless/HydrothermalSmoke.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Particles; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +11,7 @@ namespace CalamityMod.Projectiles.Typeless public new string LocalizationCategory => "Projectiles.Typeless"; public override string Texture => "CalamityMod/Projectiles/InvisibleProj"; + public override void SetDefaults() { Projectile.width = 20; @@ -23,21 +25,13 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + if (Projectile.timeLeft == 6) Projectile.Center = Main.player[Projectile.owner].Center; - int randomDust = Main.rand.Next(4); - if (randomDust == 3) + if (Main.rand.NextBool(6)) { - randomDust = 16; - } - else - { - randomDust = 127; - } - if (Main.rand.NextBool(4)) - { - int fieryDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, randomDust, 0f, 0f, 100, default, 1f); + int fieryDust = Dust.NewDust(Projectile.position, Projectile.width, Projectile.height, DustID.Flare, 0f, 0f, 100, default, 0.7f); if (Main.rand.NextBool(4)) { Main.dust[fieryDust].scale *= 0.35f; @@ -45,11 +39,13 @@ namespace CalamityMod.Projectiles.Typeless Main.dust[fieryDust].velocity *= 0f; } - Vector2 goreVec = Projectile.position; - if (Main.rand.NextBool(8) && !Main.dedServ) + + if (Main.rand.NextBool(9) && !Main.dedServ) { - int smoke = Gore.NewGore(Projectile.GetSource_FromAI(), goreVec, default, Main.rand.Next(375, 378), 0.75f); - Main.gore[smoke].behindTiles = true; + float upwardVariation = Main.rand.NextFloat(-4.5f, -8f); + MediumMistParticle mist = new MediumMistParticle(Projectile.position, -Projectile.velocity + new Vector2(0.5f, upwardVariation), // This velocity makes it slowly float upward + Main.rand.NextBool(3) ? Color.LightSteelBlue : Color.SteelBlue, Color.LightSlateGray, Main.rand.NextFloat(0.4f, 0.65f), 130); + GeneralParticleHandler.SpawnParticle(mist); } } diff --git a/Projectiles/Typeless/JewelSpike.cs b/Projectiles/Typeless/JewelSpike.cs index a2de1dd804..aec3719911 100644 --- a/Projectiles/Typeless/JewelSpike.cs +++ b/Projectiles/Typeless/JewelSpike.cs @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Typeless { if (Projectile.owner == Main.myPlayer) { - for (int index = 0; index < 3; ++index) + for (int index = 0; index < 2; ++index) { float SpeedX = -Projectile.velocity.X * Main.rand.NextFloat(0.4f, 0.7f) + Main.rand.NextFloat(-8f, 8f); float SpeedY = -Projectile.velocity.Y * Main.rand.NextFloat(0.4f, 0.7f) + Main.rand.NextFloat(-8f, 8f); diff --git a/Projectiles/Typeless/MagnusBeam.cs b/Projectiles/Typeless/MagnusBeam.cs index 3cb564ae69..627f636a66 100644 --- a/Projectiles/Typeless/MagnusBeam.cs +++ b/Projectiles/Typeless/MagnusBeam.cs @@ -117,15 +117,7 @@ namespace CalamityMod.Projectiles.Typeless Player player = Main.player[Projectile.owner]; player.statMana += 25; player.ManaEffect(25); - - int heal = (int)Math.Round(hit.Damage * 0.1); - if (heal > BalancingConstants.LifeStealCap) - heal = BalancingConstants.LifeStealCap; - - if (Main.LocalPlayer.lifeSteal <= 0f || heal <= 0 || target.lifeMax <= 5) - return; - - CalamityGlobalProjectile.SpawnLifeStealProjectile(Projectile, Main.player[Projectile.owner], heal, ModContent.ProjectileType(), BalancingConstants.LifeStealRange); + Main.player[Projectile.owner].SpawnLifeStealProjectile(target, Projectile, ModContent.ProjectileType(), (int)Math.Round(hit.Damage * 0.1), 0.75f); } public override void OnKill(int timeLeft) diff --git a/Projectiles/Typeless/OmegaBlueTentacle.cs b/Projectiles/Typeless/OmegaBlueTentacle.cs index 6a575b5809..2d922d6811 100644 --- a/Projectiles/Typeless/OmegaBlueTentacle.cs +++ b/Projectiles/Typeless/OmegaBlueTentacle.cs @@ -175,24 +175,7 @@ namespace CalamityMod.Projectiles.Typeless modifiers.SetCrit(); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) - { - if (Projectile.owner == Main.myPlayer && Owner.lifeSteal > 0f && !Owner.moonLeech && target.lifeMax > 5) - { - int healAmount = 10 * damageDone / Projectile.damage; //should always be around max, less if enemy has defense/DR - if (healAmount > BalancingConstants.LifeStealCap) - healAmount = BalancingConstants.LifeStealCap; - - if (healAmount > 0) - { - Owner.lifeSteal -= healAmount; - if (Owner.Calamity().omegaBlueAbyssalMadness) // Always crits during Abyssal Madness, this makes it have same lifesteal delay - Owner.lifeSteal += healAmount / 2; - - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ProjectileID.SpiritHeal, 0, 0f, Projectile.owner, Projectile.owner, healAmount); - } - } - } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => Owner.DoLifestealDirect(target, 10 * hit.Damage / Projectile.damage, 0.5f); public override bool PreDraw(ref Color lightColor) { diff --git a/Projectiles/Typeless/SandCloakVeil.cs b/Projectiles/Typeless/SandCloakVeil.cs index f31fb59353..53efb8d979 100644 --- a/Projectiles/Typeless/SandCloakVeil.cs +++ b/Projectiles/Typeless/SandCloakVeil.cs @@ -39,7 +39,7 @@ namespace CalamityMod.Projectiles.Typeless if (posDiff.Length() <= Radius) { BuffedPlayer.Calamity().getSandCloakAccelBoost = true; - BuffedPlayer.statDefense += 10; + BuffedPlayer.statDefense += SandCloak.SandVeilDefenseBoost; } else BuffedPlayer.Calamity().getSandCloakAccelBoost = false; diff --git a/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs index 616ca734da..03f8a7927e 100644 --- a/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs +++ b/Projectiles/Typeless/WulfrumDiggingTurtleProjectile.cs @@ -49,7 +49,7 @@ namespace CalamityMod.Projectiles.Typeless public static int Lifetime = 400; public static int DigTime = 350; public static float DigSpeed = 1.5f; - public static int MaxPickPower = 160; + public static int MaxPickPower = 1000; public static float ClearSpaceDiagonal = 50; public override void SetDefaults() diff --git a/Projectiles/Typeless/WulfrumHook.cs b/Projectiles/Typeless/WulfrumHook.cs index 448039accf..325ba40a75 100644 --- a/Projectiles/Typeless/WulfrumHook.cs +++ b/Projectiles/Typeless/WulfrumHook.cs @@ -154,7 +154,7 @@ namespace CalamityMod.Projectiles.Typeless Tile tile = Main.tile[tilePos]; - if (!tile.HasUnactuatedTile || !tile.CanTileBeLatchedOnTo(EquippedHook == ItemID.SquirrelHook) || Owner.IsBlacklistedForGrappling(tilePos)) + if (!tile.HasUnactuatedTile || !tile.CanTileBeLatchedOnTo(EquippedHook == ItemID.SquirrelHook && Projectile.Distance(Owner.Center) > 96) || Owner.IsBlacklistedForGrappling(tilePos)) continue; if (Main.myPlayer != Owner.whoAmI) continue; @@ -172,9 +172,15 @@ namespace CalamityMod.Projectiles.Typeless public void OnGrapple(Vector2 grapplePos, int x, int y) { WulfrumPackPlayer mp = Owner.GetModPlayer(); - //Clear previous grapple - if (mp.Grapple > -1 && Main.projectile[mp.Grapple].active && Main.projectile[mp.Grapple].ModProjectile is WulfrumHook hook && hook.State == WulfrumHook.HookState.Grappling) - Main.projectile[mp.Grapple].Kill(); + //Clear all grapples + Owner.ClearGrapplingBlacklist(); + Owner.grappling[0] = -1; + Owner.grapCount = 0; + for (int i = 0; i < 1000; i++) + { + if (Main.projectile[i].active && Main.projectile[i].owner == Owner.whoAmI && Main.projectile[i].aiStyle == 7 && !(Main.projectile[i].whoAmI == Projectile.whoAmI)) + Main.projectile[i].Kill(); + } //Hook onto the tile Projectile.velocity = Vector2.Zero; @@ -190,7 +196,6 @@ namespace CalamityMod.Projectiles.Typeless { Owner.grappling[Owner.grapCount] = Projectile.whoAmI; Owner.grapCount++; - //Owner.velocity = Vector2.Zero; } if (EquippedHook == ItemID.QueenSlimeHook) Owner.DoQueenSlimeHookTeleport(grapplePos + new Vector2(-(Owner.Center - Projectile.Center).Length() * 0.75f, 0).RotatedBy(Projectile.DirectionTo(Owner.Center).ToRotation())); diff --git a/Projectiles/Typeless/XykWings.cs b/Projectiles/Typeless/XykWings.cs index 222fc845b6..a602acf9bd 100644 --- a/Projectiles/Typeless/XykWings.cs +++ b/Projectiles/Typeless/XykWings.cs @@ -26,7 +26,7 @@ namespace CalamityMod.Projectiles.Typeless public float backWingRot = 0; public int lastDir = 0; public float spawnFade = 0; - public float spawnFadePow => (Projectile.ai[1] == 5 ? 1 - (float)Math.Pow(spawnFade, 4) : (float)Math.Pow(spawnFade, 4)); + public float spawnFadePow => (Projectile.ai[1] == 5 ? (float)Math.Pow(spawnFade, 1) : (float)Math.Pow(spawnFade, 4)); public int deathFadeTimer = 0; public bool iAmTopWing = false; @@ -52,6 +52,9 @@ namespace CalamityMod.Projectiles.Typeless public override void AI() { + if (!BreakApart) + lastDir = Owner.direction; + float intendedScale = 0.85f; float spawnAnimTime = 12 + wingNum; if (time == 0) @@ -157,7 +160,7 @@ namespace CalamityMod.Projectiles.Typeless deathFadeTimer++; int fadeTime = (BreakApart ? 90 : 20); - spawnFade = Utils.GetLerpValue(0, fadeTime, deathFadeTimer, true); + spawnFade = Utils.GetLerpValue(fadeTime, 0, deathFadeTimer, true); Projectile.scale = intendedScale * spawnFadePow; if (deathFadeTimer >= fadeTime) { @@ -166,107 +169,106 @@ namespace CalamityMod.Projectiles.Typeless } return; } - - bool isFlying = Owner.controlJump; - bool isFalling = Owner.controlDown && !isFlying && Owner.velocity.Y > 0; - bool isUpBoosting = Owner.wingTime > 0 && Owner.controlJump && Owner.controlUp; - bool isHovering = Owner.wingTime > 0 && Owner.controlDown && Owner.controlJump && !isUpBoosting; - if (isFalling || timeFalling < 0) - timeFalling++; - else if (timeFalling > 0) - timeFalling -= 2; - float fallingLerp = (float)Math.Pow(Utils.GetLerpValue(0, 60, timeFalling, true), 3); - float topWingNum = (checkActiveWings() - 1); - - float sine = (float)Math.Sin((time * 0.35f * (isFalling ? 3 : (isHovering || isUpBoosting) ? 3.2f : isFlying ? 2f : 1) + wingNum * ((isHovering || isUpBoosting) ? 3f : 2f)) / MathHelper.Pi); - - if (Owner.dashDelay == -1 || isUpBoosting || isHovering || Owner.Calamity().adrenalineModeActive || Owner.Calamity().rageModeActive || isFalling && Owner.velocity.Y > 16) - { - dashfx = MathHelper.Lerp(dashfx, 1, 0.25f); - float bonusScale = 1; - if (Owner.Calamity().rageModeActive) - bonusScale += 0.25f; - if (Owner.Calamity().adrenalineModeActive) - bonusScale += 0.5f; - if (Projectile.scale < bonusScale) - Projectile.scale = bonusScale; - } else { - dashfx = MathHelper.Lerp(dashfx, 0, 0.03f); - if (dashfx > 0) - dashfx -= 0.01f; - else - dashfx = 0; - } + bool isFlying = Owner.controlJump; + bool isFalling = Owner.controlDown && !isFlying && Owner.velocity.Y > 0; + bool isUpBoosting = Owner.wingTime > 0 && Owner.controlJump && Owner.controlUp; + bool isHovering = Owner.wingTime > 0 && Owner.controlDown && Owner.controlJump && !isUpBoosting; + if (isFalling || timeFalling < 0) + timeFalling++; + else if (timeFalling > 0) + timeFalling -= 3; + float fallingLerp = (float)Math.Pow(Utils.GetLerpValue(0, 40, timeFalling, true), 3); + float topWingNum = (checkActiveWings() - 1); - float flapSpeed = MathHelper.Lerp(0.06f * (isHovering ? 2.5f : isFlying ? 2f : 1), 0.55f * (isHovering ? 2.5f : isFlying ? 2f : 1), (float)Math.Pow(Utils.GetLerpValue(-1, 1, sine), 3)); + float sine = (float)Math.Sin((time * 0.35f * (isFalling ? 3 : (isHovering || isUpBoosting) ? 3.2f : isFlying ? 2f : 1) + wingNum * ((isHovering || isUpBoosting) ? 3f : 2f)) / MathHelper.Pi); - wingFlapHeight = MathHelper.Lerp(wingFlapHeight, sine, flapSpeed) * spawnFadePow; - - for (int i = -1; i <= 1; i += 2) - { - float dir = i * lastDir; - Vector2 flightMovement = Vector2.UnitY.RotatedBy(isFalling ? MathHelper.ToRadians(13) * dir * fallingLerp : 0) * (-15 * Projectile.scale + 10 * (isFalling ? 0.35f : isUpBoosting ? 5f : isHovering ? 1.5f : isFlying ? 2.5f : 1) * wingFlapHeight) * ((Owner.velocity.Y == 0) ? 0 : 1); - float wingPartDist = (1.6f / (checkActiveWings() + 1)) * wingNum * (isFalling ? 1 - 0.3f * fallingLerp : isHovering ? 0.5f : 1); - Vector2 destination = (playerCenterPoint - (Vector2.UnitX.RotatedBy(isFalling ? MathHelper.ToRadians(13) * dir * fallingLerp : 0) * (22 + 7 * wingFlapHeight * (i == -1 ? 0.5f : 1)) * Projectile.scale).RotatedBy((-0.8f + (isFalling ? 0.7f * fallingLerp : 0) + wingPartDist + (wingNum == topWingNum ? 0.1f : wingNum == 0 ? -0.1f : 0)) * dir) * dir + (Vector2.One * (isFlying ? 0 : 1)).RotatedBy((time * 0.12f + wingNum * 0.9f) * dir)) + flightMovement; - - float lerpSpeed = (1 + wingNum * (0.1f + 0.15f * fallingLerp)); - float spawnDistance = 150; - if (i == 1) - expectedWingPosition1 += ((destination + destination.DirectionFrom(playerCenterPoint) * Math.Max(1, spawnDistance * (1 - spawnFadePow))) - expectedWingPosition1) / lerpSpeed; - else - expectedWingPosition2 += ((destination + (Vector2.UnitX * -6f * lastDir) + destination.DirectionFrom(playerCenterPoint) * Math.Max(1, spawnDistance * (1 - spawnFadePow))) - expectedWingPosition2) / lerpSpeed; - } - Projectile.Center = Owner.Center; - - Projectile.rotation = expectedWingPosition1.DirectionFrom(playerCenterPoint).ToRotation() - MathHelper.PiOver2; - backWingRot = expectedWingPosition2.DirectionFrom(playerCenterPoint).ToRotation() - MathHelper.PiOver2; - - if (wingNum == 0) - Lighting.AddLight(Owner.Center, Color.Lerp(drawColor, Color.White, 0.5f).ToVector3() * 1.1f * spawnFadePow); - - if (dashfx > 0.3f && (wingNum == checkActiveWings() - 1 || wingNum == 0)) - { - for (int i = -2; i <= 2; i += 1) + if (Owner.dashDelay == -1 || isUpBoosting || isHovering || Owner.Calamity().adrenalineModeActive || Owner.Calamity().rageModeActive || isFalling && Owner.velocity.Y > 16) { - if (i == 0) - i++; - - bool front = i > 0; - Vector2 pos1 = expectedWingPosition1 + (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * (45 + 5 * wingNum) * (Projectile.scale + 0.15f); - Vector2 pos2 = expectedWingPosition2 + (backWingRot + MathHelper.PiOver2).ToRotationVector2() * (15 + 3 * wingNum) * (Projectile.scale + 0.15f); - - if (Owner.Calamity().XykVisualsBlue) - { - bool circle = Main.rand.NextBool(3); - Dust dust = Dust.NewDustPerfect(front ? pos1 : pos2, circle ? ModContent.DustType() : ModContent.DustType(), Owner.velocity.RotatedByRandom(circle ? 0.5f : 0) * Main.rand.NextFloat(-0.5f, -0.2f) * dashfx); - dust.scale = Main.rand.NextFloat(1.3f, 1.4f) * (front ? 1 : 0.6f) * dashfx * (circle ? 0.6f : 1f) * (float)Math.Pow(Projectile.scale, 0.4f); - dust.noGravity = true; - dust.color = drawColor; - dust.noLightEmittence = true; - dust.fadeIn = 1.5f * (circle ? 0 : 1f); - } + dashfx = MathHelper.Lerp(dashfx, 1, 0.25f); + float bonusScale = 1; + if (Owner.Calamity().rageModeActive) + bonusScale += 0.25f; + if (Owner.Calamity().adrenalineModeActive) + bonusScale += 0.5f; + if (Projectile.scale < bonusScale) + Projectile.scale = bonusScale; + } + else + { + dashfx = MathHelper.Lerp(dashfx, 0, 0.03f); + if (dashfx > 0) + dashfx -= 0.01f; else + dashfx = 0; + } + + float flapSpeed = MathHelper.Lerp(0.06f * (isHovering ? 2.5f : isFlying ? 2f : 1), 0.55f * (isHovering ? 2.5f : isFlying ? 2f : 1), (float)Math.Pow(Utils.GetLerpValue(-1, 1, sine), 3)); + + wingFlapHeight = MathHelper.Lerp(wingFlapHeight, sine, flapSpeed) * spawnFadePow; + + for (int i = -1; i <= 1; i += 2) + { + float dir = i * lastDir; + Vector2 flightMovement = Vector2.UnitY.RotatedBy(isFalling ? MathHelper.ToRadians(13) * dir * fallingLerp : 0) * (-15 * Projectile.scale + 10 * (isFalling ? 0.35f : isUpBoosting ? 5f : isHovering ? 1.5f : isFlying ? 2.5f : 1) * wingFlapHeight) * ((Owner.velocity.Y == 0) ? 0 : 1); + float wingPartDist = (1.6f / (checkActiveWings() + 1)) * wingNum * (isFalling ? 1 - 0.3f * fallingLerp : isHovering ? 0.5f : 1); + Vector2 destination = (playerCenterPoint - (Vector2.UnitX.RotatedBy(isFalling ? MathHelper.ToRadians(13) * dir * fallingLerp : 0) * (22 + 7 * wingFlapHeight * (i == -1 ? 0.5f : 1)) * Projectile.scale).RotatedBy((-0.8f + (isFalling ? 0.7f * fallingLerp : 0) + wingPartDist + (wingNum == topWingNum ? 0.1f : wingNum == 0 ? -0.1f : 0)) * dir) * dir + (Vector2.One * (isFlying ? 0 : 1)).RotatedBy((time * 0.12f + wingNum * 0.9f) * dir)) + flightMovement; + + float lerpSpeed = (1 + wingNum * (0.1f + 0.15f * fallingLerp) / (Owner.moveSpeed * 0.3f + 1)); + float spawnDistance = 150; + if (i == 1) + expectedWingPosition1 += ((destination + destination.DirectionFrom(playerCenterPoint) * Math.Max(1, spawnDistance * (1 - spawnFadePow))) - expectedWingPosition1) / lerpSpeed; + else + expectedWingPosition2 += ((destination + (Vector2.UnitX * -6f * lastDir) + destination.DirectionFrom(playerCenterPoint) * Math.Max(1, spawnDistance * (1 - spawnFadePow))) - expectedWingPosition2) / lerpSpeed; + } + Projectile.Center = Owner.Center; + + Projectile.rotation = expectedWingPosition1.DirectionFrom(playerCenterPoint).ToRotation() - MathHelper.PiOver2; + backWingRot = expectedWingPosition2.DirectionFrom(playerCenterPoint).ToRotation() - MathHelper.PiOver2; + + if (wingNum == 0) + Lighting.AddLight(Owner.Center, Color.Lerp(drawColor, Color.White, 0.5f).ToVector3() * 1.1f * spawnFadePow); + + if (dashfx > 0.3f && (wingNum == checkActiveWings() - 1 || wingNum == 0)) + { + for (int i = -2; i <= 2; i += 1) { - bool square = Main.rand.NextBool(3); - Dust dust = Dust.NewDustPerfect(front ? pos1 : pos2, square ? ModContent.DustType() : ModContent.DustType(), Owner.velocity.RotatedByRandom(0.25f) * Main.rand.NextFloat(-0.5f, -0.2f) * dashfx); - dust.scale = Main.rand.NextFloat(0.8f, 1f) * (front ? 1 : 0.6f) * dashfx * (square ? 1 : 1.5f) * (float)Math.Pow(Projectile.scale, 0.4f); - dust.noGravity = true; - dust.color = drawColor; - dust.noLightEmittence = true; - dust.fadeIn = 0.1f * (square ? 1 : 3f); + if (i == 0) + i++; + + bool front = i > 0; + Vector2 pos1 = expectedWingPosition1 + (Projectile.rotation + MathHelper.PiOver2).ToRotationVector2() * (45 + 5 * wingNum) * (Projectile.scale + 0.15f); + Vector2 pos2 = expectedWingPosition2 + (backWingRot + MathHelper.PiOver2).ToRotationVector2() * (15 + 3 * wingNum) * (Projectile.scale + 0.15f); + + if (Owner.Calamity().XykVisualsBlue) + { + bool circle = Main.rand.NextBool(3); + Dust dust = Dust.NewDustPerfect(front ? pos1 : pos2, circle ? ModContent.DustType() : ModContent.DustType(), Owner.velocity.RotatedByRandom(circle ? 0.5f : 0) * Main.rand.NextFloat(-0.5f, -0.2f) * dashfx); + dust.scale = Main.rand.NextFloat(1.3f, 1.4f) * (front ? 1 : 0.6f) * dashfx * (circle ? 0.6f : 1f) * (float)Math.Pow(Projectile.scale, 0.4f); + dust.noGravity = true; + dust.color = drawColor; + dust.noLightEmittence = true; + dust.fadeIn = 1.5f * (circle ? 0 : 1f); + } + else + { + bool square = Main.rand.NextBool(3); + Dust dust = Dust.NewDustPerfect(front ? pos1 : pos2, square ? ModContent.DustType() : ModContent.DustType(), Owner.velocity.RotatedByRandom(0.25f) * Main.rand.NextFloat(-0.5f, -0.2f) * dashfx); + dust.scale = Main.rand.NextFloat(0.8f, 1f) * (front ? 1 : 0.6f) * dashfx * (square ? 1 : 1.5f) * (float)Math.Pow(Projectile.scale, 0.4f); + dust.noGravity = true; + dust.color = drawColor; + dust.noLightEmittence = true; + dust.fadeIn = 0.1f * (square ? 1 : 3f); + } } } - } - time++; + time++; + } } public override bool PreDraw(ref Color lightColor) { - if (!BreakApart) - lastDir = Owner.direction; - float topWingNum = (checkActiveWings() - 1); float width = 1; float height = 1; @@ -310,7 +312,6 @@ namespace CalamityMod.Projectiles.Typeless Main.EntitySpriteDraw(tex, expectedWingPosition1 - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, dashfx) with { A = 0 } * spawnFadePow * MathHelper.Lerp(1, 0.6f, dashfx), Projectile.rotation, new Vector2(tex.Width * 0.5f, 0), scale, lastDir == 1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0); Main.EntitySpriteDraw(tex, expectedWingPosition2 - Main.screenPosition, null, Color.Lerp(drawColor, Color.White, dashfx) with { A = 0 } * spawnFadePow * MathHelper.Lerp(1, 0.6f, dashfx), backWingRot, new Vector2(tex.Width * 0.5f, 0), scaleBack, lastDir == -1 ? SpriteEffects.None : SpriteEffects.FlipHorizontally, 0); - return false; } public int checkActiveWings() diff --git a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs index b79ed81667..16c95c9c77 100644 --- a/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ImpMinionAI.cs @@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides private static float EnemyDistanceDetection { get => Target is null ? MinEnemyDistanceDetection : MaxEnemyDistanceDetection; } - private const int FireRate = 75; + private const int FireRate = 60; private const float ProjectileVelocity = 20f; private static NPC Target { get; set; } @@ -36,7 +36,7 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides shootTimer += Main.rand.NextBool(20) ? 2 : 1; if (shootTimer >= FireRate && proj.owner == Main.myPlayer) { - Vector2 toTargetDirection = CalamityUtils.CalculatePredictiveAimToTarget(proj.Center, Target, ProjectileVelocity); + Vector2 toTargetDirection = Utils.DirectionTo(proj.Center, Target.Center) * ProjectileVelocity; Projectile fireball = Projectile.NewProjectileDirect(proj.GetSource_FromThis(), proj.Center, diff --git a/Rarities/BurnishedAuric.cs b/Rarities/BurnishedAuric.cs index f6f1d78c8e..fd88890cf7 100644 --- a/Rarities/BurnishedAuric.cs +++ b/Rarities/BurnishedAuric.cs @@ -118,13 +118,14 @@ namespace CalamityMod.Rarities Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); } - public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch { -2 => ModContent.RarityType(), -1 => ModContent.RarityType(), 1 => ModContent.RarityType(), 2 => ModContent.RarityType(), _ => Type, - }; + };*/ } } diff --git a/Rarities/CalamityRed.cs b/Rarities/CalamityRed.cs index 19bb2986e1..d952117f9a 100644 --- a/Rarities/CalamityRed.cs +++ b/Rarities/CalamityRed.cs @@ -126,11 +126,12 @@ namespace CalamityMod.Rarities Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); } - public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch { -2 => ModContent.RarityType(), -1 => ModContent.RarityType(), _ => Type, - }; + };*/ } } diff --git a/Rarities/ColorTool.cs b/Rarities/ColorTool.cs index f226186c9a..ca16bd0a20 100644 --- a/Rarities/ColorTool.cs +++ b/Rarities/ColorTool.cs @@ -1,9 +1,8 @@ -using CalamityMod.Rarities; -using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Items +namespace CalamityMod.Rarities { public sealed class ColorTool : GlobalItem { @@ -41,7 +40,7 @@ namespace CalamityMod.Items } public static Color Rainbowing(float position) => colorLerps( - new Color[] { new Color(255, 50, 50, 255), new Color(255, 128, 50, 255), new Color(230, 255, 50, 255), new Color(80, 255, 60, 255), - new Color(50, 80, 250, 255), new Color(200, 50, 250, 255),new Color(255, 50, 230, 255), }, position); + [ new Color(255, 50, 50, 255), new Color(255, 128, 50, 255), new Color(230, 255, 50, 255), new Color(80, 255, 60, 255), + new Color(50, 80, 250, 255), new Color(200, 50, 250, 255), new Color(255, 50, 230, 255), ], position); } } diff --git a/Rarities/CosmicPurple.cs b/Rarities/CosmicPurple.cs index 9227f5866d..a30636dfdc 100644 --- a/Rarities/CosmicPurple.cs +++ b/Rarities/CosmicPurple.cs @@ -104,13 +104,15 @@ namespace CalamityMod.Rarities { Draw(Item, line.Text, line.X, line.Y, line.Rotation, line.Origin, line.BaseScale); } - public override int GetPrefixedRarity(int offset, float valueMult) => offset switch + + // TODO: Add a cooler alternative for reforge rarities + /*public override int GetPrefixedRarity(int offset, float valueMult) => offset switch { -2 => ModContent.RarityType(), -1 => ModContent.RarityType(), 1 => ModContent.RarityType(), 2 => ModContent.RarityType(), _ => Type, - }; + };*/ } } diff --git a/Rarities/PureGreen.cs b/Rarities/PureGreen.cs index 8d859b9226..5752ae8335 100644 --- a/Rarities/PureGreen.cs +++ b/Rarities/PureGreen.cs @@ -13,9 +13,7 @@ namespace CalamityMod.Rarities { -2 => ItemRarityID.Purple, -1 => ModContent.RarityType(), - 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), - _ => Type, + _ => Type, // Cannot reach Cosmic Purple or Burnished Auric }; } } diff --git a/Rarities/Turquoise.cs b/Rarities/Turquoise.cs index 254fa196ab..27428d0c1a 100644 --- a/Rarities/Turquoise.cs +++ b/Rarities/Turquoise.cs @@ -14,7 +14,7 @@ namespace CalamityMod.Rarities -2 => ItemRarityID.Red, -1 => ItemRarityID.Purple, 1 => ModContent.RarityType(), - 2 => ModContent.RarityType(), + 2 => ModContent.RarityType(), // Cannot reach Cosmic Purple _ => Type, }; } diff --git a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs index c9689876c6..70fb82de7f 100644 --- a/Scenes/MusicScenes/AquaticScourgeMusicScene.cs +++ b/Scenes/MusicScenes/AquaticScourgeMusicScene.cs @@ -1,6 +1,7 @@ using CalamityMod.Events; using CalamityMod.NPCs; using CalamityMod.NPCs.AquaticScourge; +using CalamityMod.World; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -20,7 +21,7 @@ namespace CalamityMod.Systems { if (CalamityGlobalNPC.aquaticScourge == -1) return false; - return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || Main.getGoodWorld; + return Main.npc[CalamityGlobalNPC.aquaticScourge].justHit || Main.npc[CalamityGlobalNPC.aquaticScourge].life <= Main.npc[CalamityGlobalNPC.aquaticScourge].lifeMax * 0.999 || BossRushEvent.BossRushActive || CalamityWorld.LegendaryMode; } } } diff --git a/Scenes/MusicScenes/DragonfollyMusicScene.cs b/Scenes/MusicScenes/DragonfollyMusicScene.cs index b005c124a8..ae42983e18 100644 --- a/Scenes/MusicScenes/DragonfollyMusicScene.cs +++ b/Scenes/MusicScenes/DragonfollyMusicScene.cs @@ -9,7 +9,7 @@ namespace CalamityMod.Systems { public override SceneEffectPriority Priority => SceneEffectPriority.BossMedium; - public override int NPCType => ModContent.NPCType(); + public override int NPCType => ModContent.NPCType(); public override int? MusicModMusic => CalamityMod.Instance.GetMusicFromMusicMod("Dragonfolly"); public override int VanillaMusic => MusicID.Boss4; public override int OtherworldMusic => MusicID.OtherworldlyBoss2; diff --git a/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs b/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs deleted file mode 100644 index e5597c0d2e..0000000000 --- a/Scenes/MusicScenes/SkeletronPrimeMasterMusicScene.cs +++ /dev/null @@ -1,14 +0,0 @@ -using CalamityMod.World; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Systems -{ - public class SkeletronPrimeMasterMusicScene : ModSceneEffect - { - public override int Music => MusicID.Boss3; // I spent 20 minutes trying to get this music to play while forgetting to actually override this in the first place _ YuH - public override SceneEffectPriority Priority => SceneEffectPriority.BossLow; - public override bool IsSceneEffectActive(Player player) => CalamityWorld.death && NPC.AnyNPCs(NPCID.SkeletronPrime) && Main.npc[NPC.FindFirstNPC(NPCID.SkeletronPrime)].Distance(player.Center) <= 525f * 16f; - } -} 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/Sounds/Item/AugerBigSlash.ogg b/Sounds/Item/AugerBigSlash.ogg new file mode 100644 index 0000000000..d068625bfd Binary files /dev/null and b/Sounds/Item/AugerBigSlash.ogg differ diff --git a/Sounds/Item/AugerHit.ogg b/Sounds/Item/AugerHit.ogg new file mode 100644 index 0000000000..26b099ea3b Binary files /dev/null and b/Sounds/Item/AugerHit.ogg differ diff --git a/Sounds/Item/AugerPull.ogg b/Sounds/Item/AugerPull.ogg new file mode 100644 index 0000000000..24db60a049 Binary files /dev/null and b/Sounds/Item/AugerPull.ogg differ diff --git a/Sounds/Item/AugerSlash1.ogg b/Sounds/Item/AugerSlash1.ogg new file mode 100644 index 0000000000..511f3dbee1 Binary files /dev/null and b/Sounds/Item/AugerSlash1.ogg differ diff --git a/Sounds/Item/AugerSlash2.ogg b/Sounds/Item/AugerSlash2.ogg new file mode 100644 index 0000000000..d533e89a27 Binary files /dev/null and b/Sounds/Item/AugerSlash2.ogg differ diff --git a/Sounds/Item/AugerWindup.ogg b/Sounds/Item/AugerWindup.ogg new file mode 100644 index 0000000000..1264dee1c5 Binary files /dev/null and b/Sounds/Item/AugerWindup.ogg differ diff --git a/Sounds/Item/LunicShot1.ogg b/Sounds/Item/LunicShot1.ogg index c7166fea88..ecd913e659 100644 Binary files a/Sounds/Item/LunicShot1.ogg and b/Sounds/Item/LunicShot1.ogg differ diff --git a/Sounds/Item/LunicShot2.ogg b/Sounds/Item/LunicShot2.ogg index bcea333ff4..26df1ef8e2 100644 Binary files a/Sounds/Item/LunicShot2.ogg and b/Sounds/Item/LunicShot2.ogg differ diff --git a/Sounds/Item/MittFail.ogg b/Sounds/Item/MittFail.ogg new file mode 100644 index 0000000000..b7f210727f Binary files /dev/null and b/Sounds/Item/MittFail.ogg differ diff --git a/Sounds/Item/MittHit.ogg b/Sounds/Item/MittHit.ogg new file mode 100644 index 0000000000..0faac84a5e Binary files /dev/null and b/Sounds/Item/MittHit.ogg differ diff --git a/Sounds/Item/MittReadyPalm.ogg b/Sounds/Item/MittReadyPalm.ogg new file mode 100644 index 0000000000..c786f75f8f Binary files /dev/null and b/Sounds/Item/MittReadyPalm.ogg differ diff --git a/Sounds/Item/MittThrust.ogg b/Sounds/Item/MittThrust.ogg new file mode 100644 index 0000000000..342b6df3a9 Binary files /dev/null and b/Sounds/Item/MittThrust.ogg differ diff --git a/Sounds/Item/MittWelding/Weld1.ogg b/Sounds/Item/MittWelding/Weld1.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld1.ogg differ diff --git a/Sounds/Item/MittWelding/Weld2.ogg b/Sounds/Item/MittWelding/Weld2.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld2.ogg differ diff --git a/Sounds/Item/MittWelding/Weld3.ogg b/Sounds/Item/MittWelding/Weld3.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld3.ogg differ diff --git a/Sounds/Item/MittWelding/Weld4.ogg b/Sounds/Item/MittWelding/Weld4.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld4.ogg differ diff --git a/Sounds/Item/MittWelding/Weld5.ogg b/Sounds/Item/MittWelding/Weld5.ogg new file mode 100644 index 0000000000..87a68dceac Binary files /dev/null and b/Sounds/Item/MittWelding/Weld5.ogg differ diff --git a/Sounds/Item/ViperSpit.ogg b/Sounds/Item/ViperSpit.ogg index b7fb928fa1..2be1d386cd 100644 Binary files a/Sounds/Item/ViperSpit.ogg and b/Sounds/Item/ViperSpit.ogg differ diff --git a/Sounds/Item/VulcanRampDown.ogg b/Sounds/Item/VulcanRampDown.ogg new file mode 100644 index 0000000000..3463218167 Binary files /dev/null and b/Sounds/Item/VulcanRampDown.ogg differ diff --git a/Sounds/Item/VulcanRampUp.ogg b/Sounds/Item/VulcanRampUp.ogg new file mode 100644 index 0000000000..63a160b201 Binary files /dev/null and b/Sounds/Item/VulcanRampUp.ogg differ diff --git a/Sounds/Item/VulcanShot.ogg b/Sounds/Item/VulcanShot.ogg new file mode 100644 index 0000000000..11c7584d26 Binary files /dev/null and b/Sounds/Item/VulcanShot.ogg differ diff --git a/Systems/Collections/DonatorsNameList.cs b/Systems/Collections/DonatorsNameList.cs index 71971a7bf2..258a4fbd64 100644 --- a/Systems/Collections/DonatorsNameList.cs +++ b/Systems/Collections/DonatorsNameList.cs @@ -517,7 +517,6 @@ namespace CalamityMod.Systems.Collections "Nanaki", "Natalie", "Nathan", - "Nathaniel", "Navigator", "Ne'er Dowell", "NEBULA", @@ -616,6 +615,7 @@ namespace CalamityMod.Systems.Collections "Scribbles", "Scrumlet", "Seanツ", + "Sevenfold", // previously "Woah" "Shadoku", "SharZz", "Shaun", @@ -668,6 +668,7 @@ namespace CalamityMod.Systems.Collections "That Katsafaros", "The Buildmonger", "The Davester", + "The Evolution", // previously "Nathaniel" "The Goliath", "The Illustrious Sqouinchuousor", "The Infinity", @@ -719,7 +720,6 @@ namespace CalamityMod.Systems.Collections "William", "WillyDilly", "WinterTire", - "Woah", "Wodernet", "Wolfmaw", "WrathOfOlympus", diff --git a/Systems/Collections/MagicGunIDList.cs b/Systems/Collections/MagicGunIDList.cs index 9bce514ec6..b13da9e39b 100644 --- a/Systems/Collections/MagicGunIDList.cs +++ b/Systems/Collections/MagicGunIDList.cs @@ -24,8 +24,7 @@ namespace CalamityMod.Systems.Collections ItemType(), ItemType(), ItemType(), - ItemType(), - ItemType(), + ItemType(), ItemType(), ItemType(), ItemType(), diff --git a/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs b/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs index 21c182ddfa..2cf7a31640 100644 --- a/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs +++ b/Systems/Collections/NPCIDs/SkeletronPrimeIDList.cs @@ -15,7 +15,6 @@ namespace CalamityMod.Systems.Collections List = [ NPCID.SkeletronPrime, - NPCType(), NPCID.PrimeCannon, NPCID.PrimeLaser, NPCID.PrimeSaw, diff --git a/Systems/Collections/NPCs/BossHPScalingList.cs b/Systems/Collections/NPCs/BossHPScalingList.cs index 5912dbbc55..9fd9f5a0a4 100644 --- a/Systems/Collections/NPCs/BossHPScalingList.cs +++ b/Systems/Collections/NPCs/BossHPScalingList.cs @@ -80,7 +80,7 @@ namespace CalamityMod.Systems.Collections NPCType(), NPCType(), NPCType(), - NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), @@ -99,12 +99,10 @@ namespace CalamityMod.Systems.Collections NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), NPCType(), - NPCType(), NPCType(), NPCType(), NPCType(), diff --git a/Systems/Collections/NPCs/BossRushHPChangeDict.cs b/Systems/Collections/NPCs/BossRushHPChangeDict.cs index 97646e5f90..452538f8b9 100644 --- a/Systems/Collections/NPCs/BossRushHPChangeDict.cs +++ b/Systems/Collections/NPCs/BossRushHPChangeDict.cs @@ -32,11 +32,10 @@ namespace CalamityMod.Systems.Collections { NPCID.EyeofCthulhu, 450000 }, // 30 seconds { NPCID.ServantofCthulhu, 6000 }, - { NPCType(), 12000 }, - { NPCID.EaterofWorldsHead, 10000 }, // 30 seconds + immunity timer at start - { NPCID.EaterofWorldsBody, 10000 }, - { NPCID.EaterofWorldsTail, 10000 }, + { NPCID.EaterofWorldsHead, 15000 }, // 30 seconds + immunity timer at start + { NPCID.EaterofWorldsBody, 15000 }, + { NPCID.EaterofWorldsTail, 15000 }, { NPCID.BrainofCthulhu, 100000 }, // 30 seconds with creepers { NPCID.Creeper, 10000 }, @@ -69,7 +68,6 @@ namespace CalamityMod.Systems.Collections { NPCID.Spazmatism, 150000 }, // 30 seconds { NPCID.Retinazer, 125000 }, - { NPCType(), 137500 }, { NPCID.TheDestroyer, 600000 }, // 30 seconds + immunity timer at start { NPCID.TheDestroyerBody, 600000 }, @@ -77,7 +75,6 @@ namespace CalamityMod.Systems.Collections { NPCID.Probe, 10000 }, { NPCID.SkeletronPrime, 160000 }, // 30 seconds - { NPCType(), 160000 }, { NPCID.PrimeVice, 54000 }, { NPCID.PrimeCannon, 45000 }, { NPCID.PrimeSaw, 45000 }, diff --git a/Systems/Collections/NPCs/BossTypeDict.cs b/Systems/Collections/NPCs/BossTypeDict.cs index 20ddc6d87e..c04456463f 100644 --- a/Systems/Collections/NPCs/BossTypeDict.cs +++ b/Systems/Collections/NPCs/BossTypeDict.cs @@ -78,7 +78,7 @@ namespace CalamityMod.Systems.Collections { NPCType(), 28 }, { NPCID.MoonLordCore, 29 }, { NPCType(), 30 }, - { NPCType(), 31 }, + { NPCType(), 31 }, { NPCType(), 32 }, { NPCType(), 33 }, { NPCType(), 34 }, diff --git a/Systems/Collections/NPCs/BossValueDict.cs b/Systems/Collections/NPCs/BossValueDict.cs deleted file mode 100644 index 43b450ad80..0000000000 --- a/Systems/Collections/NPCs/BossValueDict.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System.Collections.Generic; -using Terraria; -using Terraria.ID; -using Terraria.ModLoader; - -namespace CalamityMod.Systems.Collections -{ - public sealed class BossValueDict : ModSystem - { - public static IDictionary Dict { get; private set; } - - public override void OnModLoad() - { - // NOTE: This does not account for Calamity's base value increases - Dict = new SortedDictionary - { - { NPCID.KingSlime, Item.buyPrice(0, 2) }, - { NPCID.EyeofCthulhu, Item.buyPrice(0, 2) }, - // Evil bosses drop 5 gold in vanilla; unmodified - { NPCID.QueenBee, Item.buyPrice(0, 8) }, - { NPCID.Deerclops, Item.buyPrice(0, 8) }, - { NPCID.SkeletronHead, Item.buyPrice(0, 12) }, - { NPCID.WallofFlesh, Item.buyPrice(0, 12) }, - { NPCID.QueenSlimeBoss, Item.buyPrice(0, 16) }, - { NPCID.Spazmatism, Item.buyPrice(0, 16) }, - { NPCID.Retinazer, Item.buyPrice(0, 16) }, - { NPCID.TheDestroyer, Item.buyPrice(0, 16) }, - { NPCID.SkeletronPrime, Item.buyPrice(0, 16) }, - { NPCID.Plantera, Item.buyPrice(0, 20) }, - { NPCID.Golem, Item.buyPrice(0, 25) }, - { NPCID.HallowBoss, Item.buyPrice(0, 30) }, - { NPCID.DukeFishron, Item.buyPrice(0, 30) }, - { NPCID.CultistBoss, Item.buyPrice(0, 50) } - // Moon Lord drops 1 plat in vanilla; unmodified - }; - } - - public override void Unload() - { - Dict?.Clear(); - Dict = null; - } - - public static bool TryGet(int npcType, out int value) - { - return Dict.TryGetValue(npcType, out value); - } - } -} diff --git a/Systems/Collections/NPCs/EnemyImmunitiesList.cs b/Systems/Collections/NPCs/EnemyImmunitiesList.cs index 60d1d76aa7..87699925d8 100644 --- a/Systems/Collections/NPCs/EnemyImmunitiesList.cs +++ b/Systems/Collections/NPCs/EnemyImmunitiesList.cs @@ -42,7 +42,6 @@ namespace CalamityMod.Systems.Collections NPCType(), NPCType(), NPCID.EyeofCthulhu, - NPCType(), NPCID.EaterofWorldsHead, NPCID.EaterofWorldsBody, NPCID.EaterofWorldsTail, @@ -59,9 +58,7 @@ namespace CalamityMod.Systems.Collections NPCID.Probe, NPCID.Retinazer, NPCID.Spazmatism, - NPCType(), NPCID.SkeletronPrime, - NPCType(), NPCID.PrimeCannon, NPCID.PrimeSaw, NPCID.PrimeLaser, @@ -162,7 +159,7 @@ namespace CalamityMod.Systems.Collections NPCType(), NPCType(), NPCType(), - NPCType(), + NPCType(), NPCType(), NPCType(), NPCType(), diff --git a/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs b/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs index dbc3aa6ffd..c5f8624656 100644 --- a/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs +++ b/Systems/Collections/NPCs/ZeroContactDamageNPCList.cs @@ -113,36 +113,6 @@ namespace CalamityMod.Systems.Collections NPCID.Everscream, NPCID.IceQueen, NPCID.SantaNK1, - NPCID.DevourerBody, - NPCID.DevourerTail, - NPCID.DiggerBody, - NPCID.DiggerTail, - NPCID.TombCrawlerBody, - NPCID.TombCrawlerTail, - NPCID.DuneSplicerBody, - NPCID.DuneSplicerTail, - NPCID.GiantWormBody, - NPCID.GiantWormTail, - NPCID.LeechBody, - NPCID.LeechTail, - NPCID.StardustWormBody, - NPCID.StardustWormTail, - NPCID.SeekerBody, - NPCID.SeekerTail, - NPCID.BoneSerpentBody, - NPCID.BoneSerpentTail, - NPCID.WyvernBody, - NPCID.WyvernTail, - NPCID.WyvernBody2, - NPCID.WyvernBody3, - NPCID.WyvernLegs, - NPCID.CultistDragonBody1, - NPCID.CultistDragonBody2, - NPCID.CultistDragonBody3, - NPCID.CultistDragonBody4, - NPCID.CultistDragonTail, - NPCID.BloodEelBody, - NPCID.BloodEelTail, NPCID.AncientDoom ]; } diff --git a/Systems/Collections/ProjectileDestroyExceptionsList.cs b/Systems/Collections/ProjectileDestroyExceptionsList.cs index 5992a004e2..7b2c882b31 100644 --- a/Systems/Collections/ProjectileDestroyExceptionsList.cs +++ b/Systems/Collections/ProjectileDestroyExceptionsList.cs @@ -45,6 +45,7 @@ namespace CalamityMod.Systems.Collections ProjectileType(), ProjectileType(), ProjectileType(), + ProjectileType(), ProjectileType(), ProjectileType(), ProjectileType(), 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/Systems/Mechanic/DifficultyModeSystem.cs b/Systems/Mechanic/DifficultyModeSystem.cs index 106dd9bdef..ea7231e932 100644 --- a/Systems/Mechanic/DifficultyModeSystem.cs +++ b/Systems/Mechanic/DifficultyModeSystem.cs @@ -1,9 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.CalPlayer; -using CalamityMod.Events; +using System.Reflection; using CalamityMod.Items.Armor.Demonshade; using CalamityMod.UI.ModeIndicator; using CalamityMod.World; @@ -12,7 +10,7 @@ using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; using Terraria; using Terraria.Audio; -using Terraria.Graphics; +using Terraria.GameContent.Creative; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -29,11 +27,18 @@ namespace CalamityMod.Systems public static List DifficultyTiers; //Difficulty modes grouped together by difficulty public static int MostAlternateDifficulties; //The most alternate difficulties at any tier that exists. Used to know the widest space to take in the ui + public static FieldInfo journeySliderCacheField; // The current value of the journey mode difficulty slider + public static MethodInfo journeyDifficultyUpdateMethod; // The method which updates difficulty modes in journey mode + public override void Load() { MostAlternateDifficulties = 1; //Initialize base mod difficulties - Difficulties = new List() { new NoDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty() }; + Difficulties = new List() { new NoDifficulty(), new ExpertDifficulty(), new MasterDifficulty(), new RevengeanceDifficulty(), new DeathDifficulty() }; + + // Reflect private journey difficulty slider info + journeySliderCacheField = typeof(CreativePowers.DifficultySliderPower).GetField("_sliderCurrentValueCache", BindingFlags.Instance | BindingFlags.NonPublic); + journeyDifficultyUpdateMethod = typeof(CreativePowers.DifficultySliderPower).GetMethod("UpdateInfoFromSliderValueCache", BindingFlags.Instance | BindingFlags.NonPublic); CalculateDifficultyData(); } @@ -46,11 +51,9 @@ namespace CalamityMod.Systems // Makes the world automatically convert to Death if in Master, or out of Death if in Expert public override void PostUpdateWorld() { - if (!Main.expertMode) - ModeIndicatorUI.SwitchToDifficulty(NoDifficulty.Instance); - if (Main.expertMode && !Main.masterMode && GetCurrentDifficulty == DeathDifficulty.Instance) + if (Main.GameMode == GameModeID.Expert && GetCurrentDifficulty == DeathDifficulty.Instance) ModeIndicatorUI.SwitchToDifficulty(RevengeanceDifficulty.Instance); - if (Main.masterMode && GetCurrentDifficulty == RevengeanceDifficulty.Instance) + if (Main.GameMode == GameModeID.Master && GetCurrentDifficulty == RevengeanceDifficulty.Instance) ModeIndicatorUI.SwitchToDifficulty(DeathDifficulty.Instance); } @@ -141,19 +144,19 @@ namespace CalamityMod.Systems } public abstract Asset Texture { get; } + public abstract Asset TextureDisabled { get; } public virtual LocalizedText ExpandedDescription => LocalizedText.Empty; public float DifficultyScale; public LocalizedText Name; public LocalizedText ShortDescription; + public Color ChatTextColor; - public string ActivationTextKey; - public string DeactivationTextKey; + public LocalizedText FTWName; + public Color FTWTextColor; public SoundStyle ActivationSound; - public Color ChatTextColor; - internal int _difficultyTier; /// @@ -161,7 +164,7 @@ namespace CalamityMod.Systems /// public virtual bool RequiresDifficulty(DifficultyMode mode) => false; - public virtual int FavoredDifficultyAtTier(int tier) => 0; + public virtual int[] FavoredDifficultyAtTier(int tier) => [0]; } public class NoDifficulty : DifficultyMode @@ -169,7 +172,22 @@ namespace CalamityMod.Systems public override bool Enabled { get => true; - set { } + set + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Normal : GameModeID.Expert; + } + else + { + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + if (power.GetIsUnlocked()) + { + DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 0.33f : 0.66f); + DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); + } + } + } } private Asset _texture; @@ -178,36 +196,188 @@ namespace CalamityMod.Systems get { if (_texture == null) - _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_None"); + _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic"); return _texture; } } + private Asset _textureDisabled; + public override Asset TextureDisabled + { + get + { + if (_textureDisabled == null) + _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Classic_Off"); + + return _textureDisabled; + } + } public NoDifficulty() { DifficultyScale = 0; - Name = CalamityUtils.GetText("UI.NoDifficulty"); - ShortDescription = CalamityUtils.GetText("UI.NoDifficultyInfo"); + Name = Language.GetText("UI.Normal"); + ShortDescription = GetText("UI.ClassicInfo"); + ChatTextColor = Color.White; - ActivationTextKey = string.Empty; - DeactivationTextKey = string.Empty; + FTWName = Language.GetText("UI.Expert"); + FTWTextColor = new Color(255, 186, 117); // World display: Main.mcColor ActivationSound = SoundID.MenuTick with { Volume = 1f }; - ChatTextColor = Color.White; Instance = this; } public static NoDifficulty Instance { get; private set; } = null; } + public class ExpertDifficulty : DifficultyMode + { + public override bool Enabled + { + get => Main.getGoodWorld ? Main.masterMode : Main.expertMode; + set + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Expert : GameModeID.Normal; + } + else + { + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + if (power.GetIsUnlocked()) + { + DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 0.66f : 0.33f); + DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); + } + } + } + } + + private Asset _texture; + public override Asset Texture + { + get + { + if (_texture == null) + _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert"); + + return _texture; + } + } + private Asset _textureDisabled; + public override Asset TextureDisabled + { + get + { + if (_textureDisabled == null) + _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Expert_Off"); + + return _textureDisabled; + } + } + + public override LocalizedText ExpandedDescription => GetText("UI.ExpertExpandedInfo"); + + public ExpertDifficulty() + { + DifficultyScale = 0.1f; + Name = Language.GetText("UI.Expert"); + ShortDescription = GetText("UI.ExpertShortInfo"); + ChatTextColor = new Color(255, 186, 117); // World display: Main.mcColor + + FTWName = Language.GetText("UI.Master"); + FTWTextColor = new Color(28, 255, 170); // World display: Main.hcColor + + ActivationSound = SoundID.ForceRoarPitched; + + Instance = this; + } + + public static ExpertDifficulty Instance { get; private set; } = null; + } + + public class MasterDifficulty : DifficultyMode + { + public override bool Enabled + { + get => Main.getGoodWorld ? CalamityWorld.LegendaryMode : Main.masterMode; + set + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + } + else + { + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + if (power.GetIsUnlocked()) + { + DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 1f : 0.66f); + DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); + } + } + } + } + + private Asset _texture; + public override Asset Texture + { + get + { + if (_texture == null) + _texture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master"); + + return _texture; + } + } + private Asset _textureDisabled; + public override Asset TextureDisabled + { + get + { + if (_textureDisabled == null) + _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Master_Off"); + + return _textureDisabled; + } + } + + public override LocalizedText ExpandedDescription => GetText("UI.MasterExpandedInfo"); + + public MasterDifficulty() + { + DifficultyScale = 0.25f; + Name = Language.GetText("UI.Master"); + ShortDescription = GetText("UI.MasterShortInfo"); + ChatTextColor = new Color(28, 255, 170); // World display: Main.hcColor + + FTWName = Language.GetText("UI.Legendary"); + FTWTextColor = Main.legendaryModeColor; + + ActivationSound = SoundID.NPCDeath10; + + Instance = this; + } + + public static MasterDifficulty Instance { get; private set; } = null; + } + public class RevengeanceDifficulty : DifficultyMode { public override bool Enabled { get => CalamityWorld.revenge; - set => CalamityWorld.revenge = value; + set + { + if (Main.getGoodWorld) + { + CalamityWorld.revenge = value; + CalamityWorld.death = value; + } + else + CalamityWorld.revenge = value; + } } private Asset _texture; @@ -221,6 +391,17 @@ namespace CalamityMod.Systems return _texture; } } + private Asset _textureDisabled; + public override Asset TextureDisabled + { + get + { + if (_textureDisabled == null) + _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Rev_Off"); + + return _textureDisabled; + } + } public override LocalizedText ExpandedDescription { @@ -228,22 +409,22 @@ namespace CalamityMod.Systems { string rageKey = "[c/FFCE85:" + CalamityKeybinds.RageHotKey.TooltipHotkeyString() + "]"; string adrenKey = "[c/79DFBF:" + CalamityKeybinds.AdrenalineHotKey.TooltipHotkeyString() + "]"; - return CalamityUtils.GetText("UI.RevengeanceExpandedInfo").WithFormatArgs(rageKey, adrenKey); + return GetText("UI.RevengeanceExpandedInfo").WithFormatArgs(rageKey, adrenKey); } } public RevengeanceDifficulty() { DifficultyScale = 0.25f; - Name = CalamityUtils.GetText("UI.Revengeance"); - ShortDescription = CalamityUtils.GetText("UI.RevengeanceShortInfo"); + Name = GetText("UI.Revengeance"); + ShortDescription = GetText("UI.RevengeanceShortInfo"); + ChatTextColor = new Color(211, 42, 42); - ActivationTextKey = "Mods.CalamityMod.UI.RevengeanceActivate"; - DeactivationTextKey = "Mods.CalamityMod.UI.RevengeanceDeactivate"; + FTWName = GetText("UI.Death"); + FTWTextColor = new Color(192, 64, 219); ActivationSound = SoundID.Item119; - ChatTextColor = Color.Crimson; Instance = this; } @@ -254,8 +435,29 @@ namespace CalamityMod.Systems { public override bool Enabled { - get => CalamityWorld.death; - set => CalamityWorld.death = value; + get => Main.getGoodWorld ? CalamityWorld.death && CalamityWorld.LegendaryMode : CalamityWorld.death; + set + { + if (Main.getGoodWorld) + { + if (!Main.GameModeInfo.IsJourneyMode) + { + Main.GameMode = value == true ? GameModeID.Master : GameModeID.Expert; + } + else + { + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + if (power.GetIsUnlocked()) + { + DifficultyModeSystem.journeySliderCacheField.SetValue(power, value == true ? 1f : 0.66f); + DifficultyModeSystem.journeyDifficultyUpdateMethod.Invoke(power, null); + } + } + CalamityWorld.death = value; + } + else + CalamityWorld.death = value; + } } private Asset _texture; @@ -269,35 +471,51 @@ namespace CalamityMod.Systems return _texture; } } + private Asset _textureDisabled; + public override Asset TextureDisabled + { + get + { + if (_textureDisabled == null) + _textureDisabled = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicator_Death_Off"); - public override LocalizedText ExpandedDescription => CalamityUtils.GetText("UI.DeathExpandedInfo"); + return _textureDisabled; + } + } + + public override LocalizedText ExpandedDescription => GetText("UI.DeathExpandedInfo"); public DeathDifficulty() { DifficultyScale = 0.5f; - Name = CalamityUtils.GetText("UI.Death"); - ShortDescription = CalamityUtils.GetText("UI.DeathShortInfo"); + Name = GetText("UI.Death"); + ShortDescription = GetText("UI.DeathShortInfo"); + ChatTextColor = new Color(192, 64, 219); - ActivationTextKey = "Mods.CalamityMod.UI.DeathActivate"; - DeactivationTextKey = "Mods.CalamityMod.UI.DeathDeactivate"; + FTWName = GetText("UI.Malice"); + FTWTextColor = new Color(240, 128, 128); ActivationSound = DemonshadeHelm.ActivationSound; - ChatTextColor = Color.MediumOrchid; Instance = this; } - public override int FavoredDifficultyAtTier(int tier) + public override int[] FavoredDifficultyAtTier(int tier) { DifficultyMode[] tierList = DifficultyModeSystem.DifficultyTiers[tier]; + List difficulties = new List(); + for (int i = 0; i < tierList.Length; i++) { - if (tierList[i].Name == CalamityUtils.GetText("UI.Revengeance")) - return i; + if (tierList[i].Name == Language.GetText("UI.Master") || tierList[i].Name == GetText("UI.Revengeance")) + difficulties.Add(i); } - return 0; + if (difficulties.Count <= 0) + difficulties.Add(0); + + return difficulties.ToArray(); } public static DeathDifficulty Instance { get; private set; } = null; } diff --git a/Systems/Mechanic/RecipeSystem.cs b/Systems/Mechanic/RecipeSystem.cs index 64d9163eba..5a830c84ac 100644 --- a/Systems/Mechanic/RecipeSystem.cs +++ b/Systems/Mechanic/RecipeSystem.cs @@ -11,6 +11,8 @@ using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Items.Placeables.Abyss; using CalamityMod.Items.Placeables.Astral; +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Items.Placeables.Crags; using CalamityMod.Items.Placeables.SunkenSea; using CalamityMod.Items.Tools; @@ -35,10 +37,10 @@ namespace CalamityMod.Systems #endregion #region Recipe Group Definitions - public static int HardmodeAnvil, HardmodeForge, AnyLargeGem, AnyFood; + public static int HardmodeAnvil, HardmodeForge, AnyFood; public static int AnyCopperOre, AnySilverOre, AnyGoldOre, AnyEvilOre, AnyCobaltOre, AnyMythrilOre, AnyAdamantiteOre; public static int AnyCopperBar, AnySilverBar, AnyGoldBar, AnyEvilBar, AnyCobaltBar, AnyMythrilBar, AnyAdamantiteBar; - public static int AnyEvilPowder, Boss2Material, CursedFlameIchor, AnyEvilWater, AnyEvilFlask; + public static int Boss2Material, CursedFlameIchor, AnyEvilWater; public static int AnyStoneBlock, AnySnowBlock, AnyIceBlock, AnySiltBlock, AnyEvilBlock, AnyGoodBlock; public static int AnyWoodenSword, AnyHallowedHelmet, AnyHallowedPlatemail, AnyHallowedGreaves, AnyGoldCrown, LunarPickaxe, LunarHamaxe; public static int AnyManaFlower, AnyQuiver, AnyTombstone, AnyWings; @@ -87,19 +89,6 @@ namespace CalamityMod.Systems }); HardmodeForge = RecipeGroup.RegisterGroup("HardmodeForge", group); - // Large Gems (PvP tokens) - group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.AnyLargeGem"), new int[] - { - ItemID.LargeAmber, - ItemID.LargeAmethyst, - ItemID.LargeDiamond, - ItemID.LargeEmerald, - ItemID.LargeRuby, - ItemID.LargeSapphire, - ItemID.LargeTopaz - }); - AnyLargeGem = RecipeGroup.RegisterGroup("AnyLargeGem", group); - // Food AnyFood = RecipeGroup.RegisterGroup("AnyFood", GetFoodItems()); } @@ -214,16 +203,8 @@ namespace CalamityMod.Systems private static void AddEvilBiomeItemRecipeGroups() { - // Vile and Vicious Powder - RecipeGroup group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.AnyEvilPowder"), new int[] - { - ItemID.VilePowder, - ItemID.ViciousPowder - }); - AnyEvilPowder = RecipeGroup.RegisterGroup("AnyEvilPowder", group); - // Shadow Scale and Tissue Sample - group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.Boss2Material"), new int[] + RecipeGroup group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.Boss2Material"), new int[] { ItemID.ShadowScale, ItemID.TissueSample @@ -245,14 +226,6 @@ namespace CalamityMod.Systems ItemID.BloodWater }); AnyEvilWater = RecipeGroup.RegisterGroup("AnyEvilWater", group); - - // Flask of Cursed Flames and Flask of Ichor - group = new RecipeGroup(() => CalamityUtils.GetTextValue("Misc.RecipeGroup.AnyEvilFlask"), new int[] - { - ItemID.FlaskofCursedFlames, - ItemID.FlaskofIchor - }); - AnyEvilFlask = RecipeGroup.RegisterGroup("AnyEvilFlask", group); } private static void AddBiomeBlockRecipeGroups() @@ -841,84 +814,6 @@ namespace CalamityMod.Systems // Berserker's Glove recipe change now that it doesn't provide melee speed { Vanilla(ItemID.BerserkerGlove), ReplaceIngredient(ItemID.PowerGlove, ItemID.TitanGlove) }, - - // Standardize the costs of all PHM ore armors to 10/16/14 head/chest/legs - { Vanilla(ItemID.CopperHelmet), ChangeIngredientStack(ItemID.CopperBar, 10) }, - { Vanilla(ItemID.CopperChainmail), ChangeIngredientStack(ItemID.CopperBar, 16) }, - { Vanilla(ItemID.CopperGreaves), ChangeIngredientStack(ItemID.CopperBar, 14) }, - { Vanilla(ItemID.TinHelmet), ChangeIngredientStack(ItemID.TinBar, 10) }, - { Vanilla(ItemID.TinChainmail), ChangeIngredientStack(ItemID.TinBar, 16) }, - { Vanilla(ItemID.TinGreaves), ChangeIngredientStack(ItemID.TinBar, 14) }, - { Vanilla(ItemID.IronHelmet), ChangeIngredientStack(ItemID.IronBar, 10) }, - { Vanilla(ItemID.IronChainmail), ChangeIngredientStack(ItemID.IronBar, 16) }, - { Vanilla(ItemID.IronGreaves), ChangeIngredientStack(ItemID.IronBar, 14) }, - { Vanilla(ItemID.LeadHelmet), ChangeIngredientStack(ItemID.LeadBar, 10) }, - { Vanilla(ItemID.LeadChainmail), ChangeIngredientStack(ItemID.LeadBar, 16) }, - { Vanilla(ItemID.LeadGreaves), ChangeIngredientStack(ItemID.LeadBar, 14) }, - { Vanilla(ItemID.SilverHelmet), ChangeIngredientStack(ItemID.SilverBar, 10) }, - { Vanilla(ItemID.SilverChainmail), ChangeIngredientStack(ItemID.SilverBar, 16) }, - { Vanilla(ItemID.SilverGreaves), ChangeIngredientStack(ItemID.SilverBar, 14) }, - { Vanilla(ItemID.TungstenHelmet), ChangeIngredientStack(ItemID.TungstenBar, 10) }, - { Vanilla(ItemID.TungstenChainmail), ChangeIngredientStack(ItemID.TungstenBar, 16) }, - { Vanilla(ItemID.TungstenGreaves), ChangeIngredientStack(ItemID.TungstenBar, 14) }, - { Vanilla(ItemID.GoldHelmet), ChangeIngredientStack(ItemID.GoldBar, 10) }, - { Vanilla(ItemID.GoldChainmail), ChangeIngredientStack(ItemID.GoldBar, 16) }, - { Vanilla(ItemID.GoldGreaves), ChangeIngredientStack(ItemID.GoldBar, 14) }, - { Vanilla(ItemID.PlatinumHelmet), ChangeIngredientStack(ItemID.PlatinumBar, 10) }, - { Vanilla(ItemID.PlatinumChainmail), ChangeIngredientStack(ItemID.PlatinumBar, 16) }, - { Vanilla(ItemID.PlatinumGreaves), ChangeIngredientStack(ItemID.PlatinumBar, 14) }, - - // Standardize the costs of all HM ore items to the following: - // 10 BARS : Melee Helm, Ranged Helm, Magic Helm, Pickaxe, Drill, Waraxe, Chainsaw, Sword, Spear, Repeater - // 20 BARS : Breastplate - // 15 BARS : Leggings - { VanillaEach( - ItemID.CobaltHelmet, ItemID.CobaltMask, ItemID.CobaltHat, ItemID.CobaltPickaxe, ItemID.CobaltDrill, ItemID.CobaltWaraxe, ItemID.CobaltChainsaw, - ItemID.CobaltSword, ItemID.CobaltNaginata, ItemID.CobaltRepeater), - ChangeIngredientStack(ItemID.CobaltBar, 10) - }, - { Vanilla(ItemID.CobaltBreastplate), ChangeIngredientStack(ItemID.CobaltBar, 20) }, - { Vanilla(ItemID.CobaltLeggings), ChangeIngredientStack(ItemID.CobaltBar, 15) }, - - { VanillaEach( - ItemID.PalladiumHelmet, ItemID.PalladiumMask, ItemID.PalladiumHeadgear, ItemID.PalladiumPickaxe, ItemID.PalladiumDrill, ItemID.PalladiumWaraxe, ItemID.PalladiumChainsaw, - ItemID.PalladiumSword, ItemID.PalladiumPike, ItemID.PalladiumRepeater), - ChangeIngredientStack(ItemID.PalladiumBar, 10) - }, - { Vanilla(ItemID.PalladiumBreastplate), ChangeIngredientStack(ItemID.PalladiumBar, 20) }, - { Vanilla(ItemID.PalladiumLeggings), ChangeIngredientStack(ItemID.PalladiumBar, 15) }, - - { VanillaEach( - ItemID.MythrilHelmet, ItemID.MythrilHat, ItemID.MythrilHood, ItemID.MythrilPickaxe, ItemID.MythrilDrill, ItemID.MythrilWaraxe, ItemID.MythrilChainsaw, - ItemID.MythrilSword, ItemID.MythrilHalberd, ItemID.MythrilRepeater), - ChangeIngredientStack(ItemID.MythrilBar, 10) - }, - { Vanilla(ItemID.MythrilChainmail), ChangeIngredientStack(ItemID.MythrilBar, 20) }, - { Vanilla(ItemID.MythrilGreaves), ChangeIngredientStack(ItemID.MythrilBar, 15) }, - - { VanillaEach( - ItemID.OrichalcumHelmet, ItemID.OrichalcumMask, ItemID.OrichalcumHeadgear, ItemID.OrichalcumPickaxe, ItemID.OrichalcumDrill, ItemID.OrichalcumWaraxe, ItemID.OrichalcumChainsaw, - ItemID.OrichalcumSword, ItemID.OrichalcumHalberd, ItemID.OrichalcumRepeater), - ChangeIngredientStack(ItemID.OrichalcumBar, 10) - }, - { Vanilla(ItemID.OrichalcumBreastplate), ChangeIngredientStack(ItemID.OrichalcumBar, 20) }, - { Vanilla(ItemID.OrichalcumLeggings), ChangeIngredientStack(ItemID.OrichalcumBar, 15) }, - - { VanillaEach( - ItemID.AdamantiteHelmet, ItemID.AdamantiteMask, ItemID.AdamantiteHeadgear, ItemID.AdamantitePickaxe, ItemID.AdamantiteDrill, ItemID.AdamantiteWaraxe, ItemID.AdamantiteChainsaw, - ItemID.AdamantiteSword, ItemID.AdamantiteGlaive, ItemID.AdamantiteRepeater), - ChangeIngredientStack(ItemID.AdamantiteBar, 10) - }, - { Vanilla(ItemID.AdamantiteBreastplate), ChangeIngredientStack(ItemID.AdamantiteBar, 20) }, - { Vanilla(ItemID.AdamantiteLeggings), ChangeIngredientStack(ItemID.AdamantiteBar, 15) }, - - { VanillaEach( - ItemID.TitaniumHelmet, ItemID.TitaniumMask, ItemID.TitaniumHeadgear, ItemID.TitaniumPickaxe, ItemID.TitaniumDrill, ItemID.TitaniumWaraxe, ItemID.TitaniumChainsaw, - ItemID.TitaniumSword, ItemID.TitaniumTrident, ItemID.TitaniumRepeater), - ChangeIngredientStack(ItemID.TitaniumBar, 10) - }, - { Vanilla(ItemID.TitaniumBreastplate), ChangeIngredientStack(ItemID.TitaniumBar, 20) }, - { Vanilla(ItemID.TitaniumLeggings), ChangeIngredientStack(ItemID.TitaniumBar, 15) }, }; // Apply all recipe changes. @@ -1063,14 +958,6 @@ namespace CalamityMod.Systems convert[ItemID.LifeformAnalyzer] = ItemID.Stopwatch; convert[ItemID.Stopwatch] = ItemID.DPSMeter; - // Pyramid loot edits. There's no good way to have this not be hardcoded. - convert[ItemID.PharaohsMask] = ItemID.PharaohsRobe; - convert[ItemID.PharaohsRobe] = ItemID.PharaohsMask; - - convert[ItemID.AmberHook] = ItemID.SandstorminaBottle; - convert[ItemID.SandstorminaBottle] = ItemID.FlyingCarpet; - convert[ItemID.FlyingCarpet] = ItemID.AmberHook; - // Enchanted Sword and Terragrim shimmer into each other convert[ItemID.EnchantedSword] = ItemID.Terragrim; convert[ItemID.Terragrim] = ItemID.EnchantedSword; @@ -1376,55 +1263,11 @@ namespace CalamityMod.Systems r.DisableDecraft(); #endregion - #region New Recipes r = Recipe.Create(ItemID.Bacon); r.AddIngredient(); r.AddTile(TileID.Hellforge); r.Register(); r.DisableDecraft(); - - r = Recipe.Create(ItemID.ApplePie); - r.AddIngredient(ItemID.Apple, 3); - r.AddTile(TileID.Hellforge); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.BananaSplit); - r.AddIngredient(ItemID.Banana); - r.AddIngredient(ItemID.IceBlock); - r.AddIngredient(ItemID.MilkCarton); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.BBQRibs); - r.AddIngredient(ItemID.FleshBlock, 6); - r.AddIngredient(ItemID.Bone, 6); - r.AddTile(TileID.Hellforge); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.MilkCarton); - r.AddIngredient(ItemID.BottledWater); - r.AddIngredient(ItemID.Bone, 2); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.Milkshake); - r.AddIngredient(ItemID.IceBlock); - r.AddIngredient(ItemID.MilkCarton); - r.AddTile(TileID.IceMachine); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.Nachos); - r.AddIngredient(ItemID.PotatoChips); - r.AddIngredient(ItemID.MilkCarton); - r.AddTile(TileID.CookingPots); - r.Register(); - r.DisableDecraft(); - #endregion } #endregion @@ -1759,19 +1602,6 @@ namespace CalamityMod.Systems r.AddTile(TileID.Loom); r.Register(); r.DisableDecraft(); - - // Pharaoh set (replaced Chest items) - r = Recipe.Create(ItemID.PharaohsMask); - r.AddIngredient(ItemID.AncientCloth, 3); - r.AddTile(TileID.Loom); - r.Register(); - r.DisableDecraft(); - - r = Recipe.Create(ItemID.PharaohsRobe); - r.AddIngredient(ItemID.AncientCloth, 4); - r.AddTile(TileID.Loom); - r.Register(); - r.DisableDecraft(); } #endregion diff --git a/Systems/Mechanic/TilePingerSystem.cs b/Systems/Mechanic/TilePingerSystem.cs index f28c9cb3b1..e33c7ad470 100644 --- a/Systems/Mechanic/TilePingerSystem.cs +++ b/Systems/Mechanic/TilePingerSystem.cs @@ -6,6 +6,7 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.Graphics.Effects; using Terraria.Graphics.Light; using Terraria.ID; @@ -83,6 +84,8 @@ namespace CalamityMod.Systems pingedTiles = new Dictionary>(); pingedNonSolidTiles = new Dictionary>(); tileEffects = new Dictionary(); + + On_TileDrawing.DrawTiles_GetLightOverride += ForceSufficientLight; } public override void Unload() @@ -93,6 +96,42 @@ namespace CalamityMod.Systems tileEffects = null; } + private static Color ForceSufficientLight(On_TileDrawing.orig_DrawTiles_GetLightOverride orig, TileDrawing self, int j, int i, Tile tileCache, ushort typeCache, short tileFrameX, short tileFrameY, Color tileLight) + { + Color returnColor = orig(self, j, i, tileCache, typeCache, tileFrameX, tileFrameY, tileLight); + foreach (IPingedTileEffect effect in tileEffects.Values) + { + // Nothing else uses this so like should be okay + if (effect is WulfrumPingTileEffect w && effect.Active && effect.ShouldRegisterTile(i, j)) + { + float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - WulfrumPingTileEffect.PingCenter).Length(); + float currentExpansion = MathHelper.Clamp(WulfrumPingTileEffect.PingProgress * WulfrumPingTileEffect.MaxPingLife / (float)WulfrumPingTileEffect.MaxPingTravelTime, 0f, 1f) * WulfrumPingTileEffect.MaxPingRadius; + + if (distanceFromCenter - 8 > currentExpansion) + return returnColor; + + float brightness = 1f; + Tile tile = Framing.GetTileSafely(i, j); + //Counteracts slopes and half tiles being too bright + if (tile.Slope != SlopeType.Solid || tile.IsHalfBlock) + brightness = 0.64f; + + //Fade on the edges + if (distanceFromCenter + 8 > currentExpansion) + brightness *= 1 - (distanceFromCenter - currentExpansion + 8f) / 16f; + + //Fade away with the effect + brightness *= 1 - Math.Max(WulfrumPingTileEffect.PingProgress - 0.9f, 0) / (0.1f); + + if (tileLight.R < 200 * brightness) tileLight.R = (byte)(200 * brightness); + if (tileLight.G < 200 * brightness) tileLight.G = (byte)(200 * brightness); + if (tileLight.B < 200 * brightness) tileLight.B = (byte)(200 * brightness); + returnColor = tileLight; + } + } + return returnColor; + } + public static bool AddPing(string effectName, Vector2 position, Player pinger) { if (!Main.dedServ) @@ -231,11 +270,11 @@ namespace CalamityMod.Systems public class WulfrumPingTileEffect : IPingedTileEffect, ILoadable { internal static Texture2D emptyFrame; - const int MaxPingLife = 350; - const int MaxPingTravelTime = 60; + public const int MaxPingLife = 350; + public const int MaxPingTravelTime = 60; const float PingWaveThickness = 50f; - const float MaxPingRadius = 1700f; + public const float MaxPingRadius = 1700f; public static Vector2 PingCenter = Vector2.Zero; public static int PingTimer = 0; public static float PingProgress => (MaxPingLife - PingTimer) / (float)MaxPingLife; @@ -316,7 +355,8 @@ namespace CalamityMod.Systems Main.spriteBatch.Draw(emptyFrame, pos.ToWorldCoordinates() - Main.screenPosition, null, Color.White, 0, new Vector2(emptyFrame.Width / 2f, emptyFrame.Height / 2f), 16f, 0, 0); } - public void EditDrawData(int i, int j, ref TileDrawInfo drawData) + // CIT 16JUL2025: Tile lighting override is now applied via an On edit; this code is duplicated there, and thus is no longer needed here. + /*public void EditDrawData(int i, int j, ref TileDrawInfo drawData) { float distanceFromCenter = (new Point(i, j).ToWorldCoordinates() - PingCenter).Length(); float currentExpansion = MathHelper.Clamp(PingProgress * MaxPingLife / (float)MaxPingTravelTime, 0f, 1f) * MaxPingRadius; @@ -333,14 +373,14 @@ namespace CalamityMod.Systems //Fade on the edges if (distanceFromCenter + 8 > currentExpansion) brightness *= 1 - (distanceFromCenter - currentExpansion + 8f) / 16f; - + //Fade away with the effect brightness *= 1 - Math.Max(PingProgress - 0.9f, 0) / (0.1f); if (drawData.tileLight.R < 200 * brightness) drawData.tileLight.R = (byte)(200 * brightness); if (drawData.tileLight.G < 200 * brightness) drawData.tileLight.G = (byte)(200 * brightness); if (drawData.tileLight.B < 200 * brightness) drawData.tileLight.B = (byte)(200 * brightness); - } + }*/ public void UpdateEffect() { diff --git a/Systems/Mechanic/WorldSelectionDifficultySystem.cs b/Systems/Mechanic/WorldSelectionDifficultySystem.cs index 18d7107050..677911be0c 100644 --- a/Systems/Mechanic/WorldSelectionDifficultySystem.cs +++ b/Systems/Mechanic/WorldSelectionDifficultySystem.cs @@ -23,7 +23,7 @@ namespace CalamityMod.Systems { WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Revengeance"), GetRevengeance, new(211, 42, 42))); WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Death"), GetDeath, new(192, 64, 219))); - WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.DeathLegend"), GetLegendDeath, new(220, 255, 132))); // Defiled color + WorldDifficulties.Add(new WorldDifficulty(CalamityUtils.GetTextValue("UI.Malice"), GetMalice, new(240, 128, 128))); } } @@ -51,17 +51,25 @@ namespace CalamityMod.Systems public static bool GetDeath(AWorldListItem item) { + // Grab data from the listed world + FieldInfo worldDataField = typeof(UIWorldListItem).GetField("_data", BindingFlags.NonPublic | BindingFlags.Instance); + WorldFileData worldData = (WorldFileData)worldDataField.GetValue(item); + if (item.Data.TryGetHeaderData(out TagCompound tag)) { if (tag.ContainsKey("DeathMode") && tag.GetBool("DeathMode")) { return true; } + else if (tag.ContainsKey("RevengeanceMode") && tag.GetBool("RevengeanceMode")) + { + return worldData.ForTheWorthy; + } } return false; } - public static bool GetLegendDeath(AWorldListItem item) + public static bool GetMalice(AWorldListItem item) { // Grab data from the listed world FieldInfo worldDataField = typeof(UIWorldListItem).GetField("_data", BindingFlags.NonPublic | BindingFlags.Instance); diff --git a/Systems/World/WorldgenManagementSystem.cs b/Systems/World/WorldgenManagementSystem.cs index be629644b2..4afdf26048 100644 --- a/Systems/World/WorldgenManagementSystem.cs +++ b/Systems/World/WorldgenManagementSystem.cs @@ -224,13 +224,6 @@ namespace CalamityMod.Systems int sunkenSeaX = (GenVars.UndergroundDesertLocation.Left + GenVars.UndergroundDesertLocation.Right) / 2; int sunkenSeaY = Main.maxTilesY / 2; - SunkenSea.ForLoop = CalamityClientConfig.Instance.SunkenSeaMultiThreading switch - { - 2 => SunkenSea.CSharpParallelFor, - 1 => SunkenSea.ReLogicParallelFor, - _ => SunkenSea.NormalForLoop, - }; - // place each piece of the sunken sea based on the above positons // messages intentionally in the "incorrect" order for the player's experience. diff --git a/TileEntities/TECodebreaker.cs b/TileEntities/TECodebreaker.cs index 78fcd95db6..4e1dd4117b 100644 --- a/TileEntities/TECodebreaker.cs +++ b/TileEntities/TECodebreaker.cs @@ -1,7 +1,7 @@ using System.IO; using CalamityMod.CustomRecipes; using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.Packets; using CalamityMod.Systems.Collections; using CalamityMod.Tiles.DraedonSummoner; @@ -65,7 +65,7 @@ namespace CalamityMod.TileEntities public bool ContainsVoltageRegulationSystem; public bool ContainsCoolingCell; - public bool ContainsBloodSample; + public bool ContainsBloodyVein; public bool CanDecryptHeldSchematic { @@ -163,7 +163,7 @@ namespace CalamityMod.TileEntities totalCellsToDrop = 999; InputtedCellCount -= totalCellsToDrop; - int itemType = ContainsBloodSample ? ModContent.ItemType() : ModContent.ItemType(); + int itemType = ContainsBloodyVein ? ModContent.ItemType() : ModContent.ItemType(); Item.NewItem(new EntitySource_TileEntity(this), x * 16, y * 16, 32, 32, itemType, totalCellsToDrop); } } @@ -270,7 +270,7 @@ namespace CalamityMod.TileEntities tag["HeldSchematicID"] = HeldSchematicID; tag["DecryptionCountdown"] = DecryptionCountdown; tag["InitialCellCountBeforeDecrypting"] = InitialCellCountBeforeDecrypting; - tag["ContainsBloodSample"] = ContainsBloodSample; + tag["ContainsBloodyVein"] = ContainsBloodyVein; } public override void LoadData(TagCompound tag) @@ -284,7 +284,7 @@ namespace CalamityMod.TileEntities HeldSchematicID = tag.GetInt("HeldSchematicID"); DecryptionCountdown = tag.GetInt("DecryptionCountdown"); InitialCellCountBeforeDecrypting = tag.GetInt("InitialCellCountBeforeDecrypting"); - ContainsBloodSample = tag.GetBool("ContainsBloodSample"); + ContainsBloodyVein = tag.GetBool("ContainsBloodyVein"); } public override void NetSend(BinaryWriter writer) @@ -298,7 +298,7 @@ namespace CalamityMod.TileEntities writer.Write(HeldSchematicID); writer.Write(DecryptionCountdown); writer.Write(InitialCellCountBeforeDecrypting); - writer.Write(ContainsBloodSample); + writer.Write(ContainsBloodyVein); } public override void NetReceive(BinaryReader reader) @@ -312,7 +312,7 @@ namespace CalamityMod.TileEntities HeldSchematicID = reader.ReadInt32(); DecryptionCountdown = reader.ReadInt32(); InitialCellCountBeforeDecrypting = reader.ReadInt32(); - ContainsBloodSample = reader.ReadBoolean(); + ContainsBloodyVein = reader.ReadBoolean(); } } } diff --git a/Tiles/Abyss/AbyssAmbient/PirateCrate.cs b/Tiles/Abyss/AbyssAmbient/PirateCrate.cs index 4aa4856eb8..935afa9232 100644 --- a/Tiles/Abyss/AbyssAmbient/PirateCrate.cs +++ b/Tiles/Abyss/AbyssAmbient/PirateCrate.cs @@ -36,7 +36,7 @@ namespace CalamityMod.Tiles.Abyss.AbyssAmbient //explode when broken (troll!) //also instakill players in for the worthy Vector2 spawnPosition = new(i * 16f + 24f, j * 16f - 4f); - // NOTE: The damage of ProjectileID.Explosives is reduced in CalamityPlayerHitHurt, this actually deals 52 / 67 / 101 damage. + // NOTE: The damage of ProjectileID.Explosives is reduced in CalamityPlayerHitHurt, this actually deals 105 / 210 / 315 damage. int blastDamage = (Main.getGoodWorld ? 99999 : 150) * (Main.masterMode ? 3 : Main.expertMode ? 2 : 1); Projectile.NewProjectile(new EntitySource_WorldEvent(), spawnPosition.X, spawnPosition.Y, 0, 0, ProjectileID.Explosives, blastDamage, 0f); diff --git a/Tiles/Abyss/AcidWoodTree.cs b/Tiles/Abyss/AcidWoodTree.cs index 0e790dcafb..ef235d14ed 100644 --- a/Tiles/Abyss/AcidWoodTree.cs +++ b/Tiles/Abyss/AcidWoodTree.cs @@ -1,7 +1,7 @@ using CalamityMod.Dusts; using CalamityMod.Gores.Trees; using CalamityMod.Items.Materials; -using CalamityMod.Items.Placeables.Abyss; +using CalamityMod.Items.Placeables.FurnitureAcidwood; using CalamityMod.Items.Potions.Food; using CalamityMod.Items.Tools; using CalamityMod.NPCs.AcidRain; diff --git a/Tiles/Abyss/VoidTorch.cs b/Tiles/Abyss/VoidTorch.cs index d3074ce982..df6d9c0339 100644 --- a/Tiles/Abyss/VoidTorch.cs +++ b/Tiles/Abyss/VoidTorch.cs @@ -7,6 +7,7 @@ using Terraria.ModLoader; namespace CalamityMod.Tiles.Abyss { + [LegacyName("AbyssTorch")] public class VoidTorch : ModTile { public override void SetStaticDefaults() => this.SetUpTorch(ModContent.ItemType(), true, true); diff --git a/Tiles/Astral/AstralTree.cs b/Tiles/Astral/AstralTree.cs index d7440d736b..e0ef7fcfd1 100644 --- a/Tiles/Astral/AstralTree.cs +++ b/Tiles/Astral/AstralTree.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.Astral //treeFrame = (i + j * j) % 3; } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); public override int SaplingGrowthType(ref int style) diff --git a/Tiles/AstralDesert/AstralPalmTree.cs b/Tiles/AstralDesert/AstralPalmTree.cs index 3fb709e4d8..085f713984 100644 --- a/Tiles/AstralDesert/AstralPalmTree.cs +++ b/Tiles/AstralDesert/AstralPalmTree.cs @@ -57,7 +57,7 @@ namespace CalamityMod.Tiles.AstralDesert return Color.White * MathHelper.Lerp(0.05f, 0.75f, brightness); } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); diff --git a/Tiles/AstralSnow/AstralSnowTree.cs b/Tiles/AstralSnow/AstralSnowTree.cs index e8becab1b5..1edb32555d 100644 --- a/Tiles/AstralSnow/AstralSnowTree.cs +++ b/Tiles/AstralSnow/AstralSnowTree.cs @@ -60,7 +60,7 @@ namespace CalamityMod.Tiles.AstralSnow //treeFrame = (i + j * j) % 6; } - public override int DropWood() => ModContent.ItemType(); + public override int DropWood() => ModContent.ItemType(); public override int CreateDust() => ModContent.DustType(); diff --git a/Tiles/CalamityGlobalTile.cs b/Tiles/CalamityGlobalTile.cs index cee684049a..4b21d53067 100644 --- a/Tiles/CalamityGlobalTile.cs +++ b/Tiles/CalamityGlobalTile.cs @@ -305,7 +305,7 @@ namespace CalamityMod.Tiles // Drop Evil Smasher on every 12 alter smashed if (WorldGen.altarCount > 1 && WorldGen.altarCount % 12 == 0) - DropItem(i, j, ItemType(), quantity: 1, asStack: true); + DropItem(i, j, ItemType(), quantity: 1, asStack: true, prefix: true); } // Drop Golden Bombs at a 0.33% chance from Pots @@ -356,7 +356,7 @@ namespace CalamityMod.Tiles } } - private static void DropItem(int i, int j, int itemType, int quantity, bool asStack, Vector2 spreadMinMax = default) + private static void DropItem(int i, int j, int itemType, int quantity, bool asStack, Vector2 spreadMinMax = default, bool prefix = false) { // Multiplayer Client should not spawn item themselves if (Main.netMode == NetmodeID.MultiplayerClient) @@ -366,14 +366,14 @@ namespace CalamityMod.Tiles if (asStack) { Vector2 spawnOffset = Main.rand.NextVector2Unit(spreadMinMax.X, spreadMinMax.Y); - Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: quantity); + Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: quantity, prefixGiven: prefix ? -1 : 0); } else { for (int k = 0; k < quantity; k += 1) { Vector2 spawnOffset = Main.rand.NextVector2Unit(spreadMinMax.X, spreadMinMax.Y); - Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: 1); + Item.NewItem(new EntitySource_TileBreak(i, j), worldPos + spawnOffset, itemType, Stack: 1, prefixGiven: prefix ? -1 : 0); } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs b/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs index bf857ae736..c2a908ef42 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedBiolight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 89; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 9f / 255f * brightness, 195f / 255f * brightness, 0f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs b/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs index 3da6bb123f..0aafeea281 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedBlacklight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 173; @@ -82,10 +83,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 182f / 255f * brightness, 28f / 255f * brightness, 232f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs b/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs index 68899755d7..83a7fd5560 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedCinderlight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 6; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i, j), 252f / 255f * brightness, 184f / 255f * brightness, 29f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs b/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs index 823fa54776..0d70137c2b 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedFlamelight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 60; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), (255f / 255f) * brightness, (104f / 255f) * brightness, (104f / 255f) * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs b/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs index 557f857324..dbc8e13c6b 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedFloodlight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 187; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 105f / 255f * brightness, 195f / 255f * brightness, 193f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs b/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs index 076122c0d9..c553f25054 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedFrostlight.cs @@ -26,6 +26,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 247; @@ -83,10 +84,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Lighting.AddLight(new Vector2(i * 16, j * 16), 9f / 255f * brightness, 158f / 255f * brightness, 238f / 255f * brightness); } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/AgedLablight.cs b/Tiles/DraedonStructures/CagedLights/AgedLablight.cs index 8c154b9031..72248f3566 100644 --- a/Tiles/DraedonStructures/CagedLights/AgedLablight.cs +++ b/Tiles/DraedonStructures/CagedLights/AgedLablight.cs @@ -22,6 +22,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 299; @@ -79,11 +80,6 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 255f / 510f; } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { if (Main.tile[i, j].IsTileActuallyInvisible()) diff --git a/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs b/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs index 76f5061edd..2bfbf801fa 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedBiolight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 89; @@ -91,9 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs b/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs index 702af106f2..88623b86cc 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedBlacklight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 173; @@ -90,10 +91,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs b/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs index 7514c37cf2..99622541fb 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedCinderlight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 6; @@ -92,9 +93,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights } } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs b/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs index f330d1371d..43dc265ece 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedFlamelight.cs @@ -10,6 +10,7 @@ using Terraria.Enums; using Terraria.ObjectData; using Terraria.Audio; using CalamityMod.Sounds; +using CalamityMod.Items.Pets; namespace CalamityMod.Tiles.DraedonStructures.CagedLights { @@ -21,6 +22,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 60; @@ -91,10 +93,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs b/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs index 59539ee4f6..764e51188e 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedFloodlight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 187; @@ -91,10 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs b/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs index 1102fa25b9..635df1e7d4 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedFrostlight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 247; @@ -91,10 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/DraedonStructures/CagedLights/CagedLablight.cs b/Tiles/DraedonStructures/CagedLights/CagedLablight.cs index 6997a227ba..1e8729a673 100644 --- a/Tiles/DraedonStructures/CagedLights/CagedLablight.cs +++ b/Tiles/DraedonStructures/CagedLights/CagedLablight.cs @@ -21,6 +21,7 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights Main.tileNoFail[Type] = true; Main.tileFrameImportant[Type] = true; Main.tileObsidianKill[Type] = false; + RegisterItemDrop(ModContent.ItemType()); HitSound = CommonCalamitySounds.PlatingMine; DustType = 299; @@ -91,9 +92,5 @@ namespace CalamityMod.Tiles.DraedonStructures.CagedLights b = 0f; } } - public override void KillMultiTile(int i, int j, int frameX, int frameY) - { - Item.NewItem(new EntitySource_TileBreak(i, j), i * 16, j * 16, 32, 48, ModContent.ItemType()); - } } } diff --git a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs index 4cad230406..2cc4005b2a 100644 --- a/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodLanternTile.cs @@ -2,8 +2,10 @@ using CalamityMod.Items.Placeables.FurnitureAcidwood; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -11,6 +13,10 @@ namespace CalamityMod.Tiles.FurnitureAcidwood { public class AcidwoodLanternTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -46,9 +52,19 @@ namespace CalamityMod.Tiles.FurnitureAcidwood CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAcidwood/AcidwoodLanternTileFlame").Value, i, j, 0, -8); + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(64, 128, 102, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; } public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) diff --git a/Tiles/Abyss/AcidwoodTile.cs b/Tiles/FurnitureAcidwood/AcidwoodTile.cs similarity index 96% rename from Tiles/Abyss/AcidwoodTile.cs rename to Tiles/FurnitureAcidwood/AcidwoodTile.cs index eb33744e0a..03b7e8c4f7 100644 --- a/Tiles/Abyss/AcidwoodTile.cs +++ b/Tiles/FurnitureAcidwood/AcidwoodTile.cs @@ -5,7 +5,7 @@ using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.Abyss +namespace CalamityMod.Tiles.FurnitureAcidwood { public class AcidwoodTile : ModTile { diff --git a/Tiles/Abyss/AcidwoodTile.png b/Tiles/FurnitureAcidwood/AcidwoodTile.png similarity index 100% rename from Tiles/Abyss/AcidwoodTile.png rename to Tiles/FurnitureAcidwood/AcidwoodTile.png diff --git a/Tiles/Furniture/CraftingStations/AncientAltar.cs b/Tiles/FurnitureAncient/AncientAltar.cs similarity index 89% rename from Tiles/Furniture/CraftingStations/AncientAltar.cs rename to Tiles/FurnitureAncient/AncientAltar.cs index fb2008520f..99eb9e3e74 100644 --- a/Tiles/Furniture/CraftingStations/AncientAltar.cs +++ b/Tiles/FurnitureAncient/AncientAltar.cs @@ -7,7 +7,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureAncient { public class AncientAltar : ModTile { @@ -21,7 +21,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.newTile.LavaDeath = false; TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } @@ -58,7 +58,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations public override void PostDraw(int i, int j, SpriteBatch spriteBatch) { - CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/AncientAltarFlame").Value, i, j, offsetY: animationFrame * AnimationFrameHeight); + CalamityUtils.DrawStaticFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAncient/AncientAltarFlame").Value, i, j, offsetY: animationFrame * AnimationFrameHeight); } public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) diff --git a/Tiles/Furniture/CraftingStations/AncientAltar.png b/Tiles/FurnitureAncient/AncientAltar.png similarity index 100% rename from Tiles/Furniture/CraftingStations/AncientAltar.png rename to Tiles/FurnitureAncient/AncientAltar.png diff --git a/Tiles/Furniture/CraftingStations/AncientAltarFlame.png b/Tiles/FurnitureAncient/AncientAltarFlame.png similarity index 100% rename from Tiles/Furniture/CraftingStations/AncientAltarFlame.png rename to Tiles/FurnitureAncient/AncientAltarFlame.png diff --git a/Tiles/FurnitureAncient/AncientLantern.cs b/Tiles/FurnitureAncient/AncientLantern.cs index 00ac4b6fd0..a570d64da5 100644 --- a/Tiles/FurnitureAncient/AncientLantern.cs +++ b/Tiles/FurnitureAncient/AncientLantern.cs @@ -1,7 +1,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAncient { public class AncientLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -40,9 +46,19 @@ namespace CalamityMod.Tiles.FurnitureAncient } } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAncient/AncientLanternFlame").Value, i, j); + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 64, 64, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0f; } public override void HitWire(int i, int j) diff --git a/Tiles/FurnitureAshen/AshenChandelier.cs b/Tiles/FurnitureAshen/AshenChandelier.cs index 65bb0575ff..51b0668275 100644 --- a/Tiles/FurnitureAshen/AshenChandelier.cs +++ b/Tiles/FurnitureAshen/AshenChandelier.cs @@ -75,7 +75,7 @@ namespace CalamityMod.Tiles.FurnitureAshen tileFlameData.flameRangeXMax = 11; tileFlameData.flameRangeYMin = -10; tileFlameData.flameRangeYMax = 11; - tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultX = 0.05f; tileFlameData.flameRangeMultY = 0f; } diff --git a/Tiles/FurnitureAshen/AshenLantern.cs b/Tiles/FurnitureAshen/AshenLantern.cs index ec7f983270..e671750d60 100644 --- a/Tiles/FurnitureAshen/AshenLantern.cs +++ b/Tiles/FurnitureAshen/AshenLantern.cs @@ -1,7 +1,9 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureAshen { public class AshenLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -40,16 +46,26 @@ namespace CalamityMod.Tiles.FurnitureAshen } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 64, 64, 0); + tileFlameData.flameCount = 2; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0f; + tileFlameData.flameRangeMultY = 0f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureAshen/AshenLanternFlame").Value, i, j); - } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { Tile tile = Main.tile[i, j]; diff --git a/Tiles/Furniture/CraftingStations/BotanicPlanter.cs b/Tiles/FurnitureBotanic/BotanicPlanter.cs similarity index 93% rename from Tiles/Furniture/CraftingStations/BotanicPlanter.cs rename to Tiles/FurnitureBotanic/BotanicPlanter.cs index 1d620f9c18..f1ab9e9ee2 100644 --- a/Tiles/Furniture/CraftingStations/BotanicPlanter.cs +++ b/Tiles/FurnitureBotanic/BotanicPlanter.cs @@ -7,7 +7,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureBotanic { public class BotanicPlanter : ModTile { @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.StyleLineSkip = 2; TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } diff --git a/Tiles/Furniture/CraftingStations/BotanicPlanter.png b/Tiles/FurnitureBotanic/BotanicPlanter.png similarity index 100% rename from Tiles/Furniture/CraftingStations/BotanicPlanter.png rename to Tiles/FurnitureBotanic/BotanicPlanter.png diff --git a/Tiles/SunkenSea/Driftwood.cs b/Tiles/FurnitureDriftwood/Driftwood.cs similarity index 91% rename from Tiles/SunkenSea/Driftwood.cs rename to Tiles/FurnitureDriftwood/Driftwood.cs index 2912e3a13a..131b45406e 100644 --- a/Tiles/SunkenSea/Driftwood.cs +++ b/Tiles/FurnitureDriftwood/Driftwood.cs @@ -5,7 +5,7 @@ using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.SunkenSea +namespace CalamityMod.Tiles.FurnitureDriftwood { public class Driftwood : ModTile { @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.SunkenSea AddMapEntry(new Color(136, 129, 154)); // 02JUN2024: Ozzatron: Dunesand has no merge - // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); + //TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out tileAdjacency); // 02JUN2024: Ozzatron: Shellstone has no merge tile sheet defined // TileFraming.SetUpUniversalMerge(Type, ModContent.TileType(), out secondTileAdjacency); diff --git a/Tiles/SunkenSea/Driftwood.png b/Tiles/FurnitureDriftwood/Driftwood.png similarity index 100% rename from Tiles/SunkenSea/Driftwood.png rename to Tiles/FurnitureDriftwood/Driftwood.png diff --git a/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.cs b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.cs new file mode 100644 index 0000000000..d2474ec746 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.cs @@ -0,0 +1,36 @@ +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBaroqueCello : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); //This Cello has bookcase dimensions + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetText("Tiles.BaroqueCello")); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.png b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.png new file mode 100644 index 0000000000..d8de02541c Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBaroqueCello.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBathtub.cs b/Tiles/FurnitureDriftwood/DriftwoodBathtub.cs new file mode 100644 index 0000000000..e4119a2b31 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBathtub.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBathtub : ModTile + { + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBathtub.png b/Tiles/FurnitureDriftwood/DriftwoodBathtub.png new file mode 100644 index 0000000000..f38650ae70 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBathtub.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBed.cs b/Tiles/FurnitureDriftwood/DriftwoodBed.cs new file mode 100644 index 0000000000..ffe489ed40 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBed.cs @@ -0,0 +1,30 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBed : ModTile + { + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBed.png b/Tiles/FurnitureDriftwood/DriftwoodBed.png new file mode 100644 index 0000000000..c4e1380f12 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBed.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBed_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodBed_Highlight.png new file mode 100644 index 0000000000..5974b70765 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBed_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodBookcase.cs b/Tiles/FurnitureDriftwood/DriftwoodBookcase.cs new file mode 100644 index 0000000000..69d45e8b87 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodBookcase.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodBookcase : ModTile + { + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodBookcase.png b/Tiles/FurnitureDriftwood/DriftwoodBookcase.png new file mode 100644 index 0000000000..8bd062dc7e Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodBookcase.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandelabra.cs b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.cs new file mode 100644 index 0000000000..8bad131ba0 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.cs @@ -0,0 +1,44 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodCandelabra : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandelabra.png b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.png new file mode 100644 index 0000000000..a80821e5a7 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodCandelabra.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandle.cs b/Tiles/FurnitureDriftwood/DriftwoodCandle.cs new file mode 100644 index 0000000000..4d42b720bc --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodCandle.cs @@ -0,0 +1,58 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodCandle : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, 1, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodCandle.png b/Tiles/FurnitureDriftwood/DriftwoodCandle.png new file mode 100644 index 0000000000..a89e4a3b12 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodCandle.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChair.cs b/Tiles/FurnitureDriftwood/DriftwoodChair.cs new file mode 100644 index 0000000000..de72102d2f --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodChair.cs @@ -0,0 +1,37 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodChair : ModTile + { + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodChair.png b/Tiles/FurnitureDriftwood/DriftwoodChair.png new file mode 100644 index 0000000000..f540f21d51 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChair.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChair_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodChair_Highlight.png new file mode 100644 index 0000000000..6c8693094f Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChair_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChandelier.cs b/Tiles/FurnitureDriftwood/DriftwoodChandelier.cs new file mode 100644 index 0000000000..e520931848 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodChandelier.cs @@ -0,0 +1,47 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodChandelier : ModTile + { + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodChandelier.png b/Tiles/FurnitureDriftwood/DriftwoodChandelier.png new file mode 100644 index 0000000000..2f7510c14d Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChandelier.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChest.cs b/Tiles/FurnitureDriftwood/DriftwoodChest.cs new file mode 100644 index 0000000000..2672cb6c9e --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodChest.cs @@ -0,0 +1,32 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodChest : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChest(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodChest.png b/Tiles/FurnitureDriftwood/DriftwoodChest.png new file mode 100644 index 0000000000..63df766217 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChest.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodChest_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodChest_Highlight.png new file mode 100644 index 0000000000..61e5b0044f Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodChest_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.cs b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.cs new file mode 100644 index 0000000000..ef8946da38 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodDoorClosed : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorClosed(ModContent.ItemType(), true); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.png b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.png new file mode 100644 index 0000000000..5884fc811f Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorClosed_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed_Highlight.png new file mode 100644 index 0000000000..c923098653 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.cs b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.cs new file mode 100644 index 0000000000..b0561247ab --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodDoorOpen : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorOpen(ModContent.ItemType(), true); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.png b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.png new file mode 100644 index 0000000000..c57116c347 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDoorOpen_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen_Highlight.png new file mode 100644 index 0000000000..8121934574 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDresser.cs b/Tiles/FurnitureDriftwood/DriftwoodDresser.cs new file mode 100644 index 0000000000..2c0d90f00d --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodDresser.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodDresser : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Firework_Blue, 0f, 0f, 1, new Color(255, 255, 255), 1f); + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Firework_Pink, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodDresser.png b/Tiles/FurnitureDriftwood/DriftwoodDresser.png new file mode 100644 index 0000000000..b942c92ed3 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDresser.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodDresser_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodDresser_Highlight.png new file mode 100644 index 0000000000..726973d772 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodDresser_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodLamp.cs b/Tiles/FurnitureDriftwood/DriftwoodLamp.cs new file mode 100644 index 0000000000..dcc3a7131d --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodLamp.cs @@ -0,0 +1,44 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodLamp : ModTile + { + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodLamp.png b/Tiles/FurnitureDriftwood/DriftwoodLamp.png new file mode 100644 index 0000000000..2669926efb Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodLamp.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodLantern.cs b/Tiles/FurnitureDriftwood/DriftwoodLantern.cs new file mode 100644 index 0000000000..f56e3c9a62 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodLantern.cs @@ -0,0 +1,46 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodLantern : ModTile + { + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 89f / 155f; + g = 98f / 155f; + b = 106f / 155f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodLantern.png b/Tiles/FurnitureDriftwood/DriftwoodLantern.png new file mode 100644 index 0000000000..fb3e61ddc8 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodLantern.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodPlatform.cs b/Tiles/FurnitureDriftwood/DriftwoodPlatform.cs new file mode 100644 index 0000000000..2ea14a89b7 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodPlatform.cs @@ -0,0 +1,28 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodPlatform : ModTile + { + public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodPlatform.png b/Tiles/FurnitureDriftwood/DriftwoodPlatform.png new file mode 100644 index 0000000000..339f2394e9 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodPlatform.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSink.cs b/Tiles/FurnitureDriftwood/DriftwoodSink.cs new file mode 100644 index 0000000000..abfdaf46f1 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodSink.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodSink : ModTile + { + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodSink.png b/Tiles/FurnitureDriftwood/DriftwoodSink.png new file mode 100644 index 0000000000..ba278cfee0 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSink.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSofa.cs b/Tiles/FurnitureDriftwood/DriftwoodSofa.cs new file mode 100644 index 0000000000..da22040621 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodSofa.cs @@ -0,0 +1,37 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodSofa : ModTile + { + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodSofa.png b/Tiles/FurnitureDriftwood/DriftwoodSofa.png new file mode 100644 index 0000000000..d9043d2231 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSofa.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSofa_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodSofa_Highlight.png new file mode 100644 index 0000000000..8b6a408e46 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSofa_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSundial.cs b/Tiles/FurnitureDriftwood/DriftwoodSundial.cs new file mode 100644 index 0000000000..2dacba82d0 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodSundial.cs @@ -0,0 +1,41 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodSundial : ModTile + { + public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType(), true); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool RightClick(int x, int y) + { + return CalamityUtils.ClockRightClick(); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.SceneMetrics.HasClock = true; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodSundial.png b/Tiles/FurnitureDriftwood/DriftwoodSundial.png new file mode 100644 index 0000000000..5601159701 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSundial.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodSundial_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodSundial_Highlight.png new file mode 100644 index 0000000000..6c3469902b Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodSundial_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodTable.cs b/Tiles/FurnitureDriftwood/DriftwoodTable.cs new file mode 100644 index 0000000000..3a233fa6e2 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodTable.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodTable : ModTile + { + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodTable.png b/Tiles/FurnitureDriftwood/DriftwoodTable.png new file mode 100644 index 0000000000..24259b2899 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodTable.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodToilet.cs b/Tiles/FurnitureDriftwood/DriftwoodToilet.cs new file mode 100644 index 0000000000..d92e67baee --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodToilet.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodToilet : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + // Toilets count as Chairs + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Toilet")); + TileID.Sets.CanBeSatOnForNPCs[Type] = true; + TileID.Sets.CanBeSatOnForPlayers[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + AdjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Granite, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, shitter: true); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + + public override void HitWire(int i, int j) // I hate this please make it stop. - Merkalto + { + Tile tile = Main.tile[i, j]; + + int spawnX = i; + int spawnY = j - tile.TileFrameY / 18; + + Wiring.SkipWire(spawnX, spawnY); + Wiring.SkipWire(spawnX, spawnY + 1); + + if (Wiring.CheckMech(spawnX, spawnY, 60)) + { + Projectile.NewProjectile(Wiring.GetProjectileSource(spawnX, spawnY), spawnX * 16 + 8, spawnY * 16 + 12, 0f, 0f, ProjectileID.ToiletEffect, 0, 0f, Main.myPlayer); + } + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodToilet.png b/Tiles/FurnitureDriftwood/DriftwoodToilet.png new file mode 100644 index 0000000000..cb478a2214 Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodToilet.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodToilet_Highlight.png b/Tiles/FurnitureDriftwood/DriftwoodToilet_Highlight.png new file mode 100644 index 0000000000..784cd7f73c Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodToilet_Highlight.png differ diff --git a/Tiles/FurnitureDriftwood/DriftwoodWorkBench.cs b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.cs new file mode 100644 index 0000000000..eec1af1d56 --- /dev/null +++ b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureDriftwood +{ + public class DriftwoodWorkBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 235, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureDriftwood/DriftwoodWorkBench.png b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.png new file mode 100644 index 0000000000..47a279ce7b Binary files /dev/null and b/Tiles/FurnitureDriftwood/DriftwoodWorkBench.png differ diff --git a/Tiles/FurnitureExo/ExoLanternTile.cs b/Tiles/FurnitureExo/ExoLanternTile.cs index 30c1883ff0..8946144fcf 100644 --- a/Tiles/FurnitureExo/ExoLanternTile.cs +++ b/Tiles/FurnitureExo/ExoLanternTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.FurnitureExo; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureExo { public class ExoLanternTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -41,14 +47,24 @@ namespace CalamityMod.Tiles.FurnitureExo } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureExo/ExoLanternTileFlame").Value, i, j); - } } } diff --git a/Tiles/Astral/AstralMonolith.cs b/Tiles/FurnitureMonolith/AstralMonolith.cs similarity index 98% rename from Tiles/Astral/AstralMonolith.cs rename to Tiles/FurnitureMonolith/AstralMonolith.cs index 5dd4bb0a03..b6d82a7aec 100644 --- a/Tiles/Astral/AstralMonolith.cs +++ b/Tiles/FurnitureMonolith/AstralMonolith.cs @@ -8,8 +8,9 @@ using Terraria; using Terraria.GameContent.Metadata; using Terraria.ID; using Terraria.ModLoader; +using CalamityMod.Tiles.Astral; -namespace CalamityMod.Tiles.Astral +namespace CalamityMod.Tiles.FurnitureMonolith { public class AstralMonolith : ModTile { diff --git a/Tiles/Astral/AstralMonolith.png b/Tiles/FurnitureMonolith/AstralMonolith.png similarity index 100% rename from Tiles/Astral/AstralMonolith.png rename to Tiles/FurnitureMonolith/AstralMonolith.png diff --git a/Tiles/Astral/AstralMonolithGlow.png b/Tiles/FurnitureMonolith/AstralMonolithGlow.png similarity index 100% rename from Tiles/Astral/AstralMonolithGlow.png rename to Tiles/FurnitureMonolith/AstralMonolithGlow.png diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs b/Tiles/FurnitureMonolith/MonolithAmalgam.cs similarity index 85% rename from Tiles/Furniture/CraftingStations/MonolithAmalgam.cs rename to Tiles/FurnitureMonolith/MonolithAmalgam.cs index 8d19243ab9..7f1ef8c29d 100644 --- a/Tiles/Furniture/CraftingStations/MonolithAmalgam.cs +++ b/Tiles/FurnitureMonolith/MonolithAmalgam.cs @@ -4,15 +4,15 @@ using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.ModLoader; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureMonolith { [LegacyName("MonolithCrafting")] public class MonolithAmalgam : ModTile { public override void SetStaticDefaults() { - this.SetUpBookcase(ModContent.ItemType(), true, false, false); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + this.SetUpBookcase(ModContent.ItemType(), true, false, false); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); } public override bool CreateDust(int i, int j, ref int type) @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/MonolithAmalgamGlow").Value; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithAmalgamGlow").Value; Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgam.png b/Tiles/FurnitureMonolith/MonolithAmalgam.png similarity index 100% rename from Tiles/Furniture/CraftingStations/MonolithAmalgam.png rename to Tiles/FurnitureMonolith/MonolithAmalgam.png diff --git a/Tiles/Furniture/CraftingStations/MonolithAmalgamGlow.png b/Tiles/FurnitureMonolith/MonolithAmalgamGlow.png similarity index 100% rename from Tiles/Furniture/CraftingStations/MonolithAmalgamGlow.png rename to Tiles/FurnitureMonolith/MonolithAmalgamGlow.png diff --git a/Tiles/FurnitureMonolith/MonolithLantern.cs b/Tiles/FurnitureMonolith/MonolithLantern.cs index c5a2cc2c2e..ab9b0e5a45 100644 --- a/Tiles/FurnitureMonolith/MonolithLantern.cs +++ b/Tiles/FurnitureMonolith/MonolithLantern.cs @@ -1,13 +1,24 @@ using CalamityMod.Dusts; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ModLoader; namespace CalamityMod.Tiles.FurnitureMonolith { public class MonolithLantern : ModTile { + public Asset FlameTexture; + public Asset GlowTexture; + + public override void Load() + { + FlameTexture = ModContent.Request(Texture + "Flame"); + GlowTexture = ModContent.Request(Texture + "Glow"); + } + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -22,22 +33,7 @@ namespace CalamityMod.Tiles.FurnitureMonolith num = fail ? 1 : 3; } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - if (Main.tile[i, j].IsTileActuallyInvisible()) - return; - - int xPos = Main.tile[i, j].TileFrameX; - int yPos = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLanternGlow").Value; - Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); - Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); - Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; - Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - - Texture2D glowmaskBright = ModContent.Request("CalamityMod/Tiles/FurnitureMonolith/MonolithLanternFlame").Value; - Main.spriteBatch.Draw(glowmaskBright, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), Color.White, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); - } + public override void AdjustMultiTileVineParameters(int i, int j, ref float? overrideWindCycle, ref float windPushPowerX, ref float windPushPowerY, ref bool dontRotateTopTiles, ref float totalWindMultiplier, ref Texture2D glowTexture, ref Color glowColor) => glowTexture = GlowTexture.Value; public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) { @@ -55,6 +51,21 @@ namespace CalamityMod.Tiles.FurnitureMonolith } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 1; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0f; + tileFlameData.flameRangeMultY = 0f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs new file mode 100644 index 0000000000..7fa416acca --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBathtub")] + public class AncientNavystoneBathtub : ModTile + { + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBathtub.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBathtub.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBathtub.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs new file mode 100644 index 0000000000..a8d3e2b403 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.cs @@ -0,0 +1,31 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBed")] + public class AncientNavystoneBed : ModTile + { + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBed.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed.png diff --git a/Tiles/FurnitureEutrophic/EutrophicBed_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBed_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBed_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs new file mode 100644 index 0000000000..10e7e3fe2b --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBench")] + public class AncientNavystoneBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), false, true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBench.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBench.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench.png diff --git a/Tiles/FurnitureEutrophic/EutrophicBench_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBench_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBench_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs new file mode 100644 index 0000000000..d4411a6561 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicBookcase")] + public class AncientNavystoneBookcase : ModTile + { + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicBookcase.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicBookcase.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneBookcase.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs new file mode 100644 index 0000000000..c98491aaa5 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandelabra")] + public class AncientNavystoneCandelabra : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 2, 2); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicCandelabra.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicCandelabra.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandelabra.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs new file mode 100644 index 0000000000..c5ec992870 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.cs @@ -0,0 +1,59 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicCandle")] + public class AncientNavystoneCandle : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicCandle.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicCandle.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneCandle.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs new file mode 100644 index 0000000000..7baefbb973 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChair")] + public class AncientNavystoneChair : ModTile + { + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicChair.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChair.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair.png diff --git a/Tiles/FurnitureEutrophic/EutrophicChair_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChair_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChair_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs new file mode 100644 index 0000000000..4ca18e0ca4 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChandelier")] + public class AncientNavystoneChandelier : ModTile + { + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicChandelier.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChandelier.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChandelier.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs new file mode 100644 index 0000000000..3677bff276 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicChest")] + public class AncientNavystoneChest : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChest(ModContent.ItemType(), true); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChest.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest.png diff --git a/Tiles/FurnitureEutrophic/EutrophicChest_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicChest_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneChest_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs new file mode 100644 index 0000000000..a4b73e2700 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.cs @@ -0,0 +1,58 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicClock")] + public class AncientNavystoneClock : ModTile + { + public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool RightClick(int x, int y) + { + return CalamityUtils.ClockRightClick(); + } + + public override void NearbyEffects(int i, int j, bool closer) + { + if (closer) + { + Main.SceneMetrics.HasClock = true; + } + } + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicClock.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicClock.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock.png diff --git a/Tiles/FurnitureEutrophic/EutrophicClock_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicClock_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneClock_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.cs new file mode 100644 index 0000000000..eac29d4996 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.cs @@ -0,0 +1,39 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDoorClosed")] + public class AncientNavystoneDoorClosed : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorClosed(ModContent.ItemType()); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorClosed.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed.png diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorClosed_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorClosed_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.cs new file mode 100644 index 0000000000..d9ca902825 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.cs @@ -0,0 +1,41 @@ +using CalamityMod.Items.Placeables.FurnitureNavystone; +using CalamityMod.Items.Placeables.FurnitureNavystone.FurnitureAncientNavystone; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDoorOpen")] + public class AncientNavystoneDoorOpen : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorOpen(ModContent.ItemType()); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorOpen.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen.png diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDoorOpen_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDoorOpen_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs new file mode 100644 index 0000000000..be8cbe7258 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.cs @@ -0,0 +1,33 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicDresser")] + public class AncientNavystoneDresser : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDresser.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser.png diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser_Highlight.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser_Highlight.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicDresser_Highlight.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneDresser_Highlight.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs new file mode 100644 index 0000000000..ad6db914c5 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.cs @@ -0,0 +1,45 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLamp")] + public class AncientNavystoneLamp : ModTile + { + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicLamp.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicLamp.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLamp.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs new file mode 100644 index 0000000000..68c39d9298 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.cs @@ -0,0 +1,47 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicLantern")] + public class AncientNavystoneLantern : ModTile + { + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 0.5f; + g = 1f; + b = 1f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicLantern.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneLantern.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs new file mode 100644 index 0000000000..a085e8e67f --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPiano")] + public class AncientNavystonePiano : ModTile + { + public override void SetStaticDefaults() => this.SetUpPiano(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicPiano.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicPiano.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePiano.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs new file mode 100644 index 0000000000..94b3503972 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.cs @@ -0,0 +1,29 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicPlatform")] + public class AncientNavystonePlatform : ModTile + { + public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void PostSetDefaults() + { + Main.tileNoSunLight[Type] = false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicPlatform.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicPlatform.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystonePlatform.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs new file mode 100644 index 0000000000..4f7ab93d33 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicSink")] + public class AncientNavystoneSink : ModTile + { + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicSink.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicSink.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneSink.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs new file mode 100644 index 0000000000..46cf5a9a78 --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicTable")] + public class AncientNavystoneTable : ModTile + { + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicTable.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicTable.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneTable.png diff --git a/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs new file mode 100644 index 0000000000..2f52f6e75b --- /dev/null +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.cs @@ -0,0 +1,24 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone +{ + [LegacyName("EutrophicWorkBench")] + public class AncientNavystoneWorkBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureEutrophic/EutrophicWorkBench.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png similarity index 100% rename from Tiles/FurnitureEutrophic/EutrophicWorkBench.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientNavystoneWorkBench.png diff --git a/Tiles/FurnitureEutrophic/AncientSmoothNavystone.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs similarity index 92% rename from Tiles/FurnitureEutrophic/AncientSmoothNavystone.cs rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs index 18ae30d146..bee411f11d 100644 --- a/Tiles/FurnitureEutrophic/AncientSmoothNavystone.cs +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.cs @@ -4,7 +4,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone { public class AncientSmoothNavystone : ModTile { diff --git a/Tiles/FurnitureEutrophic/AncientSmoothNavystone.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png similarity index 100% rename from Tiles/FurnitureEutrophic/AncientSmoothNavystone.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/AncientSmoothNavystone.png diff --git a/Tiles/Furniture/CraftingStations/EutrophicShelf.cs b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs similarity index 94% rename from Tiles/Furniture/CraftingStations/EutrophicShelf.cs rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs index dca632f30e..010779aa70 100644 --- a/Tiles/Furniture/CraftingStations/EutrophicShelf.cs +++ b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.cs @@ -6,7 +6,7 @@ using Terraria.ID; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone { [LegacyName("EutrophicCrafting")] public class EutrophicShelf : ModTile @@ -41,7 +41,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; TileObjectData.addAlternate(1); TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } diff --git a/Tiles/Furniture/CraftingStations/EutrophicShelf.png b/Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png similarity index 100% rename from Tiles/Furniture/CraftingStations/EutrophicShelf.png rename to Tiles/FurnitureNavystone/FurnitureAncientNavystone/EutrophicShelf.png diff --git a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs b/Tiles/FurnitureNavystone/NavystoneBathtub.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicBathtub.cs rename to Tiles/FurnitureNavystone/NavystoneBathtub.cs index 85dcf8c046..67b72afb56 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBathtub.cs +++ b/Tiles/FurnitureNavystone/NavystoneBathtub.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBathtub : ModTile + public class NavystoneBathtub : ModTile { - public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneBathtub.png b/Tiles/FurnitureNavystone/NavystoneBathtub.png new file mode 100644 index 0000000000..60f3952cb5 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBathtub.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicBed.cs b/Tiles/FurnitureNavystone/NavystoneBed.cs similarity index 82% rename from Tiles/FurnitureEutrophic/EutrophicBed.cs rename to Tiles/FurnitureNavystone/NavystoneBed.cs index 5dd7734de4..31c8888783 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBed.cs +++ b/Tiles/FurnitureNavystone/NavystoneBed.cs @@ -4,11 +4,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBed : ModTile + public class NavystoneBed : ModTile { - public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { @@ -25,6 +25,6 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); - public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureNavystone/NavystoneBed.png b/Tiles/FurnitureNavystone/NavystoneBed.png new file mode 100644 index 0000000000..001728bd9a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBed.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneBed_Highlight.png b/Tiles/FurnitureNavystone/NavystoneBed_Highlight.png new file mode 100644 index 0000000000..b11dd25886 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBed_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs b/Tiles/FurnitureNavystone/NavystoneBookcase.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicBookcase.cs rename to Tiles/FurnitureNavystone/NavystoneBookcase.cs index cadb22b791..0ac994ccfa 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBookcase.cs +++ b/Tiles/FurnitureNavystone/NavystoneBookcase.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBookcase : ModTile + public class NavystoneBookcase : ModTile { - public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneBookcase.png b/Tiles/FurnitureNavystone/NavystoneBookcase.png new file mode 100644 index 0000000000..85c12525fb Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneBookcase.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs b/Tiles/FurnitureNavystone/NavystoneCandelabra.cs similarity index 85% rename from Tiles/FurnitureEutrophic/EutrophicCandelabra.cs rename to Tiles/FurnitureNavystone/NavystoneCandelabra.cs index 524b5da0cf..61b6bcc3d8 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandelabra.cs +++ b/Tiles/FurnitureNavystone/NavystoneCandelabra.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicCandelabra : ModTile + public class NavystoneCandelabra : ModTile { - public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpCandelabra(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneCandelabra.png b/Tiles/FurnitureNavystone/NavystoneCandelabra.png new file mode 100644 index 0000000000..09672ac1cb Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneCandelabra.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicCandle.cs b/Tiles/FurnitureNavystone/NavystoneCandle.cs similarity index 86% rename from Tiles/FurnitureEutrophic/EutrophicCandle.cs rename to Tiles/FurnitureNavystone/NavystoneCandle.cs index 1b4f0db715..895adafb2b 100644 --- a/Tiles/FurnitureEutrophic/EutrophicCandle.cs +++ b/Tiles/FurnitureNavystone/NavystoneCandle.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicCandle : ModTile + public class NavystoneCandle : ModTile { - public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { @@ -46,7 +46,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Player player = Main.LocalPlayer; player.noThrow = 2; player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); + player.cursorItemIconID = ModContent.ItemType(); } public override bool RightClick(int i, int j) diff --git a/Tiles/FurnitureNavystone/NavystoneCandle.png b/Tiles/FurnitureNavystone/NavystoneCandle.png new file mode 100644 index 0000000000..e1fe5f8507 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneCandle.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicChair.cs b/Tiles/FurnitureNavystone/NavystoneChair.cs similarity index 85% rename from Tiles/FurnitureEutrophic/EutrophicChair.cs rename to Tiles/FurnitureNavystone/NavystoneChair.cs index 2028c2a9c3..d06a33c753 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChair.cs +++ b/Tiles/FurnitureNavystone/NavystoneChair.cs @@ -6,11 +6,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicChair : ModTile + public class NavystoneChair : ModTile { - public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); - public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) { diff --git a/Tiles/FurnitureNavystone/NavystoneChair.png b/Tiles/FurnitureNavystone/NavystoneChair.png new file mode 100644 index 0000000000..30c65cd137 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChair.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png b/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png new file mode 100644 index 0000000000..fca0c61d27 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChair_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs b/Tiles/FurnitureNavystone/NavystoneChandelier.cs similarity index 86% rename from Tiles/FurnitureEutrophic/EutrophicChandelier.cs rename to Tiles/FurnitureNavystone/NavystoneChandelier.cs index c98b6590b7..0c681e1693 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChandelier.cs +++ b/Tiles/FurnitureNavystone/NavystoneChandelier.cs @@ -4,11 +4,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicChandelier : ModTile + public class NavystoneChandelier : ModTile { - public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); diff --git a/Tiles/FurnitureNavystone/NavystoneChandelier.png b/Tiles/FurnitureNavystone/NavystoneChandelier.png new file mode 100644 index 0000000000..9cc4db1d1c Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChandelier.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicChest.cs b/Tiles/FurnitureNavystone/NavystoneChest.cs similarity index 76% rename from Tiles/FurnitureEutrophic/EutrophicChest.cs rename to Tiles/FurnitureNavystone/NavystoneChest.cs index 21053e81c1..232e559bea 100644 --- a/Tiles/FurnitureEutrophic/EutrophicChest.cs +++ b/Tiles/FurnitureNavystone/NavystoneChest.cs @@ -5,14 +5,14 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicChest : ModTile + public class NavystoneChest : ModTile { public override void SetStaticDefaults() { - this.SetUpChest(ModContent.ItemType(), true); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + this.SetUpChest(ModContent.ItemType(), true); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); } public override bool CreateDust(int i, int j, ref int type) @@ -23,9 +23,9 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); - public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); - public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); } diff --git a/Tiles/FurnitureNavystone/NavystoneChest.png b/Tiles/FurnitureNavystone/NavystoneChest.png new file mode 100644 index 0000000000..b77c5ad9e5 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChest.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png b/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png new file mode 100644 index 0000000000..721846627a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneChest_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicClock.cs b/Tiles/FurnitureNavystone/NavystoneClock.cs similarity index 88% rename from Tiles/FurnitureEutrophic/EutrophicClock.cs rename to Tiles/FurnitureNavystone/NavystoneClock.cs index c58bfde6cd..98806da830 100644 --- a/Tiles/FurnitureEutrophic/EutrophicClock.cs +++ b/Tiles/FurnitureNavystone/NavystoneClock.cs @@ -4,11 +4,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicClock : ModTile + public class NavystoneClock : ModTile { - public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpClock(ModContent.ItemType()); public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; @@ -52,6 +52,6 @@ namespace CalamityMod.Tiles.FurnitureEutrophic } } - public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); } } diff --git a/Tiles/FurnitureNavystone/NavystoneClock.png b/Tiles/FurnitureNavystone/NavystoneClock.png new file mode 100644 index 0000000000..ee92788132 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneClock.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png b/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png new file mode 100644 index 0000000000..813835a873 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneClock_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs b/Tiles/FurnitureNavystone/NavystoneDoorClosed.cs similarity index 79% rename from Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs rename to Tiles/FurnitureNavystone/NavystoneDoorClosed.cs index 3fe3f15c77..1d65b6c141 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorClosed.cs +++ b/Tiles/FurnitureNavystone/NavystoneDoorClosed.cs @@ -4,14 +4,14 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicDoorClosed : ModTile + public class NavystoneDoorClosed : ModTile { public override void SetStaticDefaults() { - this.SetUpDoorClosed(ModContent.ItemType()); - TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + this.SetUpDoorClosed(ModContent.ItemType()); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); } public override bool CreateDust(int i, int j, ref int type) @@ -32,7 +32,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Player player = Main.LocalPlayer; player.noThrow = 2; player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureNavystone/NavystoneDoorClosed.png b/Tiles/FurnitureNavystone/NavystoneDoorClosed.png new file mode 100644 index 0000000000..f54be56f60 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorClosed.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png new file mode 100644 index 0000000000..e212eaa1db Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs b/Tiles/FurnitureNavystone/NavystoneDoorOpen.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs rename to Tiles/FurnitureNavystone/NavystoneDoorOpen.cs index 3a2e51ab7e..9a319a1f1e 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDoorOpen.cs +++ b/Tiles/FurnitureNavystone/NavystoneDoorOpen.cs @@ -1,18 +1,18 @@ -using CalamityMod.Items.Placeables.FurnitureEutrophic; +using CalamityMod.Items.Placeables.FurnitureNavystone; using Microsoft.Xna.Framework; using Terraria; using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicDoorOpen : ModTile + public class NavystoneDoorOpen : ModTile { public override void SetStaticDefaults() { - this.SetUpDoorOpen(ModContent.ItemType()); - TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + this.SetUpDoorOpen(ModContent.ItemType()); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); } public override bool CreateDust(int i, int j, ref int type) @@ -33,7 +33,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic Player player = Main.LocalPlayer; player.noThrow = 2; player.cursorItemIconEnabled = true; - player.cursorItemIconID = ModContent.ItemType(); + player.cursorItemIconID = ModContent.ItemType(); } } } diff --git a/Tiles/FurnitureNavystone/NavystoneDoorOpen.png b/Tiles/FurnitureNavystone/NavystoneDoorOpen.png new file mode 100644 index 0000000000..409dfbc48d Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorOpen.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png new file mode 100644 index 0000000000..6b2214683a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicDresser.cs b/Tiles/FurnitureNavystone/NavystoneDresser.cs similarity index 76% rename from Tiles/FurnitureEutrophic/EutrophicDresser.cs rename to Tiles/FurnitureNavystone/NavystoneDresser.cs index 8456bd20f4..1084bee069 100644 --- a/Tiles/FurnitureEutrophic/EutrophicDresser.cs +++ b/Tiles/FurnitureNavystone/NavystoneDresser.cs @@ -5,14 +5,14 @@ using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicDresser : ModTile + public class NavystoneDresser : ModTile { public override void SetStaticDefaults() { - this.SetUpDresser(ModContent.ItemType()); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); } public override bool CreateDust(int i, int j, ref int type) @@ -23,9 +23,9 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; - public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); - public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); - public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); } diff --git a/Tiles/FurnitureNavystone/NavystoneDresser.png b/Tiles/FurnitureNavystone/NavystoneDresser.png new file mode 100644 index 0000000000..b720409b99 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDresser.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png b/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png new file mode 100644 index 0000000000..4caa037707 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneDresser_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicLamp.cs b/Tiles/FurnitureNavystone/NavystoneLamp.cs similarity index 86% rename from Tiles/FurnitureEutrophic/EutrophicLamp.cs rename to Tiles/FurnitureNavystone/NavystoneLamp.cs index 72a09fd1a8..bd7f000af4 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLamp.cs +++ b/Tiles/FurnitureNavystone/NavystoneLamp.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicLamp : ModTile + public class NavystoneLamp : ModTile { - public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneLamp.png b/Tiles/FurnitureNavystone/NavystoneLamp.png new file mode 100644 index 0000000000..8b639f35dc Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneLamp.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicLantern.cs b/Tiles/FurnitureNavystone/NavystoneLantern.cs similarity index 87% rename from Tiles/FurnitureEutrophic/EutrophicLantern.cs rename to Tiles/FurnitureNavystone/NavystoneLantern.cs index a238668f28..b7ef1ce6cc 100644 --- a/Tiles/FurnitureEutrophic/EutrophicLantern.cs +++ b/Tiles/FurnitureNavystone/NavystoneLantern.cs @@ -4,11 +4,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicLantern : ModTile + public class NavystoneLantern : ModTile { - public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); public override bool CreateDust(int i, int j, ref int type) diff --git a/Tiles/FurnitureNavystone/NavystoneLantern.png b/Tiles/FurnitureNavystone/NavystoneLantern.png new file mode 100644 index 0000000000..85eea88754 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneLantern.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicPiano.cs b/Tiles/FurnitureNavystone/NavystoneLyre.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicPiano.cs rename to Tiles/FurnitureNavystone/NavystoneLyre.cs index 7a52e16db4..5880f7e163 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPiano.cs +++ b/Tiles/FurnitureNavystone/NavystoneLyre.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicPiano : ModTile + public class NavystoneLyre : ModTile { - public override void SetStaticDefaults() => this.SetUpPiano(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpPiano(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneLyre.png b/Tiles/FurnitureNavystone/NavystoneLyre.png new file mode 100644 index 0000000000..e797fd1cb9 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneLyre.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs b/Tiles/FurnitureNavystone/NavystonePlatform.cs similarity index 78% rename from Tiles/FurnitureEutrophic/EutrophicPlatform.cs rename to Tiles/FurnitureNavystone/NavystonePlatform.cs index d4162d7113..953bc547c3 100644 --- a/Tiles/FurnitureEutrophic/EutrophicPlatform.cs +++ b/Tiles/FurnitureNavystone/NavystonePlatform.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicPlatform : ModTile + public class NavystonePlatform : ModTile { - public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpPlatform(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystonePlatform.png b/Tiles/FurnitureNavystone/NavystonePlatform.png new file mode 100644 index 0000000000..3f97fc569b Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystonePlatform.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicSink.cs b/Tiles/FurnitureNavystone/NavystoneSink.cs similarity index 76% rename from Tiles/FurnitureEutrophic/EutrophicSink.cs rename to Tiles/FurnitureNavystone/NavystoneSink.cs index d95b05aef6..c276114d43 100644 --- a/Tiles/FurnitureEutrophic/EutrophicSink.cs +++ b/Tiles/FurnitureNavystone/NavystoneSink.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicSink : ModTile + public class NavystoneSink : ModTile { - public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneSink.png b/Tiles/FurnitureNavystone/NavystoneSink.png new file mode 100644 index 0000000000..1410a1a3db Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneSink.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicTable.cs b/Tiles/FurnitureNavystone/NavystoneTable.cs similarity index 75% rename from Tiles/FurnitureEutrophic/EutrophicTable.cs rename to Tiles/FurnitureNavystone/NavystoneTable.cs index e55e216aa7..e9997d1652 100644 --- a/Tiles/FurnitureEutrophic/EutrophicTable.cs +++ b/Tiles/FurnitureNavystone/NavystoneTable.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicTable : ModTile + public class NavystoneTable : ModTile { - public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneTable.png b/Tiles/FurnitureNavystone/NavystoneTable.png new file mode 100644 index 0000000000..fbcdd63309 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneTable.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneToilet.cs b/Tiles/FurnitureNavystone/NavystoneToilet.cs new file mode 100644 index 0000000000..1205e40ff3 --- /dev/null +++ b/Tiles/FurnitureNavystone/NavystoneToilet.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureNavystone +{ + public class NavystoneToilet : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + // Toilets count as Chairs + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Toilet")); + TileID.Sets.CanBeSatOnForNPCs[Type] = true; + TileID.Sets.CanBeSatOnForPlayers[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + AdjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Granite, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, shitter: true); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + + public override void HitWire(int i, int j) // I hate this please make it stop. - Merkalto + { + Tile tile = Main.tile[i, j]; + + int spawnX = i; + int spawnY = j - tile.TileFrameY / 18; + + Wiring.SkipWire(spawnX, spawnY); + Wiring.SkipWire(spawnX, spawnY + 1); + + if (Wiring.CheckMech(spawnX, spawnY, 60)) + { + Projectile.NewProjectile(Wiring.GetProjectileSource(spawnX, spawnY), spawnX * 16 + 8, spawnY * 16 + 12, 0f, 0f, ProjectileID.ToiletEffect, 0, 0f, Main.myPlayer); + } + } + } +} diff --git a/Tiles/FurnitureNavystone/NavystoneToilet.png b/Tiles/FurnitureNavystone/NavystoneToilet.png new file mode 100644 index 0000000000..470aaf68a0 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneToilet.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png b/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png new file mode 100644 index 0000000000..5d2772081a Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneToilet_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicBench.cs b/Tiles/FurnitureNavystone/NavystoneTriclinium.cs similarity index 84% rename from Tiles/FurnitureEutrophic/EutrophicBench.cs rename to Tiles/FurnitureNavystone/NavystoneTriclinium.cs index 876e7ec38c..41251b0b2d 100644 --- a/Tiles/FurnitureEutrophic/EutrophicBench.cs +++ b/Tiles/FurnitureNavystone/NavystoneTriclinium.cs @@ -6,11 +6,11 @@ using Terraria.GameContent.ObjectInteractions; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicBench : ModTile + public class NavystoneTriclinium : ModTile { - public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), false, true); + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), false, true); public override bool CreateDust(int i, int j, ref int type) { @@ -27,7 +27,7 @@ namespace CalamityMod.Tiles.FurnitureEutrophic public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); - public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) { diff --git a/Tiles/FurnitureNavystone/NavystoneTriclinium.png b/Tiles/FurnitureNavystone/NavystoneTriclinium.png new file mode 100644 index 0000000000..68cdff63d5 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneTriclinium.png differ diff --git a/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png b/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png new file mode 100644 index 0000000000..8376806503 Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneTriclinium_Highlight.png differ diff --git a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs b/Tiles/FurnitureNavystone/NavystoneWorkBench.cs similarity index 74% rename from Tiles/FurnitureEutrophic/EutrophicWorkBench.cs rename to Tiles/FurnitureNavystone/NavystoneWorkBench.cs index 07679537ef..162a074600 100644 --- a/Tiles/FurnitureEutrophic/EutrophicWorkBench.cs +++ b/Tiles/FurnitureNavystone/NavystoneWorkBench.cs @@ -3,11 +3,11 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { - public class EutrophicWorkBench : ModTile + public class NavystoneWorkBench : ModTile { - public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType()); + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType()); public override bool CreateDust(int i, int j, ref int type) { diff --git a/Tiles/FurnitureNavystone/NavystoneWorkBench.png b/Tiles/FurnitureNavystone/NavystoneWorkBench.png new file mode 100644 index 0000000000..5cf0c4842b Binary files /dev/null and b/Tiles/FurnitureNavystone/NavystoneWorkBench.png differ diff --git a/Tiles/SunkenSea/PolishedNavystoneBrick.cs b/Tiles/FurnitureNavystone/PolishedNavystoneBrick.cs similarity index 94% rename from Tiles/SunkenSea/PolishedNavystoneBrick.cs rename to Tiles/FurnitureNavystone/PolishedNavystoneBrick.cs index 9331d479ab..06f5c11b6a 100644 --- a/Tiles/SunkenSea/PolishedNavystoneBrick.cs +++ b/Tiles/FurnitureNavystone/PolishedNavystoneBrick.cs @@ -4,7 +4,7 @@ using Terraria.ModLoader; using Terraria.ID; using CalamityMod.Systems; -namespace CalamityMod.Tiles.SunkenSea +namespace CalamityMod.Tiles.FurnitureNavystone { public class PolishedNavystoneBrick : ModTile { diff --git a/Tiles/SunkenSea/PolishedNavystoneBrick.png b/Tiles/FurnitureNavystone/PolishedNavystoneBrick.png similarity index 100% rename from Tiles/SunkenSea/PolishedNavystoneBrick.png rename to Tiles/FurnitureNavystone/PolishedNavystoneBrick.png diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.cs b/Tiles/FurnitureNavystone/SmoothNavystone.cs similarity index 96% rename from Tiles/FurnitureEutrophic/SmoothNavystone.cs rename to Tiles/FurnitureNavystone/SmoothNavystone.cs index ce85324b05..ff73a7d14c 100644 --- a/Tiles/FurnitureEutrophic/SmoothNavystone.cs +++ b/Tiles/FurnitureNavystone/SmoothNavystone.cs @@ -5,7 +5,7 @@ using Terraria; using Terraria.ID; using Terraria.ModLoader; -namespace CalamityMod.Tiles.FurnitureEutrophic +namespace CalamityMod.Tiles.FurnitureNavystone { public class SmoothNavystone : ModTile { diff --git a/Tiles/FurnitureEutrophic/SmoothNavystone.png b/Tiles/FurnitureNavystone/SmoothNavystone.png similarity index 100% rename from Tiles/FurnitureEutrophic/SmoothNavystone.png rename to Tiles/FurnitureNavystone/SmoothNavystone.png diff --git a/Tiles/SunkenSea/SmoothSeaPrism.png b/Tiles/FurnitureNavystone/SmoothSeaPrism.png similarity index 100% rename from Tiles/SunkenSea/SmoothSeaPrism.png rename to Tiles/FurnitureNavystone/SmoothSeaPrism.png diff --git a/Tiles/FurnitureProfaned/ProfanedLantern.cs b/Tiles/FurnitureProfaned/ProfanedLantern.cs index 7435eaccba..5d142f4db2 100644 --- a/Tiles/FurnitureProfaned/ProfanedLantern.cs +++ b/Tiles/FurnitureProfaned/ProfanedLantern.cs @@ -1,8 +1,10 @@ using CalamityMod.Dusts.Furniture; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -10,6 +12,10 @@ namespace CalamityMod.Tiles.FurnitureProfaned { public class ProfanedLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -41,16 +47,26 @@ namespace CalamityMod.Tiles.FurnitureProfaned } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 108, 90, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureProfaned/ProfanedLanternFlame").Value, i, j); - } - public override void DrawEffects(int i, int j, SpriteBatch spriteBatch, ref TileDrawInfo drawData) { if (Main.tile[i, j].TileFrameX < 18) diff --git a/Tiles/FurnitureRunestone/RunestoneTerracotta.cs b/Tiles/FurnitureRunestone/RunestoneTerracotta.cs new file mode 100644 index 0000000000..ddbef319ce --- /dev/null +++ b/Tiles/FurnitureRunestone/RunestoneTerracotta.cs @@ -0,0 +1,44 @@ +using CalamityMod.Systems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; +using CalamityMod.Tiles.SunkenSea; + +namespace CalamityMod.Tiles.FurnitureRunestone +{ + public class RunestoneTerracotta : ModTile + { + public override void SetStaticDefaults() + { + TileID.Sets.GeneralPlacementTiles[Type] = false; + + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + CalamityUtils.MergeWithGeneral(Type); + + TileID.Sets.HasSlopeFrames[Type] = true; + + TileID.Sets.ChecksForMerge[Type] = true; + HitSound = SoundID.Tink; + DustType = DustID.Pot; + AddMapEntry(new Color(186, 130, 130)); + Main.tileShine2[Type] = true; + + TileID.Sets.CanBeDugByShovel[Type] = true; + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/FurnitureRunestone/RunestoneTerracotta.png b/Tiles/FurnitureRunestone/RunestoneTerracotta.png new file mode 100644 index 0000000000..c70ef9bd5f Binary files /dev/null and b/Tiles/FurnitureRunestone/RunestoneTerracotta.png differ diff --git a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs index 3b46b8500e..456a13d127 100644 --- a/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs +++ b/Tiles/FurnitureSacrilegious/SacrilegiousLanternTile.cs @@ -1,7 +1,9 @@ using CalamityMod.Items.Placeables.FurnitureSacrilegious; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -9,6 +11,10 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious { public class SacrilegiousLanternTile : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -40,14 +46,24 @@ namespace CalamityMod.Tiles.FurnitureSacrilegious } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(128, 26, 26, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureSacrilegious/SacrilegiousLanternTileFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureShellstone/ShellTrimBrick.cs b/Tiles/FurnitureShellstone/ShellTrimBrick.cs new file mode 100644 index 0000000000..e62c5122a0 --- /dev/null +++ b/Tiles/FurnitureShellstone/ShellTrimBrick.cs @@ -0,0 +1,34 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; +using Terraria.ID; +using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; + +namespace CalamityMod.Tiles.FurnitureShellstone +{ + public class ShellTrimBrick : ModTile + { + public override void SetStaticDefaults() + { + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + CalamityUtils.MergeWithGeneral(Type); + TileID.Sets.HasSlopeFrames[Type] = true; + + HitSound = SoundID.Tink; + DustType = DustID.CorruptPlants; + AddMapEntry(new Color(156, 191, 199)); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/RunestoneMerge"); + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/FurnitureShellstone/ShellTrimBrick.png b/Tiles/FurnitureShellstone/ShellTrimBrick.png new file mode 100644 index 0000000000..36960b0c90 Binary files /dev/null and b/Tiles/FurnitureShellstone/ShellTrimBrick.png differ diff --git a/Tiles/SunkenSea/ShellstoneSlab.cs b/Tiles/FurnitureShellstone/ShellstoneSlab.cs similarity index 93% rename from Tiles/SunkenSea/ShellstoneSlab.cs rename to Tiles/FurnitureShellstone/ShellstoneSlab.cs index bb2f5c706e..c3d5e24bc6 100644 --- a/Tiles/SunkenSea/ShellstoneSlab.cs +++ b/Tiles/FurnitureShellstone/ShellstoneSlab.cs @@ -3,8 +3,9 @@ using Terraria; using Terraria.ModLoader; using Terraria.ID; using CalamityMod.Systems; +using CalamityMod.Tiles.SunkenSea; -namespace CalamityMod.Tiles.SunkenSea +namespace CalamityMod.Tiles.FurnitureShellstone { public class ShellstoneSlab : ModTile { diff --git a/Tiles/SunkenSea/ShellstoneSlab.png b/Tiles/FurnitureShellstone/ShellstoneSlab.png similarity index 100% rename from Tiles/SunkenSea/ShellstoneSlab.png rename to Tiles/FurnitureShellstone/ShellstoneSlab.png diff --git a/Tiles/Furniture/CraftingStations/SilvaBasin.cs b/Tiles/FurnitureSilva/SilvaBasin.cs similarity index 93% rename from Tiles/Furniture/CraftingStations/SilvaBasin.cs rename to Tiles/FurnitureSilva/SilvaBasin.cs index a056b5aed6..73964ffa6a 100644 --- a/Tiles/Furniture/CraftingStations/SilvaBasin.cs +++ b/Tiles/FurnitureSilva/SilvaBasin.cs @@ -7,7 +7,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureSilva { public class SilvaBasin : ModTile { @@ -20,7 +20,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.LavaDeath = false; TileObjectData.newTile.StyleLineSkip = 2; TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); } diff --git a/Tiles/Furniture/CraftingStations/SilvaBasin.png b/Tiles/FurnitureSilva/SilvaBasin.png similarity index 100% rename from Tiles/Furniture/CraftingStations/SilvaBasin.png rename to Tiles/FurnitureSilva/SilvaBasin.png diff --git a/Tiles/Furniture/CraftingStations/SilvaBasin_Highlight.png b/Tiles/FurnitureSilva/SilvaBasin_Highlight.png similarity index 100% rename from Tiles/Furniture/CraftingStations/SilvaBasin_Highlight.png rename to Tiles/FurnitureSilva/SilvaBasin_Highlight.png diff --git a/Tiles/Furniture/CraftingStations/StaticRefiner.cs b/Tiles/FurnitureStatigel/StaticRefiner.cs similarity index 91% rename from Tiles/Furniture/CraftingStations/StaticRefiner.cs rename to Tiles/FurnitureStatigel/StaticRefiner.cs index 092060fb68..083159c5ed 100644 --- a/Tiles/Furniture/CraftingStations/StaticRefiner.cs +++ b/Tiles/FurnitureStatigel/StaticRefiner.cs @@ -6,7 +6,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureStatigel { public class StaticRefiner : ModTile { @@ -18,7 +18,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.addTile(Type); - AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName()); AnimationFrameHeight = 54; //also counts as a Solidifier AdjTiles = new int[] { TileID.Solidifier }; diff --git a/Tiles/Furniture/CraftingStations/StaticRefiner.png b/Tiles/FurnitureStatigel/StaticRefiner.png similarity index 100% rename from Tiles/Furniture/CraftingStations/StaticRefiner.png rename to Tiles/FurnitureStatigel/StaticRefiner.png diff --git a/Tiles/FurnitureStatigel/StatigelLantern.cs b/Tiles/FurnitureStatigel/StatigelLantern.cs index 5d09bb13e9..b31e99ef26 100644 --- a/Tiles/FurnitureStatigel/StatigelLantern.cs +++ b/Tiles/FurnitureStatigel/StatigelLantern.cs @@ -1,6 +1,8 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; +using Terraria.GameContent.Drawing; using Terraria.ID; using Terraria.ModLoader; @@ -8,6 +10,10 @@ namespace CalamityMod.Tiles.FurnitureStatigel { public class StatigelLantern : ModTile { + public Asset FlameTexture; + + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); @@ -38,14 +44,24 @@ namespace CalamityMod.Tiles.FurnitureStatigel } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 2); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureStatigel/StatigelLanternFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs b/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs index 8d0a4d96ff..406f8a0d69 100644 --- a/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs +++ b/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb.cs @@ -98,22 +98,12 @@ namespace CalamityMod.Tiles.FurnitureWulfrum if (Main.tile[i, j].IsTileActuallyInvisible()) return; - float brightness = MathHelper.Clamp(0.2f - (j / 680), 0f, 0.2f); - - float time = Main.GameUpdateCount; - float waveScale1 = time * 0.094f; - int scalar = i - (j / 2); - float wave1 = waveScale1 * -50 + scalar * 12; - float wave1angle = 0.30f + 0.25f * MathF.Sin(MathHelper.ToRadians(wave1)); - - float transparency = 0.05f + wave1angle; - Texture2D tex = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/ChargedWulfrumWallMountedBulb_Glow").Value; Tile tile = Main.tile[i, j]; Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); - TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White * transparency, false), default); + TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White, false), default); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs new file mode 100644 index 0000000000..34ed84e662 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBathtub : ModTile + { + public override void SetStaticDefaults() => this.SetUpBathtub(ModContent.ItemType()); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png new file mode 100644 index 0000000000..552c86a3e5 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBathtub.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs new file mode 100644 index 0000000000..fd1e3426de --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumBookcase : ModTile + { + public override void SetStaticDefaults() => this.SetUpBookcase(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png new file mode 100644 index 0000000000..93e13605b4 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumBookcase.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs new file mode 100644 index 0000000000..7ca49b489d --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.cs @@ -0,0 +1,37 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChair : ModTile + { + public override void SetStaticDefaults() => this.SetUpChair(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png new file mode 100644 index 0000000000..6ee3ada599 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair_Highlight.png new file mode 100644 index 0000000000..b59a4f5245 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChair_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs new file mode 100644 index 0000000000..025b515bc4 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.cs @@ -0,0 +1,67 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent.Drawing; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChandelier : ModTile + { + + public override void SetStaticDefaults() => this.SetUpChandelier(ModContent.ItemType(), true); + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 3, 3); + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 2) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png new file mode 100644 index 0000000000..bc974929bc Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow.png new file mode 100644 index 0000000000..6b8c2c9cf1 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChandelier_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs new file mode 100644 index 0000000000..6b0de18f35 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.cs @@ -0,0 +1,50 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumChest : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpChest(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.ChestMouseOver(i, j); + public override void MouseOverFar(int i, int j) => CalamityUtils.ChestMouseFar(i, j); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.ChestRightClick(i, j); + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png new file mode 100644 index 0000000000..b34000a603 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow.png new file mode 100644 index 0000000000..a415184891 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Highlight.png new file mode 100644 index 0000000000..c0d1530a5b Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumChest_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png new file mode 100644 index 0000000000..d2fd41cb59 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Glow.png new file mode 100644 index 0000000000..8c0bf62db6 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Highlight.png new file mode 100644 index 0000000000..3d82b19c24 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumClock_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs new file mode 100644 index 0000000000..f7d2e1aca5 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.cs @@ -0,0 +1,76 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDeskLight : ModTile + { + public override void SetStaticDefaults() => this.SetUpCandle(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, 1, j, 1, 1); + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + + public override bool RightClick(int i, int j) + { + CalamityUtils.RightClickBreak(i, j); + return true; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 5) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png new file mode 100644 index 0000000000..3acbbd1bee Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow.png new file mode 100644 index 0000000000..9089acfd02 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDeskLight_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.cs new file mode 100644 index 0000000000..cd6f07a065 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.cs @@ -0,0 +1,38 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDoorClosed : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorClosed(ModContent.ItemType(), true); + TileID.Sets.OpenDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.png new file mode 100644 index 0000000000..90a41c9aca Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed_Highlight.png new file mode 100644 index 0000000000..e0758984f1 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorClosed_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.cs new file mode 100644 index 0000000000..5df9264a7a --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.cs @@ -0,0 +1,39 @@ +using CalamityMod.Items.Placeables.FurnitureWulfrum.FurnitureAnodizedWulfrum; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDoorOpen : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDoorOpen(ModContent.ItemType(), true); + TileID.Sets.CloseDoorID[Type] = ModContent.TileType(); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void MouseOver(int i, int j) + { + Player player = Main.LocalPlayer; + player.noThrow = 2; + player.cursorItemIconEnabled = true; + player.cursorItemIconID = ModContent.ItemType(); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.png new file mode 100644 index 0000000000..98e854a8cc Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen_Highlight.png new file mode 100644 index 0000000000..ca767aed7b Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDoorOpen_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs new file mode 100644 index 0000000000..6d78abbe7c --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.cs @@ -0,0 +1,51 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumDresser : ModTile + { + public override void SetStaticDefaults() + { + this.SetUpDresser(ModContent.ItemType()); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetItemName(), CalamityUtils.GetMapChestName); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override LocalizedText DefaultContainerName(int frameX, int frameY) => CalamityUtils.GetItemName(); + public override void MouseOver(int i, int j) => CalamityUtils.DresserMouseOver(); + public override void MouseOverFar(int i, int j) => CalamityUtils.DresserMouseFar(); + public override void KillMultiTile(int i, int j, int frameX, int frameY) => Chest.DestroyChest(i, j); + public override bool RightClick(int i, int j) => CalamityUtils.DresserRightClick(); + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png new file mode 100644 index 0000000000..d37893dd8d Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow.png new file mode 100644 index 0000000000..26cee14f42 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Highlight.png new file mode 100644 index 0000000000..6e31954740 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumDresser_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs new file mode 100644 index 0000000000..d181d7d589 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.cs @@ -0,0 +1,55 @@ +using CalamityMod.Items.Placeables.FurnitureDriftwood; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumJukebox : ModTile + { + public override void SetStaticDefaults() + { + Main.tileLighted[Type] = true; + Main.tileFrameImportant[Type] = true; + Main.tileLavaDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style3x4); //This Jukebox has bookcase dimensions + TileObjectData.newTile.LavaDeath = false; + TileObjectData.addTile(Type); + AddMapEntry(new Color(191, 142, 111), CalamityUtils.GetText("Tiles.Jukebox")); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png new file mode 100644 index 0000000000..02f87edf42 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow.png new file mode 100644 index 0000000000..3b011f3b84 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumJukebox_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs new file mode 100644 index 0000000000..9818d57552 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.cs @@ -0,0 +1,62 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLamp : ModTile + { + public override void SetStaticDefaults() => this.SetUpLamp(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 3); + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png new file mode 100644 index 0000000000..0d0d621ae0 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow.png new file mode 100644 index 0000000000..b1d96c1638 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLamp_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs new file mode 100644 index 0000000000..ef14085edf --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.cs @@ -0,0 +1,66 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; +using Terraria; +using Terraria.GameContent.Drawing; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumLantern : ModTile + { + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType(), true); + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + if (Main.tile[i, j].TileFrameX < 18) + { + r = 201f / 255f; + g = 226f / 255f; + b = 122f / 255f; + } + else + { + r = 0f; + g = 0f; + b = 0f; + } + } + + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y - 4) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + + public override void HitWire(int i, int j) + { + CalamityUtils.LightHitWire(Type, i, j, 1, 2); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png new file mode 100644 index 0000000000..99ca6f27d1 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow.png new file mode 100644 index 0000000000..cb80de710c Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumLantern_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs new file mode 100644 index 0000000000..ae6d74a64a --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSink : ModTile + { + public override void SetStaticDefaults() => this.SetUpSink(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png new file mode 100644 index 0000000000..ea91bbf73b Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSink.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs new file mode 100644 index 0000000000..ea86bba509 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.cs @@ -0,0 +1,48 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSleepingPod : ModTile + { + public override void SetStaticDefaults() => this.SetUpBed(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) => true; + + public override bool RightClick(int i, int j) => CalamityUtils.BedRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.MouseOver(i, j, ModContent.ItemType()); + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png new file mode 100644 index 0000000000..76a7a63f3e Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive.png new file mode 100644 index 0000000000..2f42aefcdd Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive_Glow.png new file mode 100644 index 0000000000..285c7fb955 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPodActive_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow.png new file mode 100644 index 0000000000..22a6ed63e9 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Highlight.png new file mode 100644 index 0000000000..514de2d0d8 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSleepingPod_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs new file mode 100644 index 0000000000..b63d062ebf --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.cs @@ -0,0 +1,55 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumSofa : ModTile + { + public override void SetStaticDefaults() => this.SetUpSofa(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.BenchSitInfo(i, j, ref info); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.BenchMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png new file mode 100644 index 0000000000..136844ea32 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow.png new file mode 100644 index 0000000000..ea27a6db33 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Highlight.png new file mode 100644 index 0000000000..ee7b74d4f0 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumSofa_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs new file mode 100644 index 0000000000..f1cb1bd42e --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.cs @@ -0,0 +1,41 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumTable : ModTile + { + public override void SetStaticDefaults() => this.SetUpTable(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + public override void PostDraw(int i, int j, SpriteBatch spriteBatch) + { + if (Main.tile[i, j].IsTileActuallyInvisible()) + return; + + int xFrameOffset = Main.tile[i, j].TileFrameX; + int yFrameOffset = Main.tile[i, j].TileFrameY; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow").Value; + Vector2 drawOffest = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); + Vector2 drawPosition = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + drawOffest; + Color drawColour = Color.White; + Tile trackTile = Main.tile[i, j]; + if (!trackTile.IsHalfBlock && trackTile.Slope == 0) + spriteBatch.Draw(glowmask, drawPosition, new Rectangle(xFrameOffset, yFrameOffset, 18, 18), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + else if (trackTile.IsHalfBlock) + spriteBatch.Draw(glowmask, drawPosition + new Vector2(0f, 8f), new Rectangle(xFrameOffset, yFrameOffset, 18, 8), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f); + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png new file mode 100644 index 0000000000..6cd3908340 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow.png new file mode 100644 index 0000000000..39b2d14fc7 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumTable_Glow.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs new file mode 100644 index 0000000000..3dd8ae69af --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.cs @@ -0,0 +1,79 @@ +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria; +using Terraria.DataStructures; +using Terraria.Enums; +using Terraria.GameContent; +using Terraria.GameContent.ObjectInteractions; +using Terraria.ID; +using Terraria.Localization; +using Terraria.ModLoader; +using Terraria.ObjectData; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumToilet : ModTile + { + public override void SetStaticDefaults() + { + Main.tileFrameImportant[Type] = true; + Main.tileWaterDeath[Type] = false; + TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2); + TileObjectData.newTile.CoordinateHeights = new int[] { 16, 18 }; + TileObjectData.newTile.CoordinatePadding = 2; + TileObjectData.newTile.Direction = TileObjectDirection.PlaceLeft; + TileObjectData.newTile.StyleHorizontal = true; + TileObjectData.newTile.StyleMultiplier = 2; + TileObjectData.newAlternate.CopyFrom(TileObjectData.newTile); + TileObjectData.newAlternate.Direction = TileObjectDirection.PlaceRight; + TileObjectData.addAlternate(1); + TileObjectData.addTile(Type); + + // Toilets count as Chairs + AddToArray(ref TileID.Sets.RoomNeeds.CountsAsChair); + AddMapEntry(new Color(191, 142, 111), Language.GetText("MapObject.Toilet")); + TileID.Sets.CanBeSatOnForNPCs[Type] = true; + TileID.Sets.CanBeSatOnForPlayers[Type] = true; + TileID.Sets.HasOutlines[Type] = true; + AdjTiles = new int[] { TileID.Chairs }; + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override void ModifySittingTargetInfo(int i, int j, ref TileRestingInfo info) => CalamityUtils.ChairSitInfo(i, j, ref info, shitter: true); + + public override bool RightClick(int i, int j) => CalamityUtils.ChairRightClick(i, j); + + public override void MouseOver(int i, int j) => CalamityUtils.ChairMouseOver(i, j, ModContent.ItemType()); + + public override bool HasSmartInteract(int i, int j, SmartInteractScanSettings settings) + { + return settings.player.IsWithinSnappngRangeToTile(i, j, PlayerSittingHelper.ChairSittingMaxDistance); + } + + public override void HitWire(int i, int j) // I hate this please make it stop. - Merkalto + { + Tile tile = Main.tile[i, j]; + + int spawnX = i; + int spawnY = j - tile.TileFrameY / 18; + + Wiring.SkipWire(spawnX, spawnY); + Wiring.SkipWire(spawnX, spawnY + 1); + + if (Wiring.CheckMech(spawnX, spawnY, 60)) + { + Projectile.NewProjectile(Wiring.GetProjectileSource(spawnX, spawnY), spawnX * 16 + 8, spawnY * 16 + 12, 0f, 0f, ProjectileID.ToiletEffect, 0, 0f, Main.myPlayer); + } + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png new file mode 100644 index 0000000000..890177b446 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet_Highlight.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet_Highlight.png new file mode 100644 index 0000000000..5c2fc8b88a Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumToilet_Highlight.png differ diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs new file mode 100644 index 0000000000..8281656683 --- /dev/null +++ b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.cs @@ -0,0 +1,23 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.FurnitureWulfrum.FurnitureAnodizedWulfrum +{ + public class AnodizedWulfrumWorkBench : ModTile + { + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType(), true); + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Tungsten, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + } +} diff --git a/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png new file mode 100644 index 0000000000..94cbc92609 Binary files /dev/null and b/Tiles/FurnitureWulfrum/FurnitureAnodizedWulfrum/AnodizedWulfrumWorkBench.png differ diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs similarity index 89% rename from Tiles/Furniture/CraftingStations/WulfrumLabstation.cs rename to Tiles/FurnitureWulfrum/WulfrumLabstation.cs index 8b1cfe6971..fdaaccad09 100644 --- a/Tiles/Furniture/CraftingStations/WulfrumLabstation.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLabstation.cs @@ -8,7 +8,7 @@ using Terraria.Localization; using Terraria.ModLoader; using Terraria.ObjectData; -namespace CalamityMod.Tiles.Furniture.CraftingStations +namespace CalamityMod.Tiles.FurnitureWulfrum { public class WulfrumLabstation : ModTile { @@ -17,7 +17,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations Main.tileFrameImportant[Type] = true; TileObjectData.newTile.CopyFrom(TileObjectData.Style3x3); TileObjectData.addTile(Type); - AddMapEntry(new Color(100, 153, 100), CalamityUtils.GetItemName()); + AddMapEntry(new Color(100, 153, 100), CalamityUtils.GetItemName()); } public override bool CreateDust(int i, int j, ref int type) @@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Furniture.CraftingStations int xPos = Main.tile[i, j].TileFrameX; int yPos = Main.tile[i, j].TileFrameY; - Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/Furniture/CraftingStations/WulfrumLabstationGlow").Value; + Texture2D glowmask = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumLabstationGlow").Value; Color drawColour = CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, new Color(100, 100, 100, 100)); Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange); Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero; diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstation.png b/Tiles/FurnitureWulfrum/WulfrumLabstation.png similarity index 100% rename from Tiles/Furniture/CraftingStations/WulfrumLabstation.png rename to Tiles/FurnitureWulfrum/WulfrumLabstation.png diff --git a/Tiles/Furniture/CraftingStations/WulfrumLabstationGlow.png b/Tiles/FurnitureWulfrum/WulfrumLabstationGlow.png similarity index 100% rename from Tiles/Furniture/CraftingStations/WulfrumLabstationGlow.png rename to Tiles/FurnitureWulfrum/WulfrumLabstationGlow.png diff --git a/Tiles/FurnitureWulfrum/WulfrumLantern.cs b/Tiles/FurnitureWulfrum/WulfrumLantern.cs index 01b9749e60..6ba870244e 100644 --- a/Tiles/FurnitureWulfrum/WulfrumLantern.cs +++ b/Tiles/FurnitureWulfrum/WulfrumLantern.cs @@ -1,32 +1,20 @@ using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; +using ReLogic.Content; using Terraria; -using Terraria.DataStructures; +using Terraria.GameContent.Drawing; using Terraria.ID; -using Terraria.Localization; using Terraria.ModLoader; -using Terraria.ObjectData; namespace CalamityMod.Tiles.FurnitureWulfrum { public class WulfrumLantern : ModTile { - public override void SetStaticDefaults() - { - Main.tileLighted[Type] = true; - Main.tileFrameImportant[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style1x2Top); - TileObjectData.newTile.Height = 3; - TileObjectData.newTile.CoordinateHeights = new int[] { 16, 16, 16 }; - TileObjectData.newTile.StyleLineSkip = 2; - TileObjectData.addTile(Type); - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTorch); - AddMapEntry(new Color(251, 235, 127), Language.GetText("MapObject.Lantern")); + public Asset FlameTexture; - TileID.Sets.DisableSmartCursor[Type] = true; - AdjTiles = new int[] { TileID.HangingLanterns }; - } + public override void Load() => FlameTexture = ModContent.Request(Texture + "Flame"); + public override void SetStaticDefaults() => this.SetUpLantern(ModContent.ItemType()); public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) => CalamityUtils.DrawSwayingMultiTile(i, j); public override bool CanExplode(int i, int j) => false; @@ -58,14 +46,24 @@ namespace CalamityMod.Tiles.FurnitureWulfrum } } + public override void GetTileFlameData(int i, int j, ref TileDrawing.TileFlameData tileFlameData) + { + ulong flameSeed = Main.TileFrameSeed ^ (ulong)(((long)i << 32) | (uint)j); + tileFlameData.flameSeed = flameSeed; + tileFlameData.flameTexture = FlameTexture.Value; + tileFlameData.flameColor = new Color(102, 115, 128, 0); + tileFlameData.flameCount = 3; + tileFlameData.flameRangeXMin = -10; + tileFlameData.flameRangeXMax = 11; + tileFlameData.flameRangeYMin = -10; + tileFlameData.flameRangeYMax = 11; + tileFlameData.flameRangeMultX = 0.1f; + tileFlameData.flameRangeMultY = 0.1f; + } + public override void HitWire(int i, int j) { CalamityUtils.LightHitWire(Type, i, j, 1, 3); } - - public override void PostDraw(int i, int j, SpriteBatch spriteBatch) - { - CalamityUtils.DrawFlameEffect(ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumLanternFlame").Value, i, j); - } } } diff --git a/Tiles/FurnitureWulfrum/WulfrumLantern.png b/Tiles/FurnitureWulfrum/WulfrumLantern.png index 4eda4d5984..66521d13f8 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumLantern.png and b/Tiles/FurnitureWulfrum/WulfrumLantern.png differ diff --git a/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png b/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png index 8a4b6a04cb..efc098ace6 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png and b/Tiles/FurnitureWulfrum/WulfrumLanternFlame.png differ diff --git a/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs b/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs index b13c236cc4..384d860146 100644 --- a/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs +++ b/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb.cs @@ -98,22 +98,12 @@ namespace CalamityMod.Tiles.FurnitureWulfrum if (Main.tile[i, j].IsTileActuallyInvisible()) return; - float brightness = MathHelper.Clamp(0.2f - (j / 680), 0f, 0.2f); - - float time = Main.GameUpdateCount; - float waveScale1 = time * 0.094f; - int scalar = i - (j / 2); - float wave1 = waveScale1 * -50 + scalar * 12; - float wave1angle = 0.30f + 0.25f * MathF.Sin(MathHelper.ToRadians(wave1)); - - float transparency = 0.05f + wave1angle; - Texture2D tex = ModContent.Request("CalamityMod/Tiles/FurnitureWulfrum/WulfrumWallMountedBulb_Glow").Value; Tile tile = Main.tile[i, j]; Rectangle frame = new Rectangle(tile.TileFrameX, tile.TileFrameY, 16, 16); - TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White * transparency, false), default); + TileFramingSystem.SlopedGlowmask(in tile, i, j, tex, frame, CalamityUtils.ApplyPaint(Main.tile[i, j].TileColor, Color.White, false), default); } public override void KillMultiTile(int i, int j, int frameX, int frameY) { diff --git a/Tiles/MonsterBanner.cs b/Tiles/MonsterBanner.cs index a62018f05a..7ec43cdd31 100644 --- a/Tiles/MonsterBanner.cs +++ b/Tiles/MonsterBanner.cs @@ -108,7 +108,7 @@ namespace CalamityMod.Tiles npc = NPCType(); break; case 11: - npc = NPCType(); // There's also the boss variant but I dont think we want banners to affect them? + npc = NPCType(); // There's also the boss variant but I dont think we want banners to affect them? break; /*case 12: npc = NPCType(); - Formerly Sea Urchin diff --git a/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs index c58f0510f5..5cc0e8630a 100644 --- a/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs +++ b/Tiles/Rubblemaker/SunkenSea/DriftwoodAmbientEcho.cs @@ -1,4 +1,4 @@ -using CalamityMod.Items.Placeables.SunkenSea; +using CalamityMod.Items.Placeables.FurnitureDriftwood; using CalamityMod.Tiles.SunkenSea.Ambient; using Terraria.GameContent; using Terraria.ModLoader; diff --git a/Tiles/SunkenSea/AridSoil.cs b/Tiles/SunkenSea/AridSoil.cs new file mode 100644 index 0000000000..e0a83dfa7d --- /dev/null +++ b/Tiles/SunkenSea/AridSoil.cs @@ -0,0 +1,48 @@ +using CalamityMod.Systems; +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Tiles.SunkenSea +{ + public class AridSoil : ModTile + { + public override void SetStaticDefaults() + { + TileID.Sets.GeneralPlacementTiles[Type] = false; + + Main.tileSolid[Type] = true; + Main.tileBlockLight[Type] = true; + + CalamityUtils.MergeWithGeneral(Type); + CalamityUtils.MergeWithDesert(Type); + + TileID.Sets.HasSlopeFrames[Type] = true; + TileID.Sets.ChecksForMerge[Type] = true; + TileID.Sets.CanBeDugByShovel[Type] = true; + Main.tileShine2[Type] = true; + + DustType = DustID.Hive; + AddMapEntry(new Color(171, 101, 87)); + + this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); + this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); + this.RegisterUniversalMerge(TileID.HardenedSand, "CalamityMod/Tiles/Merges/HardenedSandMerge"); + + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/ShellstoneMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/EutrophicSandMerge"); + this.RegisterUniversalMerge(ModContent.TileType(), "CalamityMod/Tiles/Merges/NavystoneMerge"); + } + + public override void NumDust(int i, int j, bool fail, ref int num) + { + num = fail ? 1 : 3; + } + + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) + { + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); + } + } +} diff --git a/Tiles/SunkenSea/AridSoil.png b/Tiles/SunkenSea/AridSoil.png new file mode 100644 index 0000000000..e03a0d0ed3 Binary files /dev/null and b/Tiles/SunkenSea/AridSoil.png differ diff --git a/Tiles/SunkenSea/Basalt.cs b/Tiles/SunkenSea/Basalt.cs index 6e309e5123..08dcb46d06 100644 --- a/Tiles/SunkenSea/Basalt.cs +++ b/Tiles/SunkenSea/Basalt.cs @@ -1,4 +1,5 @@ -using Microsoft.Xna.Framework; +using CalamityMod.Systems; +using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; using Terraria.ModLoader; @@ -7,21 +8,13 @@ namespace CalamityMod.Tiles.SunkenSea { public class Basalt : ModTile { - private int sheetWidth = 234; - private int sheetHeight = 90; - - public byte[,] tileAdjacency; - public byte[,] secondTileAdjacency; - public byte[,] thirdTileAdjacency; - public byte[,] fourthTileAdjacency; - public override void SetStaticDefaults() { TileID.Sets.GeneralPlacementTiles[Type] = false; - + TileID.Sets.HasSlopeFrames[Type] = true; Main.tileSolid[Type] = true; Main.tileBlockLight[Type] = true; - Main.tileShine2[Type] = true; + Main.tileShine2[Type] = false; CalamityUtils.MergeWithGeneral(Type); CalamityUtils.MergeWithDesert(Type); @@ -52,10 +45,9 @@ namespace CalamityMod.Tiles.SunkenSea return false; } - public override void AnimateIndividualTile(int type, int i, int j, ref int frameXOffset, ref int frameYOffset) + public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak) { - frameXOffset = i % 4 * sheetWidth; - frameYOffset = j % 4 * sheetHeight; + return TileFramingSystem.BetterGemsparkFraming(i, j, resetFrame); } } diff --git a/Tiles/SunkenSea/Basalt.png b/Tiles/SunkenSea/Basalt.png index 4341da810c..c2285d2254 100644 Binary files a/Tiles/SunkenSea/Basalt.png and b/Tiles/SunkenSea/Basalt.png differ diff --git a/Tiles/SunkenSea/Dunesand.cs b/Tiles/SunkenSea/Dunesand.cs index ddf287c5f5..e9c49ead2d 100644 --- a/Tiles/SunkenSea/Dunesand.cs +++ b/Tiles/SunkenSea/Dunesand.cs @@ -25,7 +25,7 @@ namespace CalamityMod.Tiles.SunkenSea Main.tileShine2[Type] = true; DustType = DustID.Hive; - AddMapEntry(new Color(210, 124, 45)); + AddMapEntry(new Color(206, 124, 97)); this.RegisterUniversalMerge(TileID.Sandstone, "CalamityMod/Tiles/Merges/SandstoneMerge"); this.RegisterUniversalMerge(TileID.Sand, "CalamityMod/Tiles/Merges/SandMerge"); diff --git a/Tiles/SunkenSea/Dunesand.png b/Tiles/SunkenSea/Dunesand.png index 06514fde68..f6ad7b21b3 100644 Binary files a/Tiles/SunkenSea/Dunesand.png and b/Tiles/SunkenSea/Dunesand.png differ diff --git a/Tiles/SunkenSea/Runestone.cs b/Tiles/SunkenSea/Runestone.cs index 7108f7d9ed..4730684727 100644 --- a/Tiles/SunkenSea/Runestone.cs +++ b/Tiles/SunkenSea/Runestone.cs @@ -22,7 +22,7 @@ namespace CalamityMod.Tiles.SunkenSea TileID.Sets.ChecksForMerge[Type] = true; HitSound = SoundID.Tink; DustType = DustID.Pot; - AddMapEntry(new Color(152, 89, 78)); + AddMapEntry(new Color(151, 91, 81)); Main.tileShine2[Type] = true; TileID.Sets.CanBeDugByShovel[Type] = true; diff --git a/Tiles/SunkenSea/Runestone.png b/Tiles/SunkenSea/Runestone.png index a0f612e995..f2ace3dbb4 100644 Binary files a/Tiles/SunkenSea/Runestone.png and b/Tiles/SunkenSea/Runestone.png differ diff --git a/Tiles/SunkenSea/RunestoneTerracotta.png b/Tiles/SunkenSea/RunestoneTerracotta.png deleted file mode 100644 index 610bdefa21..0000000000 Binary files a/Tiles/SunkenSea/RunestoneTerracotta.png and /dev/null differ diff --git a/UI/CanvasPaintingUI.cs b/UI/CanvasPaintingUI.cs index 30119f2d8d..b655d2b1a4 100644 --- a/UI/CanvasPaintingUI.cs +++ b/UI/CanvasPaintingUI.cs @@ -63,7 +63,7 @@ namespace CalamityMod.UI float paintingFrameScale = painting.scale; Vector2 paintingFramePosition = painting.framePosition; - bool hideUI = Main.keyState.IsKeyDown(Keys.LeftShift); + bool hideUI = Main.keyState.PressingShift(); Texture2D tex = TextureAssets.Tile[ModContent.TileType()].Value; if (p.CurrentlyViewedCanvasType == 1) diff --git a/UI/DraedonSummoning/CodebreakerUI.cs b/UI/DraedonSummoning/CodebreakerUI.cs index b50d05d200..5b20fbed4c 100644 --- a/UI/DraedonSummoning/CodebreakerUI.cs +++ b/UI/DraedonSummoning/CodebreakerUI.cs @@ -2,6 +2,7 @@ using System.Text; using CalamityMod.Items.DraedonMisc; using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using CalamityMod.NPCs.ExoMechs; using CalamityMod.Packets; using CalamityMod.Systems.Collections; @@ -168,13 +169,13 @@ namespace CalamityMod.UI.DraedonSummoning // Draw the cell payment slot icon. Texture2D emptyCellIconTexture = ModContent.Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Empty").Value; Texture2D occupiedCellIconTexture = ModContent.Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Filled").Value; - Texture2D bloodSampleIconTexture = ModContent.Request("CalamityMod/Items/Materials/BloodSample").Value; + Texture2D bloodyVeinIconTexture = ModContent.Request("CalamityMod/Items/Pets/BloodyVein").Value; Texture2D cellTexture = emptyCellIconTexture; if (codebreakerTileEntity.InputtedCellCount > 0) { - if (codebreakerTileEntity.ContainsBloodSample) + if (codebreakerTileEntity.ContainsBloodyVein) { - cellTexture = bloodSampleIconTexture; + cellTexture = bloodyVeinIconTexture; } else { @@ -194,7 +195,7 @@ namespace CalamityMod.UI.DraedonSummoning DisplayNotStrongEnoughErrorText(schematicSlotDrawCenter + new Vector2(-24f, 56f)); // Handle decryption costs. - else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0 && !codebreakerTileEntity.ContainsBloodSample) + else if (codebreakerTileEntity.HeldSchematicID != 0 && codebreakerTileEntity.DecryptionCountdown == 0 && !codebreakerTileEntity.ContainsBloodyVein) { int cost = codebreakerTileEntity.DecryptionCellCost; DisplayCostText(costDisplayLocation, cost); @@ -247,8 +248,8 @@ namespace CalamityMod.UI.DraedonSummoning // Create a temporary item for drawing purposes. // If cells are present, make the item reflect that. Item temporaryPowerCell = new Item(); - if (codebreakerTileEntity.ContainsBloodSample) - temporaryPowerCell.SetDefaults(ModContent.ItemType()); + if (codebreakerTileEntity.ContainsBloodyVein) + temporaryPowerCell.SetDefaults(ModContent.ItemType()); else temporaryPowerCell.SetDefaults(ModContent.ItemType()); @@ -313,7 +314,7 @@ namespace CalamityMod.UI.DraedonSummoning if (Main.mouseLeft && Main.mouseLeftRelease && codebreakerTileEntity.DecryptionCountdown <= 0) { int powercellID = ModContent.ItemType(); - int sampleID = ModContent.ItemType(); + int sampleID = ModContent.ItemType(); short cellStackDiff = 0; bool shouldPlaySound = true; @@ -323,7 +324,7 @@ namespace CalamityMod.UI.DraedonSummoning cellStackDiff = (short)-Math.Min(temporaryItem.stack, temporaryItem.maxStack); Player p = Main.LocalPlayer; var source = p.GetSource_TileInteraction(codebreakerTileEntity.Position.X, codebreakerTileEntity.Position.Y); - p.QuickSpawnItem(source, codebreakerTileEntity.ContainsBloodSample ? sampleID : powercellID, -cellStackDiff); + p.QuickSpawnItem(source, codebreakerTileEntity.ContainsBloodyVein ? sampleID : powercellID, -cellStackDiff); // Do not play a sound in this situation. The player is going to pick up the dropped cells in a few frames, which will make sound. shouldPlaySound = false; @@ -333,7 +334,7 @@ namespace CalamityMod.UI.DraedonSummoning else { bool holdingPowercell = playerHandItem.type == powercellID || (playerHandItem.type == sampleID && Main.zenithWorld); - bool powercellsinserted = !codebreakerTileEntity.ContainsBloodSample && temporaryItem.stack > 0; + bool powercellsinserted = !codebreakerTileEntity.ContainsBloodyVein && temporaryItem.stack > 0; bool cansummon = codebreakerTileEntity.ReadyToSummonDraedon && CalamityWorld.AbleToSummonDraedon; // If the player's held power cells can be stacked on top of what's already in the codeberaker, then stack them. @@ -347,7 +348,7 @@ namespace CalamityMod.UI.DraedonSummoning { SoundEngine.PlaySound(BloodSound, codebreakerTileEntity.Center); } - codebreakerTileEntity.ContainsBloodSample = true; + codebreakerTileEntity.ContainsBloodyVein = true; int spaceLeft = TECodebreaker.MaxCellCapacity - temporaryItem.stack; @@ -362,7 +363,7 @@ namespace CalamityMod.UI.DraedonSummoning // If theres nothing inside or there are cells inside, cells can be inserted if (playerHandItem.type == powercellID && (temporaryItem.stack == 0 || powercellsinserted)) { - codebreakerTileEntity.ContainsBloodSample = false; + codebreakerTileEntity.ContainsBloodyVein = false; int spaceLeft = TECodebreaker.MaxCellCapacity - temporaryItem.stack; @@ -387,7 +388,7 @@ namespace CalamityMod.UI.DraedonSummoning playerHandItem.stack = -cellStackDiff; temporaryItem.TurnToAir(); AwaitingDecryptionTextClose = false; - codebreakerTileEntity.ContainsBloodSample = false; + codebreakerTileEntity.ContainsBloodyVein = false; } } @@ -637,7 +638,7 @@ namespace CalamityMod.UI.DraedonSummoning Rectangle clickArea = Utils.CenteredRectangle(drawPosition, contactButton.Size() * VerificationButtonScale); - float iconrotation = codebreakerTileEntity.ContainsBloodSample ? Main.GlobalTimeWrappedHourly * 20f : 0f; + float iconrotation = codebreakerTileEntity.ContainsBloodyVein ? Main.GlobalTimeWrappedHourly * 20f : 0f; // Check if the mouse is hovering over the contact button area. if (MouseScreenArea.Intersects(clickArea)) @@ -652,7 +653,7 @@ namespace CalamityMod.UI.DraedonSummoning { CalamityWorld.DraedonSummonCountdown = CalamityWorld.DraedonSummonCountdownMax; CalamityWorld.DraedonSummonPosition = codebreakerTileEntity.Center + new Vector2(-8f, -100f); - if (Main.zenithWorld && codebreakerTileEntity.ContainsBloodSample) + if (Main.zenithWorld && codebreakerTileEntity.ContainsBloodyVein) { CalamityWorld.DraedonMechdusa = true; } @@ -677,7 +678,7 @@ namespace CalamityMod.UI.DraedonSummoning string contactTextKey = "Contact"; if (DownedBossSystem.downedExoMechs) contactTextKey = "Summon"; - if (codebreakerTileEntity.ContainsBloodSample) + if (codebreakerTileEntity.ContainsBloodyVein) contactTextKey = "Evoke"; string contactText = CalamityUtils.GetTextValue("UI." + contactTextKey); diff --git a/UI/DraedonsArsenal/ChargeMeterUI.cs b/UI/DraedonsArsenal/ChargeMeterUI.cs index af52bdb329..57c70e0ead 100644 --- a/UI/DraedonsArsenal/ChargeMeterUI.cs +++ b/UI/DraedonsArsenal/ChargeMeterUI.cs @@ -65,7 +65,7 @@ namespace CalamityMod.UI.DraedonsArsenal changed = true; } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } // If the Charge Meter is turned off or the player is not holding an item, stop. @@ -132,7 +132,7 @@ namespace CalamityMod.UI.DraedonsArsenal if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } } diff --git a/UI/DraedonsArsenal/PowerCellSlot_Blood.png b/UI/DraedonsArsenal/PowerCellSlot_Blood.png index 21ab14e734..709119d21e 100644 Binary files a/UI/DraedonsArsenal/PowerCellSlot_Blood.png and b/UI/DraedonsArsenal/PowerCellSlot_Blood.png differ diff --git a/UI/FlightBar/FlightBar.cs b/UI/FlightBar/FlightBar.cs index db8cf50b90..ce2f74805e 100644 --- a/UI/FlightBar/FlightBar.cs +++ b/UI/FlightBar/FlightBar.cs @@ -125,7 +125,7 @@ namespace CalamityMod.UI } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); return; } @@ -175,7 +175,7 @@ namespace CalamityMod.UI if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } } diff --git a/UI/ModeIndicator/ModeIndicatorLock.png b/UI/ModeIndicator/ModeIndicatorLock.png index f440e5748d..ae7b9e6073 100644 Binary files a/UI/ModeIndicator/ModeIndicatorLock.png and b/UI/ModeIndicator/ModeIndicatorLock.png differ diff --git a/UI/ModeIndicator/ModeIndicatorOutline.png b/UI/ModeIndicator/ModeIndicatorOutline.png index d4f1f87ee3..8cfff31c70 100644 Binary files a/UI/ModeIndicator/ModeIndicatorOutline.png and b/UI/ModeIndicator/ModeIndicatorOutline.png differ diff --git a/UI/ModeIndicator/ModeIndicatorUI.cs b/UI/ModeIndicator/ModeIndicatorUI.cs index ddde388064..281c4de30d 100644 --- a/UI/ModeIndicator/ModeIndicatorUI.cs +++ b/UI/ModeIndicator/ModeIndicatorUI.cs @@ -1,17 +1,13 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Runtime.InteropServices; using System.Text.RegularExpressions; using CalamityMod.CalPlayer; using CalamityMod.Events; using CalamityMod.Systems; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; using Terraria.Audio; -using Terraria.GameInput; using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -49,7 +45,7 @@ namespace CalamityMod.UI.ModeIndicator internal static int MenuAnimLength => MostAlternateDifficulties > 1 ? 60 : 40; private static int menuOpenTransitionTime = 0; private static DifficultyMode previouslyHoveredMode = null; - public static float WidthForTier(int alts) => (alts - 1) * 40f; + public static float WidthForTier(int alts) => (alts - 1) * 44f; private static void ClearVariables() { @@ -207,14 +203,14 @@ namespace CalamityMod.UI.ModeIndicator if (MouseScreenArea.Intersects(MainClickArea)) { //Display the first non-none difficulty by default - string modeToDisplay = Difficulties[1].Name.ToString(); - bool anyActiveMode = false; + string modeToDisplay = Main.getGoodWorld ? Difficulties[0].FTWName.ToString() : Difficulties[1].Name.ToString(); + bool anyActiveMode = Main.getGoodWorld ? true : false; for (int i = 1; i < Difficulties.Count; i++) { if (GetCurrentDifficulty == Difficulties[i]) { - modeToDisplay = Difficulties[i].Name.ToString(); + modeToDisplay = Main.getGoodWorld ? Difficulties[i].FTWName.ToString() : Difficulties[i].Name.ToString(); anyActiveMode = true; } } @@ -229,12 +225,7 @@ namespace CalamityMod.UI.ModeIndicator { locked = false; text = CalamityUtils.GetText("UI.DifficultyClickText"); - if (!Main.expertMode && GetCurrentDifficulty == Difficulties[0]) - { - locked = true; - text = CalamityUtils.GetText("UI.ExpertDifficultyLock"); - } - else if (CalamityPlayer.areThereAnyDamnBosses || BossRushEvent.BossRushActive) + if (CalamityPlayer.areThereAnyDamnBosses || BossRushEvent.BossRushActive) { locked = true; text = CalamityUtils.GetText("UI.ChangingTheRules"); @@ -303,7 +294,7 @@ namespace CalamityMod.UI.ModeIndicator public static void ManageHexIcons(SpriteBatch spriteBatch, out string text) { int tiers = DifficultyTiers.Count(); - float barLength = 60 * tiers * BarExpansionProgress; + float barLength = 68 * tiers * BarExpansionProgress; float progress = menuOpen ? 1 - menuOpenTransitionTime / (float)MenuAnimLength : menuOpenTransitionTime / (float)MenuAnimLength; Vector2 basePosition = DrawCenter + (barLength / (float)(tiers + 1f)) * Vector2.UnitY; @@ -322,7 +313,7 @@ namespace CalamityMod.UI.ModeIndicator for (int j = 0; j < modesAtTier; j++) { DifficultyMode mode = DifficultyTiers[i][j]; - Texture2D hexIcon = mode.Texture.Value; + Texture2D hexIcon = mode.Enabled ? mode.Texture.Value : mode.TextureDisabled.Value; Vector2 hexIconSize = hexIcon.Size(); // Get position. @@ -332,7 +323,7 @@ namespace CalamityMod.UI.ModeIndicator bool hovered = MouseScreenArea.Intersects(Utils.CenteredRectangle(iconPosition, hexIconSize)); - float usedOpacity = mode.Enabled ? 0.85f : 0.55f; + float usedOpacity = 0.85f; if (hovered) usedOpacity = MathHelper.Lerp(usedOpacity, 1f, 0.7f); @@ -355,10 +346,7 @@ namespace CalamityMod.UI.ModeIndicator text = GetDifficultyText(mode); - // Cannot switch to Death Mode if Master Mode isn't active. - // Cannot switch to Revengeance Mode if Master Mode is active. - bool cannotSwitchTo = (!Main.masterMode && mode == Difficulties[2]) || (Main.masterMode && mode == Difficulties[1]); - if (ClickingMouse && !cannotSwitchTo) + if (ClickingMouse) SwitchToDifficulty(mode); } } @@ -372,16 +360,16 @@ namespace CalamityMod.UI.ModeIndicator { Texture2D lockTexture = ModContent.Request("CalamityMod/UI/ModeIndicator/ModeIndicatorLock").Value; float rotationShift = lockClickTime == 0 ? 0f : (float)Math.Sin((1 - lockClickTime / (float)LockAnimLength) * MathHelper.TwoPi * 2f) * 0.5f * (lockClickTime / (float)LockAnimLength); - spriteBatch.Draw(lockTexture, DrawCenter + Vector2.UnitY * 12 * MainIconScale, null, Color.White, 0f + rotationShift, lockTexture.Size() * 0.5f, LockShakeScale * MainIconScale, SpriteEffects.None, 0f); + spriteBatch.Draw(lockTexture, DrawCenter + Vector2.UnitY * 24 * MainIconScale, null, Color.White, 0f + rotationShift, lockTexture.Size() * 0.5f, LockShakeScale * MainIconScale, SpriteEffects.None, 0f); } #endregion #region Difficulty toggling public static string GetDifficultyText(DifficultyMode mode) { - LocalizedText preface = mode.Name; + LocalizedText preface = Main.getGoodWorld ? mode.FTWName : mode.Name; if (mode == GetCurrentDifficulty) - preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(mode.Name.ToString()); + preface = CalamityUtils.GetText("UI.CurrentlySelected").WithFormatArgs(Main.getGoodWorld ? mode.FTWName.ToString() : mode.Name.ToString()); string text = "\n" + mode.ShortDescription.ToString(); @@ -389,7 +377,7 @@ namespace CalamityMod.UI.ModeIndicator if (mode.ExpandedDescription != LocalizedText.Empty) { // Show the description either if the player is holding shift. - if (Main.keyState.IsKeyDown(Microsoft.Xna.Framework.Input.Keys.LeftShift)) + if (Main.keyState.PressingShift()) text += "\n" + mode.ExpandedDescription.ToString(); else @@ -406,6 +394,10 @@ namespace CalamityMod.UI.ModeIndicator if (mode == GetCurrentDifficulty) return; + // This has to be put before difficulties change as to not disrupt GetCurrentDifficulty + DisplayFormattedText("Mods.CalamityMod.UI.DifficultySwitch", Color.White, Main.getGoodWorld ? GetCurrentDifficulty.FTWTextColor.Hex3() : GetCurrentDifficulty.ChatTextColor.Hex3(), Main.getGoodWorld ? GetCurrentDifficulty.FTWName : GetCurrentDifficulty.Name + , Main.getGoodWorld ? mode.FTWTextColor.Hex3() :mode.ChatTextColor.Hex3(), Main.getGoodWorld ? mode.FTWName :mode.Name); + // Todo, maybe in the future having a way to have multiple difficulty options on the same tier that can coexist, and it works in branching pathes? Not very necessary for cal & addons. // But would be super useful so other mods can let their own difficulties go there. @@ -416,12 +408,7 @@ namespace CalamityMod.UI.ModeIndicator if (Difficulties[i]._difficultyTier >= mode._difficultyTier && Difficulties[i] != mode) { if (Difficulties[i].Enabled) - { - if (Difficulties[i].DeactivationTextKey != string.Empty) - DisplayLocalizedText(Difficulties[i].DeactivationTextKey, Difficulties[i].ChatTextColor); - Difficulties[i].Enabled = false; - } } } @@ -440,14 +427,14 @@ namespace CalamityMod.UI.ModeIndicator for (int j = 0; j < DifficultyTiers[i].Length; j++) DifficultyTiers[i][j].Enabled = false; - // Enable the one favored by the mode. - DifficultyTiers[i][mode.FavoredDifficultyAtTier(i)].Enabled = true; + // Enable the ones favored by the mode. + for (int j = 0; j < mode.FavoredDifficultyAtTier(i).Length; j++) + { + DifficultyTiers[i][mode.FavoredDifficultyAtTier(i)[j]].Enabled = true; + } } } - if (mode.ActivationTextKey != string.Empty) - DisplayLocalizedText(mode.ActivationTextKey, mode.ChatTextColor); - mode.Enabled = true; SoundEngine.PlaySound(mode.ActivationSound); diff --git a/UI/ModeIndicator/ModeIndicator_Classic.png b/UI/ModeIndicator/ModeIndicator_Classic.png new file mode 100644 index 0000000000..cec6bfee9b Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Classic.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Classic_Off.png b/UI/ModeIndicator/ModeIndicator_Classic_Off.png new file mode 100644 index 0000000000..ccf4bfccbc Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Classic_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Death.png b/UI/ModeIndicator/ModeIndicator_Death.png index 5729ede7b4..3407bf8f8d 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Death.png and b/UI/ModeIndicator/ModeIndicator_Death.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Death_Off.png b/UI/ModeIndicator/ModeIndicator_Death_Off.png new file mode 100644 index 0000000000..2a3f7cc3d5 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Death_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Expert.png b/UI/ModeIndicator/ModeIndicator_Expert.png new file mode 100644 index 0000000000..7f16d0f576 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Expert.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Expert_Off.png b/UI/ModeIndicator/ModeIndicator_Expert_Off.png new file mode 100644 index 0000000000..1ade0d9fd6 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Expert_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Master.png b/UI/ModeIndicator/ModeIndicator_Master.png new file mode 100644 index 0000000000..c69fcfaa6e Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Master.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Master_Off.png b/UI/ModeIndicator/ModeIndicator_Master_Off.png new file mode 100644 index 0000000000..91817fbfd1 Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Master_Off.png differ diff --git a/UI/ModeIndicator/ModeIndicator_None.png b/UI/ModeIndicator/ModeIndicator_None.png deleted file mode 100644 index 58648ff4ed..0000000000 Binary files a/UI/ModeIndicator/ModeIndicator_None.png and /dev/null differ diff --git a/UI/ModeIndicator/ModeIndicator_Rev.png b/UI/ModeIndicator/ModeIndicator_Rev.png index 64eec475d7..5b21cfd0fa 100644 Binary files a/UI/ModeIndicator/ModeIndicator_Rev.png and b/UI/ModeIndicator/ModeIndicator_Rev.png differ diff --git a/UI/ModeIndicator/ModeIndicator_Rev_Off.png b/UI/ModeIndicator/ModeIndicator_Rev_Off.png new file mode 100644 index 0000000000..3f8cc887fa Binary files /dev/null and b/UI/ModeIndicator/ModeIndicator_Rev_Off.png differ diff --git a/UI/Rippers/RipperUI.cs b/UI/Rippers/RipperUI.cs index 424310e6ec..f36c398ae7 100644 --- a/UI/Rippers/RipperUI.cs +++ b/UI/Rippers/RipperUI.cs @@ -146,7 +146,7 @@ namespace CalamityMod.UI.Rippers changed = true; } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } if (modPlayer.AdrenalineEnabled) @@ -165,7 +165,7 @@ namespace CalamityMod.UI.Rippers changed = true; } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } #region Mouse Interaction @@ -225,7 +225,7 @@ namespace CalamityMod.UI.Rippers if (ms.LeftButton == ButtonState.Released) { rageDragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } else if (adrenHover) @@ -267,7 +267,7 @@ namespace CalamityMod.UI.Rippers if (ms.LeftButton == ButtonState.Released) { adrenDragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } #endregion diff --git a/UI/SpeedrunTimerUI.cs b/UI/SpeedrunTimerUI.cs index 19eb113455..5e7d334499 100644 --- a/UI/SpeedrunTimerUI.cs +++ b/UI/SpeedrunTimerUI.cs @@ -118,7 +118,7 @@ namespace CalamityMod.UI 28 => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value, 29 => TextureAssets.NpcHeadBoss[8].Value, // Moon Lord 30 => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value, - 31 => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value, + 31 => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value, 32 => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value, 33 => TextureAssets.NpcHeadBoss[NPCID.Sets.BossHeadTextures[ModContent.NPCType()]].Value, 34 => ModContent.Request("CalamityMod/NPCs/StormWeaver/StormWeaverHeadNaked_Head_Boss").Value, diff --git a/UI/StealthUI.cs b/UI/StealthUI.cs index 42c9269e04..c369445106 100644 --- a/UI/StealthUI.cs +++ b/UI/StealthUI.cs @@ -76,7 +76,7 @@ namespace CalamityMod.UI } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8); @@ -98,7 +98,7 @@ namespace CalamityMod.UI string maxStealthStr = (100f * modPlayer.rogueStealthMax).ToString("n2"); string textToDisplay = $"{CalamityUtils.GetTextValue("UI.Stealth")}: {stealthStr}/{maxStealthStr}\n"; - if (!Main.keyState.IsKeyDown(LeftShift)) + if (!Main.keyState.PressingShift()) { textToDisplay += CalamityUtils.GetTextValue("UI.StealthShiftText"); } @@ -139,7 +139,7 @@ namespace CalamityMod.UI if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } } diff --git a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs index 04b5b562da..f6b1e35b38 100644 --- a/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs +++ b/UI/SulphurousWaterMeter/SulphurousWaterMeterUI.cs @@ -70,7 +70,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter } if (changed) - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } Rectangle mouseHitbox = new Rectangle((int)Main.MouseScreen.X, (int)Main.MouseScreen.Y, 8, 8); @@ -123,7 +123,7 @@ namespace CalamityMod.UI.SulphurousWaterMeter if (ms.LeftButton == ButtonState.Released) { dragOffset = null; - CalamityClientConfig.SaveConfig(); + CalamityClientConfig.Instance.SaveChanges(); } } else diff --git a/UI/VanillaBossBars/CeaselessVoidBossBar.cs b/UI/VanillaBossBars/CeaselessVoidBossBar.cs index 29fb7c446c..55c3541beb 100644 --- a/UI/VanillaBossBars/CeaselessVoidBossBar.cs +++ b/UI/VanillaBossBars/CeaselessVoidBossBar.cs @@ -40,7 +40,7 @@ namespace CalamityMod.UI.VanillaBossBars // Determine the shield health // Amount of Dark Energies expected from each phase/difficulty - int ExpectedBallsCounter = ((lifePercent <= 0.1f ? 3 : lifePercent <= 0.4f ? 2 : lifePercent <= 0.7f ? 1 : 0) + (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 5 : Main.expertMode ? 4 : 3)) * (Main.getGoodWorld ? 6 : 3) + 2; + int ExpectedBallsCounter = ((lifePercent <= 0.1f ? 3 : lifePercent <= 0.4f ? 2 : lifePercent <= 0.7f ? 1 : 0) + (CalamityWorld.death ? 6 : CalamityWorld.revenge ? 5 : Main.expertMode ? 4 : 3)) * (CalamityWorld.LegendaryMode ? 6 : 3) + 2; // The Dark Energies will instantly all die at a certain point of their total max health float RatioToCombust = 0.2f; if (NPC.AnyNPCs(NPCType())) diff --git a/Utilities/GeneralExtensionUtils.cs b/Utilities/GeneralExtensionUtils.cs index cba1a4cf52..a7950a7edd 100644 --- a/Utilities/GeneralExtensionUtils.cs +++ b/Utilities/GeneralExtensionUtils.cs @@ -1,5 +1,6 @@ using CalamityMod.CalPlayer; using CalamityMod.Items; +using CalamityMod.Items.BaseItems; using CalamityMod.NPCs; using CalamityMod.Projectiles; using Terraria; @@ -15,5 +16,7 @@ namespace CalamityMod public static CalamityGlobalItem Calamity(this Item item) => item.GetGlobalItem(); public static CalamityGlobalProjectile Calamity(this Projectile proj) => proj.GetGlobalProjectile(); public static Item ActiveItem(this Player player) => Main.mouseItem.IsAir ? player.HeldItem : Main.mouseItem; + public static TransformationPlayer Transformation(this Player player) => player.GetModPlayer(); + } } diff --git a/Utilities/ItemUtils.cs b/Utilities/ItemUtils.cs index c28487a7fd..0f4c8d0cc7 100644 --- a/Utilities/ItemUtils.cs +++ b/Utilities/ItemUtils.cs @@ -41,65 +41,6 @@ namespace CalamityMod internal static readonly Color DonatorItemColor = new Color(255, 121, 156); #endregion - // TODO -- This probably isn't the best place to put this but it needs to be somewhere easily accessible. - #region Accessory Prefix Stats - internal static int GetScalingDefense(int prefixID) - { - switch (prefixID) - { - default: - return 0; - - // Ironskin Potion - // This makes sense to be here but also not - case -1: - if (DownedBossSystem.downedDoG) - return 14; - else if (NPC.downedMoonlord) - return 12; - else if (Main.hardMode) - return 10; - return 8; - - case PrefixID.Hard: - if (DownedBossSystem.downedDoG) - return 4; - else if (NPC.downedMoonlord) - return 3; - else if (Main.hardMode) - return 2; - return 1; - - case PrefixID.Guarding: - if (DownedBossSystem.downedDoG) - return 5; - else if (NPC.downedMoonlord) - return 4; - else if (Main.hardMode) - return 3; - return 2; - - case PrefixID.Armored: - if (DownedBossSystem.downedDoG) - return 6; - else if (NPC.downedMoonlord) - return 5; - else if (Main.hardMode) - return 4; - return 3; - - case PrefixID.Warding: - if (DownedBossSystem.downedDoG) - return 7; - else if (NPC.downedMoonlord) - return 6; - else if (Main.hardMode) - return 5; - return 4; - } - } - #endregion - #region Reforging Algorithm internal static int GetReworkedReforge(Item item, UnifiedRandom rand, int currentPrefix) { diff --git a/Utilities/LocalizationUtils.cs b/Utilities/LocalizationUtils.cs index 07d6a8c75f..d7096cdc8e 100644 --- a/Utilities/LocalizationUtils.cs +++ b/Utilities/LocalizationUtils.cs @@ -1,4 +1,6 @@ -using Terraria.ID; +using CalamityMod.Enums; +using Terraria; +using Terraria.ID; using Terraria.Localization; using Terraria.ModLoader; @@ -81,6 +83,8 @@ namespace CalamityMod public static string GetTextValueFromModItem(string suffix) where T : ModItem => GetTextFromModItem(ModContent.ItemType(), suffix).ToString(); #region Tooltip Format Helper + public static string EmbedItemIcon(this int itemID) => $"[i:{itemID}] " + GetItemName(itemID); + public static string FramesToSeconds(this int frame) => Round(frame / 60f, "N2"); public static string ToMph(this float velocity) => Round(velocity * 216000f / 42240f, "N0"); @@ -89,6 +93,7 @@ namespace CalamityMod public static string ToRegenPerSecond(this int regen) => Round(regen * 0.5f, "N2"); public static string ToJumpSpeedPercent(this float boost) => Round(boost * 20f, "N2"); + public static string ToStealth(this float stealth) => Round(stealth * 100f, "N0"); public static string ToPercent(this float percent, string precision = "N1") => Round(percent * 100f, precision); public static string ToPercent(this double percent, string precision = "N1") => Round(percent * 100D, precision); @@ -96,5 +101,25 @@ namespace CalamityMod public static string Round(this float number, string precision = "N4") => float.Parse((number).ToString(precision)).ToString(); public static string Round(this double number, string precision = "N4") => float.Parse((number).ToString(precision)).ToString(); #endregion + + public static string GetArmorSetBonusKey() + { + ModKeybind setBonusKey = CalamityKeybinds.ArmorSetBonusHotKey; + bool hasHotkey = setBonusKey.GetAssignedKeys().Count != 0; + string directionKey = (Main.ReversedUpDownArmorSetBonuses ? Language.GetTextValue("Key.UP") : Language.GetTextValue("Key.DOWN")); + + // Allow both + if (hasHotkey && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.On) + return GetText("Common.BothArmorSetBonusKeys").Format(setBonusKey.TooltipHotkeyString(), directionKey); + // Literally bind nothing (mentions the key name to you) + else if (!hasHotkey && CalamityClientConfig.Instance.SetBonusDoubleTap == SetBonusDoubleTapOptions.Off) + return GetTextValue("Common.NoArmorSetBonusKey"); + // Hotkey only + else if (hasHotkey) + return GetText("Common.ArmorSetBonusKey").Format(setBonusKey.TooltipHotkeyString()); + // Double tap only + else + return GetText("Common.DoubleTapDown").Format(directionKey); + } } } diff --git a/Utilities/MathematicalUtils.cs b/Utilities/MathematicalUtils.cs index 8108deec16..45fba7b694 100644 --- a/Utilities/MathematicalUtils.cs +++ b/Utilities/MathematicalUtils.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using System.Linq; using System.Security.Cryptography.Xml; +using Microsoft.CodeAnalysis; using Microsoft.Xna.Framework; using ReLogic.Threading; using Terraria; @@ -433,6 +434,17 @@ namespace CalamityMod } return ratio; } + /// + /// Xyk's version of easing in and out
+ /// Returns an eased version of a 0 - 1 lerp value. + ///
+ /// The 0 - 1 lerp input + /// The intensisty of the easing in. + /// /// The intensisty of the easing out. + public static float EaseInOutExp(float lerpValue, float inPower, float outPower) + { + return (lerpValue < 0.5f ? (float)Math.Pow(Utils.GetLerpValue(0, 0.5f, lerpValue, true), inPower) * 0.5f : 0.5f + (1 - (float)Math.Pow(Utils.GetLerpValue(1, 0.5f, lerpValue, true), outPower)) * 0.5f); + } #endregion } diff --git a/Utilities/MiscUtils.cs b/Utilities/MiscUtils.cs index 89973967e4..fb0b74fabd 100644 --- a/Utilities/MiscUtils.cs +++ b/Utilities/MiscUtils.cs @@ -31,6 +31,14 @@ namespace CalamityMod ChatHelper.BroadcastChatMessage(NetworkText.FromKey(key), textColor.Value); } + public static void DisplayFormattedText(string key, Color textColor, params object[] args) + { + if (Main.netMode == NetmodeID.SinglePlayer) + Main.NewText(Language.GetOrRegister(key).Format(args), textColor); + else if (Main.dedServ || Main.netMode == NetmodeID.MultiplayerClient) + ChatHelper.BroadcastChatMessage(NetworkText.FromKey(key, args), textColor); + } + public static int IngredientIndex(this Recipe r, int itemID) { for (int i = 0; i < r.requiredItem.Count; ++i) diff --git a/Utilities/NPCDebuffs.cs b/Utilities/NPCDebuffs.cs index cdea134597..9f0f06c931 100644 --- a/Utilities/NPCDebuffs.cs +++ b/Utilities/NPCDebuffs.cs @@ -249,9 +249,9 @@ namespace CalamityMod { ModContent.NPCType(), holy }, { ModContent.NPCType(), holy }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, - { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, + { ModContent.NPCType(), new(GeneralImmunityStatus.None, new int[] { ModContent.BuffType() }) }, { ModContent.NPCType(), holy }, { ModContent.NPCType(), holy }, diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 81e4aecbd5..d65a255a8d 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -9,6 +9,7 @@ using CalamityMod.Enums; using CalamityMod.Events; using CalamityMod.Items.Accessories; using CalamityMod.Items.Armor; +using CalamityMod.Items.Armor.Statigel; using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Systems.Collections; using CalamityMod.World; @@ -438,8 +439,8 @@ namespace CalamityMod int extraIFrames = 0; if (modPlayer.godSlayerThrowing && hurtInfo.Damage > 80) extraIFrames += 30; - if (modPlayer.statigelSet && hurtInfo.Damage > 100) - extraIFrames += 30; + if (modPlayer.statigelSet && hurtInfo.Damage > StatigelArmor.SetBonusHurtDamageThreshold) + extraIFrames += StatigelArmor.SetBonusIFrameExtension; // Deific Amulet provides 10 to 40 bonus immunity frames when you get hit which scale with your missing health. // If you only take 1 damage, you get 5 iframes. @@ -617,6 +618,107 @@ namespace CalamityMod } #endregion + #region Player Healing and Lifesteal + /// + /// Directly provides lifesteal to the player. + /// This obeys the spawn behaviour of lifesteal and incurs cooldown. + /// + /// The player being healed. + /// The target being hit. Input null if there is none. + /// The amount of life being healed. + /// The multiplier to the rate of lifesteal. Increase above 1 to make it weaker and below 1 to make it stronger. + public static void DoLifestealDirect(this Player player, NPC target, int amount, float cooldownMultiplier = 1f) + { + // NPC limitations: disallow if target is not an enemy or deliberately disallowed from lifestealing + if (target is not null && (!target.IsAnEnemy(false) || !target.canGhostHeal)) + return; + + // Limit the amount of heal to the player's max health + amount = Math.Min(amount, player.statLifeMax2 - player.statLife); + + // As well as the physical cap to how much HP can be healed + amount = Math.Min(amount, BalancingConstants.LifeStealCap); + + // Player limitations: disallow if lifesteal variable reaches 0 or lower or Moon Bite is active + if (amount <= 0 || player.lifeSteal <= 0f || player.moonLeech) + return; + + // Grant lifesteal and subtract from the variable accordingly + player.lifeSteal -= amount * cooldownMultiplier; + player.HealPlayer(amount); + } + + /// + /// Spawns a projectile which grants healing to the player on contact. + /// This obeys the spawn behaviour of lifesteal and incurs cooldown. + /// This applies as a projectile on-hit effect. Use DoLifestealDirect for direct lifestealing. + /// + /// The player being healed. + /// The target being hit. Input null if there is none. + /// The source projectile performing this heal. + /// The type of healing projectile spawned. + /// The amount of life to heal. + /// The multiplier to the rate of lifesteal. Increase above 1 to make it weaker and below 1 to make it stronger. + /// Whether or not the heal is given to the player on the team with lowest HP. False by default. + /// The distance the projectile has to be from the player to direct the heal to when sharing. Default of 3000f (187.5 tiles) + public static void SpawnLifeStealProjectile(this Player player, NPC target, Projectile projSource, int projType, int amount, float cooldownMultiplier = 1f, bool shared = false, float distanceRequired = 3000f) + { + // NPC limitations: disallow if target is not an enemy or deliberately disallowed from lifestealing + if (target is not null && (!target.IsAnEnemy(false) || !target.canGhostHeal)) + return; + + int lowestHealthCheck = player.statLifeMax2 - player.statLife; + int targetPlayer = player.whoAmI; + if (shared) + { + foreach (Player otherPlayer in Main.ActivePlayers) + { + if (!otherPlayer.dead && ((!player.hostile && !otherPlayer.hostile) || player.team == otherPlayer.team)) + { + float playerDist = Vector2.Distance(projSource.Center, otherPlayer.Center); + if (playerDist < distanceRequired && (otherPlayer.statLifeMax2 - otherPlayer.statLife) > lowestHealthCheck) + { + lowestHealthCheck = otherPlayer.statLifeMax2 - otherPlayer.statLife; + targetPlayer = otherPlayer.whoAmI; + } + } + } + } + + // Limit the amount of heal to the target player's max health + amount = Math.Min(amount, lowestHealthCheck); + + // As well as the physical cap to how much HP can be healed + amount = Math.Min(amount, BalancingConstants.LifeStealCap); + + // Player limitations: disallow if lifesteal variable reaches 0 or lower or Moon Bite is active + // This is performed on the player who DOES the lifesteal, and not the recipient + if (amount <= 0 || player.lifeSteal <= 0f || player.moonLeech) + return; + + // Grant lifesteal and subtract from the variable accordingly + player.lifeSteal -= amount * cooldownMultiplier; + if (projSource.owner == Main.myPlayer) + Projectile.NewProjectile(projSource.GetSource_FromThis(), projSource.Center, Vector2.Zero, projType, 0, 0f, projSource.owner, targetPlayer, amount); + } + + /// + /// A short method that heals the player. + /// All direct heals in Calamity should use this. + /// + /// The player being healed. + /// The amount of life being healed. + /// Whether the heal CombatText should be displayed, and whether it should be synced. Displays and syncs by default. + public static void HealPlayer(this Player player, int amount, HealTextType healTextType = HealTextType.Broadcast) + { + player.statLife += amount; + if (player.statLife > player.statLifeMax2) + player.statLife = player.statLifeMax2; + if (healTextType != HealTextType.None) + player.HealEffect(amount, healTextType == HealTextType.Broadcast); + } + #endregion + #region Rage and Adrenaline /// /// Returns the damage multiplier Adrenaline Mode provides for the given player. @@ -935,23 +1037,6 @@ namespace CalamityMod return false; } - - /// - /// A short method that heals the player. - /// All direct heals in Calamity should use this. - /// - /// The player being healed. - /// The amount of life being healed. - /// Whether the heal CombatText should be displayed, and whether it should be synced. Displays and syncs by default. - public static void HealPlayer(this Player player, int amount, HealTextType healTextType = HealTextType.Broadcast) - { - player.statLife += amount; - if (player.statLife > player.statLifeMax2) - player.statLife = player.statLifeMax2; - if (healTextType != HealTextType.None) - player.HealEffect(amount, healTextType == HealTextType.Broadcast); - } - /// /// Makes the given player send the given packet to all appropriate receivers.
/// If server is false, the packet is sent only to the multiplayer host.
diff --git a/Utilities/ProjectileUtils.cs b/Utilities/ProjectileUtils.cs index e8b9ab486f..bf30417251 100644 --- a/Utilities/ProjectileUtils.cs +++ b/Utilities/ProjectileUtils.cs @@ -845,7 +845,6 @@ namespace CalamityMod private static readonly List vanillaBlastImmuneTiles = new List() { - TileID.DemonAltar, TileID.Cobalt, TileID.Mythril, TileID.Adamantite, @@ -854,8 +853,7 @@ namespace CalamityMod TileID.Titanium, TileID.Chlorophyte, TileID.LihzahrdBrick, - TileID.LihzahrdAltar, - TileID.DesertFossil + TileID.LihzahrdAltar }; public static void ExplodeTiles(this Projectile p, int explosionRadius, bool respectStandardBlastImmunity = true, IEnumerable customBlastImmuneTiles = null, IEnumerable customBlastImmuneWalls = null) @@ -918,6 +916,13 @@ namespace CalamityMod // Conditionally toss in Hellstone if it's not Hardmode yet. if (!Main.hardMode) blastImmuneTiles.Add(TileID.Hellstone); + + // Also spikes in FTW + if (Main.getGoodWorld) + { + blastImmuneTiles.Add(TileID.Spikes); + blastImmuneTiles.Add(TileID.WoodenSpikes); + } } // If specified, add custom blast immune tiles. diff --git a/Utilities/TileEntityUtils.cs b/Utilities/TileEntityUtils.cs index 3e5fae0989..4d164a7f20 100644 --- a/Utilities/TileEntityUtils.cs +++ b/Utilities/TileEntityUtils.cs @@ -1,5 +1,5 @@ using CalamityMod.Items.DraedonMisc; -using CalamityMod.Items.Materials; +using CalamityMod.Items.Pets; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -77,7 +77,7 @@ namespace CalamityMod // This check is done twice because the draw order matters. We want to draw the background icon before any text. if (item.stack > 0) { - if (item.type == ItemType()) + if (item.type == ItemType()) { slotBackgroundTex = Request("CalamityMod/UI/DraedonsArsenal/PowerCellSlot_Blood").Value; } diff --git a/Utilities/TileUtils.cs b/Utilities/TileUtils.cs index 4877f181e9..0d1e3e5774 100644 --- a/Utilities/TileUtils.cs +++ b/Utilities/TileUtils.cs @@ -1,17 +1,20 @@ using System; using System.Collections.Generic; using System.Runtime.CompilerServices; +using CalamityMod.Tiles.FurnitureNavystone.FurnitureAncientNavystone; using CalamityMod.Systems; using CalamityMod.Tiles; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.FurnitureDriftwood; +using CalamityMod.Tiles.FurnitureMonolith; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Crags; using CalamityMod.Tiles.FloralParadise; using CalamityMod.Tiles.FurnitureAbyss; using CalamityMod.Tiles.FurnitureAshen; -using CalamityMod.Tiles.FurnitureEutrophic; +using CalamityMod.Tiles.FurnitureNavystone; using CalamityMod.Tiles.FurnitureOtherworldly; using CalamityMod.Tiles.FurnitureProfaned; using CalamityMod.Tiles.FurnitureVoid; diff --git a/Walls/AncientSmoothNavystoneWall.cs b/Walls/AncientSmoothNavystoneWall.cs new file mode 100644 index 0000000000..ec71f2f560 --- /dev/null +++ b/Walls/AncientSmoothNavystoneWall.cs @@ -0,0 +1,27 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class AncientSmoothNavystoneWall : ModWall, IVisibleThroughWater + { + int IVisibleThroughWater.WaterMapEntry { get; set; } + + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = true; + + this.AddMapEntryWithWaterVisibility(new Color(27, 35, 36)); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.SnowBlock, 0f, 0f, 1, new Color(54, 69, 72), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/AncientSmoothNavystoneWall.png b/Walls/AncientSmoothNavystoneWall.png new file mode 100644 index 0000000000..585d059bc8 Binary files /dev/null and b/Walls/AncientSmoothNavystoneWall.png differ diff --git a/Walls/LargeBasaltWall.cs b/Walls/LargeBasaltWall.cs new file mode 100644 index 0000000000..4c902acac2 --- /dev/null +++ b/Walls/LargeBasaltWall.cs @@ -0,0 +1,30 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ID; + +namespace CalamityMod.Walls +{ + public class LargeBasaltWall : MultiVariantModWall + { + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = true; + + AddMapEntry(new Color(45, 44, 50)); + } + + public override bool CreateDust(int i, int j, ref int type) + { + Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, DustID.Ash, 0f, 0f, 1, new Color(255, 255, 255), 1f); + return false; + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + + public override void PopulateWallVariant(int i, int j, ref int frameXOffset, ref int frameYOffset) + { + frameXOffset = (i % 4) * 468; + frameYOffset = (j % 4) * 180; + } + } +} diff --git a/Walls/LargeBasaltWall.png b/Walls/LargeBasaltWall.png new file mode 100644 index 0000000000..775d0dc9d9 Binary files /dev/null and b/Walls/LargeBasaltWall.png differ diff --git a/Walls/NavystoneWall.cs b/Walls/NavystoneWall.cs index 500df762c1..51f5124c88 100644 --- a/Walls/NavystoneWall.cs +++ b/Walls/NavystoneWall.cs @@ -1,16 +1,81 @@ -using Microsoft.Xna.Framework; +using System; +using Microsoft.Xna.Framework; +using Microsoft.Xna.Framework.Graphics; +using Terraria.GameContent; +using Terraria; using Terraria.ModLoader; namespace CalamityMod.Walls { public class NavystoneWall : ModWall, IVisibleThroughWater { + internal static FramedMaskTexture GlowMask; int IVisibleThroughWater.WaterMapEntry { get; set; } public override void SetStaticDefaults() { + GlowMask = new("CalamityMod/Walls/NavystoneWall_Glow", 36, 36); DustType = 96; this.AddMapEntryWithWaterVisibility(new Color(16, 45, 48)); } + public override void Unload() + { + GlowMask?.Unload(); + GlowMask = null; + } + public static void DrawWallGlow(int wallType, int i, int j, SpriteBatch spriteBatch) + { + if (GlowMask.Texture is null) + return; + + Tile tile = Main.tile[i, j]; + int xLength = 32; + int xOff = 0; + + int xPos = tile.WallFrameX + xOff; + int yPos = tile.WallFrameY; + + Rectangle frame = new Rectangle(xPos, yPos, xLength, 32); + Color drawcolor; + drawcolor = WorldGen.paintColor(tile.WallColor); + drawcolor.A = 255; + Vector2 zero = new Vector2(Main.offScreenRange, Main.offScreenRange); + + if (Main.drawToScreen) + zero = Vector2.Zero; + + Vector2 pos = new Vector2(i * 16 - (int)Main.screenPosition.X, j * 16 - (int)Main.screenPosition.Y) + zero; + Color lightColor = Lighting.GetColor(i, j, Color.White); + + spriteBatch.Draw(TextureAssets.Wall[wallType].Value, pos + new Vector2(-8 + xOff, -8), frame, lightColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + + if (GlowMask.HasContentInFramePos(xPos, yPos)) + { + float brightness = MathHelper.Clamp(0.2f - (j / 680), 0f, 0.2f); + + float time = Main.GameUpdateCount; + float waveScale1 = time * 0.094f; + int scalar = i - (j / 2); + float wave1 = waveScale1 * -50 + scalar * 12; + float wave1angle = 0.30f + 0.25f * MathF.Sin(MathHelper.ToRadians(wave1)); + + drawcolor *= brightness; + + float transparency = 0.02f + (wave1angle / 4); + Color glowColor = Color.White * transparency; + + for (int k = 0; k < 3; k++) + { + //Vector2 offset = new Vector2(Main.rand.NextFloat(-1, 1f), Main.rand.NextFloat(-1, 1f)) * 0.2f * k; + spriteBatch.Draw(GlowMask.Texture, pos + new Vector2(-8 + xOff, -8), frame, glowColor, 0f, Vector2.Zero, 1f, SpriteEffects.None, 0f); + } + } + } + + public override bool PreDraw(int i, int j, SpriteBatch spriteBatch) + { + DrawWallGlow(Type, i, j, spriteBatch); + return false; + } public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; } diff --git a/Walls/NavystoneWall.png b/Walls/NavystoneWall.png index 3c3de52f96..1f7e78021e 100644 Binary files a/Walls/NavystoneWall.png and b/Walls/NavystoneWall.png differ diff --git a/Walls/NavystoneWall_Glow.png b/Walls/NavystoneWall_Glow.png new file mode 100644 index 0000000000..680f0c9855 Binary files /dev/null and b/Walls/NavystoneWall_Glow.png differ diff --git a/Walls/ShellTrimBrickWall.cs b/Walls/ShellTrimBrickWall.cs new file mode 100644 index 0000000000..ed32eacef6 --- /dev/null +++ b/Walls/ShellTrimBrickWall.cs @@ -0,0 +1,21 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Walls +{ + public class ShellTrimBrickWall : ModWall, IVisibleThroughWater + { + int IVisibleThroughWater.WaterMapEntry { get; set; } + + public override void SetStaticDefaults() + { + Main.wallHouse[Type] = false; + DustType = 24; + + this.AddMapEntryWithWaterVisibility(new Color(75, 71, 85)); + } + + public override void NumDust(int i, int j, bool fail, ref int num) => num = fail ? 1 : 3; + } +} diff --git a/Walls/ShellTrimBrickWall.png b/Walls/ShellTrimBrickWall.png new file mode 100644 index 0000000000..9c121bd0d5 Binary files /dev/null and b/Walls/ShellTrimBrickWall.png differ diff --git a/Walls/ShellstoneSlabWall.png b/Walls/ShellstoneSlabWall.png index 3d6e1f138f..2b2171a158 100644 Binary files a/Walls/ShellstoneSlabWall.png and b/Walls/ShellstoneSlabWall.png differ diff --git a/Walls/SmoothNavystoneWall.png b/Walls/SmoothNavystoneWall.png index 585d059bc8..09aa9344ea 100644 Binary files a/Walls/SmoothNavystoneWall.png and b/Walls/SmoothNavystoneWall.png differ diff --git a/Waters/BasaltGullyLava.cs b/Waters/BasaltGullyLava.cs new file mode 100644 index 0000000000..d81e1570c5 --- /dev/null +++ b/Waters/BasaltGullyLava.cs @@ -0,0 +1,26 @@ +using CalamityMod.Dusts.WaterSplash; +using CalamityMod.Gores.WaterDroplet; +using CalamityMod.Systems; +using Terraria; +using Terraria.ModLoader; + +namespace CalamityMod.Waters +{ + public class BasaltGullyLava : ModLavaStyle + { + public override string WaterfallTexture => "CalamityMod/Waters/BasaltGullyLavaflow"; + + public override int GetSplashDust() => ModContent.DustType(); + + public override int GetDropletGore() => ModContent.GoreType(); + + public override bool IsLavaActive() => Main.LocalPlayer.Calamity().ZoneBasaltGully; + + public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b) + { + r = 2.48f / 4; + g = 1.29f / 4; + b = 0.48f / 4; + } + } +} diff --git a/Waters/BasaltGullyLava.png b/Waters/BasaltGullyLava.png new file mode 100644 index 0000000000..2459b3cf5e Binary files /dev/null and b/Waters/BasaltGullyLava.png differ diff --git a/Waters/BasaltGullyLava_Block.png b/Waters/BasaltGullyLava_Block.png new file mode 100644 index 0000000000..e1c8be0e19 Binary files /dev/null and b/Waters/BasaltGullyLava_Block.png differ diff --git a/Waters/BasaltGullyLava_Slope.png b/Waters/BasaltGullyLava_Slope.png new file mode 100644 index 0000000000..a6a89147f9 Binary files /dev/null and b/Waters/BasaltGullyLava_Slope.png differ diff --git a/Waters/BasaltGullyLavaflow.png b/Waters/BasaltGullyLavaflow.png new file mode 100644 index 0000000000..791bdd5ff1 Binary files /dev/null and b/Waters/BasaltGullyLavaflow.png differ diff --git a/Waters/SunkenSeaBurrowsWater_Slope.png b/Waters/SunkenSeaBurrowsWater_Slope.png index 5598cc77c0..fcd463d89f 100644 Binary files a/Waters/SunkenSeaBurrowsWater_Slope.png and b/Waters/SunkenSeaBurrowsWater_Slope.png differ diff --git a/Waters/SunkenSeaPolypWater_Slope.png b/Waters/SunkenSeaPolypWater_Slope.png index 9404893b7c..ddf2446ee4 100644 Binary files a/Waters/SunkenSeaPolypWater_Slope.png and b/Waters/SunkenSeaPolypWater_Slope.png differ diff --git a/Waters/SunkenSeaReefsWater_Slope.png b/Waters/SunkenSeaReefsWater_Slope.png index 74919b164c..5a485e545f 100644 Binary files a/Waters/SunkenSeaReefsWater_Slope.png and b/Waters/SunkenSeaReefsWater_Slope.png differ diff --git a/World/Abyss.cs b/World/Abyss.cs index 84775f63b8..6c51e76870 100644 --- a/World/Abyss.cs +++ b/World/Abyss.cs @@ -1119,6 +1119,7 @@ namespace CalamityMod.World if (ChestIndex != -1) { Main.chest[ChestIndex].item[0].SetDefaults(itemChoice); + Main.chest[ChestIndex].item[0].Prefix(-1); Main.chest[ChestIndex].item[1].SetDefaults(WorldGen.genRand.Next(Potions1)); Main.chest[ChestIndex].item[1].stack = WorldGen.genRand.Next(1, 3); diff --git a/World/AerialiteOreGen.cs b/World/AerialiteOreGen.cs index 9a487be65a..d712a0c3e8 100644 --- a/World/AerialiteOreGen.cs +++ b/World/AerialiteOreGen.cs @@ -34,7 +34,7 @@ namespace CalamityMod.World // 2. The original tile must not be empty air. // 3. A random dice-roll must land correctly, to ensure that patches of ore are occasional. // If any of these conditions are not met, this loop iteration is skipped. - if (!(tile.TileType == TileID.Cloud || tile.TileType == TileID.LesionBlock || tile.TileType == TileID.FleshBlock) || !tile.HasTile || !WorldGen.genRand.NextBool(CloudOreConversionChance)) + if (!(tile.TileType == TileID.Cloud || ((tile.TileType == TileID.LesionBlock || tile.TileType == TileID.FleshBlock) && WorldGen.remixWorldGen)) || !tile.HasTile || !WorldGen.genRand.NextBool(CloudOreConversionChance)) continue; int radius = (int)(WorldGen.genRand.Next(3, 5) * WorldGen.genRand.NextFloat(0.74f, 0.82f)); diff --git a/World/AstralBiome.cs b/World/AstralBiome.cs index 6fcb107f3b..40f0d73511 100644 --- a/World/AstralBiome.cs +++ b/World/AstralBiome.cs @@ -4,6 +4,8 @@ using System.Linq; using CalamityMod.Schematics; using CalamityMod.Tiles.Abyss; using CalamityMod.Tiles.Astral; +using CalamityMod.Tiles.FurnitureAcidwood; +using CalamityMod.Tiles.FurnitureMonolith; using CalamityMod.Tiles.AstralDesert; using CalamityMod.Tiles.AstralSnow; using CalamityMod.Tiles.Ores; diff --git a/World/CalamityWorld.cs b/World/CalamityWorld.cs index 0b57888e4f..82bca91ae4 100644 --- a/World/CalamityWorld.cs +++ b/World/CalamityWorld.cs @@ -5,9 +5,11 @@ using CalamityMod.NPCs.ExoMechs.Apollo; using CalamityMod.NPCs.ExoMechs.Ares; using CalamityMod.NPCs.ExoMechs.Artemis; using CalamityMod.NPCs.ExoMechs.Thanatos; +using CalamityMod.Systems; using Microsoft.Xna.Framework; using Terraria; using Terraria.DataStructures; +using Terraria.GameContent.Creative; using Terraria.GameContent.Events; using Terraria.ID; using Terraria.ModLoader; @@ -52,10 +54,23 @@ namespace CalamityMod.World /// Evaluates to whether vanilla's "Legendary Mode" is enabled (Master Mode on For the Worthy). public static bool LegendaryMode => Main.getGoodWorld && ReflectMasterMode(); + /// + /// Evaluates to whether "Malice Mode" is enabled (Death Mode on For the Worthy).
+ /// Note that the effects of this difficulty are unaffiliated with the removed Malice Mode. + ///
+ public static bool MaliceMode => Main.getGoodWorld && ReflectMasterMode() && revenge; + // FTW automatically bumps difficulties up and has no proper check for Master since a world generated in Expert Mode will be classified as Master // Therefore gotta reflect! public static bool ReflectMasterMode() { + if (Main.GameModeInfo.IsJourneyMode) + { + CreativePowers.DifficultySliderPower power = CreativePowerManager.Instance.GetPower(); + float level = (float)DifficultyModeSystem.journeySliderCacheField.GetValue(power); + return level == 1f; + } + FieldInfo findInfo = typeof(Main).GetField("_currentGameModeInfo", BindingFlags.Static | BindingFlags.NonPublic); GameModeData data = (GameModeData)findInfo.GetValue(null); return data.IsMasterMode; diff --git a/World/CustomUnderworld.cs b/World/CustomUnderworld.cs index 60b43a5528..3271f7e3f4 100644 --- a/World/CustomUnderworld.cs +++ b/World/CustomUnderworld.cs @@ -2185,6 +2185,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -2215,6 +2216,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/DraedonStructures.cs b/World/DraedonStructures.cs index 566ee2b8f0..411b8181db 100644 --- a/World/DraedonStructures.cs +++ b/World/DraedonStructures.cs @@ -246,6 +246,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/DungeonArchive.cs b/World/DungeonArchive.cs index 51487e5f4c..ff39d10636 100644 --- a/World/DungeonArchive.cs +++ b/World/DungeonArchive.cs @@ -135,6 +135,7 @@ namespace CalamityMod.World else { chest.item[i].SetDefaults(contents2[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents2[i].Stack; } } diff --git a/World/GiantHive.cs b/World/GiantHive.cs index 7845fa730c..03fadea3de 100644 --- a/World/GiantHive.cs +++ b/World/GiantHive.cs @@ -831,12 +831,13 @@ namespace CalamityMod.World int index = 0; - chest.item[index++].SetDefaults(random.Next(FocusLootHoney)); + chest.item[index].SetDefaults(random.Next(FocusLootHoney)); + chest.item[index++].Prefix(-1); if (random.Next(3) <= 1) { chest.item[index].SetDefaults(random.Next(BarLootHoney)); - chest.item[index].SetDefaults(random.Next(7, 15)); + chest.item[index++].stack = random.Next(7, 15); } else { diff --git a/World/MechanicShed.cs b/World/MechanicShed.cs index 172e2fb573..5af166de3c 100644 --- a/World/MechanicShed.cs +++ b/World/MechanicShed.cs @@ -130,6 +130,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/MiscWorldgenRoutines.cs b/World/MiscWorldgenRoutines.cs index 474cf6d647..6b92ec1073 100644 --- a/World/MiscWorldgenRoutines.cs +++ b/World/MiscWorldgenRoutines.cs @@ -63,6 +63,7 @@ namespace CalamityMod.World return; c.item[itemIndex].SetDefaults(id, false); + c.item[itemIndex].Prefix(-1); // Don't set quantity unless quantity is specified if (minQuantity > 0) diff --git a/World/Planets/MudPlanet.cs b/World/Planets/MudPlanet.cs index 97113e4681..0ce47166f8 100644 --- a/World/Planets/MudPlanet.cs +++ b/World/Planets/MudPlanet.cs @@ -222,13 +222,14 @@ namespace CalamityMod.World.Planets int index = 0; //Focus loot - chest.item[index++].SetDefaults(_random.Next(FocusLoot)); + chest.item[index].SetDefaults(_random.Next(FocusLoot)); + chest.item[index++].Prefix(-1); //Bars if (_random.Next(3) <= 1) { chest.item[index].SetDefaults(_random.Next(BarLoot)); - chest.item[index].SetDefaults(_random.Next(7, 15)); + chest.item[index++].stack = _random.Next(7, 15); } else { diff --git a/World/SunkenSea.cs b/World/SunkenSea.cs index da17625dd3..1a79a9f105 100644 --- a/World/SunkenSea.cs +++ b/World/SunkenSea.cs @@ -19,25 +19,11 @@ namespace CalamityMod.World public class SunkenSea { /* - Dylandoe checklist: + checklist: - -Make ambient tiles naturally grow on sunken sea tiles/sands (only eutrophic sand is done) - -Add basalt slab block - -Add navystone brick wall -Add the wall corals properly -Make sunken sea walls produce water - */ - - /* - ena todo - - fix the fucking forest being shaved (done - HPU) cut a half oval out of the top of forest in anticipation of structure placement - change the type of noise both reefs and forest use (reefs more jagged, forest more flat) (done - HPU) - cut a curve out of the top of shores (the desert part) (done - HPU) - extend basalt to hell - DONE - convert normal terrain blocks below basalt into basalt (maybe??? - HPU) - BLOTCHES EVERYWHERE */ public static void NormalForLoop(int fromInclusive, int toExclusive, int step, Action action) { @@ -45,35 +31,6 @@ namespace CalamityMod.World action.Invoke(i); } - public static void ReLogicParallelFor(int fromInclusive, int toExclusive, int step, Action action) - { - FastParallel.For(fromInclusive, toExclusive, (start, end, _) => - { - for (int i = start; i < end; i += step) - action.Invoke(i); - }); - } - - public static void CSharpParallelFor(int fromInclusive, int toExclusive, int step, Action action) - { - var partitioner = Partitioner.Create(fromInclusive, toExclusive, step); - Parallel.ForEach(partitioner, (range, _) => - { - for (int i = range.Item1; i < range.Item2; i += step) - action.Invoke(i); - }); - } - - /// - /// The delegate that describes the method of a type of for loop. - /// - public delegate void ForLoopMethod(int fromInclusive, int toExclusive, int step, Action action); - - /// - /// The current type of for loop used to generate the Sunken Sea. - /// - public static ForLoopMethod ForLoop; - public static void PlaceTimelessShores(int startPosX, int startPosY) { int biomeSize = 250 + (Main.maxTilesX / 180); @@ -91,7 +48,7 @@ namespace CalamityMod.World else return -steepness * x + steepness; } - ForLoop.Invoke(startPosX - biomeSize - 5, startPosX + biomeSize + 20, 15, (X) => + for (int X = startPosX - biomeSize - 5; X < startPosX + biomeSize + 20; X += 15) { float height = MathHelper.Lerp(startPosY + 35, startPosY - 15, trapezoidLateralSteep(Utils.GetLerpValue(startPosX - biomeSize - 20, startPosX + biomeSize + 20, X))); for (int Y = startPosY + 25; Y >= height; Y -= 10) @@ -104,13 +61,13 @@ namespace CalamityMod.World })); WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } - }); + } // // Makes the bottom borders of the Timeless Shores curved downwards. // const int totalCuveDepth = 90; - ForLoop.Invoke(startPosX - biomeSize - 10, startPosX - biomeSize + 200, 10, (x) => + for (int x = startPosX - biomeSize - 10; x < startPosX - biomeSize + 200; x += 10) { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, x, true))); for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5) @@ -123,8 +80,9 @@ namespace CalamityMod.World })); WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } - }); - ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize + 10, 5, (x) => + } + + for (int x = startPosX + biomeSize - 200; x < startPosX + biomeSize + 10; x += 5) { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, x, true))); for (int y = startPosY + 50; y <= startPosY + 70 + curveDepth; y += 5) @@ -137,11 +95,11 @@ namespace CalamityMod.World })); WorldUtils.Gen(new Point(x, y), new ModShapes.All(circle), new Actions.SetTile((ushort)ModContent.TileType())); } - }); + } // Clear a smaller square out of the center where the biomes stuff will be // Added curves to the top of the biome via curve depth -hpu 02/19/25 - ForLoop.Invoke(startPosX - biomeSize + 10, startPosX + biomeSize - 10, 1, (X) => + for (int X = startPosX - biomeSize + 10; X < startPosX + biomeSize - 10; X += 1) { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 20, startPosX + biomeSize - 200, X, true))); int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 17, startPosX - biomeSize + 200, X, true))); @@ -161,12 +119,12 @@ namespace CalamityMod.World new Actions.Clear() })); } - }); + } // // Places slopes at the sides of the shores to actually make shores. // - ForLoop.Invoke(startPosX - biomeSize - 15, startPosX - biomeSize + 200, 20, (moundX) => + for (int moundX = startPosX - biomeSize - 15; moundX < startPosX - biomeSize + 200; moundX += 20) { int RandomX = Main.rand.Next(15, 20); ShapeData mound = new(); @@ -177,8 +135,9 @@ namespace CalamityMod.World WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.PlaceWall((ushort)ModContent.WallType())); - }); - ForLoop.Invoke(startPosX + biomeSize - 200, startPosX + biomeSize - 15, 20, (moundX) => + } + + for (int moundX = startPosX + biomeSize - 200; moundX < startPosX + biomeSize - 15; moundX += 20) { ShapeData mound = new(); GenAction blotchMod = new Modifiers.Blotches().Output(mound); @@ -187,8 +146,7 @@ namespace CalamityMod.World WorldUtils.Gen(new Point(moundX, moundY), new Shapes.Mound(30, moundHeight), blotchMod); WorldUtils.Gen(new Point(moundX, moundY), new ModShapes.All(mound), new Actions.SetTile((ushort)ModContent.TileType())); - }); - + } // // Makes a large platform in the middle of the Timeless Shores. @@ -196,7 +154,7 @@ namespace CalamityMod.World const int platformSize = 130; const int platformHeight = 35; // Remember that because of Terraria's coordinate system, making it lower actually makes it higher. const int platformDepth = 35; // How deep it goes. Like above, the higher it is, the lower it goes. - ForLoop.Invoke(startPosX - platformSize / 2, startPosX + platformSize / 2, 5, (platformX) => + for (int platformX = startPosX - platformSize / 2; platformX < startPosX + platformSize / 2; platformX += 5) { // This makes the "stem" of the platform be thinner towards the base and then expand on the top. int thickness = (int)(MathF.Pow(CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, platformX)), 3f) * platformDepth) + platformHeight; @@ -209,16 +167,16 @@ namespace CalamityMod.World new Actions.PlaceTile((ushort)ModContent.TileType()) })); } - }); - ForLoop.Invoke(startPosX - platformSize / 2, startPosX + platformSize / 2, 1, (x) => + } + for (int x = startPosX - platformSize / 2; x < startPosX + platformSize / 2; x += 1) { float interpolator = CalamityUtils.Convert01To010(Utils.GetLerpValue(startPosX - platformSize / 2, startPosX + platformSize / 2, x, true)); int elevation = (int)MathHelper.Lerp(4f, 1f, interpolator); WorldUtils.Gen(new Point(x, startPosY + platformHeight - 7), new Shapes.Circle(elevation), Actions.Chain(new GenAction[] { new Actions.Clear(), })); - }); + } // Plateau - ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 100, (wallPillarX) => + for (int wallPillarX = startPosX - biomeSize; wallPillarX < startPosX + biomeSize; wallPillarX += 100) { int randomDisplacement = WorldGen.genRand.Next(-27, 46); int RandomX = Main.rand.Next(15, 20); @@ -246,23 +204,23 @@ namespace CalamityMod.World ; } - }); + } //place water below the clear barrier for the islands so that theres water inbetween them - ForLoop.Invoke(startPosX - biomeSize + 35, startPosX + biomeSize - 35, 1, (WaterX) => + for (int WaterX = startPosX - biomeSize + 35; WaterX < startPosX + biomeSize - 35; WaterX += 1) { for (int WaterY = startPosY + 37; WaterY <= startPosY + 60; WaterY++) { Main.tile[WaterX, WaterY].Get().LiquidType = LiquidID.Water; Main.tile[WaterX, WaterY].LiquidAmount = byte.MaxValue; } - }); + } // // Generates pillars made out of walls at random points in the Timeless Shores. // const int furthestDistanceFromCenter = 100; - ForLoop.Invoke(startPosX - (biomeSize / 2) - furthestDistanceFromCenter, startPosX + (biomeSize / 2) + furthestDistanceFromCenter, 100, (wallPillarX) => + for (int wallPillarX = startPosX - (biomeSize / 2) - furthestDistanceFromCenter; wallPillarX < startPosX + (biomeSize / 2) + furthestDistanceFromCenter; wallPillarX += 100) { int randomDisplacementX = WorldGen.genRand.Next(-10, 10); int RandomX = Main.rand.Next(3, 6); @@ -288,13 +246,13 @@ namespace CalamityMod.World })) ; } - }); + } // // Makes the transition area to the Timeless Shores. // Replaces tiles, walls, and places some water spots. // - ForLoop.Invoke(startPosX - biomeSize - 30, startPosX + biomeSize + 30, 20, (x) => + for (int x = startPosX - biomeSize - 30; x < startPosX + biomeSize + 30; x += 20) { int curveDepth = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX + biomeSize + 30, startPosX + biomeSize - 200, x, true))); int curveDepth2 = (int)MathHelper.Lerp(totalCuveDepth, 0f, MathF.Sqrt(Utils.GetLerpValue(startPosX - biomeSize - 30, startPosX - biomeSize + 200, x, true))); @@ -360,7 +318,7 @@ namespace CalamityMod.World } // Place layer of sand on valid runestone blocks. - ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 1, (X) => + for (int X = startPosX - biomeSize; X < startPosX + biomeSize; X += 1) { for (int Y = startPosY - 100; Y <= startPosY + 100; Y++) { @@ -386,39 +344,42 @@ namespace CalamityMod.World if (!Main.tile[X, Y - 1].HasTile && !Main.tile[X, Y + 1].HasTile && !Main.tile[X - 1, Y].HasTile && !Main.tile[X + 1, Y].HasTile) WorldGen.KillTile(X, Y); - // Timeless Shores ambiant tiles - //if (Main.tile[X, Y].TileType == ModContent.TileType()) - //{ - // //Driftwood Ambiance - // if (WorldGen.genRand.NextBool(150)) - // { - // ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - // WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); - // } - //} - //if (Main.tile[X, Y].TileType == ModContent.TileType()) - //{ - // //Driftwood Ambiance - // if (WorldGen.genRand.NextBool(150)) - // { - // ushort[] DriftwoodPiles = new ushort[] { (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType(), (ushort)ModContent.TileType() }; - - // WorldGen.PlaceObject(X, Y - 1, WorldGen.genRand.Next(DriftwoodPiles)); - // } - //} } - }); + } - // Slope tiles - ForLoop.Invoke(startPosX - biomeSize, startPosX + biomeSize, 1, (X) => + // Slope tiles and Soil Spawn + for (int X = startPosX - biomeSize; X < startPosX + biomeSize; X += 1) { for (int Y = startPosY - 300; Y <= startPosY + 200; Y++) + { Tile.SmoothSlope(X, Y); - }); - }); + + if (Main.tile[X, Y].TileType == ModContent.TileType()) + { + if (WorldGen.genRand.NextBool(25) && !Main.tile[X - 1, Y].HasTile) + { + ushort[] Soil = new ushort[] { (ushort)ModContent.TileType() }; + + ShapeData circle = new ShapeData(); + GenAction blotchMod = new Modifiers.Blotches(2, 0.4); + WorldUtils.Gen(new Point(X, Y), new Shapes.Circle(WorldGen.genRand.Next(3, 7)), Actions.Chain(new GenAction[] + { + blotchMod.Output(circle) + })); + + WorldUtils.Gen(new Point(X, Y), new ModShapes.All(circle), Actions.Chain(new GenAction[] + { + new Modifiers.OnlyTiles((ushort)ModContent.TileType()), + new Actions.ClearTile(), new Actions.PlaceTile(WorldGen.genRand.Next(Soil)) + })); + + } + } + } + } + } } // Sides of the sunken sea (radiant reefs) @@ -506,7 +467,7 @@ namespace CalamityMod.World } // Cleanup - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -526,10 +487,10 @@ namespace CalamityMod.World WorldGen.KillTile(X, Y); } } - }); + } // Place layer of sand blocks on valid surfaces - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -546,10 +507,10 @@ namespace CalamityMod.World PlaceSand(X, Y, 5, ModContent.TileType()); } } - }); + } // Cleanup again - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -578,7 +539,7 @@ namespace CalamityMod.World Tile.SmoothSlope(X, Y); } } - }); + } } // Middle of the sunken sea (polyp forest) @@ -682,7 +643,7 @@ namespace CalamityMod.World } //cleanup - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -706,10 +667,10 @@ namespace CalamityMod.World } } } - }); + } //place extra tiles - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 20; Y <= origin.Y + verticalRadius + 20; Y++) { @@ -731,8 +692,8 @@ namespace CalamityMod.World } } - }); - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + } + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 20; Y <= origin.Y + verticalRadius + 20; Y++) { @@ -753,11 +714,11 @@ namespace CalamityMod.World } } } - }); + } //cleanup again - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -790,7 +751,7 @@ namespace CalamityMod.World Tile.SmoothSlope(X, Y); } } - }); + } } //bottom of the biome (gleaming burrows) public static void PlaceGleamingBurrows(int startPosX, int startPosY) @@ -816,7 +777,7 @@ namespace CalamityMod.World Vector2 bottomFoci = center + fociOffset; //place another barrier so the gleaming burrows doesnt just burst into the gully - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 10, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 10) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y += 2) { @@ -845,7 +806,7 @@ namespace CalamityMod.World } } } - }); + } @@ -927,7 +888,7 @@ namespace CalamityMod.World //cleanup the perlin caves - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -951,11 +912,11 @@ namespace CalamityMod.World } } } - }); + } //place extra tiles - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -975,7 +936,7 @@ namespace CalamityMod.World } } } - }); + } //cleanup again, also place geodes for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -1103,7 +1064,7 @@ namespace CalamityMod.World //cleanup the perlin caves - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -1127,11 +1088,11 @@ namespace CalamityMod.World } } } - }); + } //place extra tiles - ForLoop.Invoke(origin.X - biomeSize - 3, origin.X + biomeSize + 3, 1, (X) => + for (int X = origin.X - biomeSize - 3; X < origin.X + biomeSize + 3; X += 1) { for (int Y = (int)(origin.Y - verticalRadius * 0.4f) - 3; Y <= origin.Y + verticalRadius + 3; Y++) { @@ -1151,7 +1112,7 @@ namespace CalamityMod.World } } } - }); + } //cleanup again for (int X = origin.X - biomeSize - 3; X <= origin.X + biomeSize + 3; X++) @@ -1198,7 +1159,7 @@ namespace CalamityMod.World int XLeft = GenVars.UndergroundDesertLocation.Left + 40; int XRight = GenVars.UndergroundDesertLocation.Right - 70; //place blocks of basalt all the way down to hell, here it just places one block and wall so it doesnt hurt preformance - ForLoop.Invoke(startPosX - biomeSize - 60, startPosX + biomeSize + 60, 1, (X) => + for (int X = startPosX - biomeSize - 60; X < startPosX + biomeSize + 60; X += 1) { //const int totalCuveDepth = -120; //const int totalCuveDepth2 = 120; @@ -1227,9 +1188,9 @@ namespace CalamityMod.World { Main.tile[X, Y].ClearEverything(); WorldGen.PlaceTile(X, Y, (ushort)ModContent.TileType()); - WorldGen.PlaceWall(X, Y, WallID.LavaUnsafe1); + WorldGen.PlaceWall(X, Y, ModContent.WallType()); } - }); + } //place caverns and lava for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X <= startPosX + biomeSize + (Main.maxTilesX / 25); X++) @@ -1256,7 +1217,7 @@ namespace CalamityMod.World } //place sand blocks - ForLoop.Invoke(startPosX - biomeSize - (Main.maxTilesX / 25), startPosX + biomeSize + (Main.maxTilesX / 25), 1, (X) => + for (int X = startPosX - biomeSize - (Main.maxTilesX / 25); X < startPosX + biomeSize + (Main.maxTilesX / 25); X += 1) { for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) { @@ -1273,10 +1234,10 @@ namespace CalamityMod.World PlaceSand(X, Y, 3, ModContent.TileType()); } } - }); + } //cleanup - ForLoop.Invoke(startPosX - biomeSize - (Main.maxTilesX / 25), startPosX + biomeSize + (Main.maxTilesX / 25), 1, (X) => + for(int X = startPosX - biomeSize - (Main.maxTilesX / 25); X < startPosX + biomeSize + (Main.maxTilesX / 25); X += 1) { for (int Y = startPosY; Y <= Main.maxTilesY - 210; Y++) { @@ -1303,8 +1264,9 @@ namespace CalamityMod.World WorldGen.PlaceTile(X, Y + 1, (ushort)ModContent.TileType()); Main.tile[X, Y].TileType = (ushort)ModContent.TileType(); } + Tile.SmoothSlope(X, Y); } - }); + } } //cleanup is done separately because for whatever reason it keeps placing water inside of the gully if the cleanup is done before it @@ -1772,6 +1734,7 @@ namespace CalamityMod.World new Actions.PlaceTile((ushort)ModContent.TileType()), })); } + } } } @@ -1901,7 +1864,7 @@ namespace CalamityMod.World getAttachedPoints(x, y - 1, points); } - ForLoop.Invoke(20, Main.maxTilesX - 20, 1, (x) => + for (int x = 20; x < Main.maxTilesX - 20; x += 1) { for (int y = 20; y < Main.maxTilesY - 20; y++) { @@ -1921,7 +1884,7 @@ namespace CalamityMod.World } } } - }); + } } diff --git a/World/UndergroundShrines.cs b/World/UndergroundShrines.cs index d1379f1d3c..199fd4b84a 100644 --- a/World/UndergroundShrines.cs +++ b/World/UndergroundShrines.cs @@ -272,6 +272,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -341,6 +342,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -534,6 +536,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -670,6 +673,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } @@ -761,6 +765,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/World/VernalPass.cs b/World/VernalPass.cs index cea45e5153..4d3d7d3f94 100644 --- a/World/VernalPass.cs +++ b/World/VernalPass.cs @@ -86,6 +86,7 @@ namespace CalamityMod.World for (int i = 0; i < contents.Count; i++) { chest.item[i].SetDefaults(contents[i].Type); + chest.item[i].Prefix(-1); chest.item[i].stack = contents[i].Stack; } } diff --git a/build.txt b/build.txt index 23f413337a..f89177c05d 100644 --- a/build.txt +++ b/build.txt @@ -1,5 +1,5 @@ author = The Calamity Dev Team -version = 2.0.4.006 +version = 2.1 displayName = Calamity Mod modReferences = CalamityModMusic homepage = https://discord.gg/calamity