// Frag Armor

ACTOR FragArmorSpawnActor : CustomInventory 10063
{
	Tag "Frag Armor"
	//$Category Health and Armor
	//$Sprite ARMAA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(CallACS("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 1,"ShotGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 2,"BulletGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("FragArmorSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	ShotGun:
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("BulletArmorSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("TechArmorSpawner")
	  Stop
	}
}

ACTOR FragArmorSpawner : RandomSpawner
{
	DropItem "FragArmor"
}

ACTOR FragArmor : CustomInventory
{
  Radius 20
  Height 16
  Inventory.PickupMessage "Frag Armor!"
  Inventory.PickupSound ""
  Inventory.RespawnTics 1050
  Tag "Frag Armor"
  +BASEARMOR
  States
  {
  Spawn:
    ARMA A -1 Bright
    Stop
  Pickup:
    TNT1 A 0 A_JumpIfArmorType("FragArmorProtection","Ammo",200)
    TNT1 A 0 A_JumpIfArmorType("BulletArmorProtection","Ammo",200)
    TNT1 A 0 A_JumpIfArmorType("TechArmorProtection","Ammo",200)
    TNT1 A 0 A_JumpIfArmorType("IDMYellowArmor","Ammo",200)
    TNT1 A 0 A_JumpIfArmorType("IDMBlueArmor","Ammo",200)
    TNT1 A 0 A_JumpIfArmorType("IDMRedArmor","Ammo",200)
    TNT1 A 0 A_JumpIfArmorType("PurpleArmor","Ammo",200)
    TNT1 A 0 A_JumpIfArmorType("SuperArmor","Ammo",200)
	TNT1 A 0 A_PlaySound("misc/ammarmor_pkup",CHAN_ITEM)
    TNT1 A 0 A_GiveInventory("FragArmorProtection")
    TNT1 A 0 A_GiveInventory("IDMRocketAmmo",15)
	Stop
  ArmorUpgrade:
	TNT1 A 0 A_PlaySound("misc/ammarmor_pkup",CHAN_ITEM)
    TNT1 A 0 A_GiveInventory("FragArmorBonus")
    TNT1 A 0 A_GiveInventory("IDMRocketAmmo",15)
	Stop
  Ammo:
	TNT1 A 0 A_PlaySound("misc/ammo_pkup",CHAN_ITEM)
    TNT1 A 0 A_GiveInventory("IDMRocketAmmo",15)
    Stop
  }
}

ACTOR FragArmorProtection : BasicArmorPickup
{ 
  Radius 20
  Height 16
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  Inventory.Icon "ARMAA0"
  Armor.SavePercent 75
  Armor.SaveAmount 200
  DamageFactor "Rocket", 0.125
  DamageFactor "Grenade", 0.125
  DamageFactor "Hellstorm", 0.125
  States
  {
  Spawn:
    TNT1 A 0
    Stop
  }
}

ACTOR FragArmorBonus : BasicArmorBonus
{
	Armor.SavePercent 75
	Armor.SaveAmount 100
	Armor.MaxSaveAmount 200
	Armor.MaxBonus 100
	Armor.MaxBonusMax 100
}