/// Common Weapon Class

ACTOR IDMWeapon : Weapon
{
	-WEAPON.ALLOW_WITH_RESPAWN_INVUL
	Inventory.RespawnTics 350
}

// Dummy inventory item for Duel

ACTOR DuelItem : Inventory
{
	Inventory.MaxAmount 1
}

/// Ammo ///

// Backpack

ACTOR BackPackSpawnActor : CustomInventory replaces Backpack
{
	Tag "Backpack"
	//$Category Ammunition
	//$Sprite BPAKA0
	+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("IDMBackpack")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	}
}

ACTOR IDMBackpack : Backpack
{
  Height 26
  Inventory.PickupMessage "Backpack!"
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.RespawnTics 2100
  Tag "Back Pack"
}

/// Ammo

// Bullets

ACTOR IDMClip : Ammo
{
  Inventory.PickupMessage "Bullets."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 20
  Inventory.MaxAmount 200
  Ammo.BackpackAmount 300
  Ammo.BackpackMaxAmount 300
  Inventory.Icon "CLIPA0"
  Inventory.RespawnTics 350
  Tag "Clip of bullets"
  States
  {
  Spawn:
    CLIP A -1
    Stop
  }
}

ACTOR IDMClipBox : IDMClip
{
  Inventory.PickupMessage "Big box of bullets."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 100
  Inventory.RespawnTics 1050
  Tag "Big box of bullets"
  States
  {
  Spawn:
    AMMO A -1
    Stop
  }
}

actor IDMSmallClipBox : IDMClip
{
  Inventory.PickupMessage "Small box of bullets."
  Inventory.Amount 50
  Inventory.RespawnTics 700
  Tag "Small box of bullets"
  States
  {
  Spawn:
    AMOK A -1
    Stop
  }
}

ACTOR ClipSpawner : RandomSpawner
{
	DropItem "IDMClip"
}

ACTOR ClipBoxSpawner : RandomSpawner
{
	DropItem "IDMClipBox"
}

ACTOR SmallClipBoxSpawner : RandomSpawner
{
	DropItem "IDMSmallClipBox"
}

ACTOR ClipSpawnActor : CustomInventory 10046
{
	Tag "Clip of bullets"
	//$Category Ammunition
	//$Sprite CLIPA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 1,"ShotGun")
	  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("ClipSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketAmmoSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellSpawner")
	  Stop
	}
}

ACTOR ClipBoxSpawnActor : CustomInventory 10047
{
	Tag "Big box of bullets"
	//$Category Ammunition
	//$Sprite AMMOA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 1,"ShotGun")
	  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("ClipBoxSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR SmallClipBoxSpawnActor : CustomInventory 10048
{
	Tag "Small box of bullets"
	//$Category Ammunition
	//$Sprite AMOKA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 1,"ShotGun")
	  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("SmallClipBoxSpawner")
	Nothing:
	  TNT1 A 1
	  TNT1 A -1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellPacketSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBundleSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellKitSpawner")
	  Stop
	}
}

// Shells

ACTOR IDMShell : Ammo
{
  Inventory.PickupMessage "Shells."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 4
  Inventory.MaxAmount 20
  Ammo.BackpackAmount 30
  Ammo.BackpackMaxAmount 30
  Inventory.Icon "SHELA0"
  Inventory.RespawnTics 350
  Tag "Shells"
  States
  {
  Spawn:
    SHEL A -1
    Stop
  }
}

ACTOR IDMShellBox : IDMShell
{
  Inventory.PickupMessage "Box of shells."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 10
  Inventory.RespawnTics 1050
  Tag "Box of shells"
  States
  {
  Spawn:
    SBOX A -1
    Stop
  }
}

ACTOR IDMShellPacket : IDMShell
{
  Inventory.PickupMessage "Packet of shells."
  Inventory.Amount 6
  Inventory.RespawnTics 700
  Tag "Packet of shells"
  States
  {
  Spawn:
    SHLK A -1
    Stop
  }
}

ACTOR ShellSpawner : RandomSpawner
{
	DropItem "IDMShell"
}

ACTOR ShellBoxSpawner : RandomSpawner
{
	DropItem "IDMShellBox"
}

ACTOR ShellPacketSpawner : RandomSpawner
{
	DropItem "IDMShellPacket"
}

ACTOR ShellSpawnActor : CustomInventory 10049
{
	Tag "Shells"
	//$Category Ammunition
	//$Sprite SHELA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 2,"BulletGun")
	  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("ShellSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketAmmoSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellSpawner")
	  Stop
	}
}
ACTOR ShellBoxSpawnActor : CustomInventory 10050
{
	Tag "Box of shells"
	//$Category Ammunition
	//$Sprite SBOXA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 2,"BulletGun")
	  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("ShellBoxSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR ShellPacketSpawnActor : CustomInventory 10051
{
	Tag "Packet of shells"
	//$Category Ammunition
	//$Sprite SHLKA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("GunModifierSpawn") == 666,"Nothing")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 2,"BulletGun")
	  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("ShellPacketSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("SmallClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBundleSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellKitSpawner")
	  Stop
	}
}

// Rockets

ACTOR IDMRocketAmmo : Ammo
{
  Inventory.PickupMessage "Rocket."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 1
  Inventory.MaxAmount 15
  Ammo.BackpackAmount 30
  Ammo.BackpackMaxAmount 30
  Inventory.Icon "ROCKA0"
  Inventory.RespawnTics 350
  Tag "Rocket"
  States
  {
  Spawn:
    ROCK A -1
    Stop
  }
}

ACTOR IDMRocketBox : IDMRocketAmmo
{
  Inventory.PickupMessage "Box of rockets."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 6
  Inventory.RespawnTics 1050
  Tag "Box of rockets"
  States
  {
  Spawn:
    BROK A -1
    Stop
  }
}

ACTOR IDMRocketBundle : IDMRocketAmmo
{
  Inventory.PickupMessage "Bundle of rockets."
  Inventory.Amount 3
  Inventory.RespawnTics 700
  Tag "Bundle of rockets"
  States
  {
  Spawn:
    RCKP A -1
    Stop
  }
}

ACTOR RocketAmmoSpawner : RandomSpawner
{
	DropItem "IDMRocketAmmo"
}

ACTOR RocketBoxSpawner : RandomSpawner
{
	DropItem "IDMRocketBox"
}

ACTOR RocketBundleSpawner : RandomSpawner
{
	DropItem "IDMRocketBundle"
}

ACTOR RocketAmmoSpawnActor : CustomInventory 10052
{
	Tag "Rocket"
	//$Category Ammunition
	//$Sprite ROCKA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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("RocketAmmoSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellSpawner")
	  Stop
	}
}

ACTOR RocketBoxSpawnActor : CustomInventory 10053
{
	Tag "Box of rockets"
	//$Category Ammunition
	//$Sprite BROKA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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("RocketBoxSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR RocketBundleSpawnActor : CustomInventory 10054
{
	Tag "Bundle of rockets"
	//$Category Ammunition
	//$Sprite RCKPA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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("RocketBundleSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellPacketSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("SmallClipBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellKitSpawner")
	  Stop
	}
}

// Cells

ACTOR IDMCell : Ammo
{
  Inventory.PickupMessage "Cell."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 20
  Inventory.MaxAmount 100
  Ammo.BackpackAmount 200
  Ammo.BackpackMaxAmount 200
  Inventory.Icon "CELLA0"
  Inventory.RespawnTics 350
  Tag "Cell"
  States
  {
  Spawn:
    CELL A -1
    Stop
  }
}

ACTOR IDMCellPack : IDMCell
{
  Inventory.PickupMessage "Cell pack."
  Inventory.PickupSound "misc/ammo_pkup"
  Inventory.Amount 100
  Inventory.RespawnTics 1050
  Tag "Cell pack"
  States
  {
  Spawn:
    CELP A -1
    Stop
  }
}

ACTOR IDMCellKit : IDMCell
{
  Inventory.PickupMessage "Cell kit."
  Inventory.Amount 50
  Inventory.RespawnTics 700
  Tag "Cell kit"
  States
  {
  Spawn:
    CELK A -1
    Stop
  }
}

ACTOR CellSpawner : RandomSpawner
{
	DropItem "IDMCell"
}

ACTOR CellPackSpawner : RandomSpawner
{
	DropItem "IDMCellPack"
}

ACTOR CellKitSpawner : RandomSpawner
{
	DropItem "IDMCellKit"
}

ACTOR CellSpawnActor : CustomInventory 10055
{
	Tag "Cell"
	//$Category Ammunition
	//$Sprite CELLA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 1 A_SpawnItemEx("CellSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketAmmoSpawner")
	  Stop
	}
}

ACTOR CellPackSpawnActor : CustomInventory 10056
{
	Tag "Cell pack"
	//$Category Ammunition
	//$Sprite CELPA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	}
}

ACTOR CellKitSpawnActor : CustomInventory 10057
{
	Tag "Cell kit"
	//$Category Ammunition
	//$Sprite CELKA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 1 A_SpawnItemEx("CellKitSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellPacketSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("SmallClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBundleSpawner")
	  Stop
	}
}

// Big Weapon Ammo

ACTOR IDMMana : Ammo
{
  Inventory.Amount 50
  Inventory.MaxAmount 100
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 100
  Tag "Mana pickup"
  Inventory.Icon "MANAJ0"
  Inventory.PickupMessage "Mana."
  Inventory.PickupSound "misc/mana_pkup"
  +FLOATBOB
  States
  {
  Spawn:
    MANA ABCDEFGHIJKLMNOP 4 Bright
    Loop
  }
}
/*
ACTOR IDMHellEnergy : Ammo
{
  Tag "Hell energy"
  Inventory.Amount 6
  Inventory.MaxAmount 12
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 12
  Inventory.Icon "PLS2A0"
  Inventory.PickupMessage "Hell energy."
  Inventory.PickupSound "misc/ammo_pkup"
  +FLOATBOB
  States
  {
  Spawn:
	HLEN AB 6 Bright
	Loop
  }
}*/

ACTOR IDMMaceAmmo : Ammo
{
  Tag "Mace spheres"
  Inventory.Amount 75
  Inventory.MaxAmount 150
  Ammo.BackPackAmount 0
  Ammo.BackPackMaxAmount 150
  Inventory.Icon "FX02C0"
  Inventory.PickupMessage "Mace spheres."
  Inventory.PickupSound "misc/ammo_pkup"
  States
  {
  Spawn:
    AMM1 A -1 Bright
    Stop
  }
}

ACTOR IDMCatAmmo : Ammo
{
  Tag "Cat-mag"
  Inventory.Amount 10
  Inventory.MaxAmount 20
  Ammo.BackPackAmount 0
  Ammo.BackPackMaxAmount 20
  Inventory.Icon "CLYAA0"
  Inventory.PickupMessage "Cat-mag."
  States
  {
  Spawn:
    CLYA ABCDCB 4 Bright
	Loop
  }
}

Actor IDMGas : Ammo
{
  Tag "Gas canister"
  Inventory.PickupSound "misc/ammpickup"
  Inventory.PickupMessage "Gas canister."
  Inventory.Amount 50
  Inventory.MaxAmount 100
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 100
  Inventory.Icon "AGASA0"
  States
  {
  Spawn:
    AGAS A -1
	Stop
  }
}

ACTOR MiniNuke : Ammo
{
  Tag "Mini-Nuke"
  Inventory.PickupSound "misc/ammpickup"
  Inventory.PickupMessage "Mini-Nuke."
  Inventory.Amount 1
  Inventory.MaxAmount 1
  Ammo.BackpackAmount 0
  Ammo.BackpackMaxAmount 1
  Inventory.Icon "MNUKA0"
  States
  {
  Spawn:
    MNUK A -1
	Stop
  }
}

ACTOR ManaSpawner : RandomSpawner
{
	DropItem "IDMMana"
}

ACTOR HellEnergySpawner : RandomSpawner
{
	DropItem "IDMHellEnergy"
}

ACTOR MaceAmmoSpawner : RandomSpawner
{
	DropItem "IDMMaceAmmo"
}

ACTOR CatAmmoSpawner : RandomSpawner
{
	DropItem "IDMCatAmmo"
}

ACTOR GasSpawner : RandomSpawner
{
	DropItem "IDMGas"
}

ACTOR MiniNukeSpawner : RandomSpawner
{
	DropItem "MiniNuke"
}

ACTOR ManaSpawnActor : CustomInventory 10090
{
	Tag "Mana"
	//$Category Ammunition
	//$Sprite MANAJ0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("ManaSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR HellEnergySpawnActor : CustomInventory 10091
{
	Tag "Hell energy"
	//$Category Ammunition
	//$Sprite HLENA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("HellEnergySpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR MaceAmmoSpawnActor : CustomInventory 10092
{
	Tag "Mace spheres"
	//$Category Ammunition
	//$Sprite AMM1A0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("MaceAmmoSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR CatAmmoSpawnActor : CustomInventory 10093
{
	Tag "Cat-mag"
	//$Category Ammunition
	//$Sprite CLYAA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("CatAmmoSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR GasSpawnActor : CustomInventory 10094
{
	Tag "Gas canister"
	//$Category Ammunition
	//$Sprite AGASA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("GasSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}

ACTOR MiniNukeSpawnActor : CustomInventory 10099
{
	Tag "Mini-Nuke"
	//$Category Ammunition
	//$Sprite MNUKA0
	+NOBLOCKMAP
	+NOGRAVITY
	States
	{
	Spawn:
	  TNT1 A 0
	  TNT1 A 1
	  TNT1 A 1 A_JumpIf(ACS_NamedExecuteWithResult("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") == 3,"ExplGun")
	  TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("WeaponGroupSpawn") == 4,"PlasmaGun")
	  TNT1 A 1 A_SpawnItemEx("MiniNukeSpawner")
	Nothing:
	  TNT1 A 1
	  Stop
	ShotGun:
	  TNT1 A 1 A_SpawnItemEx("ShellBoxSpawner")
	  Stop
	BulletGun:
	  TNT1 A 1 A_SpawnItemEx("ClipBoxSpawner")
	  Stop
	ExplGun:
	  TNT1 A 1 A_SpawnItemEx("RocketBoxSpawner")
	  Stop
	PlasmaGun:
	  TNT1 A 1 A_SpawnItemEx("CellPackSpawner")
	  Stop
	}
}