fixed certain healing pots working under iron heart
This commit is contained in:
1 parent
1d08285c2a
commit
0e4062eb31
6 files changed
+34
-35
No files matched your search
@@ -391,7 +391,7 @@ namespace CalamityMod.CalPlayer
|
||||
if (player.whoAmI == Main.myPlayer && modPlayer.bloodfinTimer <= 0)
|
||||
{
|
||||
modPlayer.bloodfinTimer = 30;
|
||||
if (player.statLife <= (int)(player.statLifeMax2 * 0.75))
|
||||
if (player.statLife <= (int)(player.statLifeMax2 * 0.75) && !CalamityWorld.ironHeart)
|
||||
player.statLife += 1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Buffs.Potions;
|
||||
using CalamityMod.World;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace CalamityMod.Items.Fishing.BrimstoneCragCatches
|
||||
@@ -38,14 +39,16 @@ The life regen boost is stronger if below 75% health");
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
player.statLife += 240;
|
||||
int healAmt = CalamityWorld.ironHeart ? 0 : 240;
|
||||
player.statLife += healAmt;
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
{
|
||||
player.statLife = player.statLifeMax2;
|
||||
}
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
player.HealEffect(240, true);
|
||||
if (!CalamityWorld.ironHeart)
|
||||
player.HealEffect(healAmt, true);
|
||||
}
|
||||
player.AddBuff(ModContent.BuffType<BloodfinBoost>(), 600);
|
||||
|
||||
@@ -63,7 +66,7 @@ The life regen boost is stronger if below 75% health");
|
||||
// Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function).
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life";
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.World;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -40,7 +41,8 @@ Reduces defense by 2 and movement speed by 5%");
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
player.statLife += 100;
|
||||
int healAmt = CalamityWorld.ironHeart ? 0 : 100;
|
||||
player.statLife += healAmt;
|
||||
player.statMana += 100;
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
{
|
||||
@@ -53,7 +55,8 @@ Reduces defense by 2 and movement speed by 5%");
|
||||
player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true);
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
player.HealEffect(100, true);
|
||||
if (!CalamityWorld.ironHeart)
|
||||
player.HealEffect(healAmt, true);
|
||||
player.ManaEffect(100);
|
||||
}
|
||||
player.AddBuff(ModContent.BuffType<GrapeBeerBuff>(), 3600);
|
||||
@@ -68,7 +71,7 @@ Reduces defense by 2 and movement speed by 5%");
|
||||
// Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function).
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life";
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using CalamityMod.Buffs.Alcohol;
|
||||
using CalamityMod.World;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -43,7 +44,8 @@ Reduces defense by 6 and life regen by 1");
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
player.statLife += 200;
|
||||
int healAmt = CalamityWorld.ironHeart ? 0 : 200;
|
||||
player.statLife += healAmt;
|
||||
player.statMana += 200;
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
{
|
||||
@@ -56,7 +58,8 @@ Reduces defense by 6 and life regen by 1");
|
||||
player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true);
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
player.HealEffect(200, true);
|
||||
if (!CalamityWorld.ironHeart)
|
||||
player.HealEffect(healAmt, true);
|
||||
player.ManaEffect(200);
|
||||
}
|
||||
player.AddBuff(ModContent.BuffType<MargaritaBuff>(), 10800);
|
||||
@@ -71,7 +74,7 @@ Reduces defense by 6 and life regen by 1");
|
||||
// Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function).
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life";
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -34,33 +34,20 @@ Reduces life regen by 1");
|
||||
|
||||
public override bool CanUseItem(Player player)
|
||||
{
|
||||
return player.FindBuffIndex(BuffID.PotionSickness) == -1;
|
||||
if (player.Calamity().baguette)
|
||||
{
|
||||
item.healLife = 250;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.healLife = 200;
|
||||
}
|
||||
return base.CanUseItem(player);
|
||||
}
|
||||
|
||||
public override void OnConsumeItem(Player player)
|
||||
{
|
||||
player.statLife += (player.Calamity().baguette ? 250 : 200);
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
{
|
||||
player.statLife = player.statLifeMax2;
|
||||
}
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
player.HealEffect((player.Calamity().baguette ? 250 : 200), true);
|
||||
}
|
||||
player.AddBuff(ModContent.BuffType<RedWineBuff>(), 900);
|
||||
}
|
||||
|
||||
// Zeroes out the hardcoded healing function from having a healLife value. The item still heals in the UseItem hook.
|
||||
public override void GetHealLife(Player player, bool quickHeal, ref int healValue)
|
||||
{
|
||||
healValue = 0;
|
||||
}
|
||||
|
||||
// Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function).
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
using CalamityMod.Items.Placeables;
|
||||
using CalamityMod.Items.Fishing.BrimstoneCragCatches;
|
||||
using CalamityMod.World;
|
||||
using System.Collections.Generic;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
@@ -43,7 +44,8 @@ Grants Well Fed");
|
||||
|
||||
public override bool UseItem(Player player)
|
||||
{
|
||||
player.statLife += 120;
|
||||
int healAmt = CalamityWorld.ironHeart ? 0 : 120;
|
||||
player.statLife += healAmt;
|
||||
player.statMana += 150;
|
||||
if (player.statLife > player.statLifeMax2)
|
||||
{
|
||||
@@ -56,7 +58,8 @@ Grants Well Fed");
|
||||
player.AddBuff(BuffID.ManaSickness, Player.manaSickTime, true);
|
||||
if (Main.myPlayer == player.whoAmI)
|
||||
{
|
||||
player.HealEffect(120, true);
|
||||
if (!CalamityWorld.ironHeart)
|
||||
player.HealEffect(healAmt, true);
|
||||
player.ManaEffect(150);
|
||||
}
|
||||
|
||||
@@ -76,7 +79,7 @@ Grants Well Fed");
|
||||
// Forces the "Restores X life" tooltip to display the actual life restored instead of zero (due to the previous function).
|
||||
public override void ModifyTooltips(List<TooltipLine> tooltips)
|
||||
{
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + item.healLife + " life";
|
||||
tooltips.Find(line => line.Name == "HealLife").text = "Restores " + (CalamityWorld.ironHeart ? 0 : item.healLife) + " life";
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
|
||||
Reference in new issue
Block a user