44 lines
1.6 KiB
C#
44 lines
1.6 KiB
C#
using CalamityMod.CalPlayer;
|
|
using Terraria;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
using Terraria.GameContent.Creative;
|
|
|
|
namespace CalamityMod.Items.Accessories
|
|
{
|
|
public class TheCommunity : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
|
|
DisplayName.SetDefault("The Community");
|
|
Tooltip.SetDefault("The heart of (most of) the Terraria community\n" +
|
|
"Starts off with weak buffs to all of your stats\n" +
|
|
"The stat buffs become more powerful as you progress\n" +
|
|
"Reduces the DoT effects of harmful debuffs inflicted on you\n" +
|
|
"Thank you to all of my supporters who made this mod a reality");
|
|
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(5, 10));
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 34;
|
|
Item.height = 64;
|
|
Item.value = CalamityGlobalItem.Rarity7BuyPrice;
|
|
Item.rare = ItemRarityID.Lime;
|
|
Item.accessory = true;
|
|
Item.Calamity().customRarity = CalamityRarity.Rainbow;
|
|
}
|
|
|
|
public override void UpdateAccessory(Player player, bool hideVisual)
|
|
{
|
|
CalamityPlayer modPlayer = player.Calamity();
|
|
modPlayer.community = true;
|
|
}
|
|
|
|
// Community and Shattered Community are mutually exclusive
|
|
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().shatteredCommunity;
|
|
}
|
|
}
|