// Strength / Weapon Upgrade

ACTOR StrengthSphereSpawnActor : CustomInventory 10070
{
	Tag "Strength Sphere"
	//$Category Powerups
	//$Sprite BERSA0
	+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("StrengthSphereSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	}
}

ACTOR StrengthSphereSpawner : RandomSpawner
{
	DropItem "StrengthSphere"
}

ACTOR PowerIDMWeaponLevel2 : PowerWeaponLevel2
{
	Inventory.Icon "STRENG1"
}

ACTOR StrengthSphere : CustomInventory
{
	+COUNTITEM
	+FLOAT
	+FLOATBOB
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
	Inventory.PickupMessage "Strength!"
	Inventory.PickupSound "misc/p_pkup"
	Inventory.PickupAnnouncerEntry "strength"
	Inventory.RespawnTics 2100
	Tag "Strength Sphere"
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SphereNoGravCheck") == true,"NoGrav")
	SpawnLoop:
	  BERS ABCDEFGHHGFEDCBA 5 Bright
	  Loop
	NoGrav:
	  TNT1 A 0 A_ScaleVelocity(0)
	  TNT1 A 0 A_ChangeFlag(NOGRAVITY,true)
	  Goto SpawnLoop
	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\n\nStrength!\n\n\n\n200 Health!\nYour weapons are powered up!")
	  TNT1 A 0 Healthing(200,200)
	  TNT1 A 0 A_GiveInventory("StrengthSphereLevel2")
	  TNT1 A 0 A_GiveInventory("StrengthPowerupTrail")
	  Stop
	}
}

ACTOR StrengthSphereLevel2 : PowerupGiver
{
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
	Powerup.Type IDMWeaponLevel2
	Powerup.Color "White", 0.125
	Powerup.Duration -30
}

ACTOR StrengthPowerupTrail : PowerSpeed
{
	+CLIENTSIDEONLY
	-INVENTORY.INVBAR
	Powerup.Duration -30
	Inventory.Amount 1
	Inventory.MaxAmount 10
	Speed 1.0
}

ACTOR ModifierLevel2 : PowerupGiver
{
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
	Powerup.Type IDMWeaponLevel2
	Powerup.Duration 0x7FFFFFFF
}