Files
CalamityModPublic/Items/Armor/GodSlayerVisage.cs
T
2020-11-16 14:12:09 -05:00

69 lines
2.5 KiB
C#

using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor
{
[AutoloadEquip(EquipType.Head)]
public class GodSlayerVisage : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("God Slayer Visage");
Tooltip.SetDefault("14% increased magic damage and critical strike chance\n" +
"+100 max mana and 17% reduced mana usage");
}
public override void SetDefaults()
{
item.width = 18;
item.height = 18;
item.value = Item.buyPrice(0, 75, 0, 0);
item.defense = 21; //96
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
public override bool IsArmorSet(Item head, Item body, Item legs)
{
return body.type == ModContent.ItemType<GodSlayerChestplate>() && legs.type == ModContent.ItemType<GodSlayerLeggings>();
}
public override void ArmorSetShadows(Player player)
{
player.armorEffectDrawShadow = true;
}
public override void UpdateArmorSet(Player player)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.godSlayer = true;
modPlayer.godSlayerMage = true;
player.setBonus = "You will survive fatal damage and will be healed 150 HP if an attack would have killed you\n" +
"This effect can only occur once every 45 seconds\n" +
"While the cooldown for this effect is active all life regen is halved\n" +
"Enemies will release god slayer flames and healing flames when hit with magic attacks\n" +
"Taking damage will cause you to release a magical god slayer explosion";
}
public override void UpdateEquip(Player player)
{
player.manaCost *= 0.83f;
player.magicDamage += 0.14f;
player.magicCrit += 14;
player.statManaMax2 += 100;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<CosmiliteBar>(), 14);
recipe.AddIngredient(ModContent.ItemType<AscendantSpiritEssence>());
recipe.AddTile(ModContent.TileType<DraedonsForge>());
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}