85 lines
2.8 KiB
C#
85 lines
2.8 KiB
C#
using CalamityMod.Buffs.DamageOverTime;
|
|
using CalamityMod.Items.Materials;
|
|
using CalamityMod.Items.Placeables.Banners;
|
|
using Terraria;
|
|
using Terraria.ID;
|
|
using Terraria.ModLoader;
|
|
|
|
namespace CalamityMod.NPCs.NormalNPCs
|
|
{
|
|
public class PlagueBee : ModNPC
|
|
{
|
|
public override void SetStaticDefaults()
|
|
{
|
|
DisplayName.SetDefault("Plague Charger");
|
|
Main.npcFrameCount[npc.type] = 4;
|
|
}
|
|
|
|
public override void SetDefaults()
|
|
{
|
|
npc.damage = 37;
|
|
npc.width = 36;
|
|
npc.height = 30;
|
|
npc.defense = 20;
|
|
npc.scale = 0.5f;
|
|
npc.lifeMax = 200;
|
|
npc.aiStyle = 5;
|
|
aiType = 210;
|
|
npc.knockBackResist = 0f;
|
|
animationType = 210;
|
|
npc.value = Item.buyPrice(0, 0, 5, 0);
|
|
npc.HitSound = SoundID.NPCHit4;
|
|
npc.DeathSound = SoundID.NPCDeath14;
|
|
npc.noGravity = true;
|
|
npc.noTileCollide = false;
|
|
npc.buffImmune[189] = true;
|
|
npc.buffImmune[153] = true;
|
|
npc.buffImmune[70] = true;
|
|
npc.buffImmune[69] = true;
|
|
npc.buffImmune[44] = true;
|
|
npc.buffImmune[39] = true;
|
|
npc.buffImmune[24] = true;
|
|
npc.buffImmune[20] = true;
|
|
npc.buffImmune[ModContent.BuffType<BrimstoneFlames>()] = true;
|
|
npc.buffImmune[ModContent.BuffType<HolyFlames>()] = true;
|
|
npc.buffImmune[ModContent.BuffType<Plague>()] = true;
|
|
banner = npc.type;
|
|
bannerItem = ModContent.ItemType<PlagueChargerBanner>();
|
|
}
|
|
|
|
public override void NPCLoot()
|
|
{
|
|
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, ModContent.ItemType<PlagueCellCluster>(), Main.rand.Next(1, 3));
|
|
}
|
|
|
|
public override float SpawnChance(NPCSpawnInfo spawnInfo)
|
|
{
|
|
if (spawnInfo.playerSafe || !NPC.downedGolemBoss || spawnInfo.player.Calamity().ZoneSunkenSea)
|
|
{
|
|
return 0f;
|
|
}
|
|
return SpawnCondition.HardmodeJungle.Chance * 0.12f;
|
|
}
|
|
|
|
public override void OnHitPlayer(Player player, int damage, bool crit)
|
|
{
|
|
player.AddBuff(ModContent.BuffType<Plague>(), 180, true);
|
|
}
|
|
|
|
public override void HitEffect(int hitDirection, double damage)
|
|
{
|
|
for (int k = 0; k < 5; k++)
|
|
{
|
|
Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f);
|
|
}
|
|
if (npc.life <= 0)
|
|
{
|
|
for (int k = 0; k < 10; k++)
|
|
{
|
|
Dust.NewDust(npc.position, npc.width, npc.height, 46, hitDirection, -1f, 0, default, 1f);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|