diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 188a6775e7..b45a489ce5 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2736,9 +2736,7 @@ namespace CalamityMod.CalPlayer { Projectile proj = Main.projectile[projIndex]; float start = 360f / angelAmt; - int damage = proj.damage / 10; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(proj.damage / 10); Projectile.NewProjectile(source, new Vector2((int)(Player.Center.X + (Math.Sin(projIndex * start) * 300)), (int)(Player.Center.Y + (Math.Cos(projIndex * start) * 300))), Vector2.Zero, ModContent.ProjectileType(), damage, proj.knockBack / 10f, Player.whoAmI, Main.rand.Next(180), projIndex * start); Player.statLife += 2; @@ -2752,9 +2750,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); rogueStealth -= rogueStealthMax * 0.1f; - int damage = 7; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(7); int veil = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 8, Player.whoAmI); Main.projectile[veil].Center = Player.Center; @@ -2890,8 +2886,7 @@ namespace CalamityMod.CalPlayer double offsetAngle; int damage = (int)(Player.GetTotalDamage().ApplyTo(300f)); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); if (Player.whoAmI == Main.myPlayer) { @@ -2987,8 +2982,7 @@ namespace CalamityMod.CalPlayer // To compute Forbidden Circlet tornado damage, create a fake stat modifier on the spot which combines both classes. StatModifier forbidden = Player.GetTotalDamage().CombineWith(Player.GetDamage()); int damage = (int)forbidden.ApplyTo(ForbiddenCirclet.tornadoBaseDmg); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); float kBack = Player.GetTotalKnockback().ApplyTo(ForbiddenCirclet.tornadoBaseKB); @@ -3418,9 +3412,8 @@ namespace CalamityMod.CalPlayer { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); //Spawn explosion. ai[0] is used for transferring the recorded falling time - int damage = 300; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(GravistarSabaton.SlamDamage)); Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 4f, Player.whoAmI, gSabatonFall); gSabatonFall = 0; @@ -4004,9 +3997,9 @@ namespace CalamityMod.CalPlayer veneratedCloneYPos *= veneratedCloneDistance; float speedX4 = veneratedCloneXPos + (float)Main.rand.Next(-30, 31) * 0.02f; float speedY5 = veneratedCloneYPos + (float)Main.rand.Next(-30, 31) * 0.02f; - int locketDamage = (int)(damage * 0.07f); - if (oldFashioned) - locketDamage = CalamityUtils.CalcOldFashionedDamage(locketDamage); + + // 08DEC2023: Ozzatron: Locket + Old Fashioned may need to be a corner case. We should probably just rework Locket instead. + int locketDamage = Player.ApplyArmorAccDamageBonusesTo((int)(damage * 0.07f)); int p = Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, type, locketDamage, knockBack * 0.5f, Player.whoAmI); @@ -4027,8 +4020,7 @@ namespace CalamityMod.CalPlayer { int knifeCount = 12; int knifeDamage = (int)Player.GetTotalDamage().ApplyTo(55); - if (oldFashioned) - knifeDamage = CalamityUtils.CalcOldFashionedDamage(knifeDamage); + knifeDamage = Player.ApplyArmorAccDamageBonusesTo(knifeDamage); float angleStep = MathHelper.TwoPi / knifeCount; float speed = 14f; @@ -4051,9 +4043,8 @@ namespace CalamityMod.CalPlayer { if (item.CountsAsClass()) { - int d = (int)Player.GetTotalDamage().ApplyTo(Items.Accessories.RustyMedallion.AcidDropBaseDamage); - if (oldFashioned) - d = CalamityUtils.CalcOldFashionedDamage(d); + int d = (int)Player.GetTotalDamage().ApplyTo(RustyMedallion.AcidDropBaseDamage); + d = Player.ApplyArmorAccDamageBonusesTo(d); Vector2 startingPosition = Main.MouseWorld - Vector2.UnitY.RotatedByRandom(0.4f) * 1250f; Vector2 directionToMouse = (Main.MouseWorld - startingPosition).SafeNormalize(Vector2.UnitY).RotatedByRandom(0.1f); diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index b45338f0d2..ab15a94dc9 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -153,8 +153,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i < 10; i++) { int damage = (int)Player.GetTotalDamage().ApplyTo(55); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); int lumenyl = Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), ModContent.ProjectileType(), damage, 0, Player.whoAmI); Main.projectile[lumenyl].rotation = Main.rand.NextFloat(0, 360); @@ -186,8 +185,7 @@ namespace CalamityMod.CalPlayer var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); int damage = (int)Player.GetTotalDamage().ApplyTo(2750); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); int eclipse = Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Player.whoAmI); if (eclipse.WithinBounds(Main.maxProjectiles)) @@ -1449,9 +1447,7 @@ namespace CalamityMod.CalPlayer Rectangle npcHitbox = n.getRect(); if ((Player.getRect()).Intersects(npcHitbox) && (n.noTileCollide || Collision.CanHit(Player.position, Player.width, Player.height, n.position, n.width, n.height))) { - int damage = 150; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(GravistarSabaton.PassthroughDamage)); Projectile.NewProjectile(Player.GetSource_FromThis(), n.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0, Main.myPlayer); @@ -2396,8 +2392,7 @@ namespace CalamityMod.CalPlayer for (int n = 0; n < 4; n++) { int featherDamage = (int)Player.GetBestClassDamage().ApplyTo(65); - if (oldFashioned) - featherDamage = CalamityUtils.CalcOldFashionedDamage(featherDamage); + featherDamage = Player.ApplyArmorAccDamageBonusesTo(featherDamage); CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 20f, ModContent.ProjectileType(), featherDamage, 1f, Player.whoAmI); } @@ -2406,13 +2401,12 @@ namespace CalamityMod.CalPlayer { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); SoundEngine.PlaySound(SoundID.Item74, Player.Center); + int blazeDamage = (int)Player.GetBestClassDamage().ApplyTo(25); + blazeDamage = Player.ApplyArmorAccDamageBonusesTo(blazeDamage); + int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(320); - if (oldFashioned) - { - blazeDamage = CalamityUtils.CalcOldFashionedDamage(blazeDamage); - astralStarDamage = CalamityUtils.CalcOldFashionedDamage(astralStarDamage); - } + astralStarDamage = Player.ApplyArmorAccDamageBonusesTo(astralStarDamage); Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, 0f, 0f, ModContent.ProjectileType(), blazeDamage, 5f, Player.whoAmI, 0f, 1f); for (int n = 0; n < 12; n++) @@ -2426,8 +2420,7 @@ namespace CalamityMod.CalPlayer for (int n = 0; n < 3; n++) { int deificStarDamage = (int)Player.GetBestClassDamage().ApplyTo(130); - if (oldFashioned) - deificStarDamage = CalamityUtils.CalcOldFashionedDamage(deificStarDamage); + deificStarDamage = Player.ApplyArmorAccDamageBonusesTo(deificStarDamage); Projectile star = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.StarVeilStar, deificStarDamage, 4f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2454,8 +2447,7 @@ namespace CalamityMod.CalPlayer if (transformer) sDamage += 42; sDamage = (int)Player.GetBestClassDamage().ApplyTo(sDamage); - if (oldFashioned) - sDamage = CalamityUtils.CalcOldFashionedDamage(sDamage); + sDamage = Player.ApplyArmorAccDamageBonusesTo(sDamage); if (Player.whoAmI == Main.myPlayer) { @@ -2501,8 +2493,7 @@ namespace CalamityMod.CalPlayer { SoundEngine.PlaySound(SoundID.Item74, Player.Center); int eDamage = (int)Player.GetBestClassDamage().ApplyTo(230); - if (oldFashioned) - eDamage = CalamityUtils.CalcOldFashionedDamage(eDamage); + eDamage = Player.ApplyArmorAccDamageBonusesTo(eDamage); if (Player.whoAmI == Main.myPlayer) Projectile.NewProjectile(fuckYouBitch, Player.Center, Vector2.Zero, ModContent.ProjectileType(), eDamage, 1f, Player.whoAmI, 0f, 0f); @@ -2519,8 +2510,7 @@ namespace CalamityMod.CalPlayer double deltaAngle = spread / 8f; double offsetAngle; int sDamage = (int)Player.GetTotalDamage().ApplyTo(60); - if (oldFashioned) - sDamage = CalamityUtils.CalcOldFashionedDamage(sDamage); + sDamage = Player.ApplyArmorAccDamageBonusesTo(sDamage); if (Player.whoAmI == Main.myPlayer) { @@ -2545,8 +2535,7 @@ namespace CalamityMod.CalPlayer if (hurtInfo.Damage > 0) { int rDamage = (int)Player.GetBestClassDamage().ApplyTo(240); - if (oldFashioned) - rDamage = CalamityUtils.CalcOldFashionedDamage(rDamage); + rDamage = Player.ApplyArmorAccDamageBonusesTo(rDamage); if (Player.whoAmI == Main.myPlayer) Projectile.NewProjectile(source, Player.Center.X, Player.position.Y + 36f, 0f, -18f, ModContent.ProjectileType(), rDamage, 0f, Player.whoAmI, 0f, 0f); @@ -2562,18 +2551,14 @@ namespace CalamityMod.CalPlayer double startAngle = Math.Atan2(Player.velocity.X, Player.velocity.Y) - spread / 2; double deltaAngle = spread / 8f; double offsetAngle; - int baseDamage = 675; - if (oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - - int shrapnelFinalDamage = (int)Player.GetTotalDamage().ApplyTo(baseDamage); + int shrapnelDamage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcIntDamage(675)); if (Player.whoAmI == Main.myPlayer) { for (int i = 0; i < 4; i++) { offsetAngle = startAngle + deltaAngle * (i + i * i) / 2f + 32f * i; - Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), shrapnelFinalDamage, 5f, Player.whoAmI, 0f, 0f); - Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), shrapnelFinalDamage, 5f, Player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(Math.Sin(offsetAngle) * 5f), (float)(Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), shrapnelDamage, 5f, Player.whoAmI, 0f, 0f); + Projectile.NewProjectile(source, Player.Center.X, Player.Center.Y, (float)(-Math.Sin(offsetAngle) * 5f), (float)(-Math.Cos(offsetAngle) * 5f), ModContent.ProjectileType(), shrapnelDamage, 5f, Player.whoAmI, 0f, 0f); } } } @@ -2587,8 +2572,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < 2; l++) { int shadowbeamDamage = (int)Player.GetBestClassDamage().ApplyTo(3000); - if (oldFashioned) - shadowbeamDamage = CalamityUtils.CalcOldFashionedDamage(shadowbeamDamage); + shadowbeamDamage = Player.ApplyArmorAccDamageBonusesTo(shadowbeamDamage); Projectile beam = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.ShadowBeamFriendly, shadowbeamDamage, 7f, Player.whoAmI); if (beam.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -2601,8 +2585,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < 5; l++) { int scytheDamage = (int)Player.GetBestClassDamage().ApplyTo(5000); - if (oldFashioned) - scytheDamage = CalamityUtils.CalcOldFashionedDamage(scytheDamage); + scytheDamage = Player.ApplyArmorAccDamageBonusesTo(scytheDamage); Projectile scythe = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 22f, ProjectileID.DemonScythe, scytheDamage, 7f, Player.whoAmI); if (scythe.whoAmI.WithinBounds(Main.maxProjectiles)) diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 48d8118832..9338322a15 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -237,9 +237,7 @@ namespace CalamityMod.CalPlayer if (!HasIncreasedDashFirstFrame) { Player.velocity.X *= 1.2f; - int damage = 75; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(75)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 20f, Player.whoAmI); HasIncreasedDashFirstFrame = true; @@ -269,10 +267,7 @@ namespace CalamityMod.CalPlayer } if (Player.miscCounter % 4 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox { - int damage = 90; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(90)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI); } } @@ -288,9 +283,7 @@ namespace CalamityMod.CalPlayer if (!HasReducedDashFirstFrame) // Dash isn't reduced, this is used to determine the first frame of dashing { SoundEngine.PlaySound(SoundID.DD2_BetsyFireballImpact with { Volume = 0.4f , PitchVariance = 0.4f }, Player.Center); - int damage = 67; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(67)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 16f, Player.whoAmI); HasReducedDashFirstFrame = true; @@ -318,10 +311,7 @@ namespace CalamityMod.CalPlayer if (Player.miscCounter % 5 == 0 && Player.velocity != Vector2.Zero) //every other frame spawn the hitbox { - int damage = 175; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(175)); Projectile.NewProjectile(Player.GetSource_FromThis(), Player.Center + Player.velocity * 1.5f, Vector2.Zero, ModContent.ProjectileType(), damage, 10f, Player.whoAmI); } } @@ -723,8 +713,7 @@ namespace CalamityMod.CalPlayer Rectangle sigilHitbox = Utils.CenteredRectangle(Main.MouseWorld, new Vector2(35f, 62f)); int sigilDamage = (int)Player.GetBestClassDamage().ApplyTo(Calamity.BaseDamage); - if (oldFashioned) - sigilDamage = CalamityUtils.CalcOldFashionedDamage(sigilDamage); + sigilDamage = Player.ApplyArmorAccDamageBonusesTo(sigilDamage); bool brightenedSigil = false; for (int i = 0; i < Main.maxNPCs; i++) @@ -1157,8 +1146,7 @@ namespace CalamityMod.CalPlayer if (!tentaclesPresent[i]) { int damage = (int)Player.GetBestClassDamage().ApplyTo(390); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); var source = Player.GetSource_FromThis(OmegaBlueHelmet.TentacleEntitySourceContext); Vector2 vel = new Vector2(Main.rand.Next(-13, 14), Main.rand.Next(-13, 14)) * 0.25f; @@ -1267,9 +1255,7 @@ namespace CalamityMod.CalPlayer { unstableSelectedTarget = Main.npc[target]; unstableSelectedTarget.Calamity().arcZapCooldown = 18; - int damage = 18; - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(18)); Projectile.NewProjectile(Player.GetSource_FromThis(), new Vector2(Player.Center.X, Player.Center.Y - 20f), new Vector2(0f, -2f), ModContent.ProjectileType(), damage, 0f, Player.whoAmI, target, 3f); target = -1; @@ -1956,8 +1942,7 @@ namespace CalamityMod.CalPlayer lightningVel.Normalize(); lightningVel *= Main.rand.NextFloat(1f, 2f); int damage = (int)Player.GetTotalDamage().ApplyTo(30); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); 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); @@ -1983,8 +1968,7 @@ namespace CalamityMod.CalPlayer cloudVelocity.Normalize(); cloudVelocity *= Main.rand.NextFloat(0f, 1f); int damage = (int)Player.GetTotalDamage().ApplyTo(20); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); 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); @@ -3048,11 +3032,11 @@ namespace CalamityMod.CalPlayer for (int I = 0; I < 3; I++) { float ai1 = I * 120; - int baseDamage = 3750; - if (oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - int damage = (int)Player.GetTotalDamage().ApplyTo(baseDamage); + // 08DEC2023: Ozzatron: Bloodflare mines spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = Player.ApplyArmorAccDamageBonusesTo(3750); + int damage = Player.CalcIntDamage(baseDamage); + int projectile = Projectile.NewProjectile(source, Player.Center.X + (float)(Math.Sin(I * 120) * 550), Player.Center.Y + (float)(Math.Cos(I * 120) * 550), 0f, 0f, ModContent.ProjectileType(), damage, 1f, Player.whoAmI, ai1, 0f); if (projectile.WithinBounds(Main.maxProjectiles)) @@ -3125,10 +3109,7 @@ namespace CalamityMod.CalPlayer // If the timer rolls over, it's time to deal damage. Only run this code for the client which is wearing the armor. if (tarraLifeAuraTimer == 0 && Player.whoAmI == Main.myPlayer) { - const int BaseDamage = 120; - int damage = (int)Player.GetTotalDamage().ApplyTo(BaseDamage); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcDamage(120)); // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(TarragonHeadSummon.LifeAuraEntitySourceContext); @@ -3199,10 +3180,7 @@ namespace CalamityMod.CalPlayer // Brimstone flames is applied every single frame, but direct damage is only dealt twice per second. if (Player.whoAmI == Main.myPlayer) { - const int BaseDamage = 50; - int damage = (int)Player.GetBestClassDamage().ApplyTo(BaseDamage); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.GetBestClassDamage().ApplyTo(50)); // https://github.com/tModLoader/tModLoader/wiki/IEntitySource#detailed-list var source = Player.GetSource_FromThis(HydrothermicArmor.InfernoPotionEntitySourceContext); @@ -3265,11 +3243,11 @@ namespace CalamityMod.CalPlayer pSoulGuardians = true; + // 08DEC2023: Ozzatron: PSA/PSC "babs" spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. int guardianAmt = 1; float babCheck = profanedCrystal ? 1f : 0f; int babDamage = profanedCrystal ? 346 : 52; - if (oldFashioned) - babDamage = CalamityUtils.CalcOldFashionedDamage(babDamage); + babDamage = Player.ApplyArmorAccDamageBonusesTo(babDamage); if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) { @@ -3368,9 +3346,7 @@ namespace CalamityMod.CalPlayer if (Player.whoAmI == Main.myPlayer) { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); - int damage = (int)Player.GetTotalDamage().ApplyTo(30); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + int damage = Player.ApplyArmorAccDamageBonusesTo(Player.CalcDamage(30)); if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI, 0f, 0f); @@ -3431,8 +3407,7 @@ namespace CalamityMod.CalPlayer { var source = Player.GetSource_Accessory(FindAccessory(ModContent.ItemType())); int damage = (int)Player.GetBestClassDamage().ApplyTo(70); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); if (Player.whoAmI == Main.myPlayer && Player.ownedProjectileCounts[ModContent.ProjectileType()] == 0) Projectile.NewProjectile(source, Player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 0f, Player.whoAmI); @@ -3454,8 +3429,7 @@ namespace CalamityMod.CalPlayer { float shootSpeed = 18f; int dmg = (int)Player.GetTotalDamage().ApplyTo(30); - if (oldFashioned) - dmg = CalamityUtils.CalcOldFashionedDamage(dmg); + dmg = Player.ApplyArmorAccDamageBonusesTo(dmg); Vector2 startPos = Player.RotatedRelativePoint(Player.MountedCenter, true); Vector2 velocity = Main.MouseWorld - startPos; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 6ef1da1159..163fe02e06 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -331,8 +331,7 @@ namespace CalamityMod.CalPlayer { hideOfDeusTimer = 10; int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(320); - if (oldFashioned) - bulwarkStarDamage = CalamityUtils.CalcOldFashionedDamage(bulwarkStarDamage); + bulwarkStarDamage = Player.ApplyArmorAccDamageBonusesTo(bulwarkStarDamage); for (int n = 0; n < 3; n++) CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileType(), bulwarkStarDamage, 5f, Player.whoAmI); @@ -351,8 +350,7 @@ namespace CalamityMod.CalPlayer }); int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); - if (oldFashioned) - astralStarDamage = CalamityUtils.CalcOldFashionedDamage(astralStarDamage); + astralStarDamage = Player.ApplyArmorAccDamageBonusesTo(astralStarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 12f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -369,8 +367,7 @@ namespace CalamityMod.CalPlayer { // Ataxia True Melee Geysers: 15%, softcap starts at 300 base damage int geyserDamage = CalamityUtils.DamageSoftCap(damage * 0.15, 45); - if (oldFashioned) - geyserDamage = CalamityUtils.CalcOldFashionedDamage(geyserDamage); + geyserDamage = Player.ApplyArmorAccDamageBonusesTo(geyserDamage); Projectile.NewProjectile(source, position, Vector2.Zero, ProjectileType(), geyserDamage, 2f, Player.whoAmI, 0f, 0f); } @@ -409,8 +406,7 @@ namespace CalamityMod.CalPlayer if (alchFlask && Player.ownedProjectileCounts[ProjectileType()] < 3 && hasClass) { int seekerDamage = (int)Player.GetBestClassDamage().ApplyTo(30); - if (oldFashioned) - seekerDamage = CalamityUtils.CalcOldFashionedDamage(seekerDamage); + seekerDamage = Player.ApplyArmorAccDamageBonusesTo(seekerDamage); Projectile projectile = CalamityUtils.SpawnOrb(proj, seekerDamage, ProjectileType(), 400f, 12f); if (projectile.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -440,8 +436,7 @@ namespace CalamityMod.CalPlayer }); int astralStarDamage = (int)Player.GetBestClassDamage().ApplyTo(120); - if (oldFashioned) - astralStarDamage = CalamityUtils.CalcOldFashionedDamage(astralStarDamage); + astralStarDamage = Player.ApplyArmorAccDamageBonusesTo(astralStarDamage); Projectile star = CalamityUtils.ProjectileRain(source, position, 400f, 100f, 500f, 800f, 25f, projectileType, astralStarDamage, 5f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) @@ -495,8 +490,7 @@ namespace CalamityMod.CalPlayer { hideOfDeusTimer = 10; int bulwarkStarDamage = (int)Player.GetTotalDamage().ApplyTo(320); - if (oldFashioned) - bulwarkStarDamage = CalamityUtils.CalcOldFashionedDamage(bulwarkStarDamage); + bulwarkStarDamage = Player.ApplyArmorAccDamageBonusesTo(bulwarkStarDamage); for (int n = 0; n < 3; n++) CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileType(), bulwarkStarDamage, 5f, Player.whoAmI); @@ -509,8 +503,7 @@ namespace CalamityMod.CalPlayer { // Ataxia Melee Geysers: 15%, softcap starts at 240 base damage int geyserDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.15, 36); - if (oldFashioned) - geyserDamage = CalamityUtils.CalcOldFashionedDamage(geyserDamage); + geyserDamage = Player.ApplyArmorAccDamageBonusesTo(geyserDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), geyserDamage, 0f, Player.whoAmI, 0f, 0f); } @@ -533,10 +526,7 @@ namespace CalamityMod.CalPlayer for (int l = 0; l < 2; l++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int leafDamage = (int)(0.25 * proj.damage); - if (oldFashioned) - leafDamage = CalamityUtils.CalcOldFashionedDamage(leafDamage); - + int leafDamage = Player.ApplyArmorAccDamageBonusesTo(0.25f * proj.damage); int leaf = Projectile.NewProjectile(source, position, velocity, ProjectileID.Leaf, leafDamage, 0f, Player.whoAmI); if (leaf.WithinBounds(Main.maxProjectiles)) { @@ -549,10 +539,7 @@ namespace CalamityMod.CalPlayer for (int projCount = 0; projCount < 2; projCount++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); - int energyDamage = (int)(0.33 * proj.damage); - if (oldFashioned) - energyDamage = CalamityUtils.CalcOldFashionedDamage(energyDamage); - + int energyDamage = Player.ApplyArmorAccDamageBonusesTo(0.33f * proj.damage); Projectile.NewProjectile(source, proj.Center, velocity, ProjectileType(), energyDamage, 0f, proj.owner); } } @@ -571,9 +558,7 @@ namespace CalamityMod.CalPlayer var source = proj.GetSource_FromThis(); if (ataxiaMage && ataxiaDmg <= 0) { - int orbDamage = (int)(proj.damage * 0.6); - if (oldFashioned) - orbDamage = CalamityUtils.CalcOldFashionedDamage(orbDamage); + int orbDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.6f); CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 20f); int cooldown = (int)(orbDamage * 0.5); @@ -592,9 +577,7 @@ namespace CalamityMod.CalPlayer { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); // Bloodflare Mage Fireballs: 3 x 50%, softcap starts at 500 base damage to not overly punish slow weapons - int bloodflareFireballDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250); - if (oldFashioned) - bloodflareFireballDamage = CalamityUtils.CalcOldFashionedDamage(bloodflareFireballDamage); + int bloodflareFireballDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(proj.damage * 0.5, 250)); int fire = Projectile.NewProjectile(source, position, velocity, ProjectileID.BallofFire, bloodflareFireballDamage, 0f, Player.whoAmI); if (fire.WithinBounds(Main.maxProjectiles)) @@ -610,10 +593,7 @@ namespace CalamityMod.CalPlayer silvaMageCooldown = 300; SoundEngine.PlaySound(SoundID.Zombie103 , proj.Center); //So scuffed, just because zombie sounds werent ported normally // Silva Mage Blasts: 800 + 60%, softcap on the whole combined thing starts at 1400 - int silvaBurstDamage = CalamityUtils.DamageSoftCap(800.0 + 0.6 * proj.damage, 1400); - if (oldFashioned) - silvaBurstDamage = CalamityUtils.CalcOldFashionedDamage(silvaBurstDamage); - + int silvaBurstDamage = Player.ApplyArmorAccDamageBonusesTo(CalamityUtils.DamageSoftCap(800.0 + 0.6 * proj.damage, 1400)); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), silvaBurstDamage, 8f, Player.whoAmI); } } @@ -653,9 +633,7 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ProjectileType()] < 3 && Main.rand.NextBool(10)) { int damage = (int)Player.GetTotalDamage().ApplyTo(100); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - + damage = Player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(source, proj.position, proj.velocity, ProjectileType(), damage, 1f, Player.whoAmI); } } @@ -712,36 +690,28 @@ namespace CalamityMod.CalPlayer if (nucleogenesis) { int apparatusDamage = (int)Player.GetTotalDamage().ApplyTo(60); - if (oldFashioned) - apparatusDamage = CalamityUtils.CalcOldFashionedDamage(apparatusDamage); - + apparatusDamage = Player.ApplyArmorAccDamageBonusesTo(apparatusDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), apparatusDamage, 4f, proj.owner); summonProjCooldown = 100f; } else if (starbusterCore) { int starburstDamage = (int)Player.GetTotalDamage().ApplyTo(40); - if (oldFashioned) - starburstDamage = CalamityUtils.CalcOldFashionedDamage(starburstDamage); - + starburstDamage = Player.ApplyArmorAccDamageBonusesTo(starburstDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), starburstDamage, 3.5f, proj.owner); summonProjCooldown = 60f; } else if (nuclearFuelRod) { int nuclearDamage = (int)Player.GetTotalDamage().ApplyTo(20); - if (oldFashioned) - nuclearDamage = CalamityUtils.CalcOldFashionedDamage(nuclearDamage); - + nuclearDamage = Player.ApplyArmorAccDamageBonusesTo(nuclearDamage); Projectile.NewProjectile(source, proj.Center, Vector2.Zero, ProjectileType(), nuclearDamage, 0f, proj.owner); summonProjCooldown = 60f; } else if (jellyChargedBattery) { int batteryDamage = (int)Player.GetTotalDamage().ApplyTo(15); - if (oldFashioned) - batteryDamage = CalamityUtils.CalcOldFashionedDamage(batteryDamage); - + batteryDamage = Player.ApplyArmorAccDamageBonusesTo(batteryDamage); CalamityUtils.SpawnOrb(proj, batteryDamage, ProjectileType(), 800f, 15f); summonProjCooldown = 60f; } @@ -755,9 +725,7 @@ namespace CalamityMod.CalPlayer Vector2 spawnPosition = position - new Vector2(0f, 920f).RotatedByRandom(0.3f); float speed = Main.rand.NextFloat(17f, 23f); int hallowedDamage = (int)Player.GetTotalDamage().ApplyTo(50); - if (oldFashioned) - hallowedDamage = CalamityUtils.CalcOldFashionedDamage(hallowedDamage); - + hallowedDamage = Player.ApplyArmorAccDamageBonusesTo(hallowedDamage); Projectile.NewProjectile(source, spawnPosition, Vector2.Normalize(position - spawnPosition) * speed, ProjectileType(), hallowedDamage, 3f, proj.owner); } } @@ -772,11 +740,8 @@ namespace CalamityMod.CalPlayer int Type = ProjectileType(); if (modProj.stealthStrike && dragonScales && Main.projectile.Count(proj => proj.type == Type && proj.active) < 1) { - int damage = (int)Player.GetTotalDamage().ApplyTo(DragonScales.TornadoBaseDamage); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - + damage = Player.ApplyArmorAccDamageBonusesTo(damage); int projectileIndex = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, 0f, 0f, ProjectileType(), damage, 15f, Main.myPlayer, 10f, 9f); //First overload seems to deal with timing, second is segment amount if (projectileIndex.WithinBounds(Main.maxProjectiles)) Main.projectile[projectileIndex].netUpdate = true; @@ -791,48 +756,33 @@ namespace CalamityMod.CalPlayer { case 0: // Exodus Rogue Stars: 80% - int starDamage = (int)(proj.damage * 0.8); - if (oldFashioned) - starDamage = CalamityUtils.CalcOldFashionedDamage(starDamage); - + int starDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.8f); CalamityUtils.SpawnOrb(proj, starDamage, ProjectileType(), 800f, Main.rand.Next(15, 30)); - xerocDmg += (int)(starDamage * 0.5); + xerocDmg += (int)(starDamage * 0.5f); break; case 1: // Exodus Rogue Orbs: 60% - int orbDamage = (int)(proj.damage * 0.6); - if (oldFashioned) - orbDamage = CalamityUtils.CalcOldFashionedDamage(orbDamage); - + int orbDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.6f); CalamityUtils.SpawnOrb(proj, orbDamage, ProjectileType(), 800f, 30f); - xerocDmg += (int)(orbDamage * 0.5); + xerocDmg += (int)(orbDamage * 0.5f); break; case 2: // Exodus Rogue Fire: 15% - int fireDamage = (int)(proj.damage * 0.15); - if (oldFashioned) - fireDamage = CalamityUtils.CalcOldFashionedDamage(fireDamage); - + int fireDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.15f); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), fireDamage, 0f, proj.owner, 0f, 0f); break; case 3: // Exodus Rogue Blast: 20% - int blastDamage = (int)(proj.damage * 0.2); - if (oldFashioned) - blastDamage = CalamityUtils.CalcOldFashionedDamage(blastDamage); - + int blastDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.2f); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), blastDamage, 0f, proj.owner, 0f, 0f); break; case 4: // Exodus Rogue Bubble: 60% - int bubbleDamage = (int)(proj.damage * 0.6); - if (oldFashioned) - bubbleDamage = CalamityUtils.CalcOldFashionedDamage(bubbleDamage); - + int bubbleDamage = Player.ApplyArmorAccDamageBonusesTo(proj.damage * 0.6f); CalamityUtils.SpawnOrb(proj, bubbleDamage, ProjectileType(), 800f, 15f); xerocDmg += (int)(bubbleDamage * 0.5); break; @@ -852,19 +802,16 @@ namespace CalamityMod.CalPlayer Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); Vector2 velocity = (position - source) / 40f; int damage = (int)Player.GetTotalDamage().ApplyTo(120); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - + damage = Player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), damage, 3f, proj.owner); } } else if (moonCrown) { int lunarFlareDamage = (int)Player.GetTotalDamage().ApplyTo(MoonstoneCrown.BaseDamage); - if (oldFashioned) - lunarFlareDamage = CalamityUtils.CalcOldFashionedDamage(lunarFlareDamage); - + lunarFlareDamage = Player.ApplyArmorAccDamageBonusesTo(lunarFlareDamage); float lunarFlareKB = 3f; + for (int i = 0; i < 3; i++) { Vector2 source = new Vector2(position.X + Main.rand.Next(-201, 201), Main.screenPosition.Y - 600f - Main.rand.Next(50)); @@ -882,16 +829,16 @@ namespace CalamityMod.CalPlayer float speedX = (position.X - source.X) / 30f; float speedY = (position.Y - source.Y) * 8; Vector2 velocity = new Vector2(speedX, speedY); + int featherDamage = (int)Player.GetTotalDamage().ApplyTo(25); - if (oldFashioned) - featherDamage = CalamityUtils.CalcOldFashionedDamage(featherDamage); + featherDamage = Player.ApplyArmorAccDamageBonusesTo(featherDamage); int feather = Projectile.NewProjectile(spawnSource, source, velocity, ProjectileType(), featherDamage, 3f, proj.owner); if (feather.WithinBounds(Main.maxProjectiles)) - { + { Main.projectile[feather].DamageType = DamageClass.Generic; Main.projectile[feather].extraUpdates += 3; - } + } } spawnedFeathers = true; } @@ -907,8 +854,7 @@ namespace CalamityMod.CalPlayer xVector *= 10f; yVector *= 10f; int damage = (int)Player.GetTotalDamage().ApplyTo(40); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); int eater = Projectile.NewProjectile(spawnSource, proj.Center.X, proj.Center.Y, xVector, yVector, ProjectileType(), damage, proj.knockBack, proj.owner); if (eater.WithinBounds(Main.maxProjectiles)) @@ -920,8 +866,7 @@ namespace CalamityMod.CalPlayer if (titanHeartSet && modProj.stealthStrike && titanCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { int damage = (int)Player.GetTotalDamage().ApplyTo(40); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), damage, proj.knockBack, proj.owner, 1f, 0f); SoundEngine.PlaySound(SoundID.Item14, proj.Center); @@ -959,8 +904,7 @@ namespace CalamityMod.CalPlayer if (type != -1) { int damage = (int)Player.GetTotalDamage().ApplyTo(24); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); float speed = Main.rand.NextFloat(5f, 11f); int cloud = Projectile.NewProjectile(spawnSource, position, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * speed, type, damage, proj.knockBack, Player.whoAmI); @@ -973,12 +917,12 @@ namespace CalamityMod.CalPlayer if (shadow && shadowPotCooldown <= 0 && modProj.stealthStrikeHitCount < 3) { - int randrot = Main.rand.Next(-30, 391); - Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); - int soul = Projectile.NewProjectile(spawnSource, proj.Center, SoulSpeed, ProjectileType(), (int)(proj.damage * 0.1), 3f, proj.owner, 0f, 0f); - if (soul.WithinBounds(Main.maxProjectiles)) - Main.projectile[soul].DamageType = DamageClass.Generic; - shadowPotCooldown = 30; + int randrot = Main.rand.Next(-30, 391); + Vector2 SoulSpeed = new Vector2(13f, 13f).RotatedBy(MathHelper.ToRadians(randrot)); + int soul = Projectile.NewProjectile(spawnSource, proj.Center, SoulSpeed, ProjectileType(), (int)(proj.damage * 0.1), 3f, proj.owner, 0f, 0f); + if (soul.WithinBounds(Main.maxProjectiles)) + Main.projectile[soul].DamageType = DamageClass.Generic; + shadowPotCooldown = 30; } if (raiderTalisman && modProj.stealthStrike) @@ -998,8 +942,7 @@ namespace CalamityMod.CalPlayer { // Umbraphile Rogue Blasts: 20%, softcap starts at 50 base damage int umbraBlastDamage = CalamityUtils.DamageSoftCap(proj.damage * 0.20, 50); - if (oldFashioned) - umbraBlastDamage = CalamityUtils.CalcOldFashionedDamage(umbraBlastDamage); + umbraBlastDamage = Player.ApplyArmorAccDamageBonusesTo(umbraBlastDamage); Projectile.NewProjectile(spawnSource, proj.Center, Vector2.Zero, ProjectileType(), umbraBlastDamage, 0f, Player.whoAmI); } @@ -1009,8 +952,7 @@ namespace CalamityMod.CalPlayer { Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); int damage = (int)Player.GetTotalDamage().ApplyTo(9); - if (oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Player.ApplyArmorAccDamageBonusesTo(damage); int spark = Projectile.NewProjectile(spawnSource, position, velocity, ProjectileType(), damage, 0f, Player.whoAmI); if (spark.WithinBounds(Main.maxProjectiles)) @@ -1044,21 +986,21 @@ namespace CalamityMod.CalPlayer CalamityUtils.Inflict246DebuffsNPC(target, BuffID.OnFire3, 4f); } } - if ((melee || rogue || whip) && !noFlask) - { - if (flaskCrumbling) - { + if ((melee || rogue || whip) && !noFlask) + { + if (flaskCrumbling) + { CalamityUtils.Inflict246DebuffsNPC(target, BuffType()); } - if (flaskBrimstone) - { - CalamityUtils.Inflict246DebuffsNPC(target, BuffType(), 4f); - } + if (flaskBrimstone) + { + CalamityUtils.Inflict246DebuffsNPC(target, BuffType(), 4f); + } if (flaskHoly) - { - target.AddBuff(BuffType(), 180, false); - } - } + { + target.AddBuff(BuffType(), 180, false); + } + } if (rogue && !noFlask) { switch (Player.meleeEnchant) @@ -1237,11 +1179,11 @@ namespace CalamityMod.CalPlayer { float heal = MathHelper.Clamp(damage * 0.011f, 0f, 5f); if ((int)heal > 0) - { + { CalamityGlobalProjectile.SpawnLifeStealProjectile(proj, Player, heal, ProjectileID.VampireHeal, 1200f, 3f); - float cooldown = heal * 2f; - Main.player[Main.myPlayer].lifeSteal -= cooldown; - } + float cooldown = heal * 2f; + Main.player[Main.myPlayer].lifeSteal -= cooldown; + } } if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike) diff --git a/CalPlayer/Dashes/AsgardianAegisDash.cs b/CalPlayer/Dashes/AsgardianAegisDash.cs index c76ea21fc7..162f1275bf 100644 --- a/CalPlayer/Dashes/AsgardianAegisDash.cs +++ b/CalPlayer/Dashes/AsgardianAegisDash.cs @@ -79,14 +79,12 @@ namespace CalamityMod.CalPlayer.Dashes // Define damage parameters. int dashDamage = AsgardianAegis.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.Calamity().oldFashioned ? CalamityUtils.CalcOldFashionedDamage(dashDamage) : dashDamage; + hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); hitContext.BaseKnockback = AsgardianAegis.ShieldSlamKnockback; - // Spawn explosion + // On-hit Cosmic Dash Explosion int explosionDamage = (int)player.GetBestClassDamage().ApplyTo(AsgardianAegis.RamExplosionDamage); - if (player.Calamity().oldFashioned) - explosionDamage = CalamityUtils.CalcOldFashionedDamage(explosionDamage); - + explosionDamage = player.ApplyArmorAccDamageBonusesTo(explosionDamage); Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), explosionDamage, AsgardianAegis.RamExplosionKnockback, Main.myPlayer, 3f, 0f); npc.AddBuff(ModContent.BuffType(), 300); } diff --git a/CalPlayer/Dashes/AsgardsValorDash.cs b/CalPlayer/Dashes/AsgardsValorDash.cs index b57cf2bfc6..88e18d10f1 100644 --- a/CalPlayer/Dashes/AsgardsValorDash.cs +++ b/CalPlayer/Dashes/AsgardsValorDash.cs @@ -63,7 +63,7 @@ namespace CalamityMod.CalPlayer.Dashes // Define damage parameters. int dashDamage = AsgardsValor.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.Calamity().oldFashioned ? CalamityUtils.CalcOldFashionedDamage(dashDamage) : dashDamage; + hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); hitContext.BaseKnockback = AsgardsValor.ShieldSlamKnockback; int Dusts = 12; diff --git a/CalPlayer/Dashes/ElysianAegisDash.cs b/CalPlayer/Dashes/ElysianAegisDash.cs index aec4617b7e..4b9c9d6509 100644 --- a/CalPlayer/Dashes/ElysianAegisDash.cs +++ b/CalPlayer/Dashes/ElysianAegisDash.cs @@ -76,14 +76,12 @@ namespace CalamityMod.CalPlayer.Dashes // Define damage parameters. int dashDamage = ElysianAegis.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.Calamity().oldFashioned ? CalamityUtils.CalcOldFashionedDamage(dashDamage) : dashDamage; + hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); hitContext.BaseKnockback = ElysianAegis.ShieldSlamKnockback; // On-hit Supreme Holy Explosion int supremeExplosionDamage = (int)player.GetBestClassDamage().ApplyTo(ElysianAegis.RamExplosionDamage); - if (player.Calamity().oldFashioned) - supremeExplosionDamage = CalamityUtils.CalcOldFashionedDamage(supremeExplosionDamage); - + supremeExplosionDamage = player.ApplyArmorAccDamageBonusesTo(supremeExplosionDamage); Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), supremeExplosionDamage, ElysianAegis.RamExplosionKnockback, Main.myPlayer, 1f, 0f); npc.AddBuff(ModContent.BuffType(), 300); } diff --git a/CalPlayer/Dashes/GodslayerArmorDash.cs b/CalPlayer/Dashes/GodslayerArmorDash.cs index e87f26fa4c..8d0b178b12 100644 --- a/CalPlayer/Dashes/GodslayerArmorDash.cs +++ b/CalPlayer/Dashes/GodslayerArmorDash.cs @@ -134,7 +134,7 @@ namespace CalamityMod.CalPlayer.Dashes // Define damage parameters. int dashDamage = 3000; hitContext.damageClass = player.GetBestClass(); - hitContext.BaseDamage = player.Calamity().oldFashioned ? CalamityUtils.CalcOldFashionedDamage(dashDamage) : dashDamage; + hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); hitContext.BaseKnockback = 15f; // God Slayer Dash intentionally does not use the vanilla function for collision attack iframes. diff --git a/CalPlayer/Dashes/OrnateShieldDash.cs b/CalPlayer/Dashes/OrnateShieldDash.cs index 4528237965..807f3c0757 100644 --- a/CalPlayer/Dashes/OrnateShieldDash.cs +++ b/CalPlayer/Dashes/OrnateShieldDash.cs @@ -53,7 +53,7 @@ namespace CalamityMod.CalPlayer.Dashes // Define damage parameters. int dashDamage = OrnateShield.ShieldSlamDamage; hitContext.damageClass = DamageClass.Melee; - hitContext.BaseDamage = player.Calamity().oldFashioned ? CalamityUtils.CalcOldFashionedDamage(dashDamage) : dashDamage; + hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); hitContext.BaseKnockback = OrnateShield.ShieldSlamKnockback; npc.AddBuff(BuffID.Frostburn2, 180); //Great, Frostbite is ACTUALLY called Frostburn 2 diff --git a/CalPlayer/Dashes/PlaguebringerArmorDash.cs b/CalPlayer/Dashes/PlaguebringerArmorDash.cs index d6792659a5..dfbf5c3d9f 100644 --- a/CalPlayer/Dashes/PlaguebringerArmorDash.cs +++ b/CalPlayer/Dashes/PlaguebringerArmorDash.cs @@ -65,7 +65,7 @@ namespace CalamityMod.CalPlayer.Dashes // Define damage parameters. int dashDamage = 50; hitContext.damageClass = DamageClass.Summon; - hitContext.BaseDamage = player.Calamity().oldFashioned ? CalamityUtils.CalcOldFashionedDamage(dashDamage) : dashDamage; + hitContext.BaseDamage = player.ApplyArmorAccDamageBonusesTo(dashDamage); hitContext.BaseKnockback = 3f; } } diff --git a/CalPlayer/Dashes/StatisVoidSashDash.cs b/CalPlayer/Dashes/StatisVoidSashDash.cs index c62fca33e6..483d5c9bad 100644 --- a/CalPlayer/Dashes/StatisVoidSashDash.cs +++ b/CalPlayer/Dashes/StatisVoidSashDash.cs @@ -41,8 +41,7 @@ namespace CalamityMod.CalPlayer.Dashes if (Main.myPlayer == player.whoAmI && player.Calamity().statisTimer % 5 == 0) { int scytheDamage = (int)player.GetBestClassDamage().ApplyTo(250); - if (player.Calamity().oldFashioned) - scytheDamage = CalamityUtils.CalcOldFashionedDamage(scytheDamage); + scytheDamage = player.ApplyArmorAccDamageBonusesTo(scytheDamage); int scythe = Projectile.NewProjectile(player.GetSource_FromAI(), player.Center, player.velocity.RotatedBy(player.direction * (AngleSwap ? 30 : -30), default) * 0.1f - player.velocity / 2f, ModContent.ProjectileType(), scytheDamage, 5f, player.whoAmI);; if (scythe.WithinBounds(Main.maxProjectiles)) diff --git a/DataStructures/GemTechArmorState.cs b/DataStructures/GemTechArmorState.cs index 64bd7a6dca..c9648e5931 100644 --- a/DataStructures/GemTechArmorState.cs +++ b/DataStructures/GemTechArmorState.cs @@ -147,8 +147,7 @@ namespace CalamityMod.DataStructures return; int damage = (int)Owner.GetTotalDamage().ApplyTo(GemTechHeadgear.MeleeShardBaseDamage); - if (Owner.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Owner.ApplyArmorAccDamageBonusesTo(damage); for (int i = 0; i < 14; i++) { @@ -166,8 +165,7 @@ namespace CalamityMod.DataStructures return; int damage = CalamityUtils.DamageSoftCap((int)(hitDamage * 0.32f), 400); - if (Owner.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = Owner.ApplyArmorAccDamageBonusesTo(damage); Vector2 spawnPosition = Owner.Center + Main.rand.NextVector2Circular(Owner.width, Owner.height) * 1.35f; Vector2 shootVelocity = (target.Center - spawnPosition) * 0.04f; @@ -272,8 +270,7 @@ namespace CalamityMod.DataStructures // Softcap the damage. This is done primarily to dampen stealth interactions. gemDamage = CalamityUtils.DamageSoftCap(gemDamage, GemTechHeadgear.GemDamageSoftcapThreshold); - if (Owner.Calamity().oldFashioned) - gemDamage = CalamityUtils.CalcOldFashionedDamage(gemDamage); + gemDamage = Owner.ApplyArmorAccDamageBonusesTo(gemDamage); if (Main.myPlayer == OwnerIndex) Projectile.NewProjectile(Owner.GetSource_ItemUse(Owner.ActiveItem()), gemPosition, Vector2.Zero, ModContent.ProjectileType(), gemDamage, 0f, OwnerIndex, 0f, (int)GemThatShouldBeLost); diff --git a/Events/BossRushEvent.cs b/Events/BossRushEvent.cs index 888d86b742..d1bb856f19 100644 --- a/Events/BossRushEvent.cs +++ b/Events/BossRushEvent.cs @@ -142,7 +142,14 @@ namespace CalamityMod.Events // TODO -- Multiple different lists might be ideal for this at some point instead of a god-struct? This is a lot of parameters. Bosses = new List() { - new Boss(NPCID.KingSlime, permittedNPCs: new int[] { NPCID.BlueSlime, NPCID.YellowSlime, NPCID.PurpleSlime, NPCID.RedSlime, NPCID.GreenSlime, NPCID.RedSlime, + new Boss(NPCID.KingSlime, spawnContext: type => { + NPC.SpawnOnPlayer(ClosestPlayerToWorldCenter, type); + + // When King Slime spawns, Boss Rush is considered to be started at least once. + // Xeroc will no longer give his full start monologue anymore for this world. + DownedBossSystem.startedBossRushAtLeastOnce = true; + }, + permittedNPCs: new int[] { NPCID.BlueSlime, NPCID.YellowSlime, NPCID.PurpleSlime, NPCID.RedSlime, NPCID.GreenSlime, NPCID.RedSlime, NPCID.IceSlime, NPCID.UmbrellaSlime, NPCID.Pinky, NPCID.SlimeSpiked, NPCID.RainbowSlime, ModContent.NPCType() }), new Boss(ModContent.NPCType(), spawnContext: type => diff --git a/ExtraJumps/SulphurJump.cs b/ExtraJumps/SulphurJump.cs index d49ebf6491..4c0866b529 100644 --- a/ExtraJumps/SulphurJump.cs +++ b/ExtraJumps/SulphurJump.cs @@ -47,8 +47,7 @@ namespace CalamityMod.ExtraJumps { var source = player.GetSource_Misc("0"); int damage = (int)player.GetTotalDamage().ApplyTo(20); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); 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/Items/Accessories/AmalgamatedBrain.cs b/Items/Accessories/AmalgamatedBrain.cs index f4f5d3475b..6850ade31a 100644 --- a/Items/Accessories/AmalgamatedBrain.cs +++ b/Items/Accessories/AmalgamatedBrain.cs @@ -34,8 +34,7 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { int damage = (int)player.GetBestClassDamage().ApplyTo(60); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 2f, player.whoAmI); if (rain.whoAmI.WithinBounds(Main.maxProjectiles)) diff --git a/Items/Accessories/AmidiasPendant.cs b/Items/Accessories/AmidiasPendant.cs index dde9c80092..5f2a744be8 100644 --- a/Items/Accessories/AmidiasPendant.cs +++ b/Items/Accessories/AmidiasPendant.cs @@ -69,10 +69,9 @@ namespace CalamityMod.Items.Accessories damage = 30; break; } - int finalDamage = (int)player.GetBestClassDamage().ApplyTo(damage); - if (player.Calamity().oldFashioned) - finalDamage = CalamityUtils.CalcOldFashionedDamage(finalDamage); + int finalDamage = (int)player.GetBestClassDamage().ApplyTo(damage); + finalDamage = player.ApplyArmorAccDamageBonusesTo(finalDamage); Projectile.NewProjectile(source, spawn.X, spawn.Y, velocity.X / 3, velocity.Y / 2, type, finalDamage, 5f, Main.myPlayer); } } diff --git a/Items/Accessories/BlazingCore.cs b/Items/Accessories/BlazingCore.cs index 5d918c405f..3b4a1aa57e 100644 --- a/Items/Accessories/BlazingCore.cs +++ b/Items/Accessories/BlazingCore.cs @@ -79,11 +79,8 @@ namespace CalamityMod.Items.Accessories { spinningPoint *= 1.5f; dmgAmt = (int)player.GetBestClassDamage().ApplyTo(dmgAmt); - if (player.Calamity().oldFashioned) - dmgAmt = CalamityUtils.CalcOldFashionedDamage(dmgAmt); - + dmgAmt = player.ApplyArmorAccDamageBonusesTo(dmgAmt); Projectile.NewProjectile(player.GetSource_FromThis(), player.Center, vector2, projectileType, dmgAmt, 0f, Main.myPlayer); - } } offset += 10f; diff --git a/Items/Accessories/EyeoftheStorm.cs b/Items/Accessories/EyeoftheStorm.cs index 557ec963bd..132b79a4ca 100644 --- a/Items/Accessories/EyeoftheStorm.cs +++ b/Items/Accessories/EyeoftheStorm.cs @@ -44,11 +44,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - int baseDamage = 45; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); + // 08DEC2023: Ozzatron: Cloud Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(45); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); p.originalDamage = baseDamage; } @@ -68,11 +68,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - int baseDamage = 45; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); + // 08DEC2023: Ozzatron: Cloud Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! + int baseDamage = 45; int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); p.originalDamage = baseDamage; } diff --git a/Items/Accessories/FlameLickedShell.cs b/Items/Accessories/FlameLickedShell.cs index 93d15edc9f..3ec4ea4013 100644 --- a/Items/Accessories/FlameLickedShell.cs +++ b/Items/Accessories/FlameLickedShell.cs @@ -56,8 +56,7 @@ namespace CalamityMod.Items.Accessories float offsetAngle = (float)Math.PI * radialOffset; int type = ModContent.ProjectileType(); int damage = (int)player.GetBestClassDamage().ApplyTo(60); - if (calPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); if (player.whoAmI == Main.myPlayer) { @@ -74,8 +73,7 @@ namespace CalamityMod.Items.Accessories float radians2 = MathHelper.TwoPi / totalProjectiles; type = ModContent.ProjectileType(); damage = (int)player.GetBestClassDamage().ApplyTo(20); - if (calPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); double angleA = radians2 * 0.5; double angleB = MathHelper.ToRadians(90f) - angleA; diff --git a/Items/Accessories/FungalClump.cs b/Items/Accessories/FungalClump.cs index 7349a0454f..37b51c914a 100644 --- a/Items/Accessories/FungalClump.cs +++ b/Items/Accessories/FungalClump.cs @@ -36,11 +36,10 @@ namespace CalamityMod.Items.Accessories { var source = player.GetSource_Accessory(Item); - int baseDamage = FungalClumpDamage; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Fungal Clumps spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(FungalClumpDamage); int damage = (int)player.GetBestClassDamage().ApplyTo(baseDamage); + int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 1f, player.whoAmI); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; @@ -62,11 +61,10 @@ namespace CalamityMod.Items.Accessories { var source = player.GetSource_Accessory(Item); - int baseDamage = FungalClumpDamage; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Fungal Clumps spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! + int baseDamage = player.ApplyArmorAccDamageBonusesTo(FungalClumpDamage); int damage = (int)player.GetBestClassDamage().ApplyTo(baseDamage); + int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 1f, player.whoAmI); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; diff --git a/Items/Accessories/GravistarSabaton.cs b/Items/Accessories/GravistarSabaton.cs index 1653874aef..32519e51f3 100644 --- a/Items/Accessories/GravistarSabaton.cs +++ b/Items/Accessories/GravistarSabaton.cs @@ -8,6 +8,10 @@ namespace CalamityMod.Items.Accessories public class GravistarSabaton : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Accessories"; + + public static readonly int PassthroughDamage = 150; + public static readonly int SlamDamage = 300; + public override void SetDefaults() { Item.width = 20; diff --git a/Items/Accessories/HeartoftheElements.cs b/Items/Accessories/HeartoftheElements.cs index aefb552dba..a5bf28af39 100644 --- a/Items/Accessories/HeartoftheElements.cs +++ b/Items/Accessories/HeartoftheElements.cs @@ -59,11 +59,10 @@ namespace CalamityMod.Items.Accessories var source = player.GetSource_Accessory(Item); Vector2 velocity = new Vector2(0f, -1f); - int baseDamage = 50; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(50); int elementalDmg = (int)player.GetTotalDamage().ApplyTo(baseDamage); + float kBack = 2f + player.GetKnockback().Additive; if (player.ownedProjectileCounts[brimmy] > 1 || player.ownedProjectileCounts[siren] > 1 || @@ -126,11 +125,10 @@ namespace CalamityMod.Items.Accessories var source = player.GetSource_Accessory(Item); Vector2 velocity = new Vector2(0f, -1f); - int baseDamage = 90; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! + int baseDamage = player.ApplyArmorAccDamageBonusesTo(50); int elementalDmg = (int)player.GetTotalDamage().ApplyTo(baseDamage); + float kBack = 2f + player.GetKnockback().Additive; if (player.ownedProjectileCounts[brimmy] > 1 || player.ownedProjectileCounts[siren] > 1 || diff --git a/Items/Accessories/HowlsHeart.cs b/Items/Accessories/HowlsHeart.cs index d72dd6298a..89ca8485e3 100644 --- a/Items/Accessories/HowlsHeart.cs +++ b/Items/Accessories/HowlsHeart.cs @@ -51,9 +51,9 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ProjectileType()] < 1) { - int damage = (int)player.GetTotalDamage().ApplyTo(HowlDamage); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + // 08DEC2023: Ozzatron: Howls spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(HowlDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); Projectile howl = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ProjectileType(), damage, 1f, player.whoAmI, 0f, 1f); howl.originalDamage = damage; @@ -80,9 +80,9 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ProjectileType()] < 1) { - int damage = (int)player.GetTotalDamage().ApplyTo(HowlDamage); - if (player.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + // 08DEC2023: Ozzatron: Howls spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! + int baseDamage = player.ApplyArmorAccDamageBonusesTo(HowlDamage); + int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); int p = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ProjectileType(), damage, 1f, player.whoAmI, 0f, 1f); if (Main.projectile.IndexInRange(p)) diff --git a/Items/Accessories/MarniteRepulsionShield.cs b/Items/Accessories/MarniteRepulsionShield.cs index b8f2499a6e..f260508392 100644 --- a/Items/Accessories/MarniteRepulsionShield.cs +++ b/Items/Accessories/MarniteRepulsionShield.cs @@ -37,10 +37,7 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { - int baseDamage = 5; - if (player.Calamity().oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + int baseDamage = player.ApplyArmorAccDamageBonusesTo(5); var source = player.GetSource_Accessory(Item); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 7a16f79977..bc9c165501 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -34,6 +34,7 @@ namespace CalamityMod.Items.Accessories modPlayer.nCore = true; player.GetDamage() += 0.1f; int damage = (int)player.GetBestClassDamage().ApplyTo(250); + damage = player.ApplyArmorAccDamageBonusesTo(damage); float knockBack = 3f; if (Main.rand.NextBool(15)) { @@ -92,9 +93,6 @@ namespace CalamityMod.Items.Accessories } if (canSpawnProj && Main.myPlayer == player.whoAmI) { - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); return; } diff --git a/Items/Accessories/PearlofEnthrallment.cs b/Items/Accessories/PearlofEnthrallment.cs index 5fd2d7e5f4..f034650c90 100644 --- a/Items/Accessories/PearlofEnthrallment.cs +++ b/Items/Accessories/PearlofEnthrallment.cs @@ -45,11 +45,10 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 65; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Anahitas spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(65); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int anahita = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer); if (Main.projectile.IndexInRange(anahita)) Main.projectile[anahita].originalDamage = baseDamage; @@ -70,11 +69,10 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 65; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Anahitas spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! + int baseDamage = player.ApplyArmorAccDamageBonusesTo(65); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int anahita = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer); if (Main.projectile.IndexInRange(anahita)) Main.projectile[anahita].originalDamage = baseDamage; diff --git a/Items/Accessories/ProfanedSoulCrystal.cs b/Items/Accessories/ProfanedSoulCrystal.cs index bde3eb0c38..2e1ec84035 100644 --- a/Items/Accessories/ProfanedSoulCrystal.cs +++ b/Items/Accessories/ProfanedSoulCrystal.cs @@ -301,8 +301,7 @@ namespace CalamityMod.Items.Accessories int separation = (i * 4) - 8; int spearBaseDamage = 350; int spearDamage = (int)player.GetTotalDamage().ApplyTo(spearBaseDamage); - if (player.Calamity().oldFashioned) - spearDamage = CalamityUtils.CalcOldFashionedDamage(spearDamage); + spearDamage = player.ApplyArmorAccDamageBonusesTo(spearDamage); int proj = Projectile.NewProjectile(source, player.Center.X, player.Center.Y - separation, perturbedspeed.X, perturbedspeed.Y, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -319,8 +318,7 @@ namespace CalamityMod.Items.Accessories { int spearBaseDamage = 250; int spearDamage = (int)player.GetTotalDamage().ApplyTo(spearBaseDamage); - if (player.Calamity().oldFashioned) - spearDamage = CalamityUtils.CalcOldFashionedDamage(spearDamage); + spearDamage = player.ApplyArmorAccDamageBonusesTo(spearDamage); int proj = Projectile.NewProjectile(source, player.Center, correctedVelocity * 14f, ModContent.ProjectileType(), spearDamage, 1f, player.whoAmI, Main.rand.NextBool(player.Calamity().profanedSoulWeaponUsage == 4 ? 5 : 7) ? 1f : 0f, 1f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -346,8 +344,7 @@ namespace CalamityMod.Items.Accessories int projType = isSmallBoomer ? isThiccBoomer ? 1 : 2 : 3; int boomBaseDamage = 200; int boomDamage = (int)player.GetTotalDamage().ApplyTo(boomBaseDamage); - if (player.Calamity().oldFashioned) - boomDamage = CalamityUtils.CalcOldFashionedDamage(boomDamage); + boomDamage = player.ApplyArmorAccDamageBonusesTo(boomDamage); switch (projType) { @@ -402,8 +399,7 @@ namespace CalamityMod.Items.Accessories int sickPenalty = (int)(mageFireDamage * (0.05f * ((player.buffTime[player.FindBuffIndex(BuffID.ManaSickness)] + 60) / 60))); mageFireDamage -= sickPenalty; } - if (player.Calamity().oldFashioned) - mageFireDamage = CalamityUtils.CalcOldFashionedDamage(mageFireDamage); + mageFireDamage = player.ApplyArmorAccDamageBonusesTo(mageFireDamage); int proj = Projectile.NewProjectile(source, player.position, correctedVelocity, ModContent.ProjectileType(), mageFireDamage, 1f, player.whoAmI, empowered ? 1f : 0f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -431,8 +427,7 @@ namespace CalamityMod.Items.Accessories float angle = MathHelper.TwoPi / crystalCount * i; int shardBaseDamage = 176; int shardDamage = (int)player.GetTotalDamage().ApplyTo(shardBaseDamage); - if (player.Calamity().oldFashioned) - shardDamage = CalamityUtils.CalcOldFashionedDamage(shardDamage); + shardDamage = player.ApplyArmorAccDamageBonusesTo(shardDamage); int proj = Projectile.NewProjectile(source, player.Center, angle.ToRotationVector2() * 12f, ModContent.ProjectileType(), shardDamage, 1f, player.whoAmI, 0f, 0f); if (proj.WithinBounds(Main.maxProjectiles)) @@ -450,8 +445,7 @@ namespace CalamityMod.Items.Accessories int totalShardProjectiles = empowered ? 360 / 5 : 360 / 10; int shardBaseDamage = empowered ? 125 : 220; int shardDamage = (int)player.GetTotalDamage().ApplyTo(shardBaseDamage); - if (player.Calamity().oldFashioned) - shardDamage = CalamityUtils.CalcOldFashionedDamage(shardDamage); + shardDamage = player.ApplyArmorAccDamageBonusesTo(shardDamage); float interval = totalShardProjectiles / chains * (empowered ? 5f : 10f); double patternInterval = Math.Floor(player.Calamity().profanedSoulWeaponUsage / interval); @@ -490,9 +484,8 @@ namespace CalamityMod.Items.Accessories if (player.Calamity().profanedSoulWeaponUsage == 0) { int whipBaseDamage = 250; - int whipDamage = (int)player.GetTotalDamage().ApplyTo(whipBaseDamage); - if (player.Calamity().oldFashioned) - whipDamage = CalamityUtils.CalcOldFashionedDamage(whipDamage); + int whipDamage = (int)player.GetTotalDamage().ApplyTo(whipBaseDamage); + whipDamage = player.ApplyArmorAccDamageBonusesTo(whipDamage); var buffed = player.HasBuff(); correctedVelocity *= buffed ? 10f : 8f; diff --git a/Items/Accessories/RoseStone.cs b/Items/Accessories/RoseStone.cs index bc5be1b333..4b7e5ea685 100644 --- a/Items/Accessories/RoseStone.cs +++ b/Items/Accessories/RoseStone.cs @@ -43,11 +43,10 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 60; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Brimstone Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(60); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; @@ -68,11 +67,10 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 60; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Brimstone Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! + int baseDamage = player.ApplyArmorAccDamageBonusesTo(60); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; diff --git a/Items/Accessories/RottenBrain.cs b/Items/Accessories/RottenBrain.cs index 5fabf53f38..aabf2757c0 100644 --- a/Items/Accessories/RottenBrain.cs +++ b/Items/Accessories/RottenBrain.cs @@ -1,10 +1,8 @@ using CalamityMod.CalPlayer; using CalamityMod.Projectiles.Magic; using Terraria; -using Terraria.ModLoader; using Terraria.ID; -using Terraria.Localization; -using CalamityMod.Items.Potions.Alcohol; +using Terraria.ModLoader; namespace CalamityMod.Items.Accessories { @@ -30,8 +28,7 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { int damage = (int)player.GetBestClassDamage().ApplyTo(18); - if (player.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); Projectile rain = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 2f, player.whoAmI); if (rain.whoAmI.WithinBounds(Main.maxProjectiles)) diff --git a/Items/Accessories/ToxicHeart.cs b/Items/Accessories/ToxicHeart.cs index 3ad3416261..f93462c333 100644 --- a/Items/Accessories/ToxicHeart.cs +++ b/Items/Accessories/ToxicHeart.cs @@ -30,9 +30,9 @@ namespace CalamityMod.Items.Accessories Lighting.AddLight((int)(player.Center.X / 16f), (int)(player.Center.Y / 16f), 0.05f, 1f, 0.1f); int plagueDebuff = ModContent.BuffType(); bool shouldInflictPlague = plagueCounter % 60 == 0; + int auraDamage = (int)player.GetBestClassDamage().ApplyTo(50); - if (modPlayer.oldFashioned) - auraDamage = CalamityUtils.CalcOldFashionedDamage(auraDamage); + auraDamage = player.ApplyArmorAccDamageBonusesTo(auraDamage); int random = Main.rand.Next(10); var source = player.GetSource_Accessory(Item); diff --git a/Items/Accessories/VoidofCalamity.cs b/Items/Accessories/VoidofCalamity.cs index 803bdf6728..fcb0250f8c 100644 --- a/Items/Accessories/VoidofCalamity.cs +++ b/Items/Accessories/VoidofCalamity.cs @@ -33,9 +33,7 @@ namespace CalamityMod.Items.Accessories if (player.miscCounter % 10 == 0) { int damage = (int)player.GetBestClassDamage().ApplyTo(30); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - + damage = player.ApplyArmorAccDamageBonusesTo(damage); CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 5f, player.whoAmI); } } diff --git a/Items/Accessories/WifeinaBottle.cs b/Items/Accessories/WifeinaBottle.cs index 3b7a66147c..7cd28bbe25 100644 --- a/Items/Accessories/WifeinaBottle.cs +++ b/Items/Accessories/WifeinaBottle.cs @@ -49,11 +49,10 @@ namespace CalamityMod.Items.Accessories } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = ElementalDamage; - if (player.Calamity().oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Sand Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(ElementalDamage); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectileDirect(player.GetSource_Accessory(Item), player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer); p.originalDamage = baseDamage; } diff --git a/Items/Accessories/WifeinaBottlewithBoobs.cs b/Items/Accessories/WifeinaBottlewithBoobs.cs index fbb40d82ed..5e8968c9e4 100644 --- a/Items/Accessories/WifeinaBottlewithBoobs.cs +++ b/Items/Accessories/WifeinaBottlewithBoobs.cs @@ -44,11 +44,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - int baseDamage = 45; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); + // 08DEC2023: Ozzatron: Rare Sand Elementals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(45); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + Projectile sandy = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); sandy.originalDamage = baseDamage; } @@ -68,11 +68,11 @@ namespace CalamityMod.Items.Accessories if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { var source = player.GetSource_Accessory(Item); - int baseDamage = 45; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); + // 08DEC2023: Ozzatron: Rare Sand Elementals spawned with... Hold on a second. Why the fuck are we doing damage calculations when the accessory is in vanity?! + int baseDamage = player.ApplyArmorAccDamageBonusesTo(45); int damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + Projectile sandy = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 2f, Main.myPlayer, 0f, 0f); sandy.originalDamage = baseDamage; } diff --git a/Items/Accessories/Wings/SoulofCryogen.cs b/Items/Accessories/Wings/SoulofCryogen.cs index 05a6349279..6138988d28 100644 --- a/Items/Accessories/Wings/SoulofCryogen.cs +++ b/Items/Accessories/Wings/SoulofCryogen.cs @@ -60,8 +60,7 @@ namespace CalamityMod.Items.Accessories.Wings { var source = player.GetSource_Accessory(Item); int damage = (int)player.GetBestClassDamage().ApplyTo(25); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); int p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, player.velocity.X * 0f, 2f, ModContent.ProjectileType(), damage, 3f, player.whoAmI, 1f); if (p.WithinBounds(Main.maxProjectiles)) diff --git a/Items/Accessories/YharimsGift.cs b/Items/Accessories/YharimsGift.cs index 57e3ed291d..196026a136 100644 --- a/Items/Accessories/YharimsGift.cs +++ b/Items/Accessories/YharimsGift.cs @@ -37,8 +37,7 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { int damage = (int)player.GetBestClassDamage().ApplyTo(175); - if (player.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); int projectile1 = Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), damage, 5f, player.whoAmI, 0f, 0f); Main.projectile[projectile1].timeLeft = 60; @@ -57,8 +56,7 @@ namespace CalamityMod.Items.Accessories if (player.whoAmI == Main.myPlayer) { int damage = (int)player.GetBestClassDamage().ApplyTo(375); - if (player.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 9f, player.whoAmI); } diff --git a/Items/Armor/Aerospec/AerospecHelmet.cs b/Items/Armor/Aerospec/AerospecHelmet.cs index 6e4bfb4378..435f3f39f8 100644 --- a/Items/Armor/Aerospec/AerospecHelmet.cs +++ b/Items/Armor/Aerospec/AerospecHelmet.cs @@ -48,11 +48,10 @@ namespace CalamityMod.Items.Armor.Aerospec } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 20; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Aerospec Valkyries spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(20); var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; diff --git a/Items/Armor/Daedalus/DaedalusHeadSummon.cs b/Items/Armor/Daedalus/DaedalusHeadSummon.cs index e99ced0e62..f308960c51 100644 --- a/Items/Armor/Daedalus/DaedalusHeadSummon.cs +++ b/Items/Armor/Daedalus/DaedalusHeadSummon.cs @@ -49,11 +49,10 @@ namespace CalamityMod.Items.Armor.Daedalus } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 95; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Daedalus Crystals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(95); var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 50f, 0f); p.originalDamage = baseDamage; } diff --git a/Items/Armor/Demonshade/DemonshadeHelm.cs b/Items/Armor/Demonshade/DemonshadeHelm.cs index bc5ea60245..e2e89a9a38 100644 --- a/Items/Armor/Demonshade/DemonshadeHelm.cs +++ b/Items/Armor/Demonshade/DemonshadeHelm.cs @@ -59,11 +59,10 @@ namespace CalamityMod.Items.Armor.Demonshade } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - var baseDamage = 10000; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Demonshade Red Devils spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + var baseDamage = player.ApplyArmorAccDamageBonusesTo(10000); var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var devil = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 0f, 0f); devil.originalDamage = baseDamage; } diff --git a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs index b1bfbf2a1b..333a631d2b 100644 --- a/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs +++ b/Items/Armor/Hydrothermic/HydrothermicHeadSummon.cs @@ -49,11 +49,10 @@ namespace CalamityMod.Items.Armor.Hydrothermic } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 190; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Hydrothermic Vents spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(190); var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, 38f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; diff --git a/Items/Armor/Mollusk/MolluskShellmet.cs b/Items/Armor/Mollusk/MolluskShellmet.cs index 53b1d8c8fe..139d19f421 100644 --- a/Items/Armor/Mollusk/MolluskShellmet.cs +++ b/Items/Armor/Mollusk/MolluskShellmet.cs @@ -52,9 +52,9 @@ namespace CalamityMod.Items.Armor.Mollusk } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 2) { - int baseDamage = 140; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); + // 08DEC2023: Ozzatron: Clams spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(140); + // wait why does this not scale with summon damage Projectile clam = Projectile.NewProjectileDirect(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), baseDamage, 0f, player.whoAmI); clam.originalDamage = baseDamage; diff --git a/Items/Armor/PlagueReaper/PlagueReaperMask.cs b/Items/Armor/PlagueReaper/PlagueReaperMask.cs index 708e2f33c2..9608c7e2a3 100644 --- a/Items/Armor/PlagueReaper/PlagueReaperMask.cs +++ b/Items/Armor/PlagueReaper/PlagueReaperMask.cs @@ -61,8 +61,7 @@ namespace CalamityMod.Items.Armor.PlagueReaper if (player.miscCounter % 10 == 0) { var damage = (int)player.GetTotalDamage().ApplyTo(40); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); var cinder = CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 22f, ModContent.ProjectileType(), damage, 4f, player.whoAmI); if (cinder.whoAmI.WithinBounds(Main.maxProjectiles)) diff --git a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs index f008ad6cd9..98fc7d8e53 100644 --- a/Items/Armor/Plaguebringer/PlaguebringerVisor.cs +++ b/Items/Armor/Plaguebringer/PlaguebringerVisor.cs @@ -58,11 +58,10 @@ namespace CalamityMod.Items.Armor.Plaguebringer } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 25; - if (player.Calamity().oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Plaguebringer armor dudes spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(25); var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, player.whoAmI, 0f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; diff --git a/Items/Armor/Silva/SilvaHeadSummon.cs b/Items/Armor/Silva/SilvaHeadSummon.cs index 4a99df3f47..e38fc5b498 100644 --- a/Items/Armor/Silva/SilvaHeadSummon.cs +++ b/Items/Armor/Silva/SilvaHeadSummon.cs @@ -56,11 +56,10 @@ namespace CalamityMod.Items.Armor.Silva } if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - int baseDamage = 600; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Silva Crystals spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(600); var damage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectile(source, player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType(), damage, 0f, Main.myPlayer, -20f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; diff --git a/Items/Armor/Statigel/StatigelHeadSummon.cs b/Items/Armor/Statigel/StatigelHeadSummon.cs index fd43d34d8c..9b46cbd14f 100644 --- a/Items/Armor/Statigel/StatigelHeadSummon.cs +++ b/Items/Armor/Statigel/StatigelHeadSummon.cs @@ -50,11 +50,11 @@ namespace CalamityMod.Items.Armor.Statigel } var minionID = -1; - var baseDamage = 33; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); + // 08DEC2023: Ozzatron: Corruption and Crimson Slimes spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + var baseDamage = player.ApplyArmorAccDamageBonusesTo(33); var minionDamage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + if (WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) minionID = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer); else if (!WorldGen.crimson && player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) diff --git a/Items/Armor/Victide/VictideHeadSummon.cs b/Items/Armor/Victide/VictideHeadSummon.cs index f3af00a25b..d92eb63686 100644 --- a/Items/Armor/Victide/VictideHeadSummon.cs +++ b/Items/Armor/Victide/VictideHeadSummon.cs @@ -46,11 +46,10 @@ namespace CalamityMod.Items.Armor.Victide var source = player.GetSource_ItemUse(Item); if (player.ownedProjectileCounts[ModContent.ProjectileType()] < 1) { - var baseDamage = 7; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Victide Sea Snails spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + var baseDamage = player.ApplyArmorAccDamageBonusesTo(7); var minionDamage = (int)player.GetTotalDamage().ApplyTo(baseDamage); + var p = Projectile.NewProjectile(source, player.Center, -Vector2.UnitY, ModContent.ProjectileType(), minionDamage, 0f, Main.myPlayer, 0f, 0f); if (Main.projectile.IndexInRange(p)) Main.projectile[p].originalDamage = baseDamage; diff --git a/Items/Armor/Wulfrum/WulfrumFusionCannon.cs b/Items/Armor/Wulfrum/WulfrumFusionCannon.cs index 3ee9c43415..f9d1f1e19d 100644 --- a/Items/Armor/Wulfrum/WulfrumFusionCannon.cs +++ b/Items/Armor/Wulfrum/WulfrumFusionCannon.cs @@ -81,8 +81,8 @@ namespace CalamityMod.Items.Armor.Wulfrum { velocity = velocity.RotatedByRandom(MathHelper.PiOver4 * 0.1f); - if (player.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + // This weapon is acquired through usage of an armor set bonus and thus counts as armor. This function must be used. + damage = player.ApplyArmorAccDamageBonusesTo(damage); } public override bool CanUseItem(Player player) diff --git a/Items/CalamityGlobalItem.cs b/Items/CalamityGlobalItem.cs index 9347e0dff9..8699c788af 100644 --- a/Items/CalamityGlobalItem.cs +++ b/Items/CalamityGlobalItem.cs @@ -271,19 +271,17 @@ namespace CalamityMod.Items if (modPlayer.luxorsGift && !item.channel) { // useTime 9 = 0.9 useTime 2 = 0.2 - double damageMult = 1.0; + float damageMult = 1f; if (item.useTime < 10) - damageMult -= (10 - item.useTime) / 10D; + damageMult -= (10 - item.useTime) / 10f; - double newDamage = damage * damageMult; + float newDamage = damage * damageMult; if (player.whoAmI == Main.myPlayer) { if (item.CountsAsClass()) { - int meleeDamage = (int)(newDamage * 0.25f); - if (modPlayer.oldFashioned) - meleeDamage = CalamityUtils.CalcOldFashionedDamage(meleeDamage); + int meleeDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.25f); if (meleeDamage >= 1) { @@ -294,9 +292,7 @@ namespace CalamityMod.Items } else if (item.CountsAsClass()) { - int throwingDamage = (int)(newDamage * 0.2f); - if (modPlayer.oldFashioned) - throwingDamage = CalamityUtils.CalcOldFashionedDamage(throwingDamage); + int throwingDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.2f); if (throwingDamage >= 1) { @@ -313,9 +309,7 @@ namespace CalamityMod.Items // The projectile is fired inside of the scope's code instead if (type != ModContent.ProjectileType()) { - int rangedDamage = (int)(newDamage * 0.15f); - if (modPlayer.oldFashioned) - rangedDamage = CalamityUtils.CalcOldFashionedDamage(rangedDamage); + int rangedDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.15f); if (rangedDamage >= 1) { @@ -327,9 +321,7 @@ namespace CalamityMod.Items } else if (item.CountsAsClass()) { - int magicDamage = (int)(newDamage * 0.3f); - if (modPlayer.oldFashioned) - magicDamage = CalamityUtils.CalcOldFashionedDamage(magicDamage); + int magicDamage = player.ApplyArmorAccDamageBonusesTo(newDamage * 0.3f); if (magicDamage >= 1) { @@ -342,11 +334,10 @@ namespace CalamityMod.Items { if (damage >= 1) { - int baseDamage = item.damage; - if (modPlayer.oldFashioned) - baseDamage = CalamityUtils.CalcOldFashionedDamage(baseDamage); - + // 08DEC2023: Ozzatron: Luxor Summons spawned with Old Fashioned active will retain their bonus damage indefinitely. Oops. Don't care. + int baseDamage = player.ApplyArmorAccDamageBonusesTo(item.damage); int summonDamage = baseDamage; + int projectile = Projectile.NewProjectile(source, position, Vector2.Zero, ModContent.ProjectileType(), summonDamage, 0f, player.whoAmI); if (projectile.WithinBounds(Main.maxProjectiles)) { @@ -366,8 +357,7 @@ namespace CalamityMod.Items { // Bloodflare Mage Bolt: 130%, soft cap starts at 2000 base damage int bloodflareBoltDamage = CalamityUtils.DamageSoftCap(damage * 1.3, 2600); - if (modPlayer.oldFashioned) - bloodflareBoltDamage = CalamityUtils.CalcOldFashionedDamage(bloodflareBoltDamage); + bloodflareBoltDamage = player.ApplyArmorAccDamageBonusesTo(bloodflareBoltDamage); Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), bloodflareBoltDamage, 1f, player.whoAmI); } @@ -383,8 +373,7 @@ namespace CalamityMod.Items // Bloodflare Ranged Bloodsplosion: 80%, soft cap starts at 150 base damage // This is intentionally extremely low because this effect can be grossly overpowered with sniper rifles and the like. int bloodsplosionDamage = CalamityUtils.DamageSoftCap(damage * 0.8, 120); - if (modPlayer.oldFashioned) - bloodsplosionDamage = CalamityUtils.CalcOldFashionedDamage(bloodsplosionDamage); + bloodsplosionDamage = player.ApplyArmorAccDamageBonusesTo(bloodsplosionDamage); Projectile.NewProjectile(source, position, velocity, ModContent.ProjectileType(), bloodsplosionDamage, 2f, player.whoAmI); } @@ -397,9 +386,7 @@ namespace CalamityMod.Items modPlayer.tarraCrits = 0; // Tarragon Mage Leaves: (8-10) x 20%, soft cap starts at 200 base damage int leafAmt = 8 + Main.rand.Next(3); // 8, 9, or 10 - int leafDamage = (int)(damage * 0.2); - if (modPlayer.oldFashioned) - leafDamage = CalamityUtils.CalcOldFashionedDamage(leafDamage); + int leafDamage = player.ApplyArmorAccDamageBonusesTo(damage * 0.2f); for (int l = 0; l < leafAmt; l++) { @@ -423,10 +410,7 @@ namespace CalamityMod.Items modPlayer.canFireAtaxiaRangedProjectile = false; if (player.whoAmI == Main.myPlayer) { - int ataxiaFlareDamage = (int)(damage * 0.25); - if (modPlayer.oldFashioned) - ataxiaFlareDamage = CalamityUtils.CalcOldFashionedDamage(ataxiaFlareDamage); - + int ataxiaFlareDamage = player.ApplyArmorAccDamageBonusesTo(damage * 0.25f); Projectile.NewProjectile(source, position, velocity * 1.25f, ModContent.ProjectileType(), ataxiaFlareDamage, 2f, player.whoAmI); } } @@ -440,8 +424,7 @@ namespace CalamityMod.Items { // God Slayer Ranged Shrapnel: 100%, soft cap starts at 800 base damage int shrapnelRoundDamage = CalamityUtils.DamageSoftCap(damage, 800); - if (modPlayer.oldFashioned) - shrapnelRoundDamage = CalamityUtils.CalcOldFashionedDamage(shrapnelRoundDamage); + shrapnelRoundDamage = player.ApplyArmorAccDamageBonusesTo(shrapnelRoundDamage); Projectile.NewProjectile(source, position, velocity * 1.25f, ModContent.ProjectileType(), shrapnelRoundDamage, 2f, player.whoAmI); } @@ -456,8 +439,7 @@ namespace CalamityMod.Items // Ataxia Rogue Flares: 8 x 50%, soft cap starts at 120 base damage int flareDamage = CalamityUtils.DamageSoftCap(damage * 0.5, 120); - if (modPlayer.oldFashioned) - flareDamage = CalamityUtils.CalcOldFashionedDamage(flareDamage); + flareDamage = player.ApplyArmorAccDamageBonusesTo(flareDamage); if (player.whoAmI == Main.myPlayer) { @@ -485,8 +467,7 @@ namespace CalamityMod.Items { // Victide All-class Seashells: 200%, soft cap starts at 46 base damage int seashellDamage = CalamityUtils.DamageSoftCap(damage * 2, 46); - if (modPlayer.oldFashioned) - seashellDamage = CalamityUtils.CalcOldFashionedDamage(seashellDamage); + seashellDamage = player.ApplyArmorAccDamageBonusesTo(seashellDamage); Projectile.NewProjectile(source, position, velocity * 1.25f, ModContent.ProjectileType(), seashellDamage, 1f, player.whoAmI); } @@ -501,8 +482,7 @@ namespace CalamityMod.Items damageMult = 0.35; int newDamage = (int)(damage * 2 * damageMult); - if (modPlayer.oldFashioned) - newDamage = CalamityUtils.CalcOldFashionedDamage(newDamage); + newDamage = player.ApplyArmorAccDamageBonusesTo(newDamage); if (player.whoAmI == Main.myPlayer) { diff --git a/Items/Potions/Alcohol/OldFashioned.cs b/Items/Potions/Alcohol/OldFashioned.cs index 59455bc6d3..d1a68bde36 100644 --- a/Items/Potions/Alcohol/OldFashioned.cs +++ b/Items/Potions/Alcohol/OldFashioned.cs @@ -8,8 +8,9 @@ namespace CalamityMod.Items.Potions.Alcohol public class OldFashioned : ModItem, ILocalizedModType { public new string LocalizationCategory => "Items.Potions"; - public const float AccessoryAndSetBonusDamageMultiplier = 1.5f; - public const float DamageStatReduction = 0.25f; + + public static readonly float AccessoryAndSetBonusDamageMultiplier = 1.5f; + public static readonly float DamageStatReduction = 0.25f; public override void SetStaticDefaults() { diff --git a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs index 3a497c8f54..c92a58262a 100644 --- a/Items/VanillaArmorChanges/MythrilArmorSetChange.cs +++ b/Items/VanillaArmorChanges/MythrilArmorSetChange.cs @@ -52,8 +52,7 @@ namespace CalamityMod.Items.VanillaArmorChanges owner.Calamity().MythrilFlareSpawnCountdown = FlareFrameSpawnDelay; int flareDamage = CalamityUtils.DamageSoftCap(originalDamage * 0.4, FlareDamageSoftcap); - if (owner.Calamity().oldFashioned) - flareDamage = CalamityUtils.CalcOldFashionedDamage(flareDamage); + flareDamage = owner.ApplyArmorAccDamageBonusesTo(flareDamage); Vector2 flareSpawnPosition = victim.Center + Main.rand.NextVector2Circular(10f, 10f); Projectile.NewProjectile(owner.GetSource_ItemUse(owner.ActiveItem()), flareSpawnPosition, Vector2.Zero, ModContent.ProjectileType(), flareDamage, 0f, owner.whoAmI); diff --git a/Items/Weapons/Rogue/GraveGrimreaver.cs b/Items/Weapons/Rogue/GraveGrimreaver.cs index d029e9f33e..bf87f7278f 100644 --- a/Items/Weapons/Rogue/GraveGrimreaver.cs +++ b/Items/Weapons/Rogue/GraveGrimreaver.cs @@ -12,7 +12,7 @@ namespace CalamityMod.Items.Weapons.Rogue public override void SetDefaults() { Item.width = 80; - Item.damage = 31; + Item.damage = 84; Item.noMelee = true; Item.noUseGraphic = true; Item.useAnimation = 48; @@ -30,8 +30,8 @@ namespace CalamityMod.Items.Weapons.Rogue Item.Calamity().donorItem = true; } - public override float StealthDamageMultiplier => 0.45f; - public override float StealthVelocityMultiplier => 1f; + public override float StealthDamageMultiplier => 0.40f; + public override float StealthVelocityMultiplier => 1.75f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { diff --git a/Items/Weapons/Rogue/Sacrifice.cs b/Items/Weapons/Rogue/Sacrifice.cs index 87e6a7026f..87a880fec0 100644 --- a/Items/Weapons/Rogue/Sacrifice.cs +++ b/Items/Weapons/Rogue/Sacrifice.cs @@ -13,7 +13,7 @@ namespace CalamityMod.Items.Weapons.Rogue { public override void SetDefaults() { - Item.damage = 310; + Item.damage = 300; Item.width = Item.height = 68; Item.useAnimation = Item.useTime = 9; Item.noMelee = true; @@ -32,8 +32,8 @@ namespace CalamityMod.Items.Weapons.Rogue public override bool AltFunctionUse(Player player) => player.ownedProjectileCounts[Item.shoot] > 0; - public override float StealthDamageMultiplier => 1.7f; - public override float StealthVelocityMultiplier => 1.2f; + public override float StealthDamageMultiplier => 1.65f; + public override float StealthVelocityMultiplier => 1.5f; public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { @@ -52,6 +52,7 @@ namespace CalamityMod.Items.Weapons.Rogue Main.projectile[i].ModProjectile().AbleToHealOwner = attachedNPC.type != NPCID.TargetDummy && attachedNPC.type != ModContent.NPCType(); Main.projectile[i].netUpdate = true; } + //TODO: Add something here to avoid stealth being consumed return false; } diff --git a/Items/Weapons/Summon/UniverseSplitter.cs b/Items/Weapons/Summon/UniverseSplitter.cs index 7fc0d92333..51fe340cc5 100644 --- a/Items/Weapons/Summon/UniverseSplitter.cs +++ b/Items/Weapons/Summon/UniverseSplitter.cs @@ -31,7 +31,7 @@ namespace CalamityMod.Items.Weapons.Summon Item.DamageType = DamageClass.Summon; Item.mana = 300; - Item.damage = 18000; + Item.damage = 15000; Item.knockBack = 7f; Item.useTime = Item.useAnimation = 10; Item.shoot = ModContent.ProjectileType(); diff --git a/Localization/en-US/Mods.CalamityMod.Configs.hjson b/Localization/en-US/Mods.CalamityMod.Configs.hjson index 6d7a36f0c1..99b3e029a3 100644 --- a/Localization/en-US/Mods.CalamityMod.Configs.hjson +++ b/Localization/en-US/Mods.CalamityMod.Configs.hjson @@ -401,13 +401,14 @@ CalamityConfig: { ''' } - PlayerRespawnTime_BossAlive: { - Label: "[i:Stopwatch] Player Respawn Time while a Boss is Alive" - Tooltip: - ''' - Adjust the amount of time it takes for a player to respawn while a boss is alive, in seconds. - ''' - } + PlayerRespawnTime_BossAlive: { + Label: "[i:Stopwatch] Boss Fight Player Respawn Time" + Tooltip: + ''' + Sets the respawn time for players when a boss is alive, in seconds. This applies equally in single player and multiplayer. + When no boss is alive, players will respawn in 3 seconds in both single player and multiplayer. + ''' + } TownNPCSpawnRateMultiplier: { Label: "[i:GuideVoodooDoll] Town NPC Spawn Rate Multiplier" diff --git a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson index 737cee4b94..ee056d2018 100644 --- a/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson +++ b/Localization/en-US/Mods.CalamityMod.Items.Weapons.Melee.hjson @@ -14,7 +14,6 @@ AbyssBlade: { ''' Fires short-range tridents Hitting enemies will inflict the crush depth debuff - The lower the enemies' defense, the more damage they take from this debuff ''' } diff --git a/Localization/en-US/Mods.CalamityMod.NPCs.hjson b/Localization/en-US/Mods.CalamityMod.NPCs.hjson index 50fe92f84d..eadc7a82b3 100644 --- a/Localization/en-US/Mods.CalamityMod.NPCs.hjson +++ b/Localization/en-US/Mods.CalamityMod.NPCs.hjson @@ -313,7 +313,7 @@ DILF: { LikeNPC: "{NPCName} is well learned, and quite a respectable mage himself!" DislikeNPC: I dislike {NPCName}'s blatant disregard of magic. I cannot blame his functions, but he is quite ignorant. LikeNPC_Princess: "{NPCName} has some very quaint spells. I'm quite impressed, for someone of her age." - Princess_LovesNPC: I like {NPCName}. + Princess_LovesNPC: "{NPCName} makes the best ice cream I've ever tasted, it's so good!" } } @@ -404,7 +404,7 @@ FAP: { HateNPC_GoblinTinkerer: "{NPCName} was so terrible that I had to FORCE him to have a better reforge system. Why would you house me next to him? Do you enjoy watching me relive the stress he gave me!?" HateNPC_Angler: "{NPCName} never stops blabbering about his inane fishing quests. Get me away from him before I stomp him into the ground!" LikeNPC_Princess: You think I'd dislike {NPCName} because we're too different? Quite the contrary, there's a lot we like to talk about, over non-alcoholic drinks of course. - Princess_LovesNPC: I like {NPCName}. + Princess_LovesNPC: "{NPCName} has really interesting stories to tell, I learned a lot from her already!" HateNPC: I hate {NPCName}. DislikeNPC: I dislike {NPCName}. LikeNPC: I like {NPCName}. @@ -493,7 +493,7 @@ SEAHOE: { DislikeNPC: I've had quite enough carnage for one lifetime thank you! {NPCName}'s destructive tendencies are a bit insensitive. HateNPC: "{NPCName} is just a child, but his attitude towards marine life is unacceptable! Absolutely unacceptable!" LikeNPC_Princess: That child, {NPCName}. She is an innocent soul. Let us hope the horrors of war never reach her. - Princess_LovesNPC: I like {NPCName}. + Princess_LovesNPC: "{NPCName} always smiles when I'm nearby, I like being around him just for that!" } } @@ -574,7 +574,7 @@ THIEF: { LikeNPC: "{NPCName} doesn't only keep spiky balls in his pockets, he keeps a ton of cash! He's too absentminded to notice I'm stealing from him too! I like that a lot!" DislikeNPC: What a goody two shoes, {NPCName} is! I dislike her out of principle! …And because she has almost no material goods. LikeNPC_Princess: I couldn't bear to steal anything from {NPCName}, she's so cute! - Princess_LovesNPC: I like {NPCName}. + Princess_LovesNPC: "{NPCName} gifts me with nice exact replicas of other's things! I wonder where she gets them from..." } } @@ -616,6 +616,6 @@ WITCH: { LikeNPC: "{NPCName} is someone who's had a terrible experience being cursed. He's put up with it quite well all that time, it's quite impressive honestly." DislikeNPC: Such a racket! All {NPCName} does is make noise, day in and day out! I can't stand her! LikeNPC_Princess: What a strangely pleasant kid {NPCName} is to be around. - Princess_LovesNPC: I like {NPCName}. + Princess_LovesNPC: "{NPCName} is always lonely, it's why I want to hang out with her, no one should be left alone like that!" } } diff --git a/Projectiles/CalamityGlobalProjectile.cs b/Projectiles/CalamityGlobalProjectile.cs index 30bd80f47b..234d740617 100644 --- a/Projectiles/CalamityGlobalProjectile.cs +++ b/Projectiles/CalamityGlobalProjectile.cs @@ -2422,9 +2422,7 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 5) { int damage = (int)player.GetTotalDamage().ApplyTo(60); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); - + damage = player.ApplyArmorAccDamageBonusesTo(damage); Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); } } @@ -2436,8 +2434,7 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 5) { int damage = (int)player.GetTotalDamage().ApplyTo(42); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, 0f, projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) @@ -2453,8 +2450,7 @@ namespace CalamityMod.Projectiles if (projectile.owner == Main.myPlayer && player.ownedProjectileCounts[ProjectileType()] < 5) { int damage = (int)player.GetTotalDamage().ApplyTo(DragonScales.ShitBaseDamage); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); int proj = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.One.RotatedByRandom(MathHelper.TwoPi) * 1.2f, ProjectileType(), damage, 0f, projectile.owner); if (proj.WithinBounds(Main.maxProjectiles)) @@ -2474,8 +2470,7 @@ namespace CalamityMod.Projectiles { // Daedalus Rogue Crystals: 2 x 25%, soft cap starts at 120 base damage int crystalDamage = CalamityUtils.DamageSoftCap(projectile.damage * 0.25, 30); - if (modPlayer.oldFashioned) - crystalDamage = CalamityUtils.CalcOldFashionedDamage(crystalDamage); + crystalDamage = player.ApplyArmorAccDamageBonusesTo(crystalDamage); for (int i = 0; i < 2; i++) { @@ -3093,9 +3088,9 @@ namespace CalamityMod.Projectiles for (int i = 0; i < 2; i++) { Vector2 velocity = CalamityUtils.RandomVelocity(100f, 70f, 100f); + int damage = (int)player.GetTotalDamage().ApplyTo(20); - if (player.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); int soul = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, velocity, ProjectileType(), damage, 0f, projectile.owner); Main.projectile[soul].tileCollide = false; @@ -3107,8 +3102,7 @@ namespace CalamityMod.Projectiles if (modPlayer.scuttlersJewel && stealthStrike && modPlayer.scuttlerCooldown <= 0) { int damage = (int)player.GetTotalDamage().ApplyTo(18); - if (modPlayer.oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); int spike = Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ProjectileType(), damage, projectile.knockBack, projectile.owner); Main.projectile[spike].frame = 4; diff --git a/Projectiles/Rogue/GraveGrimreaverProjectile.cs b/Projectiles/Rogue/GraveGrimreaverProjectile.cs index 4c29030444..08df69e65f 100644 --- a/Projectiles/Rogue/GraveGrimreaverProjectile.cs +++ b/Projectiles/Rogue/GraveGrimreaverProjectile.cs @@ -38,10 +38,10 @@ namespace CalamityMod.Projectiles.Rogue SoundEngine.PlaySound(SoundID.Item7, Projectile.position); } - //Spawn a skull every 30 frames - if (Projectile.timeLeft % 30 == 0) + //Spawn a skull every 90 frames + if (Projectile.timeLeft % 90 == 0) { - Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0.2f, ModContent.ProjectileType(), Projectile.damage, Projectile.knockBack, Projectile.owner, 1f, 0f); + Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 0.2f, ModContent.ProjectileType(), (int)(Projectile.damage * 0.4f), Projectile.knockBack, Projectile.owner, 1f, 0f); } CalamityUtils.HomeInOnNPC(Projectile, true, 250f, 4f, 14f); @@ -71,7 +71,7 @@ namespace CalamityMod.Projectiles.Rogue DustExplosion(15, 6, 12, 30, 2.4f); for (int i = 0; i < 10; i++) { - CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 600f, 100f, 700f, 1000f, 20, ModContent.ProjectileType(), (int)(Projectile.damage * 0.75f), 3f, Projectile.owner); + CalamityUtils.ProjectileRain(Projectile.GetSource_FromThis(), Projectile.Center, 600f, 100f, 700f, 1000f, 20, ModContent.ProjectileType(), (int)(Projectile.damage * 0.35f), 3f, Projectile.owner); } } else diff --git a/Projectiles/Rogue/InkBombProjectile.cs b/Projectiles/Rogue/InkBombProjectile.cs index c7f63c6211..d4ee134514 100644 --- a/Projectiles/Rogue/InkBombProjectile.cs +++ b/Projectiles/Rogue/InkBombProjectile.cs @@ -67,8 +67,7 @@ namespace CalamityMod.Projectiles.Rogue break; } int damage = (int)player.GetTotalDamage().ApplyTo(22); - if (player.Calamity().oldFashioned) - damage = CalamityUtils.CalcOldFashionedDamage(damage); + damage = player.ApplyArmorAccDamageBonusesTo(damage); int inkID = Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center.X, Projectile.Center.Y, Main.rand.NextFloat(-2f, 2f), Main.rand.NextFloat(-2f, 2f), inkType, damage, 7, Projectile.owner); Main.projectile[inkID].timeLeft += Main.rand.Next(-20, 25); diff --git a/Projectiles/Rogue/SacrificeProjectile.cs b/Projectiles/Rogue/SacrificeProjectile.cs index 6f4b105ee6..af977d31af 100644 --- a/Projectiles/Rogue/SacrificeProjectile.cs +++ b/Projectiles/Rogue/SacrificeProjectile.cs @@ -45,7 +45,7 @@ namespace CalamityMod.Projectiles.Rogue if (ReturningToOwner) { - Projectile.timeLeft = 15; + Projectile.timeLeft = 20; Projectile.velocity = Projectile.SafeDirectionTo(Owner.Center) * 28f; Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.Pi + MathHelper.PiOver4; Projectile.damage = 0; @@ -55,7 +55,7 @@ namespace CalamityMod.Projectiles.Rogue { if (!Owner.moonLeech && AbleToHealOwner) { - int healAmount = Projectile.Calamity().stealthStrike ? 35 : 3; + int healAmount = Projectile.Calamity().stealthStrike ? 40 : 3; Owner.HealEffect(healAmount); Owner.statLife += healAmount; @@ -84,8 +84,8 @@ namespace CalamityMod.Projectiles.Rogue { if (Projectile.timeLeft > 90 && !Projectile.Calamity().stealthStrike) Projectile.timeLeft = 90; - else if (Projectile.timeLeft > 120 && Projectile.Calamity().stealthStrike) - Projectile.timeLeft = 120; + else if (Projectile.timeLeft > 180 && Projectile.Calamity().stealthStrike) + Projectile.timeLeft = 180; } Projectile.StickyProjAI(50); } diff --git a/Projectiles/Rogue/ScarletDevilProjectile.cs b/Projectiles/Rogue/ScarletDevilProjectile.cs index 7a11531294..a4f6404e97 100644 --- a/Projectiles/Rogue/ScarletDevilProjectile.cs +++ b/Projectiles/Rogue/ScarletDevilProjectile.cs @@ -129,8 +129,8 @@ namespace CalamityMod.Projectiles.Rogue if (!Main.player[Projectile.owner].moonLeech) { // Give on-heal effects from stealth strikes. - Main.player[Projectile.owner].statLife += 120; - Main.player[Projectile.owner].HealEffect(120); + Main.player[Projectile.owner].statLife += 90; + Main.player[Projectile.owner].HealEffect(90); } // And spawn a bloom of bullets. diff --git a/Projectiles/Summon/MiniGuardianAttack.cs b/Projectiles/Summon/MiniGuardianAttack.cs index cf558bf189..04a1022e36 100644 --- a/Projectiles/Summon/MiniGuardianAttack.cs +++ b/Projectiles/Summon/MiniGuardianAttack.cs @@ -2,7 +2,6 @@ using System.IO; using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Buffs.Summon.Whips; -using CalamityMod.Items.Potions.Alcohol; using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; using Terraria; @@ -360,9 +359,8 @@ namespace CalamityMod.Projectiles.Summon // Dynamically update stats here, originalDamage can be found in MiscEffects Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); - Projectile.localNPCHitCooldown = (SpawnedFromPSC ? 6 : 9); + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + Projectile.localNPCHitCooldown = SpawnedFromPSC ? 6 : 9; var currentAIState = getAiState; diff --git a/Projectiles/Summon/MiniGuardianHolyRay.cs b/Projectiles/Summon/MiniGuardianHolyRay.cs index 6e22b082f4..3e0f18d03c 100644 --- a/Projectiles/Summon/MiniGuardianHolyRay.cs +++ b/Projectiles/Summon/MiniGuardianHolyRay.cs @@ -1,19 +1,14 @@ -using CalamityMod.Buffs.DamageOverTime; -using CalamityMod.NPCs; -using CalamityMod.NPCs.ProfanedGuardians; +using System; +using System.IO; using CalamityMod.NPCs.Providence; -using CalamityMod.World; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using ReLogic.Content; -using System; -using System.IO; -using CalamityMod.Buffs.Summon.Whips; -using CalamityMod.Items.Potions.Alcohol; using Terraria; using Terraria.Enums; using Terraria.ID; using Terraria.ModLoader; + namespace CalamityMod.Projectiles.Summon { public class MiniGuardianHolyRay : ModProjectile, ILocalizedModType @@ -67,8 +62,7 @@ namespace CalamityMod.Projectiles.Summon Vector2 fireFrom = new Vector2(owner.Center.X, owner.Center.Y); Projectile.position = fireFrom - new Vector2(Projectile.width, Projectile.height) / 2f; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); } else Projectile.Kill(); diff --git a/Projectiles/Summon/MiniGuardianRock.cs b/Projectiles/Summon/MiniGuardianRock.cs index 3ebdd5ccce..6e5299604a 100644 --- a/Projectiles/Summon/MiniGuardianRock.cs +++ b/Projectiles/Summon/MiniGuardianRock.cs @@ -1,7 +1,6 @@ using System; using CalamityMod.Buffs.Summon.Whips; using CalamityMod.Dusts; -using CalamityMod.Items.Potions.Alcohol; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using Terraria; @@ -45,6 +44,8 @@ namespace CalamityMod.Projectiles.Summon { // Dynamically update stats here, originalDamage can be found in MiscEffects Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + // Despawn properly if (Owner.Calamity().pSoulGuardians && Projectile.ai[0] == 0f) Projectile.timeLeft = 4; @@ -54,9 +55,6 @@ namespace CalamityMod.Projectiles.Summon Projectile.active = false; return; } - - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); if (Projectile.ai[0] == 0f) //regular expected behaviour of floaty rocks { diff --git a/Projectiles/Summon/MiniGuardianStars.cs b/Projectiles/Summon/MiniGuardianStars.cs index 72b8d1d8f8..9730b86be7 100644 --- a/Projectiles/Summon/MiniGuardianStars.cs +++ b/Projectiles/Summon/MiniGuardianStars.cs @@ -1,13 +1,12 @@ -using CalamityMod.NPCs.Providence; +using System; +using CalamityMod.Items.Accessories; +using CalamityMod.NPCs.Providence; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; -using System; -using CalamityMod.Items.Accessories; -using CalamityMod.Items.Potions.Alcohol; using Terraria; +using Terraria.Audio; using Terraria.ID; using Terraria.ModLoader; -using Terraria.Audio; namespace CalamityMod.Projectiles.Summon { @@ -34,8 +33,7 @@ namespace CalamityMod.Projectiles.Summon Player owner = Main.player[Projectile.owner]; Projectile.damage = (int)owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); + Projectile.damage = owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); if (Projectile.ai[0] < 240f) { diff --git a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs index bcd75839b9..71cc0dd126 100644 --- a/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs +++ b/Projectiles/Summon/ProfanedSoulCrystalProjectiles.cs @@ -16,6 +16,7 @@ using Terraria.ModLoader; using Terraria.Audio; using Terraria.GameContent; using Vector2 = Microsoft.Xna.Framework.Vector2; +using static Humanizer.In; namespace CalamityMod.Projectiles.Summon { @@ -142,8 +143,7 @@ namespace CalamityMod.Projectiles.Summon Main.dust[num469].velocity *= 0f; var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); } public override Color? GetAlpha(Color lightColor) @@ -254,8 +254,7 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight(Projectile.Center, 0.5f, 0.1f, 0f); var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); if (Projectile.timeLeft == 600) { damage = Projectile.damage; @@ -456,8 +455,7 @@ namespace CalamityMod.Projectiles.Summon Lighting.AddLight(Projectile.Center, 1f, 0.2f, 0f); var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); } public override bool PreAI() @@ -730,9 +728,8 @@ namespace CalamityMod.Projectiles.Summon var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); - + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + Projectile.frameCounter++; if (Projectile.frameCounter > 8) { @@ -897,9 +894,8 @@ namespace CalamityMod.Projectiles.Summon { var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); - + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + Projectile.frameCounter++; if (Projectile.frameCounter > 4) { @@ -1020,9 +1016,8 @@ namespace CalamityMod.Projectiles.Summon { var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); - + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + if (Projectile.timeLeft > 120) { Projectile.rotation += 1f; @@ -1320,11 +1315,10 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { Player owner = Main.player[Projectile.owner]; - + Projectile.damage = (int)owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); - + Projectile.damage = owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + if (Projectile.ai[1] == 0f) { owner.itemAnimation = owner.itemAnimationMax; @@ -1792,14 +1786,12 @@ namespace CalamityMod.Projectiles.Summon public override void AI() { - var psc = Projectile.ai[0] > 0f; - //Ensure that psa's spears are not coloured by night - var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); - + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + + //Ensure that psa's spears are not coloured by night + var psc = Projectile.ai[0] > 0f; int pscState = (int)((!Main.dayTime && psc) ? Providence.BossMode.Night : Providence.BossMode.Day); int num469 = Dust.NewDust(new Vector2(Projectile.position.X, Projectile.position.Y), Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, !Main.dayTime && psc ? 0.5f : 1f); Main.dust[num469].noGravity = true; @@ -1941,9 +1933,8 @@ namespace CalamityMod.Projectiles.Summon { var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); - + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); + int pscState = (int)(Main.dayTime ? Providence.BossMode.Day : Providence.BossMode.Night); int num469 = Dust.NewDust(Projectile.Center, Projectile.width, Projectile.height, ProvUtils.GetDustID(pscState), 0f, 0f, 100, default, 1f); Main.dust[num469].noGravity = true; @@ -2061,8 +2052,7 @@ namespace CalamityMod.Projectiles.Summon var Owner = Main.player[Projectile.owner]; Projectile.damage = (int)Owner.GetTotalDamage().ApplyTo(Projectile.originalDamage); - if (Owner.Calamity().oldFashioned) - Projectile.damage = CalamityUtils.CalcOldFashionedDamage(Projectile.damage); + Projectile.damage = Owner.ApplyArmorAccDamageBonusesTo(Projectile.damage); Projectile.frameCounter++; if (Projectile.frameCounter > 6) diff --git a/Projectiles/Typeless/BossRushEffectThing.cs b/Projectiles/Typeless/BossRushEffectThing.cs index b91fdc6cfc..afd9b6d18a 100644 --- a/Projectiles/Typeless/BossRushEffectThing.cs +++ b/Projectiles/Typeless/BossRushEffectThing.cs @@ -65,7 +65,7 @@ namespace CalamityMod.Projectiles.Typeless BossRushEvent.BossRushActive = true; // Play startup dialogue - BossRushDialogueSystem.StartDialogue(DownedBossSystem.downedBossRush ? BossRushDialoguePhase.StartRepeat : BossRushDialoguePhase.Start); + BossRushDialogueSystem.StartDialogue(DownedBossSystem.startedBossRushAtLeastOnce ? BossRushDialoguePhase.StartRepeat : BossRushDialoguePhase.Start); CalamityNetcode.SyncWorld(); if (Main.netMode == NetmodeID.Server) diff --git a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs index ee06064842..81ace9a24d 100644 --- a/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs +++ b/Projectiles/VanillaProjectileOverrides/ChlorophyteCrystalAI.cs @@ -51,9 +51,8 @@ namespace CalamityMod.Projectiles.VanillaProjectileOverrides { if (Main.myPlayer == projectile.owner) { - int pulseDamage = (int)Main.player[projectile.owner].GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.BaseDamageToEnemies); - if (owner.Calamity().oldFashioned) - pulseDamage = CalamityUtils.CalcOldFashionedDamage(pulseDamage); + int pulseDamage = (int)owner.GetBestClassDamage().ApplyTo(ChlorophyteArmorSetChange.BaseDamageToEnemies); + pulseDamage = owner.ApplyArmorAccDamageBonusesTo(pulseDamage); Projectile.NewProjectile(projectile.GetSource_FromThis(), projectile.Center, Vector2.Zero, ModContent.ProjectileType(), pulseDamage, 0f, projectile.owner); } diff --git a/Systems/DownedBossSystem.cs b/Systems/DownedBossSystem.cs index ea88fe27a3..d8e5081616 100644 --- a/Systems/DownedBossSystem.cs +++ b/Systems/DownedBossSystem.cs @@ -54,6 +54,7 @@ namespace CalamityMod // Events internal static bool _downedEoCAcidRain = false; internal static bool _downedAquaticScourgeAcidRain = false; + internal static bool _startedBossRushAtLeastOnce = false; internal static bool _downedBossRush = false; // Betsy and Dreadnautilus because vanilla doesn't track them @@ -493,6 +494,11 @@ namespace CalamityMod NPC.SetEventFlagCleared(ref _downedAquaticScourgeAcidRain, -1); } } + public static bool startedBossRushAtLeastOnce + { + get => _startedBossRushAtLeastOnce; + set => _startedBossRushAtLeastOnce = value; // Starting Boss Rush for the first time does not trigger a Lantern Night + } public static bool downedBossRush { get => _downedBossRush; @@ -552,6 +558,8 @@ namespace CalamityMod downedMauler = false; downedNuclearTerror = false; + + startedBossRushAtLeastOnce = false; downedBossRush = false; } @@ -654,6 +662,9 @@ namespace CalamityMod downed.Add("mauler"); if (downedNuclearTerror) downed.Add("nuclearTerror"); + + if (startedBossRushAtLeastOnce) + downed.Add("startedBossRush"); if (downedBossRush) downed.Add("bossRush"); @@ -710,6 +721,8 @@ namespace CalamityMod downedMauler = downed.Contains("mauler"); downedNuclearTerror = downed.Contains("nuclearTerror"); + + startedBossRushAtLeastOnce = downed.Contains("startedBossRush"); downedBossRush = downed.Contains("bossRush"); } } diff --git a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs index b81be99a18..708d5f7550 100644 --- a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs +++ b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.cs @@ -12,22 +12,7 @@ namespace CalamityMod.Tiles.FurnitureWulfrum [LegacyName("WulfrumWorkbench")] public class WulfrumWorkBenchTile : ModTile { - public override void SetStaticDefaults() - { - Main.tileSolidTop[Type] = true; - Main.tileFrameImportant[Type] = true; - Main.tileNoAttach[Type] = true; - Main.tileTable[Type] = true; - TileObjectData.newTile.CopyFrom(TileObjectData.Style2x1); - TileObjectData.newTile.Width = 3; - TileObjectData.newTile.CoordinateHeights = new int[] { 18 }; - TileObjectData.addTile(Type); - - AddToArray(ref TileID.Sets.RoomNeeds.CountsAsTable); - AddMapEntry(new Color(191, 142, 111), Language.GetText("ItemName.WorkBench")); - TileID.Sets.DisableSmartCursor[Type] = true; - AdjTiles = new int[] { TileID.WorkBenches }; - } + public override void SetStaticDefaults() => this.SetUpWorkBench(ModContent.ItemType(), true); public override bool CanExplode(int i, int j) => false; diff --git a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.png b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.png index bc426b72c7..6f2a294722 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.png and b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTile.png differ diff --git a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTileGlow.png b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTileGlow.png index f7425e7835..9d0b5eca8d 100644 Binary files a/Tiles/FurnitureWulfrum/WulfrumWorkBenchTileGlow.png and b/Tiles/FurnitureWulfrum/WulfrumWorkBenchTileGlow.png differ diff --git a/Utilities/PlayerUtils.cs b/Utilities/PlayerUtils.cs index 34e0de9d2c..578c40e2fa 100644 --- a/Utilities/PlayerUtils.cs +++ b/Utilities/PlayerUtils.cs @@ -50,9 +50,6 @@ namespace CalamityMod public static float CalcDamage(this Player player, float baseDamage) where T : DamageClass => player.GetTotalDamage().ApplyTo(baseDamage); public static int CalcIntDamage(this Player player, float baseDamage) where T : DamageClass => (int)player.CalcDamage(baseDamage); - // Calculate and return Old Fashioned damage adjustment for Accessories and Set Bonuses. - public static int CalcOldFashionedDamage(int damage) => (int)(damage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); - // Naively determines the player's chosen (aka "best") class by whichever has the highest damage boost. public static DamageClass GetBestClass(this Player player) { @@ -130,6 +127,20 @@ namespace CalamityMod return ret; } + /// + /// Extension method which calculates the player's current multiplicative boost to armor set bonus and accessory damage.
+ /// This is currently only used by the Old Fashioned drink. + ///
+ /// The player whose armor / accessory damage bonus should be applied. + /// The damage to apply the bonus to. + /// Boosted damage. If no boosts are applicable, returns the damage parameter that was passed in. + public static int ApplyArmorAccDamageBonusesTo(this Player player, float damage) + { + if (!player.Calamity().oldFashioned) + return (int)damage; + return (int)(damage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + } + public static float GetRangedAmmoCostReduction(this Player player) { // Tally up all possible vanilla effects.