Files
CalamityModPublic/NPCs/Calamitas/LifeSeeker.cs
T

68 lines
2.2 KiB
C#

using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.World;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.Calamitas
{
public class LifeSeeker : ModNPC
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Life Seeker");
Main.npcFrameCount[npc.type] = 2;
}
public override void SetDefaults()
{
npc.damage = 30;
npc.width = 44;
npc.height = 30;
npc.defense = 8;
npc.lifeMax = 200;
if (CalamityWorld.bossRushActive)
{
npc.lifeMax = 30000;
}
npc.aiStyle = 5;
aiType = 139;
npc.knockBackResist = CalamityWorld.bossRushActive ? 0f : 0.25f;
animationType = 2;
npc.noGravity = true;
npc.noTileCollide = true;
npc.canGhostHeal = false;
npc.HitSound = SoundID.NPCHit4;
npc.DeathSound = SoundID.NPCDeath14;
npc.buffImmune[24] = true;
}
public override bool PreNPCLoot()
{
return false;
}
public override void OnHitPlayer(Player player, int damage, bool crit)
{
player.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f);
}
if (npc.life <= 0)
{
for (int k = 0; k < 20; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 235, hitDirection, -1f, 0, default, 1f);
}
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker"), 1f);
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker2"), 1f);
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/CalamitasGores/LifeSeeker3"), 1f);
}
}
}
}