-- 2.0 Recycler Box - Ported by MIDIMan
-- Use with LUA_FBOX and LUA_FBXM

freeslot(
	"MT_FDBOX_RECYCLE",
	"MT_FDBOX_RECYCLE_ICON",
	"S_FDBOX_RECYCLE_IDLE",
	"S_FDBOX_RECYCLE_ICON1",
	"S_FDBOX_RECYCLE_ICON2"
)

addHook("MobjFuse", RM_FDMonitorFuseThink, MT_FDBOX_RECYCLE)
addHook("MapThingSpawn", RM_FDMonitorTypeSpawn, MT_FDBOX_RECYCLE)

mobjinfo[MT_FDBOX_RECYCLE] = {
	--$Name 2.0 Recycler
	--$Sprite FBXMH0
	--$Category Monitors
	--$Flags4Text Random (Strong)
	--$Flags8Text Random (Weak)
	--$Arg1 Respawn behavior
	--$Arg1Type 11
	--$Arg1Enum monitorrespawn
	doomednum = 479,
	spawnstate = S_FDBOX_RECYCLE_IDLE,
	spawnhealth = 1,
	painstate = S_FDBOX_RECYCLE_IDLE,
	deathstate = S_FDBOX_EXPLOSION1,
	deathsound = sfx_pop,
	speed = 1,
	radius = 16*FRACUNIT,
	height = 32*FRACUNIT,
	damage = MT_FDBOX_RECYCLE_ICON,
	flags = MF_SOLID|MF_SHOOTABLE|MF_MONITOR|MF_GRENADEBOUNCE
}

states[S_FDBOX_RECYCLE_IDLE] =	{SPR_FBXM,	H,	2,	nil,	0,	0,	S_FDBOX_FLICKER}

mobjinfo[MT_FDBOX_RECYCLE_ICON] = {
	doomednum = -1,
	spawnstate = S_FDBOX_RECYCLE_ICON1,
	spawnhealth = 1,
	speed = 4*FRACUNIT,	-- Originally 2*FRACUNIT; Changed to match pre-2.1's speed
	radius = 8*FRACUNIT,
	height = 14*FRACUNIT,
	damage = 62*FRACUNIT,
	flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_SCENERY|MF_NOGRAVITY|MF_BOXICON
}

states[S_FDBOX_RECYCLE_ICON1] =	{SPR_FBXM,	I,	18,	nil,				0,	0,	S_FDBOX_RECYCLE_ICON2}
states[S_FDBOX_RECYCLE_ICON2] =	{SPR_FBXM,	I,	18,	A_RecyclePowers,	0,	0,	S_NULL}
