32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using CalamityMod.NPCs;
|
|
using CalamityMod.Systems.Collections;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.Buffs.StatDebuffs
|
|
{
|
|
public class GalvanicCorrosion : ModBuff
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
Main.debuff[Type] = true;
|
|
Main.pvpBuff[Type] = true;
|
|
Main.buffNoSave[Type] = false;
|
|
BuffID.Sets.LongerExpertDebuff[Type] = true;
|
|
}
|
|
|
|
public override void Update(NPC npc, ref int buffIndex)
|
|
{
|
|
npc.Calamity().galvanicCorrosion = true;
|
|
if ((CalamityNPCSets.ResistSlowingDebuffsAndOtherSpecialEffects[npc.type] || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
|
|
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.buffTime[buffIndex];
|
|
}
|
|
|
|
public override void Update(Player player, ref int buffIndex)
|
|
{
|
|
player.Calamity().galvanicCorrosion = true;
|
|
}
|
|
}
|
|
}
|