
ACTOR WensternShotgun : Weapon
{
    +FLOORCLIP
    Weapon.AmmoType "Shell"
    Weapon.AmmoGive 8
    Weapon.AmmoUse 1
    Weapon.KickBack 50
    Inventory.PickupSound "Misc/w_pkup" 
    Inventory.PickupMessage "Picked up an old western shotgun."

//ALBERT
  Weapon.SelectionOrder 903
  Weapon.SlotNumber 3	
  Weapon.SlotPriority 0.2
  +SHOOTABLE
  +NOBLOOD
  //+CANPASS
  +WINDTHRUST
  Health 10

  /*
  Weapon.AmmoType2 "Shell"
  Weapon.AmmoUse2 0
  +WEAPON.ALT_AMMO_OPTIONAL
  //+WEAPON.AMMO_CHECKBOTH //Not in Zandronum 1.3
  */

    States
    {
    Spawn:
        WSRN A -1
        Loop
    Ready:
		WSTG A 1 A_WeaponReady(WRF_NOSWITCH)
		//WSTG A 0 A_JumpIfNoAmmo("NoAmmo")
		WSTG A 0 A_WeaponReady
		Loop
    /* Not doing the shell loading thing for WesternShotgun because
       the player already loads it one shell at a time!    
   NoAmmo:
		TNT1 A 0
        TNT1 A 0 A_JumpIfInventory("Shell", 1, "LoadShells")
        WSTG A 1 A_WeaponReady //So the user can switch weapons if they're out of ammo
		goto Ready
   LoadShells:
		TNT1 A 0 
		WSTG B 1 Offset(0,35)
		WSTG B 1 Offset(0,38)
		WSTG B 1 Offset(0,44)
		WSTG C 1 Offset(0,52)
		WSTG C 1 Offset(0,62)
		WSTG C 1 Offset(0,72)
		WSTG C 1 Offset(0,82)
   LoadShell:
        TNT1 A 0
        TNT1 A 0 A_Jump(256, "LoadShell1", "LoadShell2", "LoadShell3", "LoadShell4", "LoadShell5")
   LoadShell1:
		WSTG C 2 Offset(-1,82) A_PlaySound ("weapons/shotgf3", CHAN_WEAPON)
		WSTG C 3 Offset(0,82) 
   LoadShell2:
		WSTG C 2 Offset(-2,84) A_PlaySound ("weapons/shotgf3", CHAN_WEAPON)
		WSTG C 3 Offset(0,82)
   LoadShell3:
		WSTG C 2 Offset(-1,84) A_PlaySound ("weapons/shotgf3", CHAN_WEAPON)
		WSTG C 3 Offset(0,82) 
   LoadShell4:
		WSTG C 2 Offset(-3,84) A_PlaySound ("weapons/shotgf3", CHAN_WEAPON)
		WSTG C 3 Offset(0,82) 
   LoadShell5:
		WSTG C 2 Offset(-1,84) A_PlaySound ("weapons/shotgf3", CHAN_WEAPON)
		WSTG C 3 Offset(0,82) 
   FinishLoading:
        WSTG C 1 A_TakeInventory("Shell", 1)
        WSTG C 1 A_GiveInventory("LoadedWesternShell", 1)
        WSTG C 0 A_JumpIfInventory("LoadedWesternShell", 0, "DoneLoading")
        WSTG C 1 A_JumpIfInventory("Shell", 1, "LoadShell")
   DoneLoading:
        WSTG B 1 Offset(0,82)
		WSTG B 1 Offset(0,72)
		WSTG B 1 Offset(0,62)
		WSTG B 1 Offset(0,52)
		WSTG B 1 Offset(0,44)
		WSTG B 1 Offset(0,38)
		WSTG B 1 Offset(0,35)
		WSTG B 1 Offset(0,32)
		WSTG B 2 Offset(0,32)
		goto Ready
    */
    Deselect:
        WSTG A 1 A_Lower
        TNT1 AA 0 A_Lower
        Loop
    Select:
        WSTG A 1 A_Raise
        TNT1 AA 0 A_Raise
        Loop
    Fire:
		TNT1 A 0 A_GunFlash
		CHGG A 0 Radius_Quake(2, 4, 0, 2, 0)
        BSGN B 0 A_PlayWeaponSound("WSTFIR")
        WSF2 A 2 BRIGHT A_FireBullets(4.3, 4.3, 8, 7, "BulletPuff", 1)
        WSF2 B 2 BRIGHT
		//TNT1 A 0 A_JumpIfNoAmmo("NoAmmo")
		BSGN B 0 A_PlaySound("WSTLOAD")
        WSTG BCDEFGHIJKLMNOPQRS 2
        goto Ready
	Flash:
		WSTF AB 2 bright
		stop
}
}

//For backwards compatibility with saved inventory in multiplayer. 
//----> Use "WesternShotgun" in all new places.
Actor WesternShotgun : WensternShotgun replaces WensternShotgun {}
