actor NecromancerBoltRifle : Weapon
{
	Weapon.Slotnumber 3
	Obituary "%o was bolted by %k."
	Weapon.Ammotype "RifleBullets"
	Weapon.Ammogive 20
	Weapon.ammouse 1
	Decal "Bulletchip"
	Inventory.Pickupmessage "You got the Bolt Rifle!"
	Attacksound "SAKO/FIRE"
	Tag "Bolt Rifle"	
	Inventory.RestrictedTo "NecromancerClass"
	+ADDITIVEPOISONDAMAGE
	+ADDITIVEPOISONDURATION
	States
	{
		Ready:
			SAKO A 1 A_Weaponready
			loop
			
		Select:
			SAKO A 1 A_RAISE
			TNT1 A 0 A_Raise
			TNT1 A 0 A_Raise
			loop
			
		Deselect:
			SAKO A 1 A_LOWER
			TNT1 A 0 A_LOWER
			TNT1 A 0 A_LOWER
			loop
			
		Fire:
			SAKO B 2 BRIGHT A_Firebullets(0,0,1,100,"RiflePuff",FBF_USEAMMO|FBF_NORANDOM)
			TNT1 A 0 A_Quake(2,3,0,3)			
			SAKO CD 3
			goto Bolt
		AltFire:
			SAKO A 0 A_JumpIfInventory("RifleBullets", 5, 1)
			Goto Ready
			TNT1 A 0 A_TakeInventory("RifleBullets", 5) // manually deduct 1 shells
			SAKO B 2 BRIGHT A_FireBullets(0,0,1,500,"SuperRiflePuff",FBF_USEAMMO|FBF_NORANDOM) // stronger shot
			TNT1 A 0 A_Quake(4,5,0,5)
			SAKO C 3
			SAKO D 3
			Goto HeavyBolt
		Bolt:
			SAKO E 3
			TNT1 A 0 A_PLAYSOUND("SAKO/BOLT",CHAN_AUTO)		
			SAKO F 3
			SAKO G 5
			SAKO HI 5
			SAKO JK 3
			SAKO L 3
			SAKO M 2
			SAKO A 3
			TNT1 A 0 A_REFIRE
			goto ready
		HeavyBolt:
			SAKO E 5
			TNT1 A 0 A_PlaySound("SAKO/BOLT", CHAN_AUTO)
			SAKO F 5
			SAKO G 7
			SAKO H 7
			SAKO I 7
			SAKO J 5
			SAKO K 5
			SAKO L 5
			SAKO M 3
			SAKO A 4
			TNT1 A 0 A_ReFire
			Goto Ready
		Spawn:
			SAKP A -1
			stop
		
	}
}

actor RifleBullets : Ammo
{
	Inventory.Amount 5
	Inventory.Maxamount 25
	Ammo.Backpackamount 10
	Ammo.Backpackmaxamount 50
	
	States
	{
		Spawn:
			RFAM A -1
			stop
	}
}

actor RiflePuff: Bulletpuff
{
	+NoExtremeDeath
}

actor SuperRiflePuff: RiflePuff
{
	+ExtremeDeath
	-NoExtremeDeath
	+FoilInvul
}