// Turbosphere

ACTOR TurboSphereSpawnActor : CustomInventory 10084
{
	Tag "Turbosphere (Insanity)"
	//$Category Powerups
	//$Sprite TURBA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1 A_JumpIf(CallACS("BladeModeSpawn") == 666,"Nothing")
	  TNT1 A 1 A_SpawnItemEx("TurboSphereSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	}
}

ACTOR TurboSphereSpawner : RandomSpawner
{
	DropItem "IDMTurboSphere"
}

ACTOR IDMTurboSphere : CustomInventory
{
	+FLOAT
	+FLOATBOB
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+COUNTITEM
	-INVENTORY.INVBAR
	Inventory.PickupMessage "Turbosphere!"
	Inventory.PickupSound "misc/impkup"
	Inventory.PickupAnnouncerEntry "turbosphere"
	Inventory.RespawnTics 3150
	Inventory.MaxAmount 0
	Tag "Turbosphere"
	States
	{
	Spawn:
      TURB ABCD 6 Bright
      Loop
	Pickup:
	  TNT1 A 0 A_JumpIfInventory("PowerRageInvulnerable",1,"NoProt")
	  TNT1 A 0 A_GiveInventory("PickupProtection")
    NoProt:
	  TNT1 A 0 A_Print("\n\n\n\n\nTurbosphere!\n\n\n\n2x movement speed!")
	  TNT1 A 0 A_GiveInventory("TurboSphereSpeed")
	  Stop
	}
}

ACTOR PowerIDMTurbo : PowerSpeed
{
	Inventory.Icon "TURBSP1"
	Speed 2.0
}

ACTOR TurboSphereSpeed : PowerupGiver
{
	Powerup.Duration -30
	Powerup.Type "IDMTurbo"
	Powerup.ColorMap 1.5,0.5,0.0
	Inventory.MaxAmount 0
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}