Files
CalamityModPublic/Items/Accessories/MutatedTruffle.cs
T
Andrew Marheine d5a2c4963b 1 - Expert boss items are now dropped on all modes and no longer have the expert rarity or tag.
2 - Counter Scarf is no longer dropped by EoC and is now sold by the Clothier for 10 gold.
2022-01-14 22:32:02 -06:00

51 lines
1.7 KiB
C#

using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace CalamityMod.Items.Accessories
{
public class MutatedTruffle : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Mutated Truffle");
Tooltip.SetDefault("Summons a small Old Duke to fight for you\n" +
"When below 50% life, it moves much faster");
}
public override void SetDefaults()
{
item.width = 24;
item.height = 26;
item.value = CalamityGlobalItem.Rarity13BuyPrice;
item.rare = ItemRarityID.Red;
item.accessory = true;
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.miniOldDuke = true;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<MutatedTruffleBuff>()) == -1)
{
player.AddBuff(ModContent.BuffType<MutatedTruffleBuff>(), 3600, true);
}
const int damage = 1200;
if (player.ownedProjectileCounts[ModContent.ProjectileType<YoungDuke>()] < 1)
{
Projectile.NewProjectile(player.Center, Vector2.Zero,
ModContent.ProjectileType<YoungDuke>(),
(int)(damage * player.MinionDamage()),
6.5f, Main.myPlayer, 0f, 0f);
}
}
}
}
}