49 lines
1.6 KiB
C#
49 lines
1.6 KiB
C#
using CalamityMod.Buffs.Pets;
|
|
using CalamityMod.NPCs.ExoMechs.Thanatos;
|
|
using CalamityMod.Projectiles.Pets;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.GameContent;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Pets
|
|
{
|
|
public class BurrowerController : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Pets";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.DefaultToVanitypet(ModContent.ProjectileType<BurrowerPet>(), ModContent.BuffType<BurrowerBuff>());
|
|
Item.rare = ItemRarityID.Green;
|
|
Item.value = Item.sellPrice(gold: 3);
|
|
Item.UseSound = ThanatosHead.ThanatosHitSoundClosed;
|
|
}
|
|
|
|
public override void UseStyle(Player player, Rectangle heldItemFrame)
|
|
{
|
|
if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
|
|
{
|
|
player.AddBuff(Item.buffType, 3600, true);
|
|
}
|
|
}
|
|
public override bool PreDrawInInventory(SpriteBatch spriteBatch, Vector2 position, Rectangle frame, Color drawColor, Color itemColor, Vector2 origin, float scale)
|
|
{
|
|
CalamityUtils.DrawInventoryCustomScale(
|
|
spriteBatch,
|
|
texture: TextureAssets.Item[Type].Value,
|
|
position,
|
|
frame,
|
|
drawColor,
|
|
itemColor,
|
|
origin,
|
|
scale,
|
|
wantedScale: 0.8f,
|
|
drawOffset: new(0f, 0f)
|
|
);
|
|
return false;
|
|
}
|
|
}
|
|
}
|