43 lines
1.5 KiB
C#
43 lines
1.5 KiB
C#
using CalamityMod.Buffs.StatBuffs;
|
|
using CalamityMod.CalPlayer;
|
|
using CalamityMod.Rarities;
|
|
using Microsoft.Xna.Framework;
|
|
using Microsoft.Xna.Framework.Graphics;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Items.Accessories
|
|
{
|
|
public class Affliction : ModItem, ILocalizedModType
|
|
{
|
|
public new string LocalizationCategory => "Items.Accessories";
|
|
public override void SetDefaults()
|
|
{
|
|
Item.width = 38;
|
|
Item.height = 44;
|
|
Item.accessory = true;
|
|
Item.value = CalamityGlobalItem.Rarity13BuyPrice;
|
|
Item.rare = ModContent.RarityType<PureGreen>();
|
|
}
|
|
|
|
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
|
|
{
|
|
Item.DrawItemGlowmaskSingleFrame(spriteBatch, rotation, ModContent.Request<Texture2D>("CalamityMod/Items/Accessories/Affliction").Value);
|
|
}
|
|
|
|
public override void UpdateAccessory(Player player, bool hideVisual)
|
|
{
|
|
CalamityPlayer modPlayer = player.Calamity();
|
|
modPlayer.affliction = true;
|
|
if (player.whoAmI != Main.myPlayer && player.miscCounter % 10 == 0)
|
|
{
|
|
if (Main.LocalPlayer.team == player.team && player.team != 0)
|
|
{
|
|
Main.LocalPlayer.AddBuff(ModContent.BuffType<Afflicted>(), 20, true);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|