Files
CalamityModPublic/NPCs/SlimeGod/CorruptSlimeSpawn2.cs
T
mountaindrew10 5595cdcc32 1 - Rev+ no longer blocks heart drops from boss minions.
2 - Rev+ Skeletron Prime changes.
3 - Rev+ Cryogen changes.
4 - Hive Mind Hive Blob projectiles accelerate.
5 - Rev+ WoF laser changes.
6 - Rev+ Queen Bee uses the new 1.4 stinger projectiles.
7 - Rev+ EoL changes.
8 - Fixed gore spreads on several bosses and enemies.
9 - Rev+ EoW cursed fireballs are slower now.
2022-07-07 04:11:22 -05:00

74 lines
2.4 KiB
C#

using CalamityMod.Events;
using CalamityMod.World;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.SlimeGod
{
public class CorruptSlimeSpawn2 : ModNPC
{
public override void SetStaticDefaults()
{
this.HideFromBestiary();
DisplayName.SetDefault("Corrupt Slime Spawn");
Main.npcFrameCount[NPC.type] = 2;
}
public override void SetDefaults()
{
NPC.aiStyle = 1;
NPC.GetNPCDamage();
NPC.width = 40;
NPC.height = 30;
NPC.defense = 4;
NPC.lifeMax = 90;
if (BossRushEvent.BossRushActive)
{
NPC.lifeMax = 5000;
}
NPC.knockBackResist = 0f;
AnimationType = NPCID.CorruptSlime;
NPC.alpha = 55;
NPC.lavaImmune = false;
NPC.noGravity = false;
NPC.noTileCollide = false;
NPC.canGhostHeal = false;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
NPC.Calamity().VulnerableToHeat = true;
NPC.Calamity().VulnerableToSickness = false;
}
public override void HitEffect(int hitDirection, double damage)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, Color.Lavender, 1f);
}
if (NPC.life <= 0)
{
for (int k = 0; k < 20; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, 4, hitDirection, -1f, NPC.alpha, Color.Lavender, 1f);
}
}
}
public override void OnKill()
{
int closestPlayer = Player.FindClosest(NPC.Center, 1, 1);
if (Main.rand.NextBool(8) && Main.player[closestPlayer].statLife < Main.player[closestPlayer].statLifeMax2)
Item.NewItem(NPC.GetSource_Loot(), (int)NPC.position.X, (int)NPC.position.Y, NPC.width, NPC.height, ItemID.Heart);
}
public override void ModifyNPCLoot(NPCLoot npcLoot) => npcLoot.Add(ItemID.Vitamins, 50);
public override void OnHitPlayer(Player player, int damage, bool crit)
{
player.AddBuff(BuffID.Weak, 90, true);
}
}
}