//=================================================================================================
//
// Turbosphere
//
//=================================================================================================

ACTOR Turbosphere : PowerupGiver 5030
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 169
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type Speed
	Powerup.Color BlueMap
	Powerup.Duration 1050
	Inventory.PickupMessage "Turbo Sphere!"
	Inventory.PickupAnnouncerEntry "turbosphere"
	States
	{
	Spawn:
		TURB ABCD 3 Bright
		Loop
	}
}

//=================================================================================================
//
// Time freeze sphere
//
//=================================================================================================

ACTOR TimeFreezeSphere : PowerupGiver 5032
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 171
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type TimeFreezer
	Powerup.Color GoldMap
	Inventory.PickupMessage "Time freeze!"
	Inventory.PickupAnnouncerEntry "timefreeze"
	States
	{
	Spawn:
		TIME ABCD 6 Bright
		Loop
	}
}

//=================================================================================================
//
// Skulltag's invisibility sphere. It's a little different in that it alters your alpha.
//
//=================================================================================================

ACTOR InvisibilitySphere : PowerupGiver 5035
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 174
	+COUNTITEM
	+NOGRAVITY
	+VISIBILITYPULSE
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type Shadow // Translucency // Not implemented in ZDoom... How many invis variant do we need anyway?
	RenderStyle Translucent
	Inventory.PickupMessage "Invisibility!"
	Inventory.PickupAnnouncerEntry "invisibility"
	States
	{
	Spawn:
		SINV ABCD 6 Bright
		Loop
	}
}	

//=================================================================================================
//
// Doomsphere
//
//=================================================================================================

ACTOR PowerQuadDamage : PowerDamage
{
	Damagefactor "normal", 4
}

ACTOR Doomsphere : PowerupGiver 5036
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 175
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type QuadDamage
	Powerup.Color RedMap
	Inventory.PickupMessage "Doomsphere!"
	Inventory.PickupAnnouncerEntry "doomsphere"
	States
	{
	Spawn:
		DOOM A 10 Bright
		DOOM B 15 Bright
		DOOM C 8 Bright
		DOOM D 6 Bright
		Loop
	}
}

//=================================================================================================
//
// Guardsphere
//
//=================================================================================================

ACTOR PowerQuarterDamage: PowerProtection
{
	Damagefactor "normal", 0.25
}

ACTOR Guardsphere : PowerupGiver 5037
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 0
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type QuarterDamage
	Powerup.Color GreenMap
	Inventory.PickupMessage "Guardsphere"
	Inventory.PickupAnnouncerEntry "guardsphere"
	States
	{
	Spawn:
		GARD ABCD 6 Bright
		Loop
	}
}

//=================================================================================================
//
// PowerTerminatorArtifact
//
//=================================================================================================
/* Not implemented in ZDoom
ACTOR PowerTerminatorArtifact : Powerup native
{
	Powerup.Duration 0
}

//=================================================================================================
//
// Terminator
//
//=================================================================================================

ACTOR Terminator : PowerupGiver -1
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 0
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type TerminatorArtifact
	Inventory.PickupMessage "$PICKUP_TERMINATOR"
	Inventory.PickupAnnouncerEntry "terminator"
	States
	{
	Spawn:
		ARNO ABCD 6 Bright
		Loop
	}
}

//=================================================================================================
//
// PowerPossessionArtifact 
//
//=================================================================================================

ACTOR PowerPossessionArtifact : Powerup native
{
	Powerup.Duration 0
}

//=================================================================================================
//
// Possession stone
//
//=================================================================================================

ACTOR PossessionStone : PowerupGiver -1
{
	Game Doom
	Game Heretic
	Game Hexen
	SpawnID 0
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0
	Powerup.Type PossessionArtifact
	Inventory.PickupMessage "$PICKUP_POSSESSIONSTONE"
	States
	{
	Spawn:
		PPOS ABCDEF 6 Bright
		Loop
	}
}
*/

//=================================================================================================
//
// RandomPowerup
//
//=================================================================================================

ACTOR RandomPowerup : CustomInventory 5039 //RandomInventory 5039 // Inherits from RandomInventory now
{
	Game Doom
	SpawnID 176
	+COUNTITEM
	+NOGRAVITY
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.MaxAmount 0

	// action native A_RandomPowerupFrame (); // de-nativized in ZDoom

	States
	{
	Spawn:
		MEGA A 6 Bright
		SOUL A 6 Bright
		GARD A 6 Bright
		PINS A 6 Bright
		TIME A 6 Bright
		SINV A 6 Bright
		DOOM A 6 Bright
		TURB A 6 Bright
		Loop
	Use:
		TNT1 A 0 A_Jump(255,"Megasphere","Soulsphere","Guardsphere","BlurSphere","TimeFreezeSphere","InvisibilitySphere","Doomsphere","Turbosphere")
		Goto Spawn
	Megasphere:
		MEGA A 6 Bright A_GiveInventory("Megasphere",1)
		Stop
	Soulsphere:
		SOUL A 6 Bright A_GiveInventory("Soulsphere",1)
		Stop
	Guardsphere:
		GARD A 6 Bright A_GiveInventory("Guardsphere",1)
		Stop
	BlurSphere:
		PINS A 6 Bright A_GiveInventory("BlurSphere",1)
		Stop
	TimeFreezeSphere:
		TIME A 6 Bright A_GiveInventory("TimeFreezeSphere",1)
		Stop
	InvisibilitySphere:
		SINV A 6 Bright A_GiveInventory("InvisibilitySphere",1)
		Stop
	Doomsphere:
		DOOM A 6 Bright A_GiveInventory("Doomsphere",1)
		Stop
	Turbosphere:
		TURB A 6 Bright A_GiveInventory("Turbosphere",1)
		Stop
	}
}
