Files
CalamityModPublic/Buffs/StatDebuffs/GlacialState.cs
T
Andrew Marheine ba22da6cda 1 - Some 'minor' debuff changes.
2 - Added weakness and resistance system for debuffs. I'll explain it all later.
2021-12-13 15:06:59 -06:00

35 lines
1.1 KiB
C#

using CalamityMod.NPCs;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.StatDebuffs
{
public class GlacialState : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Glacial State");
Description.SetDefault("Cannot move");
Main.debuff[Type] = true;
Main.pvpBuff[Type] = true;
Main.buffNoSave[Type] = true;
longerExpertDebuff = false;
}
public override void Update(Player player, ref int buffIndex)
{
player.Calamity().gState = true;
}
public override void Update(NPC npc, ref int buffIndex)
{
if (npc.Calamity().gState < npc.buffTime[buffIndex])
npc.Calamity().gState = npc.buffTime[buffIndex];
if ((CalamityLists.enemyImmunityList.Contains(npc.type) || npc.boss) && npc.Calamity().debuffResistanceTimer <= 0)
npc.Calamity().debuffResistanceTimer = CalamityGlobalNPC.slowingDebuffResistanceMin + npc.Calamity().gState;
npc.DelBuff(buffIndex);
buffIndex--;
}
}
}