// main damage reduced from 11 or 12
// fire damage reduced from 19



ACTOR Buckshot_LoadedShells : Inventory
{
	Inventory.MaxAmount 10
}

ACTOR Buckshot_Chamber_LoadedShells : Inventory
{
	Inventory.MaxAmount 20
}

ACTOR Buckshot : Weapon
{
	Weapon.AmmoUse1			0
	Weapon.AmmoUse2			0
	Weapon.AmmoGive 		8
	Weapon.AmmoType1			"Shell"
	Weapon.AmmoType2			"Shell"
	Inventory.PickupMessage		"You got the Buckshot!"
	Obituary			"%o got shelled by %k's Buckshot."
	
	Weapon.UpSound			"w2/load"
	AttackSound			"w2/fire"
	
	States
	{
		Ready:
			W5E1 V 10
			goto Ready0
		Ready0:
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 10, "Ready10")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 9, "Ready9")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 8, "Ready8")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 7, "Ready7")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 6, "Ready6")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 5, "Ready5")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 4, "Ready4")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 3, "Ready3")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 2, "Ready2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 1, "Ready1")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 0, 1)
			W5E1 A 1 A_WeaponReady
			goto Ready0
		Ready1:
			W5E1 B 1 A_WeaponReady
			goto Ready1
		Ready2:
			W5E1 C 1 A_WeaponReady
			goto Ready2
		Ready3:
			W5E1 D 1 A_WeaponReady
			goto Ready3
		Ready4:
			W5E1 E 1 A_WeaponReady
			goto Ready4
		Ready5:
			W5E1 F 1 A_WeaponReady
			goto Ready5
		Ready6:
			W5E1 G 1 A_WeaponReady
			goto Ready6
		Ready7:
			W5E1 H 1 A_WeaponReady
			goto Ready7
		Ready8:
			W5E1 I 1 A_WeaponReady
			goto Ready8
		Ready9:
			W5E1 J 1 A_WeaponReady
			goto Ready9
		Ready10:
			W5E1 K 1 A_WeaponReady
			goto Ready10
		Deselect:
			W5E1 V 1 A_Lower
			W5E1 V 0 A_Lower
			goto Deselect
		Select:
			W5E1 V 1 A_Raise
			W5E1 V 0 A_Raise
			goto Select
		Fire:
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 10, "Fire10")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 9, "Fire9")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 8, "Fire8")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 7, "Fire7")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 6, "Fire6")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 5, "Fire5")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 4, "Fire4")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 3, "Fire3")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 2, "Fire2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 1, "Fire1")
			W5E1 A 0 A_JumpIfInventory("Shell", 1, 2)
			W5E1 A 0 ACS_Execute(56,0,0,0,0)
		Fire1:
			W5E1 B 0 A_JumpIfInventory("Buckshot_LoadedShells", 1, 1)
			goto Ready0
			W5E1 B 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 B 3 A_GunFlash
			W5E1 A 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 A 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 A 10 A_Refire
			goto Ready0
		Fire2:
			W5E1 C 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 C 3 A_GunFlash
			W5E1 B 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 B 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 B 10 A_Refire
			goto Ready0
		Fire3:
			W5E1 D 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 D 3 A_GunFlash
			W5E1 C 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 C 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 C 10 A_Refire
			goto Ready0
		Fire4:
			W5E1 E 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 E 3 A_GunFlash
			W5E1 D 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 D 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 D 10 A_Refire
			goto Ready
		Fire5:
			W5E1 F 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 F 3 A_GunFlash
			W5E1 E 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 E 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 E 10 A_Refire
			goto Ready0
		Fire6:
			W5E1 G 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 G 3 A_GunFlash
			W5E1 F 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 F 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 F 10 A_Refire
			goto Ready0
		Fire7:
			W5E1 H 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 H 3 A_GunFlash
			W5E1 G 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 G 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 G 10 A_Refire
			goto Ready0
		Fire8:
			W5E1 I 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 I 3 A_GunFlash
			W5E1 H 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 H 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 H 10 A_Refire
			goto Ready0
		Fire9:
			W5E1 J 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 J 3 A_GunFlash
			W5E1 I 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 I 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 I 10 A_Refire
			goto Ready0
		Fire10:
			W5E1 K 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 K 3 A_GunFlash
			W5E1 J 7 A_FireBullets(6, 6, 7, 18, "BulletPuff_Standard")
			W5E1 J 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 J 10 A_Refire
			goto Ready0
		AltFire:
			W5E1 A 0 A_JumpIfInventory("Shell", 1, 2)
			W5E1 A 0 A_Jump(255, "Ready")
			W5E1 A 0 A_JumpIfInventory("Shell", 2, 2)
			W5E1 A 0 A_Jump(255, "AltFire2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 9, "Altfire2")
                        W2E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 0, "Ready")
			W2E1 A 1
			W2E1 B 3
			W2E1 C 4 A_TakeInventory("Shell", 2)
			W2E1 D 5 A_PlayWeaponSound("w2/load")
			W2E1 C 4 A_GiveInventory("Buckshot_LoadedShells", 2)
			W2E1 B 3 A_Refire
			goto Ready0
                Altfire2:
                        W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 10, "Ready")
                        W2E1 C 4 A_TakeInventory("Shell", 1)
			W2E1 D 5 A_PlayWeaponSound("w2/load")
			W2E1 C 4 A_GiveInventory("Buckshot_LoadedShells", 1)
			W2E1 B 3 A_Refire
                        goto Ready0
		Flash:
			SHTF A 2 bright A_Light1
			SHTF B 2 Bright A_Light2
			Goto LightDone
	}
}

ACTOR Buckshot_Chamber : Weapon
{

	Weapon.AmmoUse1			0
	Weapon.AmmoUse2			0
	Weapon.AmmoGive 		8
	Weapon.AmmoType1			"Shell"
	Weapon.AmmoType2			"Shell"
	Inventory.PickupMessage		"You got the Buckshot with an Extended Chamber!"
	Obituary			"%o got shelled by %k's Extended Buckshot."
	
	Weapon.UpSound			"w2/load"
	AttackSound			"w2/fire"
	
	States
	{
		Ready:
			W5E2 A 10
			goto Ready0
		Ready0:
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 20, "Ready20")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 19, "Ready19")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 18, "Ready18")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 17, "Ready17")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 16, "Ready16")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 15, "Ready15")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 14, "Ready14")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 13, "Ready13")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 12, "Ready12")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 11, "Ready11")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 10, "Ready10")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 9, "Ready9")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 8, "Ready8")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 7, "Ready7")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 6, "Ready6")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 5, "Ready5")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 4, "Ready4")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 3, "Ready3")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 2, "Ready2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 1, "Ready1")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 0, 1)
			W5E1 A 1 A_WeaponReady
			goto Ready0
		Ready1:
			W5E1 B 1 A_WeaponReady
			goto Ready1
		Ready2:
			W5E1 C 1 A_WeaponReady
			goto Ready2
		Ready3:
			W5E1 D 1 A_WeaponReady
			goto Ready3
		Ready4:
			W5E1 E 1 A_WeaponReady
			goto Ready4
		Ready5:
			W5E1 F 1 A_WeaponReady
			goto Ready5
		Ready6:
			W5E1 G 1 A_WeaponReady
			goto Ready6
		Ready7:
			W5E1 H 1 A_WeaponReady
			goto Ready7
		Ready8:
			W5E1 I 1 A_WeaponReady
			goto Ready8
		Ready9:
			W5E1 J 1 A_WeaponReady
			goto Ready9
		Ready10:
			W5E1 K 1 A_WeaponReady
			goto Ready10
		Ready11:
			W5E1 L 1 A_WeaponReady
			goto Ready11
		Ready12:
			W5E1 M 1 A_WeaponReady
			goto Ready12
		Ready13:
			W5E1 N 1 A_WeaponReady
			goto Ready13
		Ready14:
			W5E1 O 1 A_WeaponReady
			goto Ready14
		Ready15:
			W5E1 P 1 A_WeaponReady
			goto Ready15
		Ready16:
			W5E1 Q 1 A_WeaponReady
			goto Ready16
		Ready17:
			W5E1 R 1 A_WeaponReady
			goto Ready17
		Ready18:
			W5E1 S 1 A_WeaponReady
			goto Ready18
		Ready19:
			W5E1 T 1 A_WeaponReady
			goto Ready19
		Ready20:
			W5E1 U 1 A_WeaponReady
			goto Ready20
		Deselect:
			W5E2 A 1 A_Lower
			W5E2 A 0 A_Lower
			goto Deselect
		Select:
			W5E2 A 1 A_Raise
			W5E2 A 0 A_Raise
			goto Select
		Fire:
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 20, "Fire20")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 19, "Fire19")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 18, "Fire18")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 17, "Fire17")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 16, "Fire16")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 15, "Fire15")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 14, "Fire14")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 13, "Fire13")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 12, "Fire12")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 11, "Fire11")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 10, "Fire10")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 9, "Fire9")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 8, "Fire8")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 7, "Fire7")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 6, "Fire6")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 5, "Fire5")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 4, "Fire4")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 3, "Fire3")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 2, "Fire2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 1, "Fire1")
			W5E1 A 0 A_JumpIfInventory("Shell", 1, 2)
			W5E1 A 0 ACS_Execute(56,0,0,0,0)
		Fire1:
			W5E1 B 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 1, 1)
			goto Ready0
			W5E1 B 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 B 3 A_GunFlash
			W5E1 A 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 A 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 A 10 A_Refire
			goto Ready0
		Fire2:
			W5E1 C 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 C 3 A_GunFlash
			W5E1 B 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 B 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 B 10 A_Refire
			goto Ready0
		Fire3:
			W5E1 D 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 D 3 A_GunFlash
			W5E1 C 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 C 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 C 10 A_Refire
			goto Ready0
		Fire4:
			W5E1 E 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 E 3 A_GunFlash
			W5E1 D 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 D 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 D 10 A_Refire
			goto Ready
		Fire5:
			W5E1 F 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 F 3 A_GunFlash
			W5E1 E 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 E 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 E 10 A_Refire
			goto Ready0
		Fire6:
			W5E1 G 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 G 3 A_GunFlash
			W5E1 F 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 F 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 F 10 A_Refire
			goto Ready0
		Fire7:
			W5E1 H 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 H 3 A_GunFlash
			W5E1 G 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 G 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 G 10 A_Refire
			goto Ready0
		Fire8:
			W5E1 I 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 I 3 A_GunFlash
			W5E1 H 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 H 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 H 10 A_Refire
			goto Ready0
		Fire9:
			W5E1 J 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 J 3 A_GunFlash
			W5E1 I 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 I 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 I 10 A_Refire
			goto Ready0
		Fire10:
			W5E1 K 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 K 3 A_GunFlash
			W5E1 I 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 I 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 I 10 A_Refire
			goto Ready0
		Fire11:
			W5E1 L 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 L 3 A_GunFlash
			W5E1 K 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 K 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 K 10 A_Refire
			goto Ready0
		Fire12:
			W5E1 M 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 M 3 A_GunFlash
			W5E1 L 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 L 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 L 10 A_Refire
			goto Ready0
		Fire13:
			W5E1 N 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 N 3 A_GunFlash
			W5E1 M 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 M 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 M 10 A_Refire
			goto Ready0
		Fire14:
			W5E1 O 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 O 3 A_GunFlash
			W5E1 N 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 N 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 N 10 A_Refire
			goto Ready0
		Fire15:
			W5E1 P 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 P 3 A_GunFlash
			W5E1 O 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 O 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 O 10 A_Refire
			goto Ready0
		Fire16:
			W5E1 Q 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 Q 3 A_GunFlash
			W5E1 P 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 P 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 P 10 A_Refire
			goto Ready0
		Fire17:
			W5E1 R 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 R 3 A_GunFlash
			W5E1 Q 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 Q 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 Q 10 A_Refire
			goto Ready0
		Fire18:
			W5E1 S 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 S 3 A_GunFlash
			W5E1 R 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 R 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 R 10 A_Refire
			goto Ready0
		Fire19:
			W5E1 T 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 T 3 A_GunFlash
			W5E1 S 7 A_FireBullets(6, 6, 7, 9, "BulletPuff_Standard")
			W5E1 S 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 S 10 A_Refire
			goto Ready0
		Fire20:
			W5E1 U 0 A_TakeInventory("Buckshot_Chamber_LoadedShells", 1)
			W5E1 U 3 A_GunFlash
			W5E1 T 7 A_FireBullets(6, 6, 7, 18, "BulletPuff_Standard")
			W5E1 T 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 T 10 A_Refire
			goto Ready0
		AltFire:
			W5E1 A 0 A_JumpIfInventory("Shell", 1, 2)
			W5E1 A 0 A_Jump(255, "Ready")
			W5E1 A 0 A_JumpIfInventory("Shell", 2, 2)
			W5E1 A 0 A_Jump(255, "AltFire2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 19, "AltFire2")
			W2E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 0, "Ready")
			W2E1 A 1
			W2E1 B 3
			W2E1 C 3 A_TakeInventory("Shell", 2)
			W2E1 D 3 A_PlayWeaponSound("w2/load")
			W2E1 C 2 A_GiveInventory("Buckshot_Chamber_LoadedShells", 2)
			W2E1 B 2 A_Refire
			goto Ready0
		AltFire2:
			W5E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 20, "Ready")
			W2E1 A 0 A_JumpIfInventory("Buckshot_Chamber_LoadedShells", 0, "Ready")
			W2E1 A 1
			W2E1 B 3
			W2E1 C 3 A_TakeInventory("Shell", 1)
			W2E1 D 3 A_PlayWeaponSound("w2/load")
			W2E1 C 2 A_GiveInventory("Buckshot_Chamber_LoadedShells", 1)
			W2E1 B 2 A_Refire
			goto Ready0
		
		Flash:
			SHTF A 2 bright A_Light1
			SHTF B 2 Bright A_Light2
			Goto LightDone
	}
}

ACTOR Buckshot_Explosive : Weapon
{
	Weapon.AmmoUse1			0
	Weapon.AmmoUse2			0
	Weapon.AmmoGive 		8
	Weapon.AmmoType1			"Shell"
	Weapon.AmmoType2			"Shell"
	Inventory.PickupMessage		"You got the Buckshot, upgraded with Explosive Shells!"
	Obituary			"%o got explosively shelled by %k's Buckshot."
	
	Weapon.UpSound			"w2/load"
	AttackSound			"w2/fire"
	
	States
	{
		Ready:
			W5E3 A 10
			goto Ready0
		Ready0:
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 10, "Ready10")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 9, "Ready9")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 8, "Ready8")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 7, "Ready7")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 6, "Ready6")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 5, "Ready5")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 4, "Ready4")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 3, "Ready3")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 2, "Ready2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 1, "Ready1")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 0, 1)
			W5E1 A 1 A_WeaponReady
			goto Ready0
		Ready1:
			W5E1 B 1 A_WeaponReady
			goto Ready1
		Ready2:
			W5E1 C 1 A_WeaponReady
			goto Ready2
		Ready3:
			W5E1 D 1 A_WeaponReady
			goto Ready3
		Ready4:
			W5E1 E 1 A_WeaponReady
			goto Ready4
		Ready5:
			W5E1 F 1 A_WeaponReady
			goto Ready5
		Ready6:
			W5E1 G 1 A_WeaponReady
			goto Ready6
		Ready7:
			W5E1 H 1 A_WeaponReady
			goto Ready7
		Ready8:
			W5E1 I 1 A_WeaponReady
			goto Ready8
		Ready9:
			W5E1 J 1 A_WeaponReady
			goto Ready9
		Ready10:
			W5E1 K 1 A_WeaponReady
			goto Ready10
		Deselect:
			W5E3 A 1 A_Lower
			W5E3 A 0 A_Lower
			goto Deselect
		Select:
			W5E3 A 1 A_Raise
			W5E3 A 0 A_Raise
			goto Select
		Fire:
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 10, "Fire10")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 9, "Fire9")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 8, "Fire8")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 7, "Fire7")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 6, "Fire6")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 5, "Fire5")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 4, "Fire4")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 3, "Fire3")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 2, "Fire2")
			W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 1, "Fire1")
			W5E1 A 0 A_JumpIfInventory("Shell", 1, 2)
			W5E1 A 0 ACS_Execute(56,0,0,0,0)
		Fire1:
			W5E1 B 0 A_JumpIfInventory("Buckshot_LoadedShells", 1, 1)
			goto Ready0
			W5E1 B 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 B 3 A_GunFlash
			W5E1 A 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 A 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 A 10 A_Refire
			goto Ready0
		Fire2:
			W5E1 C 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 C 3 A_GunFlash
			W5E1 B 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 B 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 B 10 A_Refire
			goto Ready0
		Fire3:
			W5E1 D 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 D 3 A_GunFlash
			W5E1 C 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 C 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 C 10 A_Refire
			goto Ready0
		Fire4:
			W5E1 E 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 E 3 A_GunFlash
			W5E1 D 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 D 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 D 10 A_Refire
			goto Ready
		Fire5:
			W5E1 F 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 F 3 A_GunFlash
			W5E1 E 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 E 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 E 10 A_Refire
			goto Ready0
		Fire6:
			W5E1 G 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 G 3 A_GunFlash
			W5E1 F 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 F 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 F 10 A_Refire
			goto Ready0
		Fire7:
			W5E1 H 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 H 3 A_GunFlash
			W5E1 G 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 G 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 G 10 A_Refire
			goto Ready0
		Fire8:
			W5E1 I 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 I 3 A_GunFlash
			W5E1 H 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 H 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 H 10 A_Refire
			goto Ready0
		Fire9:
			W5E1 J 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 J 3 A_GunFlash
			W5E1 I 7 A_FireBullets(6, 6, 7, 12, "BulletPuff_Explosive")
			W5E1 I 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 I 10 A_Refire
			goto Ready0
		Fire10:
			W5E1 K 0 A_TakeInventory("Buckshot_LoadedShells", 1)
			W5E1 K 3 A_GunFlash
			W5E1 J 7 A_FireBullets(6, 6, 13, 20, "BulletPuff_Explosive")
			W5E1 J 0 A_FireCustomMissile("splatShellCasing", 45 + random(-8,8), 0, 2, 3)
			W5E1 J 10 A_Refire
			goto Ready0
		AltFire:
			W5E1 A 0 A_JumpIfInventory("Shell", 1, 2)
			W5E1 A 0 A_Jump(255, "Ready")
			W5E1 A 0 A_JumpIfInventory("Shell", 2, 2)
			W5E1 A 0 A_Jump(255, "AltFire2")
			W2E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 9, "AltFire2")
			W2E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 0, "Ready")
			W2E1 A 1
			W2E1 B 3
			W2E1 C 3 A_TakeInventory("Shell", 2)
			W2E1 D 3 A_PlayWeaponSound("w2/load")
			W2E1 C 3 A_GiveInventory("Buckshot_LoadedShells", 2)
			W2E1 B 2 A_Refire
			goto Ready0
		AltFire2:
                        W5E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 10, "Ready")
			W2E1 A 0 A_JumpIfInventory("Buckshot_LoadedShells", 0, "Ready")
			W2E1 A 1
			W2E1 B 3
			W2E1 C 3 A_TakeInventory("Shell", 1)
			W2E1 D 3 A_PlayWeaponSound("w2/load")
			W2E1 C 2 A_GiveInventory("Buckshot_LoadedShells", 1)
			W2E1 B 2 A_Refire
			goto Ready0
		Flash:
			SHTF A 2 bright A_Light1
			SHTF B 2 Bright A_Light2
			Goto LightDone
	}
}