LIFE STEAL!!!11!!!!!
This commit is contained in:
1 parent
bfa59def06
commit
66ce058526
9 files changed
+53
-45
No files matched your search
@@ -105,22 +105,30 @@
|
||||
internal static readonly float LifeStealCapReduction_Master = 10f;
|
||||
|
||||
// The base life steal cooldowns from vanilla
|
||||
internal static readonly float LifeStealRecoveryRate_Classic = 0.8f;
|
||||
internal static readonly float LifeStealRecoveryRate_Expert = 0.7f;
|
||||
internal static readonly float LifeStealRecoveryRate_Classic = 0.6f;
|
||||
internal static readonly float LifeStealRecoveryRate_Expert = 0.5f;
|
||||
|
||||
// Nerfs the life steal recovery rate in Classic from 0.8/s to 0.4/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.4f;
|
||||
// The calculations below show the time (in frames) for 10 life steal cooldown to recover in each difficulty
|
||||
// Classic: 10 / 0.3 = 33.333
|
||||
// Expert: 10 / 0.2 = 50
|
||||
// Revengeance: 10 / 0.15 = 66.667
|
||||
// Death: 10 / 0.125 = 80
|
||||
// Master: 10 / 0.15 = 66.667
|
||||
// Revengeance Master: 10 / 0.1 = 100
|
||||
// Death Master: 10 / 0.075 = 133.333
|
||||
// Nerfs the life steal recovery rate in Classic from 0.6/s to 0.3/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Classic = 0.3f;
|
||||
|
||||
// Nerfs the life steal recovery rate in Expert from 0.7/s to 0.35/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.35f;
|
||||
// Nerfs the life steal recovery rate in Expert from 0.5/s to 0.2/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Expert = 0.3f;
|
||||
|
||||
// Nerfs the life steal recovery rate in Revengeance from 0.7/s to 0.3/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Revengeance = 0.4f;
|
||||
// Nerfs the life steal recovery rate in Revengeance from 0.5/s to 0.15/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Revengeance = 0.35f;
|
||||
|
||||
// Nerfs the life steal recovery rate in Death from 0.7/s to 0.25/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Death = 0.45f;
|
||||
// Nerfs the life steal recovery rate in Death from 0.5/s to 0.125/s
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Death = 0.375f;
|
||||
|
||||
// Nerfs the life steal recovery rate in Master by 0.05/s, resulting in 0.3/s in non-Rev Master, 0.25/s in Rev Master, and 0.2/s in Death Master
|
||||
// Nerfs the life steal recovery rate in Master by 0.05/s, resulting in 0.2/s in non-Rev Master, 0.15/s in Rev Master, and 0.1/s in Death Master (10 / 0.1 = 100)
|
||||
internal static readonly float LifeStealRecoveryRateReduction_Master = 0.05f;
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -3598,17 +3598,11 @@ namespace CalamityMod.CalPlayer
|
||||
lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master;
|
||||
|
||||
float lifeStealRecoveryRate = baseRecoveryRate - lifeStealRecoveryRateReduction;
|
||||
|
||||
// This value is here to somewhat prevent the rapid cooldown flashing that happens sometimes.
|
||||
float cooldownDisplayGateValue = 12f;
|
||||
float displayLifeStealCooldownGateValue = lifeStealRecoveryRate * cooldownDisplayGateValue;
|
||||
if (Player.lifeSteal < -displayLifeStealCooldownGateValue)
|
||||
if (Player.lifeSteal < -lifeStealRecoveryRate)
|
||||
{
|
||||
float duration = Math.Abs(Player.lifeSteal);
|
||||
duration /= lifeStealRecoveryRate;
|
||||
|
||||
if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < (int)duration))
|
||||
Player.AddCooldown(LifeSteal.ID, (int)duration);
|
||||
int duration = (int)Math.Ceiling(Math.Abs(Player.lifeSteal) / lifeStealRecoveryRate);
|
||||
if (!Player.HasCooldown(LifeSteal.ID) || (cooldowns[LifeSteal.ID].duration < duration))
|
||||
Player.AddCooldown(LifeSteal.ID, duration);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -901,10 +901,10 @@ namespace CalamityMod.CalPlayer
|
||||
if (Player.lifeSteal > lifeStealCap)
|
||||
Player.lifeSteal = lifeStealCap;
|
||||
|
||||
// Normal Mode life steal recovery rate is 0.4/s
|
||||
// Expert Mode life steal recovery rate is 0.35/s
|
||||
// Revengeance Mode life steal recovery rate is 0.3/s
|
||||
// Death Mode life steal recovery rate is 0.25/s
|
||||
// Normal Mode life steal recovery rate is 0.3/s
|
||||
// Expert Mode life steal recovery rate is 0.2/s
|
||||
// Revengeance Mode life steal recovery rate is 0.15/s
|
||||
// Death Mode life steal recovery rate is 0.125/s
|
||||
// Master Mode life steal recovery rate is nerfed by an additional 0.05/s
|
||||
float lifeStealRecoveryRateReduction =
|
||||
CalamityWorld.death ? BalancingConstants.LifeStealRecoveryRateReduction_Death :
|
||||
@@ -915,7 +915,8 @@ namespace CalamityMod.CalPlayer
|
||||
if (Main.masterMode)
|
||||
lifeStealRecoveryRateReduction += BalancingConstants.LifeStealRecoveryRateReduction_Master;
|
||||
|
||||
Player.lifeSteal -= lifeStealRecoveryRateReduction;
|
||||
if (Player.lifeSteal < lifeStealCap)
|
||||
Player.lifeSteal -= lifeStealRecoveryRateReduction;
|
||||
|
||||
// Bool for drawing boss health bar small text or not
|
||||
if (Main.myPlayer == Player.whoAmI)
|
||||
|
||||
@@ -112,11 +112,11 @@ namespace CalamityMod.CalPlayer
|
||||
|
||||
case ItemID.CandyCaneSword:
|
||||
|
||||
if (Player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (Player.moonLeech || Player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = 2;
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
Player.lifeSteal -= heal;
|
||||
Player.statLife += heal;
|
||||
Player.HealEffect(heal);
|
||||
if (Player.statLife > Player.statLifeMax2)
|
||||
|
||||
@@ -84,11 +84,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
if (target.Calamity().miscDefenseLoss < target.defense)
|
||||
target.Calamity().miscDefenseLoss += 1;
|
||||
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = Main.rand.Next(1, 70);
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
@@ -143,11 +143,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Projectile.NewProjectile(source, realPlayerPos.X, realPlayerPos.Y, speedX4, speedY5, ModContent.ProjectileType<EarthProj>(), earthDamage, Item.knockBack, player.whoAmI, 0f, (float)Main.rand.Next(10));
|
||||
}
|
||||
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = Main.rand.Next(1, 70);
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
|
||||
@@ -42,11 +42,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
if (target.Calamity().miscDefenseLoss >= target.defense)
|
||||
{
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = 4;
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
int heal = 6;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
|
||||
@@ -52,6 +52,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.rare = ModContent.RarityType<Rainbow>();
|
||||
}
|
||||
|
||||
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
||||
{
|
||||
player.itemLocation += new Vector2(-12f * player.direction, 2f * player.gravDir).RotatedBy(player.itemRotation);
|
||||
}
|
||||
|
||||
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
||||
{
|
||||
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Weapons/Melee/IridescentExcaliburGlow").Value);
|
||||
@@ -167,11 +172,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 600);
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
|
||||
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = Main.rand.Next(3) + 10;
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
@@ -183,11 +188,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
target.AddBuff(ModContent.BuffType<MiracleBlight>(), 600);
|
||||
target.AddBuff(ModContent.BuffType<GlacialState>(), 60);
|
||||
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = Main.rand.Next(3) + 10;
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
|
||||
@@ -39,11 +39,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone)
|
||||
{
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = 5;
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
@@ -52,11 +52,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, Player.HurtInfo hurtInfo)
|
||||
{
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = 5;
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
|
||||
@@ -31,11 +31,11 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
if (target.Calamity().miscDefenseLoss >= target.defense)
|
||||
{
|
||||
if (player.moonLeech || Main.player[Main.myPlayer].lifeSteal <= 0f)
|
||||
if (player.moonLeech || player.lifeSteal <= 0f)
|
||||
return;
|
||||
|
||||
int heal = 3;
|
||||
Main.player[Main.myPlayer].lifeSteal -= heal;
|
||||
player.lifeSteal -= heal;
|
||||
player.statLife += heal;
|
||||
player.HealEffect(heal);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
|
||||
Reference in new issue
Block a user