lifesteal conversions

This commit is contained in:
Altixal authored and Cameron Ewell committed 2025-07-03 11:33:17 -04:00
1 parent 9f06d20635
commit 37005aa532
11 files changed
+22 -55

No files matched your search

-6
View File
@@ -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;
+11 -11
View File
@@ -591,7 +591,7 @@ namespace CalamityMod.CalPlayer
for (int i = 0; i <= 2; i++)
{
Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType<AltTransfusionTrail>(), (int)Math.Round(hit.Damage * 0.01));
Main.player[proj.owner].SpawnLifeStealProjectile(target, proj, ProjectileType<AltTransfusionTrail>(), (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<RogueDamageClass>() && modProj.stealthStrike)
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, BalancingConstants.LifeStealAccessoryCooldownMultiplier);
Player.SpawnLifeStealProjectile(target, proj, ProjectileID.VampireHeal, 2, 1.5f);
if (bloodflareThrowing && proj.CountsAsClass<ThrowingDamageClass>() && 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<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (manaOverloader)
{
double healMult = 0.1D - proj.numHits * 0.025D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealAccessoryCooldownMultiplier);
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ManaPolarizerHealOrb>(), (int)Math.Round(damage * healMult), 1.5f);
}
}
if (silvaSet)
{
double healMult = 0.1D - proj.numHits * 0.05D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<SilvaOrb>(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier);
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<SilvaOrb>(), (int)Math.Round(damage * healMult), 0.75f);
}
else if (proj.CountsAsClass<MagicDamageClass>() && Player.ActiveItem().CountsAsClass<MagicDamageClass>())
{
if (tarraMage)
{
double healMult = 0.1D - proj.numHits * 0.05D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ReaverHealOrb>(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier);
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<ReaverHealOrb>(), (int)Math.Round(damage * healMult));
}
else if (ataxiaMage)
{
double healMult = 0.1D - proj.numHits * 0.05D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<HydrothermicHealOrb>(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier);
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<HydrothermicHealOrb>(), (int)Math.Round(damage * healMult), 1.25f);
}
}
@@ -1394,7 +1394,7 @@ namespace CalamityMod.CalPlayer
if (xerocSet && xerocDmg <= 0 && Player.ownedProjectileCounts[ProjectileType<EmpyreanEmber>()] < 3 && Player.ownedProjectileCounts[ProjectileType<EmpyreanBlast>()] < 3)
{
double healMult = 0.1D - proj.numHits * 0.05D;
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<EmpyreanHealOrb>(), (int)Math.Round(damage * healMult), BalancingConstants.LifeStealSetBonusCooldownMultiplier);
Player.SpawnLifeStealProjectile(target, proj, ProjectileType<EmpyreanHealOrb>(), (int)Math.Round(damage * healMult));
}
}
}
@@ -1414,7 +1414,7 @@ namespace CalamityMod.CalPlayer
}
if (bloodflareMelee && item.CountsAsClass<MeleeDamageClass>())
Player.DoLifestealDirect(target, 4, BalancingConstants.LifeStealSetBonusCooldownMultiplier);
Player.DoLifestealDirect(target, 4);
if (gladiatorSword && target.life <= 0 && target.Calamity().gladiatorOnKill)
{
+1 -5
View File
@@ -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;
}
}
@@ -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;
+1 -3
View File
@@ -141,9 +141,7 @@ namespace CalamityMod.Projectiles.Melee
SoundEngine.PlaySound(HitSound, target.Center);
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 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)
+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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<PrimordialWyrmHead>() || (DownedBossSystem.downedCalamitas && DownedBossSystem.downedExoMechs))
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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);
@@ -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;
@@ -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