ACTOR "Nemesis Sawed-Off Shotgun" : Weapon
{
  Scale 0.85
  Weapon.PreferredSkin "DoubleBarrelSG-Marine"
  Decal "DoomImpScorch"
  Weapon.SelectionOrder 400
  Weapon.KickBack 100
  Weapon.AmmoType "NemesisPellets"
  Weapon.AmmoType2 "NemesisShell"
  Inventory.PickupMessage "You got the Nemesis Sawed-Off Shotgun!"
  Inventory.PickupSound "Coachgun/Pickup"
  Obituary "%o needs to stop playing CF deathmatch."
  +WEAPON.AMMO_OPTIONAL
  +WEAPON.NOALERT
  Tag "Nemesis Sawed-Off Shotgun"
  States
	{
	Spawn:
		NSSW A -1 Bright
		Loop
	Ready:
		TNT1 A 0 A_PlayWeaponSound("Coachgun/Pickup")
		NSSZ ACDFGIKMP 1
	ReadyLoop:
		NSSD A 1 A_WeaponReady
		TNT1 A 0 A_JumpIfInventory("HandGrenadeAction",1,"GrenadeCheck")
		TNT1 A 0 A_JumpIfInventory("MineAction",1,"MineCheck")
		Loop
	Select:
		TNT1 A 0 A_Raise
		Wait
	Deselect:
		TNT1 A 0
		TNT1 A 0 A_PlayWeaponSound("weapons/weapondown")
		TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
		TNT1 A 0 A_TakeInventory("MineAction",1)
		TNT1 A 0 A_TakeInventory("RailgunAction",1)
	DeselectLoop:
		NSSD A 1 A_Lower
		Loop
	Fire:
		TNT1 A 0 A_JumpIfInventory("NemesisPellets",2,"FireBoth")
		TNT1 A 0 A_JumpIfInventory("NemesisShell",1,"Reload")
		Goto Empty
	FireBoth:
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_Light1
		TNT1 A 0 A_PlaySound("NemesisSSG/Fire1")
		TNT1 A 0 Radius_Quake(6,5,0,1,0)
		TNT1 A 0 A_TakeInventory("NemesisPellets",2)
		//TNT1 AAAAAAAA 0 Bright A_FireCustomMissile("NemesisTracer",Random(8,-8),0,0,Random(8,-8))
		//TNT1 A 0 Bright A_FireBullets(6.2,3.1,26,0,"NemesisASGPuffExplodePlayer",0)
		//NSSF A 1 Bright A_FireBullets(6.2,3.1,26,random(32,40),"NemesisASGBulletPuffPlayer")
		TNT1 AAAAAAAAAAAAAAAAAAAAAAA 0 A_FireCustomMissile("NemesisASGBallPlayer",frandom(-10,10),0,0,-4,0,frandom(-6,6))
		NSSF A 1 Bright A_FireCustomMissile("NemesisASGBallPlayer",frandom(-10,10),1,0,-4,0,frandom(-6,6))
		NSSF B 1
		NSSF CD 1 Bright A_Light2
		NSSF E 1 Radius_Quake(6,5,0,1,0)
		NSSF F 1
		NSSF GH 1 A_Light0
		NSSD AAAAAA 1
	SSGReloadCheck:
		TNT1 A 0 A_JumpIfInventory("NemesisShell",2,2)
		NSSC D 2
		Goto ReadyLoop
		TNT1 A 0
		Goto ReloadBoth+4
	AltFire:
		TNT1 A 0 A_JumpIfInventory("NemesisPellets",2,"FireRight")
		TNT1 A 0 A_JumpIfInventory("NemesisPellets",1,1)
		Goto Reload
		TNT1 A 0 A_PlaySound("NemesisSSG/Fire2")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_Light1
		TNT1 A 0 Radius_Quake(4,4,0,1,0)
		TNT1 A 0 A_TakeInventory("NemesisPellets",1)
		//TNT1 AAAA 0 A_FireCustomMissile("NemesisTracer",Random(6,-6),0,0,Random(6,-6))
		//TNT1 A 0 Bright A_FireBullets(2.2,1.3,9,0,"NemesisASGPuffExplodePlayer",0)
		//N1SF A 1 Bright A_FireBullets(2.2,1.3,9,random(32,40),"NemesisASGBulletPuffPlayer")
		TNT1 AAAAAAAAAAA 0 A_FireCustomMissile("NemesisASGBallPlayer",frandom(-4,4),0,0,-4,0,frandom(-2.5,2.5))
		N1SF A 1 Bright A_FireCustomMissile("NemesisASGBallPlayer",frandom(-4,4),1,0,-4,0,frandom(-2.5,2.5))
		N1SF B 1 Bright A_Light2
		TNT1 A 0 A_Light0
		TNT1 A 0
		N1SF CDEF 1
		NSSD A 2
		Goto ReadyLoop
	FireRight:
		TNT1 A 0 A_PlaySound("NemesisSSG/Fire2")
		TNT1 A 0 A_AlertMonsters
		TNT1 A 0 A_GunFlash
		TNT1 A 0 A_Light1
		TNT1 A 0 Radius_Quake(4,4,0,1,0)
		TNT1 A 0 A_TakeInventory("NemesisPellets",1)
		//TNT1 AAAA 0 A_FireCustomMissile("NemesisTracer",Random(6,-6),0,0,Random(6,-6))
		//TNT1 A 0 Bright A_FireBullets(2.2,1.3,9,0,"NemesisASGPuffExplodePlayer",0)
		//N2SF A 1 Bright A_FireBullets(2.2,1.3,9,random(32,40),"NemesisASGBulletPuffPlayer")
		TNT1 AAAAAAAAAAA 0 A_FireCustomMissile("NemesisASGBallPlayer",frandom(-4,4),0,0,-4,0,frandom(-2.5,2.5))
		N2SF A 1 Bright A_FireCustomMissile("NemesisASGBallPlayer",frandom(-4,4),1,0,-4,0,frandom(-2.5,2.5))
		N2SF B 1 Bright A_Light2
		TNT1 A 0 A_Light0
		TNT1 A 0
		N2SF CDEF 1
		NSSD A 2
		Goto ReadyLoop
	Empty:
		TNT1 A 0 A_JumpIfInventory("NemesisPellets",1,"Empty2")
		NSSD A 10 A_PlaySound("weapons/click")
		Goto ReadyLoop
	Empty2:
		NSSD A 10 A_PlaySound("weapons/click")
		Goto ReadyLoop
	Reload:
		TNT1 A 0 A_JumpIfInventory("NemesisPellets",1,"ReloadRight")	
		TNT1 A 0 A_JumpIfInventory("NemesisShell",2,"ReloadBoth")
		Goto Empty		
	ReloadBoth:
		TNT1 A 0 A_JumpIfInventory("NemesisShell",2,1)
		Goto ReadyLoop
		NSSR EDCBA 1
		NSSR ABCDEF 1
		NSSR G 1 A_PlayWeaponSound("NemesisSSG/Open")
		NSSR HI 1
		NSSR J 1
		TNT1 AA 0 A_SpawnItemEx("NemesisShellCasing",25,-2,25,Random(2,4),Random(-3,-6),Random(3,6),0)
		NSS2 A 2
		NSS2 B 2
		NSS2 CD 2
		NSS2 EFG 1
		NSS2 H 1 A_PlayWeaponSound("NemesisSSG/Load")
		NSS2 IJKLMN 1
		TNT1 A 0 A_TakeInventory("NemesisShell",2,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("NemesisPellets",2)
		NSSR KKKK 2
		NSSC AC 1
		NSSC D 1 A_PlayWeaponSound("NemesisSSG/Close")
		NSSC F 1
		NSSC GIJL 1
		NSSC MOPR 1
		Goto ReadyLoop
	ReloadRight:
		TNT1 A 0 A_JumpIfInventory("NemesisShell",1,1)
		Goto ReadyLoop
		NSSR EDCBA 1
		NSSR ABCDEFGHI 1
		N2SR B 2 A_PlayWeaponSound("NemesisSSG/Open")	
		N2SR CCCCC 1
		N2SR D 2
		N2SR EF 2
		TNT1 A 0 A_SpawnItemEx("NemesisShellCasing",25,-2,25,Random(2,4),Random(-3,-6),Random(3,6),0)
		N2SR GH 2
		N2SR I 1 A_PlayWeaponSound("NemesisSSG/Load")
		TNT1 A 0 A_TakeInventory("NemesisShell",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("NemesisPellets",1)
		NSSC AC 1
		NSSC D 1 A_PlayWeaponSound("NemesisSSG/Close")
		NSSC F 1
		NSSC GIJL 1
		NSSC MOPR 1
		Goto ReadyLoop
	GrenadeCheck:
		TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,"GrenadeToss")
		TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
		Goto ReadyLoop
	GrenadeToss:
		TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
		LSGN ABCDE 1
		TNT1 A 4
		HGRN ABC 1
		HGRN D 2
		HGRN EFG 1
		HGRN HI 2
		TNT1 A 15 A_PlayWeaponSound("weapons/hgrenadepin")
		TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
		TNT1 A 0 A_TakeInventory("HandGrenadeAmmo",1,TIF_NOTAKEINFINITE)
		HGNE A 1 A_FireCustomMissile("ThrownGrenade",0,0,0,0,false)
		HGRN J 1
		HGRN KLM 2
		HGRN NO 1
		TNT1 A 6
		TNT1 A 0 A_JumpIfInventory("HandGrenadeAmmo",1,2)
		TNT1 A 0// A_TakeInventory("Hand Grenade",1)
		TNT1 A 0 A_TakeInventory("HandGrenadeAction",1)
		TNT1 A 0
		LSGN EDCBA 1
		Goto ReadyLoop
	MineCheck:
		TNT1 A 0 A_JumpIfInventory("MineAmmo",1,"MineToss")
		TNT1 A 0 A_TakeInventory("MineAction",1)
		Goto ReadyLoop
	MineToss:
		TNT1 A 0 A_PlayWeaponSound("weapons/weapondown") 
		LSGN ABCDE 1
		TNT1 A 8
		TNT1 A 0 A_PlayWeaponSound("weapons/hgrenadethrow")
		MINE ABCDEF 1		
		TNT1 A 0 A_TakeInventory("MineAmmo",1,TIF_NOTAKEINFINITE)	  
		MINE G 1 A_FireCustomMissile("ThrownMine",0,0,0,0,false)
		MINE HI 1
		MINE JK 2
		TNT1 A 0 A_JumpIfInventory("MineAmmo",1,2)
		TNT1 A 0// A_TakeInventory("Land Mine",1)
		TNT1 A 0 A_TakeInventory("MineAction",1)
		TNT1 A 0
		TNT1 A 5
		LSGN EDCBA 1
		Goto ReadyLoop
	}
}

ACTOR NemesisPellets : Ammo
{
+IGNORESKILL
+NOTIMEFREEZE
Inventory.Amount 0
Inventory.MaxAmount 2
Ammo.BackpackAmount 0
Ammo.BackpackMaxAmount 2
Inventory.Icon "NSSWA0"
}