// Resistance

ACTOR ResistSphere : CustomInventory 10077
{
    +FLOAT
    +FLOATBOB
    +COUNTITEM
    +NOGRAVITY
    +INVENTORY.AUTOACTIVATE
	+INVENTORY.ALWAYSPICKUP
	+INVENTORY.FANCYPICKUPSOUND
	-INVENTORY.INVBAR
	Inventory.PickupSound "misc/impkup"
	Inventory.MaxAmount 0
	Inventory.PickupMessage "Ballistic Resistance!"
	Inventory.PickupAnnouncerEntry "resistance"
	Inventory.RespawnTics 3150
	Tag "Ballistic Resistance"
    //$Category Powerups
	States
	{
	Spawn:
      BIOS A 28 Bright
	  BIOS B 14 Bright
      Loop
	Pickup:
	  TNT1 A 0 A_JumpIfInventory("TimeFreezeInvulnerable",1,3)
	  TNT1 A 0 A_JumpIfInventory("RageSphereInvulnerable",1,2)
	  TNT1 A 0 A_GiveInventory("PickupProtection")
	  TNT1 A 0 A_Print("\n\n\n\n\nBallistic Resistance!\n\n\n\n90% resistance to ballistic & melee attacks!")
	  TNT1 A 0 A_GiveInventory("ResistSphereProtection")
	  Stop
	}
}

ACTOR PowerResistance : PowerProtection
{
  DamageFactor "Bullet", 0.1
  DamageFactor "Nail", 0.1
  DamageFactor "Punch", 0.1
  DamageFactor "Saw", 0.1
  DamageFactor "Mace", 0.1
  Inventory.Icon "GRESIS1"
}

ACTOR ResistSphereProtection : PowerupGiver
{
  Inventory.MaxAmount 1
  Powerup.Type "Resistance"
  Powerup.Colormap 0.0,1.0,0.0
  Powerup.Duration -30
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  -INVENTORY.INVBAR
}


ACTOR ResistSphere2 : ResistSphere
{
  Inventory.RespawnTics 3150
  Inventory.PickupMessage "Explosive Resistance!"
  Tag "Explosive Resistance"
  //$Category Powerups
  States
  {
  Spawn:
    BIO2 A 28 Bright
	BIO2 B 14 Bright
    Loop
  Pickup:
	TNT1 A 0 A_JumpIfInventory("TimeFreezeInvulnerable",1,3)
	TNT1 A 0 A_JumpIfInventory("RageSphereInvulnerable",1,2)
	TNT1 A 0 A_GiveInventory("PickupProtection")
	TNT1 A 0 A_Print("\n\n\n\n\nExplosive Resistance!\n\n\n\n90% resistance to explosive attacks!")
	TNT1 A 0 A_GiveInventory("ResistSphere2Protection")
	Stop
  }
}

ACTOR PowerResistance2 : PowerProtection
{
  DamageFactor "Fire", 0.1
  DamageFactor "Rocket", 0.1
  DamageFactor "Grenade", 0.1
  DamageFactor "Hellstorm", 0.1
  Inventory.Icon "RRESIS1"
}

ACTOR ResistSphere2Protection : PowerupGiver
{
  Inventory.MaxAmount 1
  Powerup.Type "Resistance2"
  Powerup.Colormap 1.25,0.25,0.1
  Powerup.Duration -30
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  -INVENTORY.INVBAR
}

ACTOR ResistSphere3 : ResistSphere
{
  Inventory.RespawnTics 3150
  Inventory.PickupMessage "Plasma Resistance!"
  Tag "Plasma Resistance"
  //$Category Powerups
  States
  {
  Spawn:
    BIO3 A 28 Bright
	BIO3 B 14 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\nPlasma Resistance!\n\n\n\n90% resistance to plasma attacks!")
	TNT1 A 0 A_GiveInventory("ResistSphere3Protection")
	Stop
  }
}

ACTOR PowerResistance3 : PowerProtection
{
  DamageFactor "Slime", 0.1
  DamageFactor "Plasma", 0.1
  DamageFactor "HitPlasma", 0.1
  DamageFactor "RedPlasma", 0.1
  DamageFactor "Pulse", 0.1
  DamageFactor "Blaster", 0.1
  DamageFactor "Railgun", 0.1
  DamageFactor "BFGSpray", 0.1
  DamageFactor "BFG10k", 0.1
  DamageFactor "Reflection", 0.1
  Inventory.Icon "BRESIS1"
}

ACTOR ResistSphere3Protection : PowerupGiver
{
  Inventory.MaxAmount 1
  Powerup.Type "Resistance3"
  Powerup.Colormap 0.0,1.0,1.3
  Powerup.Duration -30
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  +INVENTORY.AUTOACTIVATE
  +INVENTORY.ALWAYSPICKUP
  -INVENTORY.INVBAR
}