diff --git a/Balancing/BalancingConstants.cs b/Balancing/BalancingConstants.cs index 22226fc9c7..2322303648 100644 --- a/Balancing/BalancingConstants.cs +++ b/Balancing/BalancingConstants.cs @@ -119,12 +119,6 @@ #region Life Steal // Life steal cap (Maximum HP healed per instance of lifesteal) internal static readonly int LifeStealCap = 100; - - // Life steal accessories require a more strict cooldown due to their ease of use and global application - internal static readonly float LifeStealAccessoryCooldownMultiplier = 3f; - - // Life steal cooldown multipliers used for armor set bonuses - internal static readonly float LifeStealSetBonusCooldownMultiplier = 2f; // Base life steal caps from vanilla (aka, how much life steal the player is allowed before it goes on cooldown) internal static readonly float LifeStealCap_Classic = 80f; diff --git a/CalPlayer/CalamityPlayerOnHit.cs b/CalPlayer/CalamityPlayerOnHit.cs index 067448175b..f7aa30aabe 100644 --- a/CalPlayer/CalamityPlayerOnHit.cs +++ b/CalPlayer/CalamityPlayerOnHit.cs @@ -591,7 +591,7 @@ namespace CalamityMod.CalPlayer for (int i = 0; i <= 2; i++) { - Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(hit.Damage * 0.01)); + Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(hit.Damage * 0.01), 0.75f); } } @@ -1349,43 +1349,43 @@ namespace CalamityMod.CalPlayer if (proj.Calamity().stealthStrike) heal /= 2; // Stealth strikes heal half due to generally dealing far more dmg - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, BalancingConstants.LifeStealAccessoryCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, heal, 1.25f); } if (bloodyGlove && proj.CountsAsClass() && modProj.stealthStrike) - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, BalancingConstants.LifeStealAccessoryCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, 1.5f); if (bloodflareThrowing && proj.CountsAsClass() && crit) - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, BalancingConstants.LifeStealSetBonusCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2); if (bloodflareMelee && proj.IsTrueMelee()) - Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, BalancingConstants.LifeStealSetBonusCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2); if (proj.CountsAsClass() && Player.ActiveItem().CountsAsClass()) { if (manaOverloader) { double healMult = 0.1D - proj.numHits * 0.025D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealAccessoryCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.5f); } } if (silvaSet) { double healMult = 0.1D - proj.numHits * 0.05D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 0.75f); } else if (proj.CountsAsClass() && Player.ActiveItem().CountsAsClass()) { if (tarraMage) { double healMult = 0.1D - proj.numHits * 0.05D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult)); } else if (ataxiaMage) { double healMult = 0.1D - proj.numHits * 0.05D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), 1.25f); } } @@ -1394,7 +1394,7 @@ namespace CalamityMod.CalPlayer if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType()] < 3 && Player.ownedProjectileCounts[ProjectileType()] < 3) { double healMult = 0.1D - proj.numHits * 0.05D; - Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier); + Player.SpawnLifeStealProjectile(target, proj, ProjectileType(), (int)Math.Round(damage * healMult)); } } } @@ -1414,7 +1414,7 @@ namespace CalamityMod.CalPlayer } if (bloodflareMelee && item.CountsAsClass()) - Player.DoLifestealDirect(target, 4, BalancingConstants.LifeStealSetBonusCooldownMultiplier); + Player.DoLifestealDirect(target, 4); if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill) { diff --git a/DataStructures/Attunement.cs b/DataStructures/Attunement.cs index 683b8a49b1..8c36c52d84 100644 --- a/DataStructures/Attunement.cs +++ b/DataStructures/Attunement.cs @@ -508,11 +508,7 @@ namespace CalamityMod.DataStructures { if (Procced) { - if (!player.moonLeech) - { - player.HealPlayer(OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal); - } - + player.DoLifestealDirect(null, OmegaBiomeBlade.SuperPogoAttunement_PassiveLifeSteal); Procced = false; } } diff --git a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs index 8c7e3ac1c3..4f6706afe6 100644 --- a/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs +++ b/Projectiles/Melee/BrokenBiomeBlade_DecaysRetort.cs @@ -25,9 +25,6 @@ namespace CalamityMod.Projectiles.Melee public const float LungeSpeed = 16; public ref float CanBounce => ref Projectile.localAI[0]; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -91,20 +88,14 @@ namespace CalamityMod.Projectiles.Melee Owner.velocity = direction.SafeNormalize(Vector2.UnitX * Owner.direction) * LungeSpeed; } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - - private void OnHitEffects(bool cannotLifesteal) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { Projectile.ForceNetUpdate(); if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - if (!cannotLifesteal) //trolled - { - Owner.HealPlayer(BrokenBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck - } + Owner.DoLifestealDirect(target, BrokenBiomeBlade.EvilAttunement_Lifesteal, 1.25f); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; diff --git a/Projectiles/Melee/DevilsSunriseCyclone.cs b/Projectiles/Melee/DevilsSunriseCyclone.cs index cab7c87dbf..4e5e3888ab 100644 --- a/Projectiles/Melee/DevilsSunriseCyclone.cs +++ b/Projectiles/Melee/DevilsSunriseCyclone.cs @@ -141,9 +141,7 @@ namespace CalamityMod.Projectiles.Melee SoundEngine.PlaySound(HitSound, target.Center); target.AddBuff(ModContent.BuffType(), 180); // Heals on each hit - Player own = Main.player[Projectile.owner]; - if (!own.moonLeech) - own.HealPlayer(1); + Main.player[Projectile.owner].DoLifestealDirect(target, 1, 0.75f); // Start slicing the hit enemy if not doing so already if (State != 2f) diff --git a/Projectiles/Melee/EarthHoldout.cs b/Projectiles/Melee/EarthHoldout.cs index 8406697e38..05d8f0727f 100644 --- a/Projectiles/Melee/EarthHoldout.cs +++ b/Projectiles/Melee/EarthHoldout.cs @@ -306,7 +306,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(healPower - Projectile.numHits * 75, 1, healPower)); if (Projectile.numHits < 10) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.1f); } if (Projectile.numHits <= 2) diff --git a/Projectiles/Melee/GrandDadHoldout.cs b/Projectiles/Melee/GrandDadHoldout.cs index a1cf5ba28d..df2af4e30b 100644 --- a/Projectiles/Melee/GrandDadHoldout.cs +++ b/Projectiles/Melee/GrandDadHoldout.cs @@ -234,7 +234,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(20 - Projectile.numHits * 12, 1, 20)); if (Projectile.numHits < 10) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.5f); } if (target.CanBeMoved(true) || Main.zenithWorld || target.type == ModContent.NPCType() || (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs)) diff --git a/Projectiles/Melee/GrandGuardianHoldout.cs b/Projectiles/Melee/GrandGuardianHoldout.cs index d184324240..1b9181626a 100644 --- a/Projectiles/Melee/GrandGuardianHoldout.cs +++ b/Projectiles/Melee/GrandGuardianHoldout.cs @@ -215,7 +215,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(5 - Projectile.numHits * 3, 1, 5)); if (Projectile.numHits < 5) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal, 0.75f); } int points = 4; diff --git a/Projectiles/Melee/MajesticGuardHoldout.cs b/Projectiles/Melee/MajesticGuardHoldout.cs index b336a0b32d..1ec5cb2f5f 100644 --- a/Projectiles/Melee/MajesticGuardHoldout.cs +++ b/Projectiles/Melee/MajesticGuardHoldout.cs @@ -194,7 +194,7 @@ namespace CalamityMod.Projectiles.Melee int heal = (int)(MathHelper.Clamp(7 - Projectile.numHits * 5, 1, 7)); if (Projectile.numHits < 5) { - Owner.HealPlayer(heal); + Owner.DoLifestealDirect(target, heal); } Vector2 launchVel = Utils.DirectionTo(Owner.Center, Owner.Calamity().mouseWorld); diff --git a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs index 56033def56..966f0d858e 100644 --- a/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs +++ b/Projectiles/Melee/MendedBiomeBlade_TrueDecaysRetort.cs @@ -30,9 +30,6 @@ namespace CalamityMod.Projectiles.Melee private Vector2 PowerLungeStart; - public override void SetStaticDefaults() - { - } public override void SetDefaults() { Projectile.DamageType = DamageClass.Melee; @@ -140,10 +137,7 @@ namespace CalamityMod.Projectiles.Melee Owner.GiveUniversalIFrames(TrueBiomeBlade.EvilAttunement_SlashIFrames); } - public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - public override void OnHitPlayer(Player target, Player.HurtInfo info) => OnHitEffects(Main.player[Projectile.owner].moonLeech); - - private void OnHitEffects(bool cannotLifesteal) + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) { if (ChargedUp) return; @@ -153,10 +147,7 @@ namespace CalamityMod.Projectiles.Melee if (Main.myPlayer != Owner.whoAmI || CanBounce == 0f) return; - if (!cannotLifesteal) //trolled - { - Owner.HealPlayer(TrueBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck - } + Owner.DoLifestealDirect(target, TrueBiomeBlade.EvilAttunement_Lifesteal); //Idk if its too much or what but at the same time its close range as fuck // Bounce off float bounceStrength = LungeSpeed / 2f; diff --git a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs index 47863bc102..cd19d30216 100644 --- a/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs +++ b/Projectiles/Melee/TrueBiomeBlade_SanguineFuryDash.cs @@ -57,10 +57,7 @@ namespace CalamityMod.Projectiles.Melee GeneralParticleHandler.SpawnParticle(Spark); } - if (Owner.moonLeech) - return; - - Owner.HealPlayer(OmegaBiomeBlade.SuperPogoAttunementSliceLifesteal); + Owner.DoLifestealDirect(target, OmegaBiomeBlade.SuperPogoAttunementSliceLifesteal, 0.75f); } public override bool PreDraw(ref Color lightColor) //OMw to reuse way too much code from the entangling vines