40 lines
1.2 KiB
C#
40 lines
1.2 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.DataStructures;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Accessories
|
|
{
|
|
public class DynamoStemCells : ModItem
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
SacrificeTotal = 1;
|
|
DisplayName.SetDefault("Dynamo Stem Cells");
|
|
Tooltip.SetDefault(@"10% increased movement speed
|
|
Ranged weapons have a chance to fire mini swarmers
|
|
Grants immunity to Dragonfire and Electrified");
|
|
Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(6, 5));
|
|
ItemID.Sets.AnimatesAsSoul[Type] = true;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 20;
|
|
Item.height = 20;
|
|
Item.value = CalamityGlobalItem.Rarity11BuyPrice;
|
|
Item.rare = ItemRarityID.Purple;
|
|
Item.accessory = true;
|
|
}
|
|
|
|
public override void UpdateAccessory(Player player, bool hideVisual)
|
|
{
|
|
player.Calamity().dynamoStemCells = true;
|
|
player.moveSpeed += 0.1f;
|
|
player.buffImmune[BuffID.Electrified] = true;
|
|
player.buffImmune[ModContent.BuffType<Dragonfire>()] = true;
|
|
}
|
|
}
|
|
}
|