// Soulsphere

ACTOR SoulSphereSpawnActor : CustomInventory 10071
{
	Tag "Soulsphere (Insanity)"
	//$Category Powerups
	//$Sprite SOULA0
	+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("SoulsphereSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	}
}

ACTOR SoulSphereSpawner : RandomSpawner
{
	DropItem "IDMSoulsphere"
}

ACTOR IDMSoulsphere : CustomInventory
{
  +COUNTITEM
  +FLOAT
  +FLOATBOB
  +INVENTORY.AUTOACTIVATE
  -INVENTORY.INVBAR
  +INVENTORY.ALWAYSPICKUP
  +SUPERHEALTH
  Inventory.RespawnTics 2100
  Inventory.PickupMessage "Soulsphere!"
  Inventory.PickupSound "misc/p_pkup"
  Inventory.PickupAnnouncerEntry "soulsphere"
  Tag "Soulsphere"
  States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SphereNoGravCheck") == true,"NoGrav")
  SpawnLoop:
    SOUL ABCDCB 6 Bright
    Loop
  NoGrav:
	TNT1 A 0 A_ScaleVelocity(0)
	TNT1 A 0 A_ChangeFlag(NOGRAVITY,true)
	Goto SpawnLoop
  Pickup:
	TNT1 A 0 A_Print("\n\n\n\n\n\nSoulsphere!\n\n\n\n300 Health!\nHealth pickups are doubled!",4)
	TNT1 A 0 A_GiveInventory("SoulSphereHealth")
	TNT1 A 0 A_GiveInventory("PowerSoul")
	Stop
  }
}

ACTOR SoulSphereHealth : Health
{
  Inventory.Amount 300
  Inventory.MaxAmount 300
  +INVENTORY.ALWAYSPICKUP
  -INVENTORY.INVBAR
}

ACTOR PowerSoul : PowerStrength
{
	-INVENTORY.INVBAR
	Powerup.Color 0, 0, 128, 0.5
}