Files
CalamityModPublic/Buffs/StatDebuffs/WarCleave.cs
T
DominicKarma42 55e89c9b98 Replaced (hopefully) every magic number with a constant
Note: Does not include item rarities, and appears to shown nonexistant using directive movement in the commit. This does not really affect anything, however.
2020-05-30 17:56:36 -04:00

34 lines
903 B
C#

using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class WarCleave : ModBuff
{
public static int DefenseReduction = 15;
public override void SetDefaults()
{
DisplayName.SetDefault("War Cleave");
Description.SetDefault("Defense and protection reduced");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
longerExpertDebuff = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().wCleave < npc.buffTime[buffIndex])
npc.Calamity().wCleave = npc.buffTime[buffIndex];
npc.DelBuff(buffIndex);
buffIndex--;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().wCleave = true;
}
}
}