
ACTOR RevolverClip : Ammo replaces Clip
{
	Inventory.Amount 6
	Inventory.MaxAmount 72
	Ammo.BackpackAmount 12
	Ammo.BackpackMaxAmount 108
	Inventory.PickupMessage "Picked up a speedloader."
	ConversationID 186
	Scale 0.5
	Inventory.Icon REVAA0
	States
	{
	Spawn:
		REVA A -1
		Stop
	}
}
	
ACTOR RevolverAmmo : Ammo
{
	+IGNORESKILL
	Inventory.MaxAmount 6
	Inventory.Icon REVPA0
}

ACTOR WeaselsRevolver : Weapon
{
	Weapon.AmmoType "RevolverAmmo"
	Weapon.AmmoUse 0
	Weapon.AmmoGive 0
	Weapon.AmmoType2 "RevolverClip"
	Weapon.AmmoUse2 1
	Weapon.AmmoGive2 9
	Weapon.Kickback 45
	Weapon.BobStyle InverseSmooth
	Weapon.BobSpeed 2.2
	Weapon.BobRangeY 0.5
	Weapon.BobRangeX 0.7
	Weapon.SelectionOrder 9999
	Tag ".357 Revolver"
	Obituary "%o was breached by %k's revolver."
	Inventory.PickupMessage "You got the revolver! (slot 2)"
	Decal BulletChip
	Scale 0.5
	+Ammo_Optional
	+Alt_Ammo_Optional
	+WEAPON.PRIMARY_USES_BOTH
	+Weapon.NoAlert
   	// weapon.sisterweapon TargeterRevolver
	States
	{
	Spawn:
		REVP A -1
		Stop
	Select:
		REVG A 0 A_Raise
		REVG A 1 A_Raise
		Loop
	Deselect:
		REVG A 0 A_Lower
		REVG A 1 A_Lower
		Loop
	Ready:
		REVG A 1 A_WeaponReady(WRF_ALLOWRELOAD)
		Loop
	Fire:
		REVG A 0 A_JumpIfInventory("RevolverAmmo",1,1)
		Goto Reload
		REVG A 0 A_GunFlash
		REVG A 0 A_PlayWeaponSound("Weapons/Revolver")
		REVG A 0 A_TakeInventory("RevolverAmmo",1)
			  TNT1 A 0 A_Jump(250,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
		REVG B 2 BRIGHT A_FireCustomMissile("RevolverTracer",frandom(-1.5,1.5),0,0,0,0,frandom(-0.8,0.8))
		REVG C 1 Offset(0,38) A_SetPitch (pitch - 0.6)
		REVG D 1 Offset(0,44) A_SetPitch (pitch - 0.6)
		REVG D 1 Offset(0,56) A_SetPitch (pitch - 0.6)
		REVG D 1 Offset(0,52) A_AlertMonsters
		REVG C 1 Offset(0,50)
		REVG C 1 Offset(0,47)
		REVG C 1 Offset(0,44)
		REVG A 1 Offset(0,40) A_Jump(128,2)
		REVG A 1 Offset(0,36)
		REVG A 1 Offset(0,34)
		REVG A 1 Offset(0,33)
		REVG A 1 Offset(0,32)
		Goto Ready
	Flash:
		TNT1 A 2 BRIGHT A_Light2
		TNT1 A 2 BRIGHT A_Light1
		TNT1 A 0 A_Light0
		Stop
	Reload:
		REVG A 0 A_JumpIfInventory("RevolverAmmo",6,2)
		REVG A 0 A_JumpIfNoAmmo(1)
		Goto ProperReload
		REVG A 1
		Goto Ready
	ProperReload:
		  TNT1 A 0 A_Jump(160,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
		REVG A 1 Offset(0,35) A_PlaySound("weapons/revolverout",CHAN_ITEM)
		REVG C 1 Offset(0,38)
		REVG C 1 Offset(0,44)
		REVG C 1 Offset(0,52)
		REVG D 1 Offset(0,62)
		REVG D 1 Offset(0,72)
		REVG D 1 Offset(0,82)
		TNT1 A 8
	ReloadLoop:
		TNT1 A 0 A_TakeInventory("RevolverClip",1,TIF_NOTAKEINFINITE)
		TNT1 A 0 A_GiveInventory("RevolverAmmo",1)
		TNT1 A 0 A_JumpIfInventory("RevolverAmmo",6,"ReloadFinish")
		TNT1 A 0 A_JumpIfNoAmmo("ReloadFinish")
		Goto ReloadLoop
	ReloadFinish:
		TNT1 A 3
		RHND A 3 Offset(0,32)
		RHND B 3 A_PlaySound("weapons/revolverload",CHAN_ITEM)
		RHND C 2
		RHND BAD 3
		TNT1 A 4
		REVG D 1 Offset(0,82) A_PlaySound("weapons/revolverin",CHAN_ITEM)
		REVG D 1 Offset(0,72)
		REVG D 1 Offset(0,62)
		REVG C 1 Offset(0,52)
		REVG C 1 Offset(0,44)
		REVG C 1 Offset(0,38)
		REVG A 1 Offset(0,35)
		REVG A 1 Offset(0,32)
		Goto Ready
	}
}

ACTOR RevolverPuff : BulletPuff
{
	+NOEXTREMEDEATH
}