// Guardsphere

ACTOR PowerIDMQuarterDamage : PowerProtection
{
    DamageFactor "Normal", 0.25
	Inventory.Icon "GARDSP1"
	+DONTRIP
}

ACTOR GuardsphereProtection : PowerupGiver
{
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	-INVENTORY.INVBAR
	Inventory.MaxAmount 0
	Powerup.Type "IDMQuarterDamage"
	Powerup.Duration -30
	Powerup.Color GreenMap
}

ACTOR IDMGuardSphere : CustomInventory 10076
{
    +FLOAT
    +FLOATBOB
	+COUNTITEM
    +NOGRAVITY
	-INVENTORY.INVBAR
	+INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	Inventory.PickupMessage "Guardsphere!"
    Inventory.PickupSound "misc/impkup"
	Inventory.PickupAnnouncerEntry "guardsphere"
	Inventory.RespawnTics 3150
	Tag "Guardsphere"
    //$Category Powerups
	States
	{
	Spawn:
	  GARD 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\nGuardsphere!\n\n\n\n75% damage resistance!")
	  TNT1 A 0 A_GiveInventory("GuardSphereProtection")
	  Stop
	}
}