Actor GuyPI: Weapon
{
	Inventory.RestrictedTo "Stickguyclass"
	Weapon.SelectionOrder 3700
	Weapon.SlotNumber 2
	+Weapon.noalert
	Weapon.AmmoType "Clip"
	Weapon.AmmoUse 1
	Obituary "$OB_MPPISTOL"
    +WEAPON.WIMPY_WEAPON
    Inventory.Pickupmessage "How did you forget your weapon of self defence?"
    Tag "$TAG_PISTOL"
	+weapon.Ammo_optional
	STATES
	{
	  Ready:
		REPI A 1 A_weaponready(WRF_ALLOWRELOAD)
		Loop
	  Deselect:
	    REPI ED 1 A_Lower
	  DeselectLoop:
		TNT1 A 1 A_Lower
		TNT1 AAAAAAAAAAA 0 A_lower
		Loop
	  Select:
		REPI A 1 A_Raise
		TNT1 AAAAAAAAAAA 0 A_Raise
		Loop
	  Fire:
		//TNT1 A 0 A_JumpIfnoammo("Click")
		TNT1 A 0 A_JumpIfInventory("Stickguyfastfingers",1,"SpeedFire")
	  FireContinue:
		TNT1 A 0 A_GunFlash
		REPI A 2 Bright A_FireBullets (5.6, 0.5, 1, 3, "Stickguypuffs",0)
		TNT1 A 0 A_PlaySound("Stickguy/PISTOL", CHAN_WEAPON)
		Goto RestofFire
	  SpeedFire:
	    TNT1 A 0 A_JumpIfnoammo("FireContinue")
		REPI B 1 A_FireBullets (5.6, 0.5, 1, 2, "Stickguypuffs",0)
		TNT1 A 0 A_PlaySound("Stickguy/PISTOL", CHAN_WEAPON)
		REPI B 1 A_FireBullets (5.6, 0.5, 1, 2, "Stickguypuffs",0)
		TNT1 A 0 A_PlaySound("Stickguy/PISTOL", CHAN_WEAPON)
		REPI B 1 A_FireBullets (5.6, 0.5, 1, 2, "Stickguypuffs")
		TNT1 A 0 A_PlaySound("Stickguy/PISTOL", CHAN_WEAPON)
	  RestofFire:
		TNT1 A 0 A_AlertMonsters
		
		TNT1 A 0 A_SetPitch (pitch-0.4)
		REPI F 2 A_SetPitch (pitch+0.2)
		REPI G 2 A_SetPitch (pitch+0.2)
		REPI A 3
		REPI A 2
		REPI A 0 A_ReFire
		Goto Ready
	  Click:
		REPI G 2
		REPI F 2 A_PlaySound("Stickguy/Tock", CHAN_WEAPON)
		REPI D 2 Offset(0,12)
		REPI D 2 Offset(0,6) A_PlaySound("Stickguy/Tick", CHAN_WEAPON)
		REPI E 2
		REPI A 2
		Goto Ready
	  Flash:
		REPI B 1 Bright A_Light1
		REPI C 1 Bright A_Light2
		Goto LightDone
	  Spawn:
		REPP 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
	}
}