actor LegoSandileProp
{
	-SOLID
	scale 2.5
	radius 4
	height 4
	+NOGRAVITY
	States
	{
	Spawn:
		XCRE R -1
		stop
	}
}
actor LegoCreaturePropBase
{
	+NOGRAVITY
	+FLOATBOB
	+RANDOMIZE
	FloatSpeed 2
	height 2
	radius 2
	Scale 2.0
	mass 16
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Warp(AAPTR_DEFAULT, 0, 0, mass, 0, WARPF_NOCHECKPOSITION)
		TNT1 A 1 A_JumpIf(true, "SpawnLoop")
		wait
	SpawnLoop:
		TNT1 A 1
		wait
	}
}

actor LegoCreatureProp1 : LegoCreaturePropBase
{
	mass 64
	States
	{
	SpawnLoop:
		XCRE B 1
		wait
	}
}
actor LegoCreatureProp2 : LegoCreaturePropBase
{
	+FORCEXYBILLBOARD
	-FLOATBOB
	States
	{
	SpawnLoop:
		EVIL A 0
		EVIL ABBC 6
		TNT1 A 12
		TNT1 A 2 A_Jump(128,1)
		TNT1 A 2 A_Jump(128,1)
		TNT1 A 2 A_Jump(128,1)
		TNT1 A 2 A_Jump(128,1)
		TNT1 A 2
		EVIL BC 6
		loop
	}
}
actor LegoCreatureProp3 : LegoCreatureProp2 { mass 12 }
actor LegoCreatureProp4 : LegoCreatureProp2 { mass 20 }
actor LegoCreatureProp5 : LegoCreatureProp2 { mass 22 }
actor LegoCreatureProp6 : LegoCreatureProp2 { mass 14 }
actor LegoCreatureProp7 : LegoCreaturePropBase
{
	States
	{
	SpawnLoop:
		XCRE Q 1
		wait
	}
}

actor LegoCreatureProp8 : LegoCreaturePropBase
{
	Scale 1.5
	mass 32
	States
	{
	SpawnLoop:
		XCRE LLLLL 35
		XCRE M 2
		XCRE N 70
		XCRE MLMNNNNNMLM 2
		XCRE N 70
		XCRE MLM 2
		XCRE N 70
		XCRE M 0 A_JumpIf(random(1, 4) == 4, "Roar")
		XCRE M 2
		loop
	Roar:
		XCRE O 0 A_ChangeFlag(FLOATBOB, false)
		XCRE O 4
		XCRE PAPAPAPAPAPAPAPAPAPAPAPAPAPAPA 2
		XCRE O 2
		XCRE O 0 A_ChangeFlag(FLOATBOB, true)
		goto SpawnLoop+6
	}
}

actor LegoCreatureProp9 : LegoCreaturePropBase
{
	mass 16
	States
	{
	SpawnLoop:
		XCRE C 1
		wait
	}
}

actor LegoCreatureProp10 : LegoCreaturePropBase
{
	-NOGRAVITY
	-FLOATBOB
	Scale 2.0
	mass 1
	States
	{
	SpawnLoop:
		XCRE DDDDDDDDDD 35
		XCRE EFGH 2
		XCRE GGGG 35
		XCRE FE 3
		loop
	}
}

actor LegoCreatureWormLauncher
{
	-SOLID
	+NOINTERACTION
	+NOGRAVITY
	mass 3
	health 30
	States
	{
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_SpawnItemEx("LegoCreatureWormHead", 0, 0, 0, 1, 0, 0, 0, SXF_MULTIPLYSPEED)
	BodyLoop:
		TNT1 A 1 A_SetTics(mass)
		TNT1 A 0 A_SpawnItemEx("LegoCreatureWormBody", 0, 0, 0, 1, 0, 0, 0, SXF_MULTIPLYSPEED)
		TNT1 A 0 A_GiveInventory("CutterFlag", 1)
		TNT1 A 0 A_JumpIfInventory("CutterFlag", health, "End")
		loop
	End:
		TNT1 A 0
		stop
	}
}

actor LegoCreatureWormHead
{
	PROJECTILE
	+DONTBLAST
	+DONTREFLECT
	+RIPPER
	height 10
	radius 5
	Speed 10
	Damage (5)
	scale 2.5
	States
	{
	Spawn:
		XCRE JJKK 1 A_Weave(0, 1.5, 0, 5.0)
		loop
	}
}

actor LegoCreatureWormBody : LegoCreatureWormHead
{
	States
	{
	Spawn:
		XCRE I 1 A_Weave(0, 1.5, 0, 5.0)
		loop
	}
}
