namespace NicksMod.NPCs
{
public class KillerWhale : ModNPC
{
public override void SetDefaults()
{
npc.name = "Killer Whale";
npc.displayName = "Killer Whale";
npc.width = 70;
npc.height = 70;
npc.damage = 65;
npc.defense = 15;
npc.lifeMax = 500;
npc.HitSound = SoundID.NPCHit1;
npc.DeathSound = SoundID.NPCDeath1;
npc.value = 60f;
npc.knockBackResist = 0.5f;
npc.aiStyle = 16;
Main.npcFrameCount[npc.type] = 3;
aiType = NPCID.Shark; //npc behavior
animationType = NPCID.Shark;
}
public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
return spawnInfo.spawnTileY < Main.worldSurface && !Main.dayTime ? 0.5f : 0.5f;
}
public override void FindFrame(int frameHeight)
{
npc.frameCounter -= 0.1F; // Determines the animation speed. Higher value = faster animation.
npc.frameCounter %= Main.npcFrameCount[npc.type];
int frame = (int)npc.frameCounter;
npc.frame.Y = frame * frameHeight;
npc.spriteDirection = npc.direction;
}
public override void NPCLoot() //Npc drop
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("OrcaFin"));
}
public override float CanSpawn(NPCSpawnInfo spawnInfo)
{
int x = spawnInfo.spawnTileX;
int y = spawnInfo.spawnTileY;
int tile = (int)Main.tile[x, y].type;
return (NicksMod.NormalSpawn(spawnInfo) && (tile == 53 || tile == 112 || tile == 116 || tile == 234) && NicksMod.NoZoneAllowWater(spawnInfo) && spawnInfo.water) && y < Main.rockLayer && (x < 250 || x > Main.maxTilesX - 250)
}
}
}