
/*
===SHOTGUN===

Multi-barreled rotating shotgun.
Hold trigger for rapid fire.
Can fire up to three consecutive times.
Third shot is a double barreled blast, heavy recoil.
Needs time to cycle more shells in after this.

I've seen him with a shotgun in his current form,
haphazardly pushing handfuls of shells into it.
He gets strange when he's fractured.
*/

actor DeriverShotgun : Buran
{
	Weapon.SelectionOrder 80
	Weapon.SlotNumber 2
	Weapon.AmmoUse 1
	Weapon.AmmoGive 8
	Weapon.AmmoType "Shell"
	Weapon.KickBack 180
	Weapon.BobStyle smooth
	Weapon.BobRangeX 0.3
	Weapon.BobRangeY 0.4
	Weapon.BobSpeed 2
	Inventory.PickupMessage "Cycler shotgun."
	Inventory.PickupSound "DShotgun/Pickup"
	Obituary "%o was hammered by %k."
	Tag "Cycler"
	States
	{
	Ready:
		TNT1 A 0 A_JumpIfInventory ("ShotgunStack", 1, "CycleShell")
		TNT1 A 0 A_PlaySound ("DShotgun/Equip",0,0.70)
		DVG1 ABC 1 A_WeaponReady
		TNT1 A 0 A_PlaySound ("DShotgun/Pump",0,0.30)
		DVG1 DE 1 A_WeaponReady
		Goto RealReady
	Deselect:
		TNT1 A 0
		TNT1 A 0 A_JumpIfHealthLower (1, "DeadLower")
		DVG7 ABC 1
		TNT1 A 0 A_PlaySound ("DShotgun/Holster",0,0.70)
		DVG7 DE 1
		Goto Holster
	RealReady:
		DVG2 A 1 A_WeaponReady
		wait
	Fire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("ShotgunStack", 1, "CycleShell")
		DVG2 A 1 A_JumpIfNoAmmo ("DryFire")
		TNT1 A 0 A_GiveInventory ("UsingDeriverGun",1)
		TNT1 A 0 A_FireBullets (5.6, 2, 7, 5, "DVSGPuff")
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("DShotgun/Fire1", 0)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_Quake(2, 5, 0, 32)
		TNT1 A 0 A_GiveInventory ("ShotgunStack",1)
		DVG2 BCC 1 Bright
		DVG2 D 2
		DVG2 E 1
		DVG2 FF 2
		DVG2 G 1 A_Refire ("SecondShot")
		Goto CycleShell
	DryFire:
		TNT1 A 0 
		TNT1 A 0 A_PlaySound ("DShotgun/DryFire",0)
		DVG6 ABCD 1 A_WeaponReady (WRF_NOPRIMARY)
		Goto RealReady
	SecondShot:
		TNT1 A 0
		TNT1 A 0 A_JumpIfNoAmmo ("DryFire")
		TNT1 A 0 A_GiveInventory ("UsingDeriverGun",1)
		TNT1 A 0 A_FireBullets (5.6, 2, 7, 5, "DVSGPuff")
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("DShotgun/Fire2", 0)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_Quake(2, 5, 0, 32)
		TNT1 A 0 A_GiveInventory ("ShotgunStack",1)
		DVG2 BCC 1 Bright
		DVG2 D 2
		DVG2 E 1
		DVG2 FF 2
		DVG2 G 1 A_Refire ("FinisherShot")
		Goto CycleShell
	FinisherShot:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("Shell", 2, 2)
		TNT1 A 0 A_Jump (256,"SecondShot")
		TNT1 A 0 A_GiveInventory ("UsingDeriverGun",1)
		TNT1 A 0 A_FireBullets (11.2, 7.1, 20, 15, "DVSGPuff2",FBF_NORANDOM|FBF_USEAMMO)
		TNT1 A 0 A_TakeInventory ("Shell",1)
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_PlaySound("DShotgun/DoubleShot", 6)
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_Quake(2, 5, 0, 32)
		TNT1 A 0 A_GiveInventory ("ShotgunStack",4)
		DVG4 ABB 1 Bright
		TNT1 A 0 A_Recoil (8)
		TNT1 A 0 A_SetPitch (pitch-4)		
		DVG4 C 2
		TNT1 A 0 A_SetPitch (pitch-3,SPF_INTERPOLATE)
		DVG4 D 1
		TNT1 A 0 A_SetPitch (pitch-2,SPF_INTERPOLATE)
		DVG4 EEE 4
		DVG4 F 2
		Goto FastCycling

	//----------------------------------------------------------------------
	//Reloading
	//----------------------------------------------------------------------
	CycleShell:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory ("ShotgunStack", 3, "FastCycling")
		DVG2 A 1 A_WeaponReady (WRF_NOPRIMARY)
		DVG3 ABCC 2 A_WeaponReady (WRF_NOPRIMARY)
		TNT1 A 0 A_TakeInventory ("ShotgunStack",1)
		TNT1 A 0 A_PlaySound ("DShotgun/Pump",6)
		TNT1 A 0 A_FireCustomMissile("DeriverShellcasingspawner",0,0,2,2)
		DVG3 D 2 A_WeaponReady (WRF_NOPRIMARY)
		DVG3 E 2 A_WeaponReady (WRF_NOPRIMARY)
		TNT1 A 0 A_JumpIfInventory ("ShotgunStack",1,"CycleShell")
		Goto RealReady
	FastCycling:
		DVG5 A 1 A_WeaponReady (WRF_NOPRIMARY)
		TNT1 A 0 A_PlaySound ("DShotgun/FastLoad",0)
		TNT1 A 0 A_FireCustomMissile("DeriverShellcasingspawner",0,0,2,2)
		TNT1 A 0 A_TakeInventory ("ShotGunStack",1)
		DVG5 BCD 1 A_WeaponReady (WRF_NOPRIMARY)
		TNT1 A 0 A_JumpIfInventory ("ShotgunStack",1,"FastCycling")
		Goto FastEnd
	FastEnd:
		TNT1 A 0 A_PlaySound ("DShotgun/FastLoad",0)
		DVG6 AC 1 A_WeaponReady (WRF_NOPRIMARY)
		DVG6 BD 1 A_WeaponReady (WRF_NOPRIMARY)
		DVG6 AC 1 A_WeaponReady (WRF_NOPRIMARY)
		DVG6 BD 1 A_WeaponReady (WRF_NOPRIMARY)
		DVG6 ABBCCDD 2 A_WeaponReady (WRF_NOPRIMARY)
		TNT1 A 0 A_PlaySound ("DShotgun/FastLoadFinish",0)
		DVG6 B 2 A_WeaponReady (WRF_NOPRIMARY)
		DVG2 A 2 A_WeaponReady
		Goto RealReady




	Altfire:
		TNT1 A 0
		TNT1 A 2
		TNT1 A 0 A_Jump (256, "ParryStance")
		Goto AltfireEnd
	AltFireEnd:
		TNT1 A 0
		TNT1 A 2 A_WeaponReady
		Goto SilentReady
	SwordSheathe:
		TNT1 A 3 A_WeaponReady
		MGS6 AB 1 A_WeaponReady
		MGS6 CDEF 2 A_WeaponReady
		MGS6 G 1 A_WeaponReady
		TNT1 A 0 A_PlaySound ("MagSword/Sheathe1",0)
		MGS6 HI 1 A_WeaponReady
		TNT1 A 0 A_PlaySound ("MagSword/Sheathe2",0)
		MGS6 JJ 1 A_WeaponReady
		MGS6 KLKL 1 A_WeaponReady
		MGS6 L 3 A_WeaponReady
		MGS6 MRST 1 A_WeaponReady
		TNT1 A 1 A_WeaponReady
		Goto SilentReady
	SilentReady:
		TNT1 A 0 A_JumpIfInventory ("ShotgunStack", 1, "CycleShell")
		DVG1 ABC 1 A_WeaponReady
		DVG1 DE 1 A_WeaponReady
		Goto RealReady


	}
}



actor ShotgunStack : inventory
{
	Inventory.RestrictedTo "Deriver"
	inventory.maxamount 4
}


//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
