Files
CalamityModPublic/Items/Armor/SilvaHelmet.cs
T

83 lines
3.3 KiB
C#

using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Items.Materials;
using CalamityMod.Items.Placeables;
using CalamityMod.Projectiles.Summon;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Armor
{
[AutoloadEquip(EquipType.Head)]
public class SilvaHelmet : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Silva Horned Hood");
Tooltip.SetDefault("10% increased minion damage");
}
public override void SetDefaults()
{
item.width = 28;
item.height = 24;
item.value = Item.buyPrice(0, 90, 0, 0);
item.defense = 13; //110
item.rare = ItemRarityID.Purple;
item.Calamity().customRarity = CalamityRarity.DarkBlue;
}
public override bool IsArmorSet(Item head, Item body, Item legs)
{
return body.type == ModContent.ItemType<SilvaArmor>() && legs.type == ModContent.ItemType<SilvaLeggings>();
}
public override void ArmorSetShadows(Player player)
{
player.armorEffectDrawShadow = true;
}
public override void UpdateArmorSet(Player player)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.silvaSet = true;
modPlayer.silvaSummon = true;
player.setBonus = "65% increased minion damage and +5 max minions\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 8 seconds\n" +
"This effect has a 5 minute cooldown. The cooldown does not decrement if any bosses or events are active.\n" +
"Summons an ancient leaf prism to blast your enemies with life energy";
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<SilvaSummonSetBuff>()) == -1)
{
player.AddBuff(ModContent.BuffType<SilvaSummonSetBuff>(), 3600, true);
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<SilvaCrystal>()] < 1)
{
Projectile.NewProjectile(player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<SilvaCrystal>(), (int)(600f * player.MinionDamage()), 0f, Main.myPlayer, -20f, 0f);
}
}
player.minionDamage += 0.65f;
player.maxMinions += 5;
}
public override void UpdateEquip(Player player) => player.minionDamage += 0.1f;
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ModContent.ItemType<EffulgentFeather>(), 5);
recipe.AddRecipeGroup("AnyGoldBar", 5);
recipe.AddIngredient(ModContent.ItemType<Tenebris>(), 6);
recipe.AddIngredient(ModContent.ItemType<AscendantSpiritEssence>(), 2);
recipe.AddTile(ModContent.TileType<CosmicAnvil>());
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}