//// --------------------------------------------------------------------------
//
// Revolver
//
// --------------------------------------------------------------------------


actor RevolverAlt : Inventory
{
inventory.maxamount 1
}
actor shellbox_real: ShellBox
{}

actor shellbox_rep: RandomSpawner replaces ShellBox
{
	DropItem "shellbox_real" 256 15
	DropItem "Revolver" 256 1
}

ACTOR Revolver : Weapon Replaces Pistol
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 6
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "AmmoShell"
	Weapon.AmmoType2 "RevolverAmmo"
	tag "RVX"
	Weapon.BobRangeX 0.3
	Weapon.BobRangeY 1.0
	Weapon.BobStyle Alpha
	Weapon.BobSpeed 2.0
	Weapon.Kickback 200
	Obituary "%k [RVX] %o"
    AttackSound "None"
    Inventory.PickupSound "AmmoShellIN"
	Inventory.Pickupmessage "RVX"
	+WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
    +WEAPON.NOAUTOFIRE
    Scale 0.9
	States
	{    
	PickUp:
	TNT1 A 0
	TNT1 A 0 A_Playsound("PICKUPONELINER")
	TNT1 A 0
	Stop
	
	Steady:
	TNT1 A 1
	Goto Ready
	
	Ready:
        TNT1 A 1 A_JumpIfInventory("GoFatality", 1, "Steady")
        TNT1 A 0 A_PlaySound("AmmoShellIN")
        REVS ABCD 1
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("RifleAmmo",1,2)
		//Goto Reload
		TNT1 A 0 A_JumpIfInventory("RevolverAlt",1,"AltSelect")
        TNT1 AAAA 0

        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		REVI A 4 A_WeaponReady
		
		TNT1 A 0 A_JumpIfInventory("RevolverAlt",1,"AltSelect")
		
	    TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		REVI A 4 A_WeaponReady
		
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		REVI A 4 A_WeaponReady
		
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		REVI A 4 A_WeaponReady
		
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		REVI A 4 A_WeaponReady
        //TNT1 A 0 BRIGHT A_FireCustomMissile("Alerter", random(-2,2), 0, -1, 0)
		Goto Ready+9
    Ready2:
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		REVF I 2 A_WeaponReady
		Loop
	Deselect:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        REVS DCBA 1
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 1 A_Lower
		Wait
	Select:
	
	TNT1 A 0 A_Takeinventory("FistsSelected",1)
	TNT1 A 0 A_Takeinventory("SawSelected",1)
	TNT1 A 0 A_Takeinventory("ShotgunSelected",1)
	TNT1 A 0 A_Takeinventory("SSGSelected",1)
	TNT1 A 0 A_Takeinventory("MinigunSelected",1)
	TNT1 A 0 A_Takeinventory("PlasmaGunSelected",1)
	TNT1 A 0 A_Takeinventory("RocketLauncherSelected",1)
    TNT1 A 0 A_Takeinventory("GrenadeLauncherSelected",1)
	TNT1 A 0 A_Takeinventory("BFGSelected",1)
	TNT1 A 0 A_Takeinventory("BFG10kSelected",1)
	TNT1 A 0 A_Takeinventory("RailGunSelected",1)
	TNT1 A 0 A_Takeinventory("SubMachineGunSelected",1)
	TNT1 A 0 A_Takeinventory("RevenantLauncherSelected",1)
	TNT1 A 0 A_Takeinventory("LostSoulSelected",1)
	TNT1 A 0 A_Takeinventory("FlameCannonSelected",1)
	TNT1 A 0 A_Takeinventory("HasBarrel",1)
	
		TNT1 A 0 A_Raise
		Wait
	AltSelect:
		REVF EFGHI 1
		TNT1 A 0
		Goto Ready2
    Fire:		
        TNT1 A 0 A_JumpIfInventory("RevolverAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0

		TNT1 A 0 A_JumpIfInventory("RevolverAlt",1,"Fire2")
        TNT1 A 0 A_PlaySound("revolver/fire", 5)
        //TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		REVF A 1 BRIGHT A_AlertMonsters
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		REVF B 1 BRIGHT A_FireBullets (8.75, 8.75, 5, 50, "HitPuff")
        REVF B 0 A_FireCustomMissile("Tracer", random(-2,2), 0, -1, 0)
        //TNT1 A 0 ACS_Execute(373, 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("ShakeYourAss", 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		TNT1 A 0 A_Takeinventory("RevolverAmmo",2)
		REVF CDDCDC 1
		REVI A 6 A_WeaponReady(1)
		Goto Ready+6
		
  Fire2:
	  TNT1 A 0 A_JumpIfInventory("RevolverAmmo",1,2)
      Goto Reload
      TNT1 A 0 A_PlaySound("revolver/fire", 5)
	  TNT1 A 0 A_PlaySound("revolver/fire", 3)
      REVF J 1 BRIGHT A_AlertMonsters
      TNT1 J 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
      REVF K 1 BRIGHT A_FireBullets (4, 4, 1, 80,"RevolverRicoPuff1")
      REVF K 0 A_FireCustomMissile("Tracer", random(-2,2), 0, -1, 0)
      TNT1 A 0 A_Recoil(2)
      TNT1 A 0 A_FireCustomMissile("ShakeYourAssQuad", 0, 0, 0, 0)
      TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
      TNT1 A 0 A_Takeinventory("RevolverAmmo",1)
      REVF I 1
      Goto Ready2

	AltFire:
     TNT1 A 0 A_JumpIfInventory("RevolverAlt",1,"StopAlt")
     TNT1 A 0 A_GiveInventory ("RevolverAlt",1)
     //TNT1 A 0 SetPlayerProperty(0,1,0)
     REVF EFGHI 1
     TNT1 A 0
     Goto Ready2

  StopAlt:
     TNT1 A 0 A_TakeInventory ("RevolverAlt",1)
     //TNT1 A 0 SetPlayerProperty(0,0,0)
     REVF LM 1
     TNT1 A 0
     Goto Ready+13
		
	NoAmmo:
	REVI A 1 A_PlaySound("weapons/empty")
	Goto Ready+12
	
    Reload:
		REVI A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("RevolverAmmo",6,60)
        TNT1 A 0 A_JumpIfInventory("AmmoShell",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		//TNT1 A 0 A_Takeinventory("RevolverAlt",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_PlaySound("Reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
        REVR ABC 3 A_JumpIfInventory("Kicking",1,"DoKick")
		REVR D 1 A_JumpIfInventory("Kicking",1,"DoKick")
	    REVR E 1 A_PlaySound("insertshell")
		REVR F 1 A_JumpIfInventory("Kicking",1,"DoKick")
        REVR GH 2 A_JumpIfInventory("Kicking",1,"DoKick")
		TNT1 AAAAAA 0 A_FireCustomMissile("RifleCaseSpawn",-2,0,8,0)
        REVR IJKLMNO 2
		REVR O 4
		REVR P 2 A_PlaySound("insertshell")
		REVR QRSTE 2 
        REVR D 1 
		REVR CBA 3
		
		InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("RevolverAmmo",6,15)
		TNT1 A 0 A_JumpIfInventory("AmmoShell",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("RevolverAmmo",1)
		TNT1 A 0 A_Takeinventory("AmmoShell",1)
		Goto InsertBullets
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+6
 	Spawn:
		RVIC A -1
		Stop
		
		
    DoKick:
	    TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"BerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK BCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KICK H 4
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+6
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KICK H 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK IGFEDCBA 1
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+6
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KICK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KICK O 3
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Ready+6
    /*Taunt:
		TNT1 A 0 A_JumpIfInventory("IsPostal",1,"FlipOff1")
		TNT1 A 0 A_JumpIfInventory("IsQuaker540",1,"FlipOff2")
		TNT1 A 0 A_JumpIfInventory("IsNikolai",1,"FlipOff3")
		TNT1 A 0 A_JumpIfInventory("IsSgtDoomguy5th",1,"FlipOff4")
		TNT1 A 0 A_JumpIfInventory("IsCommander",1,"FlipOff5")
		TNT1 A 0 A_JumpIfInventory("IsDukeNukem",1,"FlipOff6")
		TNT1 A 0 A_Takeinventory("RevolverAlt",1)
		Goto Ready+14
	FlipOff1:
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("PFUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready+14
	FlipOff2:
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("DFUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready+14
	FlipOff3:
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("NFUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready+14
	FlipOff4:
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("5FUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready+14
	FlipOff5:
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("TFUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready+14
	FlipOff6:
		TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 5
		FUCK A 2
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 0, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", -9, 0, -1, 0)
		TNT1 A 0 BRIGHT A_FireCustomMissile("Taunter", 9, 0, -1, 0)
        FUCK B 2 A_PlaySound("NUCK", 1)
        FUCK C 2 A_AlertMonsters
		FUCK D 15 A_Takeinventory("Taunting",1)
        FUCK CBA 5
        TNT1 A 5
		Goto Ready+14
	Salute:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		TNT1 A 0 A_ALertMonsters
		SALU ABCDEDCDEDCDEDCBA 4
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready*/
	}
}

//Actor RifleAmmo : Inventory
//{
//inventory.maxamount 30
//}

ACTOR RevolverAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 6
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 6
   Inventory.Icon "RVICA0"
}

ACTOR RevolverRicoPuff1
{
  renderstyle Translucent
  alpha 0.4
  Scale 1.5
  MONSTER
  +FRIENDLY
  AttackSound "revolver/ricochet"
  +NOBLOCKMAP
  -NOGRAVITY
  Gravity 0.01
  +NOEXTREMEDEATH
  +FORCEXYBILLBOARD
DamageType Bullet
Decal "BulletChip"
  states
  {
  Spawn:
   TNT1 A 0
   TNT1 AAAAAAAAAA 0 A_CustomMissile ("SparkXNoModel", 2, 0, random (0, 360), 2, random (0, 360))
   TNT1 AAAAAAAA 1 A_Look
    TNT1 A 2 BRIGHT A_CustomMissile("RevolverRicoTracer1")
  Melee:
    //PUFF CD 6
   TNT1 AAA 0 A_CustomMissile ("OldschoolRocketSmokeTrail2", 2, 0, random (0, 360), 2, random (0, 360))
   stop
  See:
     TNT1 A 0 A_CustomBulletAttack(0,0,0,0,"HitPuff",512,1)
    TNT1 A 2 A_FaceTarget
   TNT1 A 2 BRIGHT A_CustomMissile("RevolverRicoTracer1")

    stop
  }
}

ACTOR RevolverRicoPuff2
{
  renderstyle Translucent
  alpha 0.4
  Scale 1.5
  MONSTER
  +FRIENDLY
  AttackSound "revolver/ricochet"
  +NOBLOCKMAP
  -NOGRAVITY
  Gravity 0.01
  +NOEXTREMEDEATH
  +FORCEXYBILLBOARD
DamageType Bullet
Decal "BulletChip"
  states
  {
  Spawn:
   TNT1 A 0
   TNT1 AAAAAAAAAA 0 A_CustomMissile ("SparkXNoModel", 2, 0, random (0, 360), 2, random (0, 360))
   TNT1 AAAAAAAA 1 A_Look
    TNT1 A 2 BRIGHT A_CustomMissile("RevolverRicoTracer2")
  Melee:
    //PUFF CD 6
   TNT1 AAA 0 A_CustomMissile ("OldschoolRocketSmokeTrail2", 2, 0, random (0, 360), 2, random (0, 360))
   stop
  See:
     TNT1 A 0 A_CustomBulletAttack(0,0,0,0,"HitPuff",512,1)
    TNT1 A 2 A_FaceTarget
   TNT1 A 2 BRIGHT A_CustomMissile("RevolverRicoTracer2")

    stop
  }
}