Files
CalamityModPublic/NPCs/Crags/InfernalCongealment.cs
T

100 lines
3.4 KiB
C#

using CalamityMod.BiomeManagers;
using CalamityMod.Buffs.DamageOverTime;
using CalamityMod.Dusts;
using CalamityMod.Items.Placeables.Banners;
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Items.Materials;
using Terraria;
using Terraria.GameContent.Bestiary;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.NPCs.Crags
{
public class InfernalCongealment : ModNPC
{
public override void SetStaticDefaults()
{
Main.npcFrameCount[NPC.type] = 2;
}
public override void SetDefaults()
{
NPC.aiStyle = NPCAIStyleID.Slime;
AIType = NPCID.LavaSlime;
NPC.damage = 40;
NPC.width = 40;
NPC.height = 30;
NPC.defense = 10;
NPC.lifeMax = 250;
NPC.knockBackResist = 0f;
AnimationType = NPCID.CorruptSlime;
NPC.value = Item.buyPrice(0, 0, 5, 0);
NPC.alpha = 50;
NPC.lavaImmune = true;
NPC.noGravity = false;
NPC.noTileCollide = false;
NPC.HitSound = SoundID.NPCHit1;
NPC.DeathSound = SoundID.NPCDeath1;
if (DownedBossSystem.downedProvidence)
{
NPC.damage = 80;
NPC.defense = 20;
NPC.lifeMax = 3500;
}
Banner = NPC.type;
BannerItem = ModContent.ItemType<InfernalCongealmentBanner>();
NPC.Calamity().VulnerableToHeat = false;
NPC.Calamity().VulnerableToCold = true;
NPC.Calamity().VulnerableToWater = true;
SpawnModBiomes = new int[1] { ModContent.GetInstance<BrimstoneCragsBiome>().Type };
}
public override void SetBestiary(BestiaryDatabase database, BestiaryEntry bestiaryEntry)
{
bestiaryEntry.Info.AddRange(new IBestiaryInfoElement[]
{
new FlavorTextBestiaryInfoElement("Mods.CalamityMod.Bestiary.InfernalCongealment")
});
}
public override float SpawnChance(NPCSpawnInfo spawnInfo)
{
if (!DownedBossSystem.downedBrimstoneElemental)
{
return 0f;
}
return spawnInfo.Player.Calamity().ZoneCalamity ? 0.08f : 0f;
}
public override void OnHitPlayer(Player target, Player.HurtInfo hurtInfo)
{
if (hurtInfo.Damage > 0)
target.AddBuff(ModContent.BuffType<BrimstoneFlames>(), 120, true);
}
public override void HitEffect(NPC.HitInfo hit)
{
for (int k = 0; k < 5; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, hit.HitDirection, -1f, 0, default, 1f);
}
if (NPC.life <= 0)
{
for (int k = 0; k < 20; k++)
{
Dust.NewDust(NPC.position, NPC.width, NPC.height, (int)CalamityDusts.Brimstone, hit.HitDirection, -1f, 0, default, 1f);
}
}
}
public override void ModifyNPCLoot(NPCLoot npcLoot)
{
npcLoot.Add(ModContent.ItemType<InfernalSuevite>(), 1, 10, 26);
npcLoot.Add(ModContent.ItemType<EssenceofHavoc>(), 2);
LeadingConditionRule postProv = npcLoot.DefineConditionalDropSet(DropHelper.PostProv());
postProv.Add(ModContent.ItemType<Bloodstone>(), 4);
}
}
}