From a45e515d9b8fec46709467e4aa012ccf55fe1530 Mon Sep 17 00:00:00 2001 From: mountaindrew10 Date: Mon, 20 Nov 2023 23:30:55 -0600 Subject: [PATCH] Old Fashioned support for all Restorative accessories that deal damage. --- CalPlayer/CalamityPlayer.cs | 6 +++++- CalPlayer/CalamityPlayerHitHurt.cs | 3 +++ CalPlayer/CalamityPlayerMiscEffects.cs | 2 ++ CalPlayer/CalamityPlayerOnHit.cs | 9 +++++++++ CalPlayer/Dashes/AsgardianAegisDash.cs | 4 ++++ Items/Accessories/NebulousCore.cs | 4 ++++ 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/CalPlayer/CalamityPlayer.cs b/CalPlayer/CalamityPlayer.cs index 4c43488d94..a009f92c8c 100644 --- a/CalPlayer/CalamityPlayer.cs +++ b/CalPlayer/CalamityPlayer.cs @@ -2738,7 +2738,11 @@ namespace CalamityMod.CalPlayer { Projectile proj = Main.projectile[projIndex]; float start = 360f / angelAmt; - 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(), proj.damage / 10, proj.knockBack / 10f, Player.whoAmI, Main.rand.Next(180), projIndex * start); + int damage = proj.damage / 10; + if (oldFashioned) + damage = (int)(damage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + + 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; Player.HealEffect(2); } diff --git a/CalPlayer/CalamityPlayerHitHurt.cs b/CalPlayer/CalamityPlayerHitHurt.cs index 0918cd6cfa..3f82c18c2b 100644 --- a/CalPlayer/CalamityPlayerHitHurt.cs +++ b/CalPlayer/CalamityPlayerHitHurt.cs @@ -2414,6 +2414,9 @@ namespace CalamityMod.CalPlayer for (int n = 0; n < 3; n++) { int deificStarDamage = (int)Player.GetBestClassDamage().ApplyTo(130); + if (oldFashioned) + deificStarDamage = (int)(deificStarDamage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + Projectile star = CalamityUtils.ProjectileRain(source, Player.Center, 400f, 100f, 500f, 800f, 29f, ProjectileID.StarVeilStar, deificStarDamage, 4f, Player.whoAmI); if (star.whoAmI.WithinBounds(Main.maxProjectiles)) { diff --git a/CalPlayer/CalamityPlayerMiscEffects.cs b/CalPlayer/CalamityPlayerMiscEffects.cs index 36e27ba49f..25d43c2f58 100644 --- a/CalPlayer/CalamityPlayerMiscEffects.cs +++ b/CalPlayer/CalamityPlayerMiscEffects.cs @@ -3213,6 +3213,8 @@ namespace CalamityMod.CalPlayer int guardianAmt = 1; float babCheck = profanedCrystal ? 1f : 0f; int babDamage = profanedCrystal ? 346 : 52; + if (oldFashioned) + babDamage = (int)(babDamage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); if (Player.ownedProjectileCounts[ModContent.ProjectileType()] < guardianAmt) { diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index de83731648..b254301232 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -614,6 +614,9 @@ namespace CalamityMod.CalPlayer if (Player.ownedProjectileCounts[ProjectileType()] < 3 && Main.rand.NextBool(10)) { int damage = (int)Player.GetTotalDamage().ApplyTo(100); + if (oldFashioned) + damage = (int)(damage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + Projectile.NewProjectile(source, proj.position, proj.velocity, ProjectileType(), damage, 1f, Player.whoAmI); } } @@ -701,6 +704,9 @@ 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 = (int)(hallowedDamage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + Projectile.NewProjectile(source, spawnPosition, Vector2.Normalize(position - spawnPosition) * speed, ProjectileType(), hallowedDamage, 3f, proj.owner); } } @@ -919,6 +925,9 @@ namespace CalamityMod.CalPlayer { Vector2 velocity = CalamityUtils.RandomVelocity(50f, 30f, 60f); int damage = (int)Player.GetTotalDamage().ApplyTo(9); + if (oldFashioned) + damage = (int)(damage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + int spark = Projectile.NewProjectile(spawnSource, position, velocity, ProjectileType(), damage, 0f, Player.whoAmI); if (spark.WithinBounds(Main.maxProjectiles)) { diff --git a/CalPlayer/Dashes/AsgardianAegisDash.cs b/CalPlayer/Dashes/AsgardianAegisDash.cs index 7cc66bec8c..91ea58a4f6 100644 --- a/CalPlayer/Dashes/AsgardianAegisDash.cs +++ b/CalPlayer/Dashes/AsgardianAegisDash.cs @@ -3,6 +3,7 @@ using CalamityMod.Buffs.DamageOverTime; using CalamityMod.Dusts; using CalamityMod.Enums; using CalamityMod.Items.Accessories; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Particles; using CalamityMod.Projectiles.Typeless; using Microsoft.Xna.Framework; @@ -75,6 +76,9 @@ namespace CalamityMod.CalPlayer.Dashes hitContext.Damage = (int)player.GetTotalDamage().ApplyTo(300f); int supremeExplosionDamage = (int)player.GetBestClassDamage().ApplyTo(135); + if (player.Calamity().oldFashioned) + supremeExplosionDamage = (int)(supremeExplosionDamage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + Projectile.NewProjectile(source, player.Center, Vector2.Zero, ModContent.ProjectileType(), supremeExplosionDamage, 20f, Main.myPlayer, 3f, 0f); npc.AddBuff(ModContent.BuffType(), 300); } diff --git a/Items/Accessories/NebulousCore.cs b/Items/Accessories/NebulousCore.cs index 1806d72212..6d0d57b40f 100644 --- a/Items/Accessories/NebulousCore.cs +++ b/Items/Accessories/NebulousCore.cs @@ -1,4 +1,5 @@ using CalamityMod.CalPlayer; +using CalamityMod.Items.Potions.Alcohol; using CalamityMod.Projectiles.Typeless; using CalamityMod.Rarities; using Microsoft.Xna.Framework; @@ -91,6 +92,9 @@ namespace CalamityMod.Items.Accessories } if (canSpawnProj && Main.myPlayer == player.whoAmI) { + if (modPlayer.oldFashioned) + damage = (int)(damage * OldFashioned.AccessoryAndSetBonusDamageMultiplier); + Projectile.NewProjectile(source, center.X, center.Y, 0f, 0f, ModContent.ProjectileType(), damage, knockBack, player.whoAmI); return; }