2 - Changed life fruit upgrade recipes. 3 - DoG phase 2 teleport refactor. 4 - Reduced life fruit spawns pre-mech by 3x.
71 lines
2.3 KiB
C#
71 lines
2.3 KiB
C#
using CalamityMod.CalPlayer;
|
|
using CalamityMod.Items.Materials;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.PermanentBoosters
|
|
{
|
|
public class BloodOrange : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Blood Orange");
|
|
Tooltip.SetDefault("It has a distinctly sweet flavor and a strong aroma\n" +
|
|
"Permanently increases maximum life by 25\n" +
|
|
"Can only be used if the max amount of life fruit has been consumed");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 20;
|
|
item.height = 20;
|
|
item.useAnimation = 30;
|
|
item.rare = ItemRarityID.LightPurple;
|
|
item.useTime = 30;
|
|
item.useStyle = ItemUseStyleID.HoldingUp;
|
|
item.UseSound = SoundID.Item4;
|
|
item.consumable = true;
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
CalamityPlayer modPlayer = player.Calamity();
|
|
if (modPlayer.bOrange || player.statLifeMax < 500)
|
|
{
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public override bool UseItem(Player player)
|
|
{
|
|
if (player.itemAnimation > 0 && player.itemTime == 0)
|
|
{
|
|
player.itemTime = item.useTime;
|
|
if (Main.myPlayer == player.whoAmI)
|
|
{
|
|
player.HealEffect(25);
|
|
}
|
|
CalamityPlayer modPlayer = player.Calamity();
|
|
modPlayer.bOrange = true;
|
|
}
|
|
return true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe recipe = new ModRecipe(mod);
|
|
recipe.AddIngredient(ItemID.LifeFruit, 5);
|
|
recipe.AddIngredient(ItemID.OrangeBloodroot);
|
|
recipe.AddIngredient(ModContent.ItemType<BloodOrb>(), 10);
|
|
recipe.AddIngredient(ItemID.SoulofMight, 5);
|
|
recipe.AddIngredient(ItemID.SoulofSight, 5);
|
|
recipe.AddIngredient(ItemID.SoulofFright, 5);
|
|
recipe.AddTile(TileID.MythrilAnvil);
|
|
recipe.SetResult(this);
|
|
recipe.AddRecipe();
|
|
}
|
|
}
|
|
}
|