using CalamityMod.CalPlayer; using CalamityMod.Items.Materials; using CalamityMod.Items.Placeables; using CalamityMod.Tiles.Furniture.CraftingStations; using Terraria; using Terraria.ModLoader; namespace CalamityMod.Items.Armor { [AutoloadEquip(EquipType.Head)] public class SilvaHelm : ModItem { public override void SetStaticDefaults() { DisplayName.SetDefault("Silva Helm"); Tooltip.SetDefault("13% increased melee damage and critical strike chance"); } public override void SetDefaults() { item.width = 18; item.height = 18; item.value = Item.buyPrice(0, 90, 0, 0); item.defense = 52; //110 item.Calamity().postMoonLordRarity = 15; } public override bool IsArmorSet(Item head, Item body, Item legs) { return body.type == ModContent.ItemType() && legs.type == ModContent.ItemType(); } public override void ArmorSetShadows(Player player) { player.armorEffectDrawShadow = true; } public override void UpdateArmorSet(Player player) { CalamityPlayer modPlayer = player.Calamity(); modPlayer.silvaSet = true; modPlayer.silvaMelee = true; player.setBonus = "You are immune to almost all debuffs\n" + "All projectiles spawn healing leaf orbs on enemy hits\n" + "Max run speed and acceleration boosted by 5%\n" + "If you are reduced to 1 HP you will not die from any further damage for 10 seconds\n" + "If you get reduced to 1 HP again while this effect is active you will lose 100 max life\n" + "This effect only triggers once per life and if you are reduced to 400 max life the invincibility effect will stop\n" + "Your max life will return to normal if you die\n" + "True melee strikes have a 25% chance to do five times damage\n" + "After the silva invincibility is over you will take 20% less contact damage\n" + "Melee projectiles have a 25% chance to stun enemies for a very brief moment"; } public override void UpdateEquip(Player player) { player.meleeDamage += 0.13f; player.meleeCrit += 13; } public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 5); recipe.AddIngredient(ModContent.ItemType(), 6); recipe.AddIngredient(ModContent.ItemType(), 14); recipe.AddIngredient(ModContent.ItemType(), 14); recipe.AddTile(ModContent.TileType()); recipe.SetResult(this); recipe.AddRecipe(); } } }