//////////////////////////Glock18 Slot 1 MoonMan////////////////////////////////
ACTOR Glock18 : weapon //replaces pistol
{
  obituary "%o was killed by %k's Glock."
  decal MBulletChip
  Weapon.SlotNumber 0
  AttackSound "Weapons/GLOKFIR"
//  Inventory.ForbiddenTo "MoonMan", "ZyklonB", "WolfenPlayer"
//  Inventory.RestrictedTo "MoonMan"
  inventory.pickupmessage "You got the Glock!"
  weapon.ammotype "Clip"
  weapon.ammouse 1
  weapon.ammogive 25
  states
  {
	Ready:
		GLOK A 1 A_WeaponReady
		loop
	Deselect: 
		GLOK A 0 A_TakeInventory("GlockDummy", 17)
		GLOK A 1 A_Lower
		loop
	Select:
		GLOK A 0 A_TakeInventory("GlockDummy", 17)
		GLOK A 1 A_Raise
		loop
	Fire:
		GLOK A 0 A_JumpIfInventory("GlockDummy", 17, "Reload")
		GLOK A 1
		
		GLOK A 0 A_GunFlash
		GLOF A 2 BRIGHT Offset(0, 38) A_FireBullets(3.8, 3, 1, 4.5, "MoonPuff")
		GLOK A 1 Offset(0, 37) A_SetPitch(pitch-0.35)
		GLOK A 1 Offset(0, 36) 
		GLOK A 1 Offset(0, 35) A_SetPitch(pitch+0.35)
		GLOK B 1 Offset(0, 34) A_SpawnItemEx("BulletCasing", 25, 6, 32, frandom(1,3), frandom(2,4), frandom(1,3))
		GLOK B 1 
		GLOK B 1 Offset(0, 32) A_GiveInventory("GlockDummy")
		
		GLOK A 1 A_JumpIfInventory("GlockDummy", 17, "Reload")
		
		GLOK A 1 A_GunFlash
		GLOF A 2 BRIGHT Offset(0, 38) A_FireBullets(3.8, 3, 1, 4.5, "MoonPuff")
		GLOK A 1 Offset(0, 37) A_SetPitch(pitch-0.2)
		GLOK A 1 Offset(0, 36) 
		GLOK A 1 Offset(0, 35) A_SetPitch(pitch+0.2)
		GLOK B 1 Offset(0, 34) A_SpawnItemEx("BulletCasing", 25, 6, 32, frandom(1,3), frandom(2,4), frandom(1,3))
		GLOK B 1 
		GLOK B 1 Offset(0, 32) A_GiveInventory("GlockDummy")
		
		GLOK A 0 A_ReFire
		Goto Ready
	Reload:
		Goto AltFire
	AltFire:
		GLOK B 0 A_JumpIfInventory("GlockDummy", 1, 1)
		Goto Ready
		GLOK B 2 Offset(0, 45)
		GLOK B 2 Offset(0, 55)
		GLOK B 2 Offset(0, 65)
		GLOK B 2 Offset(0, 75) A_PlaySound("GLOKRLD", CHAN_WEAPON)
		GLOK B 2 Offset(0, 85) 
		GLOK B 2 Offset(0, 95)
		GLOK B 2 Offset(0, 105) A_TakeInventory("GlockDummy", 17)
		GLOK B 2 Offset(0, 115)
		GLOK B 2 Offset(0, 105)
		GLOK B 2 Offset(0, 95)
		GLOK B 2 Offset(0, 85)
		GLOK B 2 Offset(0, 65)
		GLOK B 2 Offset(0, 45)
		GLOK B 2 Offset(0, 32)
		Goto Ready
	Flash:
		TNT1 A 1 A_Light2
		TNT1 A 1 A_Light1
		TNT1 A 1 A_Light0
		Stop
	Spawn:
		GLOI A -1
		stop
  }
}

ACTOR GlockDummy : Inventory
{
	Inventory.MaxAmount 17
}

ACTOR RevolverDummy : Inventory
{
	Inventory.MaxAmount 6
}

Actor MoonPuff
{     
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_SpawnItemEx("BulletSmoke", 0, 0, 0, 0, 0, 1)
    Stop   
  }
}
////////////////////////////////////////////////////////////////////////////////
Actor Revolver : Weapon
{
	Obituary "%o was killed by %k's revolver."
	Weapon.Ammotype "Clip"
	Weapon.Ammogive 24
	Weapon.Ammouse 1
	Weapon.Slotnumber 0
	Decal MBulletChip
	AttackSound "REVLSHT"
	Inventory.PickupMessage "Picked up the revolver."
	States
	{
	Ready:
	REVL A 1 A_WeaponReady
	Loop
	Select:
	REVL A 0 A_TakeInventory("RevolverDummy", 6)
	REVL A 1 A_Raise
	Loop
	Deselect:
	REVL A 0 A_TakeInventory("RevolverDummy", 6)
	REVL A 1 A_Lower
	Loop
	Fire:
	REVL A 0 A_JumpIfInventory("RevolverDummy", 6, "Reload")
	REVL A 2
	REVL A 0 A_GunFlash
	REVL D 2 Bright A_FireBullets(2.5, 2.4, 1, 10, "MoonPuff")
	REVL D 0 Bright A_GiveInventory("RevolverDummy", 1)
	REVL B 1 A_SetPitch(pitch-0.5)
	REVL B 1 Offset(0,36)
	REVL B 1 Offset(0,42) A_SetPitch(pitch+0.5)
	REVL C 1 Offset(0,46)
	REVL C 1 Offset(0,43)
	REVL C 1 Offset(0,40)
	REVL C 1 Offset(0,37)
	REVL C 1 Offset(0,34)
	REVL C 2 Offset(0,32)
	REVL BA 2
	REVL A 1 A_Refire
	Goto Ready
	Reload:
	Goto AltFire
	AltFire:
	GLOK B 0 A_JumpIfInventory("RevolverDummy", 6, 1)
	Goto Ready
	REVL A 2 Offset(0, 45)
	REVL A 2 Offset(0, 55) 
	REVL A 2 Offset(0, 65)
	REVL A 2 Offset(0, 75) A_PlaySound("REVOUT", CHAN_WEAPON)
	REVL A 2 Offset(0, 85) 
	REVL A 2 Offset(0, 95) 
	REVL AAAAAA 0 A_SpawnItemEx("BulletCasing", 15, -6, 24, frandom(1,3), frandom(-4,-2), frandom(1,3))
	REVL A 2 Offset(0, 105) A_TakeInventory("RevolverDummy", 6)
	REVL A 9 Offset(0, 115) A_PlaySound("REVIN", CHAN_WEAPON)
	REVL A 9 Offset(0, 115) A_PlaySound("REVLOAD", CHAN_WEAPON)
	REVL A 2 Offset(0, 95)
	REVL A 2 Offset(0, 85)
	REVL A 2 Offset(0, 65)
	REVL A 2 Offset(0, 45)
	REVL A 2 Offset(0, 32)
	Goto Ready
	Flash:
	TNT1 A 1 A_Light2
	TNT1 A 1 A_Light1
	TNT1 A 1 A_Light0
	Stop
	}
}

//////////////////////////Wolfenstein Slot 2////////////////////////////////////
ACTOR Luger : Weapon
{
  Weapon.SelectionOrder 1900
  Weapon.AmmoUse 1
  Weapon.AmmoGive 20
  Weapon.AmmoType "Clip"
  Obituary "$OB_MPPISTOL"
  +WEAPON.WIMPY_WEAPON
  Inventory.Pickupmessage "$PICKUP_PISTOL_DROPPED"
  Tag "Luger"
  Decal MBulletChip
  States
  {
  Ready:
    LUGG A 1 A_WeaponReady
    Loop
  Deselect:
    LUGG A 1 A_Lower
    Loop
  Select:
    LUGG A 1 A_Raise
    Loop
  Fire:
    LUGG A 1
    LUGG A 1 A_GunFlash
    LUGF A 0 Bright A_PlaySound("LUGRSHT", CHAN_WEAPON)
    LUGF A 1 Bright A_FireBullets (3.2, 3.1, 1, 5, "MoonPuff")
    LUGF A 1 Bright Offset(0, 37) A_SetPitch(pitch-0.6)
    LUGG B 1 Offset(0,35) A_SpawnItemEx("BulletCasing", 25, 6, 32, frandom(1,3), frandom(2,4), frandom(1,3))
    LUGG B 1 Offset(0,34) A_SetPitch(pitch+0.6)
    LUGG B 1 Offset(0,33)
    LUGG BCAA 2 Offset(0,32)
    LUGG A 2 A_ReFire
    Goto Ready
  Flash:
    TNT1 A 1 A_Light2
    TNT1 A 1 A_Light1
    Goto LightDone
  Spawn:
    LUGP A -1
    Stop
  }
}
actor BlankPuff2: BulletPuff { DamageType "Pistol" }

actor BlankPuff2Bloodless : BlankPuff2 { -BLOODSPLATTER +BLOODLESSIMPACT }

actor WolfenBullet2: FastProjectile
{
    Damage (Random(1,3)*7)
    Radius 1
    Height 1
    Speed 320
    Projectile
    Species "Player"
    DamageType "Pistol"
    +BLOODSPLATTER
    +THRUSPECIES
    +NOTIMEFREEZE
    States
    {
      Spawn:
        TNT1 A 1
        loop

      Death:
        TNT1 A 1
        stop
    }
}

actor WolfenBulletSupplement//: WolfenBullet2
{
    Speed 120
    Damage (Random(1,3)*2)
    Radius 1
    Height 1
    Projectile
    Species "Player"
    DamageType "Pistol"
    -BLOODSPLATTER
	+BLOODLESSIMPACT
    +THRUSPECIES
    +NOTIMEFREEZE
	States
	{
      Spawn:
	    TNT1 A 0
        TNT1 A 1
		TNT1 A 0 A_Stop
		TNT1 A 0 A_Die
		stop

      Death:
        TNT1 A 1
        stop
	}
}

actor WolfenBulletSupplement2
{
    Speed 120
    Damage (Random(1,3)*2)
    Radius 1
    Height 1
    Projectile
    Species "Player"
    -BLOODSPLATTER
	+BLOODLESSIMPACT
    +THRUSPECIES
    +NOTIMEFREEZE
	States
	{
      Spawn:
	    TNT1 A 0
        TNT1 A 1
		TNT1 A 0 A_Stop
		TNT1 A 0 A_Die
		stop

      Death:
        TNT1 A 1
        stop
	}
}
////////////////////////////SLOT 2 WEAPON SPAWN SWAP////////////////////////////

//ACTOR Glock18A : Glock18
//{
// Inventory.ForbiddenTo ""
// Inventory.RestrictedTo "MoonMan"
//}

ACTOR PistolA : Pistol
{
	Weapon.SlotNumber 0
// Inventory.ForbiddenTo ""
// Inventory.RestrictedTo "ZyklonB"
}

//ACTOR LugerA : Luger
//{
// Inventory.ForbiddenTo ""
// Inventory.RestrictedTo "WolfenPlayer"
//}