actor SoccerBallPlatform 10828
{
//$Category MM8BDM-Interactive Props
//$Title Soccer Ball
//$Arg0 Rise Height
obituary "%o was punctured by a soccer ball platform."
+SOLID
+SHOOTABLE
+NODAMAGE
+ACTLIKEBRIDGE
+CANPASS
+NOBLOOD
Health 1
Mass 999999999
Height 56
radius 40
scale 2.5
species "MovingPlatform"
+THRUSPECIES
states
{
	Spawn:
	STKB A 0
	STKB A 0 A_SpawnItemEx("SoccerBallPlatformPlayerCheck", 0, 0, 4)
	SpawnLoop:
	STKB A 6 A_JumpIf(z-floorz==0, "Ready2Shoot")
	Goto Spawn
	Ready2Shoot:
	STKB A 0 A_JumpIf(pitch!=0, "RealReady")
	STKB A 0 A_SetPitch(args[0])
	STKB A 0 A_JumpIf(pitch==0, "DefaultPitch")
	STKB A 8
	RealReady:
	STKB A 0 A_ChangeFlag("CANPASS", 1)
	STKB A -1 A_ChangeFlag("NODAMAGE", 0)
	stop
	Death:
	STKB A 0 A_SpawnItemEx("SoccerBallPlatformRising",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	stop
	DefaultPitch:
	STKB A 0 A_SetPitch(8)
	goto Ready2Shoot+3
}
}

actor SoccerBallPlatformPlayerCheck
{
PROJECTILE
+HITTRACER
+THRUSPECIES
height 46
radius 35
renderstyle none
species "MovingPlatform"
damage (5)
damagetype "Misc"
states
{
Spawn:
PLAY A 0
PLAY A 1// A_Log("?")
stop
Death:
PLAY A 1
PLAY A 0 A_CheckFlag("PICKUP", "Pass", AAPTR_TRACER)
stop
Pass:
PLAY A 0 A_GiveToTarget("SoccerBallCanPass", 1)
PLAY A 0// A_Log("Get out of me!")
stop
}
}

actor SoccerBallCanPass : CustomInventory
{
states
{
Pickup:
TNT1 A 0 A_ChangeFlag("CANPASS", 0)
stop
}
}

actor SoccerBallPlatformRising : SoccerBallPlatform
{
+NOGRAVITY
-CANPASS
states
{
	Spawn:
	STKB A 0
	STKB A 0 A_PlaySoundEx("misc/soccerballplatform", Voice)
	Rising:
	STKB A 0 ThrustThingZ(0, 38, 0, 0)
	STKB CCDDEE 1 A_JumpIf(z-floorz>=pitch*32, "Hang")
	loop
	Hang:
	STKB C 0 A_stop
	STKB CCDDEECCDDEE 1
	Goto Death
	Death:
	STKB A 1 A_SpawnItemEx("SoccerBallPlatform", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	stop
}
}

actor SoccerBallPlatformSpike
{
Damagetype "Spiney"
PROJECTILE
+NOINTERACTION
+DONTREFLECT
damage (5)
radius 4
height 8
states
{
Spawn:
TNT1 A 0 
TNT1 A 1 A_ClearTarget
TNT1 A 1 A_ChangeFlag("NOINTERACTION", 0)
stop
}
}

actor SoccerBallPlatformBottomSpike : SoccerBallPlatformSpike
{
radius 40
}

actor SoccerBallPlatformSpiked : SoccerBallPlatform 10829
{
//$Category MM8BDM-Interactive Props
//$Title Soccer Ball (Spiked)
//$Arg0 Rise Height
states
{
	Spawn:
	STKB F 0 A_SpawnItemEx("SoccerBallPlatformSpike", 0, 0, 56)
	STKB A 0 A_SpawnItemEx("SoccerBallPlatformBottomSpike", 0, 0, -8)
	STKB FF 6 A_JumpIf(z-floorz==0, "Ready2Shoot")
	loop
	Ready2Shoot:
	STKB A 0 A_JumpIf(pitch!=0, "RealReady")
	STKB A 0 A_SetPitch(args[0])
	STKB A 0 A_JumpIf(pitch==0, "DefaultPitch")
	STKB F 8
	RealReady:
	Spike:
	STKB A 0 A_SpawnItemEx("SoccerBallPlatformSpike", 0, 0, 56)
	STKB F 12 A_ChangeFlag("NODAMAGE", 0)
	loop
	Death:
	STKB A 0 A_SpawnItemEx("SoccerBallPlatformRisingSpiked",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	stop
	DefaultPitch:
	STKB A 0 A_SetPitch(8)
	goto Ready2Shoot+3
}
}


actor SoccerBallPlatformRisingSpiked : SoccerBallPlatformRising
{
states
{
	Spawn:
	STKB A 0
	STKB A 0 A_PlaySoundEx("misc/soccerballplatform", Voice)
	Rising:
	STRK A 0 A_SpawnItemEx("SoccerBallPlatformSpike", 0, 0, 56)
	STKB A 0 ThrustThingZ(0, 38, 0, 0)
	STKB GGHHII 1 A_JumpIf(z-floorz>=pitch*32, "Hang")
	STKB A 0 ThrustThingZ(0, 38, 0, 0)
	STKB GGHHII 1 A_JumpIf(z-floorz>=pitch*32, "Hang")
	loop
	Hang:
	STKB C 0 A_stop
	STRK A 0 A_SpawnItemEx("SoccerBallPlatformSpike", 0, 0, 56)
	STKB GGHHIIGGHHII 1
	Goto Death
	Death:
	STKB A 1 A_SpawnItemEx("SoccerBallPlatformSpiked", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION|SXF_TRANSFERPITCH)
	stop
}
}

actor SoccerBallBridgeFixer 10830
{
//$Category MM8BDM-Interactive Props
+ACTLIKEBRIDGE
+CANPASS
+THRUSPECIES
species "MovingPlatform"
-SHOOTABLE
+NOGRAVITY
+SOLID
+THRUGHOST
renderstyle none
radius 48
height 8
states
{
	Spawn:
	WLE1 D -1
	stop
}
}

actor TheKeeper 11761
{
//$Category MM8BDM-Props
+SOLID
+NOGRAVITY 
+FORCEYBILLBOARD
height 32
radius 16
scale 2.5
States 
{
Spawn: 
KEPR A 150
KEPR B 35
KEPR C 35
KEPR A 70
KEPR B 20
KEPR A 35
KEPR C 20
KEPR B 35
KEPR C 35
loop 
}
}

actor MechaPitchan 10832
{
//$Category MM8BDM-Props
radius 32
height 32
renderstyle none
+NOINTERACTION
states
{
Spawn:
MPIT A 0
MPIT A 1 A_Jump(256, "Blue", "Orange")
Blue:
MPIT A 1 A_SpawnItemEx("BluePitchan")
stop
Orange:
MPIT A 1 A_SpawnItemEx("OrangePitchan")
stop
}
}

actor BluePitchan
{
radius 32
height 32
scale 2.5
translation "192:192=4:4", "198:198=71:71"
states
{
Spawn:
MPIT A -1
stop
}
}

actor OrangePitchan : BluePitchan
{
translation "192:192=4:4", "198:198=172:172"
}
