Files
CalamityModPublic/Buffs/StatDebuffs/KamiFlu.cs
T
ben-tk 242808f0ce Fixed debuff times not getting doubled if the config was disabled, this now also applies to Cal debuffs
If you want to suffer, we'll let you
Also Kami Flu no longer freezes players?
2022-09-25 16:35:01 -04:00

33 lines
1.2 KiB
C#

using CalamityMod.NPCs;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class KamiFlu : ModBuff
{
public const float MultiplicativeDamageReduction = 0.8f;
// Hard-cap for npc speed when afflicted with this debuff. Does not affect certain NPCs and does not affect any bosses (Basically only works on boss minions).
public const float MaxNPCSpeed = 16f;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Kami Flu");
Description.SetDefault("Defenseless and dying");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = false;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().kamiFlu < npc.buffTime[buffIndex])
npc.Calamity().kamiFlu = npc.buffTime[buffIndex];
if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().kamiFlu;
npc.DelBuff(buffIndex);
buffIndex--;
}
}
}