Decimation_Mod/Content/Items/Amulets/FrostAmulet.cs
FyloZ ec4585bed5 - Changed Bloodshot Eye's music to Boss 1 Orchestra ( https://www.youtube.com/watch?time_continue=120&v=r-9nKGc85FQ )
- Added support for animated projectiles
- Refactoring
- Removed useless fields
- Fixed swords not dealing damages
- Added Hour Hand (from Evie's PR)
2020-03-21 00:11:07 -04:00

57 lines
1.9 KiB
C#

using System.Collections.Generic;
using Decimation.Lib.Amulets;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Items.Amulets
{
internal class FrostAmulet : Amulet
{
protected override string ItemName => "Frost Amulet";
public override AmuletClasses AmuletClass => AmuletClasses.Ranger;
protected override void InitAmulet()
{
item.height = 32;
}
protected override void UpdateAmulet(Player player)
{
player.rangedDamage *= 1.03f;
player.rangedCrit += 3;
}
protected override List<ModRecipe> GetAdditionalRecipes()
{
ModRecipe recipe = GetNewModRecipe(this, 1, new List<int> {TileID.TinkerersWorkbench});
recipe.AddIngredient(ItemID.Chain, 2);
recipe.AddIngredient(ItemID.IceBlock, 20);
recipe.AddIngredient(ItemID.Lens, 2);
recipe.AddIngredient(ItemID.ArcheryPotion);
return new List<ModRecipe> {recipe};
}
protected override void GetAmuletTooltip(ref AmuletTooltip tooltip)
{
tooltip
.AddEffect("+3% ranged damages")
.AddEffect("+3% ranged velocity")
.AddEffect("+3% ranged critical strike chances")
.AddEffect("+2% chance to not consume ammo")
.AddEffect("+4% chance that arrows will inflict \"Forstburn\"");
}
}
public class FrostAmuletRangedEffect : GlobalNPC
{
public override void OnHitByProjectile(NPC npc, Projectile projectile, int damage, float knockback, bool crit)
{
if (Main.LocalPlayer.GetModPlayer<DecimationPlayer>().AmuletSlotItem.type ==
ModContent.ItemType<FrostAmulet>() && projectile.arrow && Main.rand.NextBool(25))
npc.AddBuff(BuffID.Frostburn, 300);
}
}
}