
//***Che ChebMaster's invention
// the script that checks if an actor could be spawned 
// (AND making sure it would not spawn hanging over the edge)
// use a couple of volume checkers to fit a requested hitbox shape
// and then check floor drop distance at four corners using floor checkers

// See function FBD_CheckSpawnSpace(x,y,z, r,h,maxdrop) 
// and "FBD_CheckSpawnSpace" (r, h, maxdrop)
// and "FBD_CheckSpawnSpaceAt" (packed_xy, packed_rz, h, maxdrop)

ACTOR FloorChecker {
	+NOCLIP // disables collision with walls but not floors
	+THRUACTORS
	+THRUGHOST
	+NOTARGET
	+NEVERTARGET
	-SOLID
	
	Radius 1
	Height 1
	States
	{
		Spawn:
			TNT1 A 2
			Stop
	}
}

// step 2
ACTOR SpaceChecker12: AbstractSpaceChecker {
	Radius 12
	Height 24
}

ACTOR SpaceChecker14: AbstractSpaceChecker {
	Radius 14
	Height 28
}

ACTOR SpaceChecker16: AbstractSpaceChecker {
	Radius 16
	Height 32
}

ACTOR SpaceChecker18: AbstractSpaceChecker {
	Radius 18
	Height 36
}

ACTOR SpaceChecker20: AbstractSpaceChecker {
	Radius 20
	Height 40
}

ACTOR SpaceChecker22: AbstractSpaceChecker {
	Radius 22
	Height 44
}

ACTOR SpaceChecker24: AbstractSpaceChecker {
	Radius 24
	Height 48
}

ACTOR SpaceChecker26: AbstractSpaceChecker {
	Radius 26
	Height 52
}

ACTOR SpaceChecker28: AbstractSpaceChecker {
	Radius 28
	Height 56
}

ACTOR SpaceChecker30: AbstractSpaceChecker {
	Radius 30
	Height 60
}

ACTOR SpaceChecker32: AbstractSpaceChecker {
	Radius 32
	Height 64
}

// above 32, step 8

ACTOR SpaceChecker40: AbstractSpaceChecker {
	Radius 40
	Height 64
}

ACTOR SpaceChecker48: AbstractSpaceChecker {
	Radius 48
	Height 64
}

ACTOR SpaceChecker56: AbstractSpaceChecker {
	Radius 56
	Height 64
}

ACTOR SpaceChecker64: AbstractSpaceChecker {
	Radius 64
	Height 64
}

//Above 64 are megabosses, step 32 (eday cyberlord radius 130, eday icon of sin radius 320)

ACTOR SpaceChecker96: AbstractSpaceChecker {
	Radius 96 
	Height 192 
}

ACTOR SpaceChecker128: AbstractSpaceChecker {
	Radius 128
	Height 256
}

ACTOR SpaceChecker160: AbstractSpaceChecker {
	Radius 160
	Height 320
}

ACTOR SpaceChecker192: AbstractSpaceChecker {
	Radius 192
	Height 384
}

ACTOR SpaceChecker256: AbstractSpaceChecker {
	Radius 256
	Height 512
}

ACTOR SpaceChecker288: AbstractSpaceChecker {
	Radius 288
	Height 576
}

ACTOR SpaceChecker320: AbstractSpaceChecker {
	// the *exact* dimensions of IOS stage 2 !
	Radius 320
	Height 640
}

