using System;
using System.IO;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace MetalMania.NPCs.Boss
{
public class SoluriumSlimeMaster : ModNPC
{
public override void SetDefaults()
{
npc.name = "Solurium Slime Master";
npc.displayName = "Solurium Slime Monster";
npc.aiStyle = 15;
npc.lifeMax = 120000;
npc.damage = 80;
npc.defense = 30;
npc.knockBackResist = 0f;
npc.width = 410;
npc.height = 210;
npc.value = Item.buyPrice(0, 8, 75, 40);
npc.npcSlots = 1f;
npc.boss = true;
npc.lavaImmune = false;
npc.noGravity = false;
npc.noTileCollide = false;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
npc.buffImmune[24] = false;
music = MusicID.Boss3;
npc.netAlways = true;
}
public override void AutoloadHead(ref string headTexture, ref string bossHeadTexture)
{
bossHeadTexture = "MetalMania/NPCs/Boss/SoluriumSlimeMaster_head";
}
public override void BossLoot(ref string name, ref int potionType)
{
potionType = ItemID.GreaterHealingPotion;
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BottledSpark"), Main.rand.Next(8, 32));
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("MeteriumWormStaff"), 1);
ManiaWorld.downedBossSoluriumSlime = true;
npc.ai[2] = 0;
}
public override void ScaleExpertStats(int numPlayers, float bossLifeScale)
{
npc.lifeMax = (int)(npc.lifeMax * 1.3f * bossLifeScale);
npc.damage = (int)(npc.damage * 1.1f);
npc.defense = 40;
}
public override void AI()
{
npc.ai[0]++;
Player player = Main.player[npc.target];
if (!player.active || player.dead)
{
npc.velocity = new Vector2(0f, 10f);
if (npc.timeLeft > 10)
{
npc.timeLeft = 10;
}
return;
}
npc.ai[3]++;
if (npc.ai[3] % 600 == 3)
{
NPC.NewNPC((int)npc.position.X, (int)npc.position.Y, mod.NPCType("SoluriumSlimeMinion"));
}
}
}
}