Actor GuySG: Weapon
{
	Inventory.RestrictedTo "Stickguyclass"
	Weapon.AmmoUse 0
	Weapon.AmmoType "Shell"
	Weapon.AmmoGive 8
	Weapon.SlotNumber 3
	Obituary "%o tried to touch %k 's Rifle"
    Inventory.Pickupmessage "A battle rifle, better than nothing."
    Tag "Rifle"
	+Weapon.noalert
	STATES
	{
	  Ready:
		SGRF A 1 A_weaponready(WRF_ALLOWRELOAD)
		Loop
	  Deselect:
		SGRF A 1 A_Lower
		Loop
	  Select:
		SGRF A 1 A_Raise
		Loop
	  Fire:
		TNT1 A 0 A_JumpIfInventory("Shell",1,1)
		Goto Click
		TNT1 A 0 A_JumpIfInventory("Stickguyfastfingers",1,"SpeedFire")
		SGRF A 1
		TNT1 A 0 A_AlertMonsters
		SGRF B 1 Bright OFFset(0,40)
		TNT1 A 0 A_FireBullets (5.6, 0, 1, 60, "Stickguypuffs",FBF_NORANDOM|FBF_USEAMMO)
		TNT1 A 0 A_Takeinventory("Shell", 1)
		TNT1 A 0 A_Playsound("Stickguy/SGRFL",Chan_weapon)
		TNT1 A 0 A_SetPitch(Pitch-0.9)
		SGRF C 1 Bright OFFset(0,41)A_SetPitch(Pitch-0.1)
		SGRF D 2 Offset(0,44) A_SetPitch(Pitch+0.1)
		SGRF D 2 Offset(0,42) A_SetPitch(Pitch+0.2)
		SGRF D 2 Offset(0,40) A_SetPitch(Pitch+0.3)
		SGRF D 2 Offset(0,37) A_SetPitch(Pitch+0.4)
		SGRF E 2 Offset(0,33)
		SGRF A 4 Offset(0,32)
		TNT1 A 0 A_refire
		Goto Ready
	  SpeedFire:
		TNT1 A 0 A_AlertMonsters
		SGRF B 1 BRIGHT A_FireBullets (11.2, 7.1, -1, 40, "Stickguypuffs",FBF_NORANDOM|FBF_USEAMMO)
		TNT1 A 0 A_Takeinventory("Shell", 1)
		TNT1 A 0 A_Playsound("Stickguy/SGRFL",Chan_weapon)
		SGRF C 1 BRIGHT Offset(0,38)
		SGRF F 3 Offset(0,40)
		SGRF G 1 Offset(0,39)
		SGRF G 1 Offset(0,37)
		SGRF H 2 Offset(0,35)
		SGRF A 2 Offset(0,33)
		goto ready
	  Click:
		SGRF A 2 Offset(0,48) A_PlaySound("Stickguy/Tick", CHAN_WEAPON)
		SGRF A 2 Offset(0,40)
		SGRF A 2 Offset(0,32)
		Goto ready
	  Spawn:
		TNT1 A -1
		Stop
	//---------------------------------------MELEE STUFF
	  Altfire:
		TNT1 A 0 Offset(0,32) A_JumpIfInventory("GuyStick",1,"XiaoMelee")
		TNT1 A 1 Offset(0,32) A_JumpIfInventory("StickguyMeleeStack",20,"BerserkFire")
	  QuickPunch:
		REFT D 2 A_FireCustomMissile("FistImpact",0,0,0,1)
		REFT D 2 Offset(-2,32) A_AlertMonsters 
		REFT C 2 Offset(0,32)
		REFT B 2
		TNT1 A 6
		Goto Ready
	  BerserkFire:
		REFT M 1 Offset(104,18) A_FireCustomMissile("ZerkFist",0,0,0,1)
		REFT N 2 Offset(0,32) A_AlertMonsters
		REFT P 2 
		REFT P 2 
		REFT U 1 
		TNT1 A 1 Offset(0,32)
		Goto Ready
	  XiaoMelee:
		TNT1 A 1 Offset(0,32) A_JumpIfInventory("StickguyMeleeStack",10,"XiaoZerk")
		RXXS A 2 A_FireCustomMissile("StickImpact",0,0,0,1)
		RXXS B 2 A_alertMonsters
		Goto RestOfStickmelee	
	  XiaoZerk:
		RXXS E 2 A_FireCustomMissile("ZerkStick",0,0,0,1)
		RXXS F 2 A_alertMonsters
	  RestOfStickmelee:
		RXXS CD 2
		TNT1 A 4
		Goto Ready
	}
}