freeslot(
	"MT_BLUECROWLO",
	"S_BCROWLO_IDLE",
	"S_BCROWLO_MOVE",
	"S_BCROWLO_MOVE2",
	"S_BCROWLO_MOVE3",
	"S_BCROWLO_MOVE4",
	"S_BCROWLO_MOVE5",
	"S_BCROWLO_MOVE6",
	"SPR_SPSS"
)

states[S_BCROWLO_IDLE] = {
	sprite = SPR_SPSS,
	frame = A,
	tics = 5,
	action = A_Look,
	nextstate = S_BCROWLO_IDLE
}

states[S_BCROWLO_MOVE] = {
	sprite = SPR_SPSS,
	frame = A,
	tics = 3,
	action = A_Chase,
	nextstate = S_BCROWLO_MOVE2
}

states[S_BCROWLO_MOVE2] = {
	sprite = SPR_SPSS,
	frame = A,
	tics = 3,
	action = A_Chase,
	nextstate = S_BCROWLO_MOVE3
}

states[S_BCROWLO_MOVE3] = {
	sprite = SPR_SPSS,
	frame = A,
	tics = 3,
	action = A_Chase,
	nextstate = S_BCROWLO_MOVE4
}

states[S_BCROWLO_MOVE4] = {
	sprite = SPR_SPSS,
	frame = A,
	tics = 3,
	action = A_Chase,
	nextstate = S_BCROWLO_MOVE5
}

states[S_BCROWLO_MOVE5] = {
	sprite = SPR_SPSS,
	frame = A,
	tics = 3,
	action = A_Chase,
	nextstate = S_BCROWLO_MOVE6
}

states[S_BCROWLO_MOVE6] = {
	sprite = SPR_SPSS,
	frame = A,
	tics = 3,
	action = A_Chase,
	nextstate = S_BCROWLO_MOVE
}

mobjinfo[MT_BLUECROWLO] = {
	spawnstate = S_BCROWLO_IDLE,
	seestate = S_BCROWLO_MOVE,
	deathstate = S_XPLD_FLICKY,
	deathsound = sfx_pop,
	spawnhealth = 1,
	reactiontime = 32,
	painchance = 200,
	speed = 3,
	radius = 24*FRACUNIT,
	height = 32*FRACUNIT,
	mass = 100,
	flags = MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE
}

addHook("MobjThinker", function(egg)
	for p in players.iterate do
		if not (p.mo and p.mo.valid) then return end
		if p.mo.skin ~= "specki" and p.mo.skin ~= "mechaspecki" then return end
		if not egg and egg.valid then return end
		if not egg.health then return end
		local aggro = P_SpawnMobj(egg.x, egg.y, egg.z, MT_BLUECROWLO)
		aggro.flags = egg.flags
		aggro.flags2 = egg.flags2
		aggro.eflags = egg.eflags
		aggro.health = egg.health
		aggro.scale = egg.scale
		aggro.angle = egg.angle
		P_RemoveMobj(egg)
		return
	end
end, MT_BLUECRAWLA)