Files
CalamityModPublic/Buffs/StatDebuffs/WitherDebuff.cs
T
2021-09-04 22:07:56 -04:00

35 lines
997 B
C#

using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class WitherDebuff : ModBuff
{
public static int DefenseReduction = 20;
public override void SetDefaults()
{
DisplayName.SetDefault("Wither");
Description.SetDefault("Withered...\n" +
"Defense reduced by 20"); // Literally Ichor but patron. Also not to be confused with Withered Armor/Weapons
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
longerExpertDebuff = false;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().wither < npc.buffTime[buffIndex])
npc.Calamity().wither = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().wither = true;
}
}
}