// Bullet Armor

ACTOR BulletArmorSpawnActor : CustomInventory 10062
{
	Tag "Bullet Armor"
	//$Category Health and Armor
	//$Sprite ARMBA0
	+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") == 3,"ExplGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("BulletArmorSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("FragArmorSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("TechArmorSpawner")
	  Stop
	}
}

ACTOR BulletArmorSpawner : RandomSpawner
{
	DropItem "BulletArmor"
}

ACTOR BulletArmor : CustomInventory
{
	Radius 20
	Height 16
	Inventory.PickupMessage "Bullet Armor!"
	Inventory.PickupSound ""
	Inventory.RespawnTics 1050
	Tag "Bullet Armor"
	+BASEARMOR
	States
	{
	Spawn:
	  ARMB A -1 Bright
      Stop
	Pickup:
      TNT1 A 0 A_JumpIfArmorType("BulletArmorProtection","Ammo",200)
      TNT1 A 0 A_JumpIfArmorType("FragArmorProtection","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("BulletArmorProtection")
      TNT1 A 0 A_GiveInventory("IDMClip", 150)
      TNT1 A 0 A_GiveInventory("IDMShell", 20)
	  Stop
    ArmorUpgrade:
	  TNT1 A 0 A_PlaySound("misc/ammarmor_pkup",CHAN_ITEM)
      TNT1 A 0 A_GiveInventory("BulletArmorBonus")
      TNT1 A 0 A_GiveInventory("IDMClip", 150)
      TNT1 A 0 A_GiveInventory("IDMShell", 20)
	  Stop
	Ammo:
	  TNT1 A 0 A_PlaySound("misc/ammo_pkup",CHAN_ITEM)
      TNT1 A 0 A_GiveInventory("IDMClip", 150)
      TNT1 A 0 A_GiveInventory("IDMShell", 20)
      Stop
    }
}

ACTOR BulletArmorProtection : BasicArmorPickup
{
  Radius 20
  Height 16
  Inventory.PickupMessage ""
  Inventory.PickupSound ""
  Inventory.Icon "ARMBA0"
  Armor.SavePercent 66.6667
  Armor.SaveAmount 200
  DamageFactor "Bullet", 0.2
  DamageFactor "Nail", 0.2
  DamageFactor "Punch", 0.2
  DamageFactor "Saw", 0.2
  DamageFactor "Knife", 0.2
  DamageFactor "Blade", 0.2
  DamageFactor "Mace", 0.2
  States
  {
  Spawn:
    TNT1 A 0
    Stop
  }
}

ACTOR BulletArmorBonus : BasicArmorBonus
{
	Armor.SavePercent 66.6667
	Armor.SaveAmount 100
	Armor.MaxSaveAmount 200
	Armor.MaxBonus 100
	Armor.MaxBonusMax 100
}