64 lines
2.0 KiB
C#
64 lines
2.0 KiB
C#
using CalamityMod.Items.Materials;
|
|
using System.Collections.Generic;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.LoreItems
|
|
{
|
|
public class KnowledgeKingSlime : LoreItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("King Slime");
|
|
Tooltip.SetDefault("Only a fool could be caught by this pitiful excuse for a hunter.\n" +
|
|
"Unfortunately, our world has no shortage of those.\n" +
|
|
"Favorite this item to gain 5% increased movement speed and 2% increased jump speed.\n" +
|
|
"However, your defense is reduced by 3 due to your gelatinous body.");
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
item.width = 20;
|
|
item.height = 20;
|
|
item.rare = 1;
|
|
item.consumable = false;
|
|
}
|
|
|
|
public override void ModifyTooltips(List<TooltipLine> list)
|
|
{
|
|
bool autoJump = Main.player[Main.myPlayer].autoJump;
|
|
string hasJumpBoost = "Place in your inventory to gain 5% increased movement speed and 2% increased jump speed.";
|
|
string noJumpBoost = "Place in your inventory to gain 5% increased movement speed.";
|
|
foreach (TooltipLine line2 in list)
|
|
{
|
|
if (line2.mod == "Terraria" && line2.Name == "Tooltip2")
|
|
{
|
|
line2.text = autoJump ? noJumpBoost : hasJumpBoost;
|
|
}
|
|
}
|
|
}
|
|
|
|
public override bool CanUseItem(Player player)
|
|
{
|
|
return false;
|
|
}
|
|
|
|
public override void UpdateInventory(Player player)
|
|
{
|
|
if (item.favorited)
|
|
player.Calamity().kingSlimeLore = true;
|
|
}
|
|
|
|
public override void AddRecipes()
|
|
{
|
|
ModRecipe r = new ModRecipe(mod);
|
|
r.SetResult(this);
|
|
r.AddTile(TileID.Bookcases);
|
|
r.AddIngredient(ItemID.KingSlimeTrophy);
|
|
r.AddIngredient(ModContent.ItemType<VictoryShard>(), 10);
|
|
r.AddRecipe();
|
|
}
|
|
}
|
|
}
|