Decimation_Mod/Content/Items/Accessories/DraculaPendant.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

60 lines
2.1 KiB
C#

using Decimation.Content.Buffs.Buffs;
using Decimation.Lib.Items;
using Decimation.Lib.Util;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace Decimation.Content.Items.Accessories
{
internal class DraculaPendant : DecimationAccessory
{
protected override string ItemName => "Dracula's Pendant";
protected override string ItemTooltip => "Dont tread under the suns gaze!\n\n" +
"Gives Vampire debuff\n" +
"Bats will be friendly\n" +
"You will burn at sun";
protected override void InitAccessory()
{
item.width = 46;
item.height = 62;
item.rare = Rarity.LightPurple.GetRarityValue();
this.item.value = Item.buyPrice(0, 4);
}
public override void UpdateAccessory(Player player, bool hideVisual)
{
player.AddBuff(ModContent.BuffType<Vampire>(), 1);
player.npcTypeNoAggro[NPCID.CaveBat] = true;
player.npcTypeNoAggro[NPCID.JungleBat] = true;
player.npcTypeNoAggro[NPCID.Hellbat] = true;
player.npcTypeNoAggro[NPCID.IceBat] = true;
player.npcTypeNoAggro[NPCID.GiantBat] = true;
player.npcTypeNoAggro[NPCID.IlluminantBat] = true;
player.npcTypeNoAggro[NPCID.Lavabat] = true;
player.npcTypeNoAggro[NPCID.Slimer] = true;
player.npcTypeNoAggro[NPCID.GiantFlyingFox] = true;
player.npcTypeNoAggro[NPCID.Vampire] = true;
if (player.ZoneOverworldHeight && Main.dayTime)
{
int damages = 4;
player.lifeRegen -= damages;
Dust.NewDust(player.position, player.width, player.height, DustID.GoldFlame);
}
}
}
public class DraculaPendantDrop : GlobalNPC
{
public override void NPCLoot(NPC npc)
{
if (npc.type == NPCID.Vampire && Main.rand.NextBool(50))
Item.NewItem(npc.getRect(), ModContent.ItemType<DraculaPendant>());
}
}
}