UserInputNumber ( dista, "Inner Diameter?", "128" )
UserInputNumber ( distb, "Stair Width?", "128" )
distb = distb + dista

UserInputNumber ( StepHeight, "Step Height", "8" )

UserInputNumber ( StartAngle, "Start Angle", "0" )
UserInputNumber ( EndAngle, "End Angle", "180" )
UserInputNumber ( AngleStep, "Angle Step", "10" )

DeselectAll

x = MapX
y = MapY
PointInWhichSector ( sec, x, y )

if equal("sec,-1")
	fh = 0
	ch = 128
else
	GetSectorProperty ( fh, sec, FloorHeight )
	GetSectorProperty ( ch, sec, CeilingHeight )
endif

LineDefFlags = 0
LineDefFrontMainTexture = "GRAY1"
LineDefFrontBelowTexture = "STEP4"
LineDefFrontAboveTexture = "STEP4"

RotatePoint ( xa, ya, x, y, dista, StartAngle )
RotatePoint ( xb, yb, x, y, distb, StartAngle )

for angl, StartAngle + AngleStep, EndAngle, AngleStep
	SectorDuplicate ( sec )                          
	LineDefFrontSector = nSectors
	
	;dista = dista - 4
	;distb = distb - 4
	                                               
	fh = fh - StepHeight
	ch = ch - StepHeight
	SetSectorProperty ( nSectors, FloorHeight, fh )
	SetSectorProperty ( nSectors, CeilingHeight, ch )

	xc = xa
	yc = ya
	xd = xb
	yd = yb
	RotatePoint ( xa, ya, x, y, dista, angl )
	RotatePoint ( xb, yb, x, y, distb, angl )
	NewLineDef xc, yc, xa, ya
	NewLineDef xd, yd, xc, yc
	NewLineDef xb, yb, xd, yd
	NewLineDef xa, ya, xb, yb
next
