// Rage

ACTOR RageSphereSpawnActor : CustomInventory 10073
{
	Tag "Rage Sphere"
	//$Category Powerups
	//$Sprite BLDSA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 1 A_SpawnItemEx("RageSphereSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	}
}

ACTOR RageSphereSpawner : RandomSpawner
{
	DropItem "RageSphere"
}

ACTOR RageSphere : CustomInventory
{
  +FLOAT
  +FLOATBOB
  +COUNTITEM
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  -INVENTORY.INVBAR
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickupMessage "RAGE!"
  Inventory.PickupAnnouncerEntry "rage"
  Inventory.RespawnTics 2100
  Tag "Rage Sphere"
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SphereNoGravCheck") == true,"NoGrav")
  SpawnLoop:
    BLDS ABCD 6 Bright
    Loop
  NoGrav:
	TNT1 A 0 A_ScaleVelocity(0)
	TNT1 A 0 A_ChangeFlag(NOGRAVITY,true)
	Goto SpawnLoop
  Pickup:
	TNT1 A 0 A_TakeInventory("PowerPickupProtection")
	TNT1 A 0 A_GiveInventory("RageSphereInvulnerable")
	TNT1 A 0 A_GiveInventory("RageSphereIcon")
	TNT1 A 0 A_Print("\n\nRAGE!!")
	TNT1 A 0 A_Jump(8,"Major")
	TNT1 A 0 A_Jump(64,"Haste1","Haste2","Haste3","Haste4","Haste5","Haste6","Haste7","Haste8","Regen1","Regen2","Regen3","Regen4","Regen5","Regen6","Regen7","Strength1","Strength2","Strength3","Strength4","Strength5","Strength6","Quad1","Quad2","Quad3","Quad4","Quad5","Prosperity1","Prosperity2","Prosperity3","Prosperity4","Spread1","Spread2","Spread3","Drain1","Drain2")
	TNT1 A 0 A_Jump(256, "Minor1", "Minor2", "Minor3", "Minor4", "Minor5", "Minor6", "Minor7", "Minor8", "Minor9")
	Stop
  Minor1:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	Stop
  Minor2:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	Stop
  Minor3:
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	Stop
  Minor4:
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	Stop
  Minor5:
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	Stop
  Minor6:
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	Stop
  Minor7:
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	Stop
  Minor8:
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Minor9:
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Haste1:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	Stop
  Haste2:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	Stop
  Haste3:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	Stop
  Haste4:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	Stop
  Haste5:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	Stop
  Haste6:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Haste7:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	Stop
  Haste8:
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Regen1:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	Stop
  Regen2:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	Stop
  Regen3:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	Stop
  Regen4:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	Stop
  Regen5:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	Stop
  Regen6:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Regen7:
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Strength1:
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	Stop
  Strength2:
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	Stop
  Strength3:
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	Stop
  Strength4:
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	Stop
  Strength5:
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Strength6:
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Quad1:
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	Stop
  Quad2:
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	Stop
  Quad3:
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	Stop
  Quad4:
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Quad5:
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Prosperity1:
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	Stop
  Prosperity2:
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	Stop
  Prosperity3:
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Prosperity4:
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Spread1:
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	Stop
  Spread2:
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Spread3:
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Drain1:
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	Stop
  Drain2:
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  Major:
	// "Ragesphere, give me everything."
	// "What do you mean everyt--"
	// "EEVVEERRYYTTHHIIIIINNNGGG!!!!"
	TNT1 A 0 A_GiveInventory("RageSphereDoubleFire")
	TNT1 A 0 A_GiveInventory("RageSphereSpeed")
	TNT1 A 0 A_GiveInventory("RageSphereRegeneration")
	TNT1 A 0 A_GiveInventory("RageSphereStrength")
	TNT1 A 0 A_GiveInventory("RageSphereQuadDamage")
	TNT1 A 0 A_GiveInventory("DoomSphereShortIcon")
	TNT1 A 0 A_GiveInventory("RageSphereInfiniteAmmo")
	TNT1 A 0 A_GiveInventory("RageSphereSpread")
	TNT1 A 0 A_GiveInventory("RageSphereDrain")
	TNT1 A 0 A_GiveInventory("RageSphereTurbo")
	TNT1 A 0 A_GiveInventory("RageSphereInvis")
	Stop
  }
}

ACTOR RageSphereIcon : Powerup
{
	Inventory.Icon "RAGESP1"
	Powerup.Duration -10
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereReflection : PowerupGiver
{
	Powerup.Type "Reflection"
	Inventory.MaxAmount 0
	Powerup.Duration -10
	Inventory.PickupMessage ""
	Inventory.PickupSound ""
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereQuadDamage : PowerupGiver
{
	Powerup.Type "QuadDamage"
	Inventory.MaxAmount 0
	Powerup.Duration -10
	Inventory.PickupMessage ""
	Inventory.PickupSound ""
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereInvulnerable : PowerupGiver
{
	Powerup.Type "RageInvulnerable"
	Powerup.Duration -10
	Powerup.ColorMap 1.5,0.75,0.0
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereDoubleFire : PowerupGiver
{
	Powerup.Type "PowerDoubleFiringSpeed"
	Powerup.Duration -10
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereSpeed : PowerupGiver
{
	Powerup.Type "IDMSpeed"
	Powerup.Duration -10
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereHighJump : PowerupGiver
{
	Powerup.Type "PowerHighJump"
	Powerup.Duration -10
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereRegeneration : PowerupGiver
{
	Powerup.Type "IDMRegeneration"
	Powerup.Strength 25
	Powerup.Duration -10
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereStrength : PowerupGiver
{
	Powerup.Type "IDMWeaponLevel2"
	Powerup.Duration -10
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereInfiniteAmmo : PowerupGiver
{
	Powerup.Duration -10
	Powerup.Type "IDMInfiniteAmmo"
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereSpread : PowerupGiver
{
	Powerup.Duration -10
	Powerup.Type "IDMSpread"
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereDrain : PowerupGiver
{
	Powerup.Duration -10
	Powerup.Type "IDMDrain"
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereTurbo : PowerupGiver
{
	Powerup.Duration -10
	Powerup.Type "IDMTurbo"
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}

ACTOR RageSphereInvis : PowerupGiver
{
	Powerup.Duration -10
	Powerup.Type "IDMInvisibility"
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
}