// Blastoid
freeslot(
	"MT_BLASTOID",
	"S_BASTOID_WAIT",
	"S_BASTOID_SHOOT1",
	"S_BASTOID_SHOOT2",
	"S_BASTOID_SHOOT3",
	"S_BASTOID_RELOAD1",
	"S_BASTOID_RELOAD2",
	"S_BASTOID_RELOAD3",
	"SPR_BSTO"
)

mobjinfo[MT_BLASTOID] = {
	//$Name Blastoid
	//$Sprite BSTOA1
	//$Category Genesis Enemies
	doomednum = 3005,
	spawnstate = S_BASTOID_WAIT,
	spawnhealth = 1,
	attacksound = sfx_s3k4d,
	painchance = 1024,
	deathstate = S_XPLD1,
	deathsound = sfx_pop,
	radius = 12*FRACUNIT,
	height = 64*FRACUNIT,
	raisestate = MT_JETTBULLET,
	flags = MF_ENEMY|MF_SPECIAL|MF_SHOOTABLE
}

//shot lasts 12 frames
//35 between shooting

states[S_BASTOID_WAIT] =	{SPR_BSTO,	A,	40,	nil,	35,	0,	S_BASTOID_SHOOT1}

states[S_BASTOID_SHOOT1] =	{SPR_BSTO,	B,	4,	A_TrapShot,	(20<<16)+MT_JETTBULLET,	(18<<16)+15,	S_BASTOID_RELOAD1}
states[S_BASTOID_RELOAD1] =	{SPR_BSTO,	A,	4,	A_PlayAttackSound,	0,	0,	S_BASTOID_SHOOT2}
states[S_BASTOID_SHOOT2] =	{SPR_BSTO,	B,	4,	A_TrapShot,	(20<<16)+MT_JETTBULLET,	(18<<16)+15,	S_BASTOID_RELOAD2}
states[S_BASTOID_RELOAD2] =	{SPR_BSTO,	A,	4,	A_PlayAttackSound,	0,	0,	S_BASTOID_SHOOT3}
states[S_BASTOID_SHOOT3] =	{SPR_BSTO,	B,	4,	A_TrapShot,	(20<<16)+MT_JETTBULLET,	(18<<16)+15,	S_BASTOID_RELOAD3}
states[S_BASTOID_RELOAD3] =	{SPR_BSTO,	A,	4,	A_PlayAttackSound,	0,	0,	S_BASTOID_WAIT}

//Puyo
if not(kirbyabilitytable)
    rawset(_G, "kirbyabilitytable", {})
end
kirbyabilitytable[MT_BLASTOID] = -4    // Makes MT_BLASTOID give Gun
