/*ACTOR ClippyBox : CustomInventory //replaces Chaingun
{
  SpawnID 75
  Radius 12
  Height 12
  Inventory.PickupSound "sniper/bolt"
  Inventory.PickupMessage "Picked up the Minigun and Sniper Rifle!" // "COMBINED MANA"
  States
  {
  Spawn:
    RM79 S 1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("Gatling_Gun", 1)
    TNT1 A 0 A_GiveInventory("SniperRifle", 1)
    Stop
  }
}

ACTOR BigAmmoBox : CustomInventory// replaces ClipBox
{
  SpawnID 75
  Radius 12
  Height 12
  Inventory.PickupSound "sniper/ammopick"
  Inventory.PickupMessage "Picked up a box of bullets and sniper rounds!" // "COMBINED MANA"
  States
  {
  Spawn:
    AMP1 A 1
    Loop
  Pickup:
    TNT1 A 0 A_GiveInventory("Clip", 50)
    TNT1 A 0 A_GiveInventory("SniperAmmo", 10)
    Stop
  }
}*/

ACTOR SniperRifle : Weapon
  {
      +WEAPON.NOALERT
     obituary "%k [M40A3] %o"
	 AttackSound "Weapons/Sniper"
     +WEAPON.NOAUTOFIRE
	 +WEAPON.NOAUTOAIM
     Weapon.ammouse 15
	 Weapon.AmmoType "Clip2"
	 tag "M40A3"
	 Inventory.PickupMessage "M40A3"
     Weapon.Kickback 100
	 Weapon.BobRangeX 0.3
	Weapon.BobRangeY 1.0
	Weapon.BobStyle Alpha
	Weapon.BobSpeed 2.0
	 Decal Bulletchip
     States
     {
     Ready:
    TNT1 A 0 A_PlaySound("sniper/raise")
    SPSL JHFDB 1
        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")
        2NIP A 1 A_WeaponReady
        Goto Ready+6
     ReadySniper:
        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")
	    ZOM1 A 1 A_WeaponReady(1)
		loop
  Deselect:
 	    TNT1 A 0 A_TakeInventory("ADSmode",1)
	    TNT1 A 0 A_TakeInventory("Zoomed",1)
		SNIP A 0 A_TakeInventory ("Sniper_Zoomed", 1)
    	2NIP A 0 A_ZoomFactor(1.0)
    SPSL ACEGI 1
	//TNT1 A 0 A_TakeInventory("BDM50", 999)
	TNT1 A 1 A_Lower
    wait
  ToReady:
        2NIP A 0
		Goto Ready+6
    DoKick:
	    TNT1 A 0 A_TakeInventory("ADSmode",1)
	    TNT1 A 0 A_TakeInventory("Zoomed",1)
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory ("Sniper_Zoomed", 2)
		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 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 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
		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
		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("Zoomed",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 A_TakeInventory("ADSmode",1)
		2NIP A 0 A_ZoomFactor(1.0)
		2NIP A 0 A_TakeInventory ("Sniper_Zoomed", 2)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
	    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*/
		
  Spawn:
    BUPP A 1
    Loop
	
	
  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_TakeInventory("BDM50", 999)
		TNT1 A 0 A_Raise
		Wait
     Fire:
	    TNT1 A 0 A_TakeInventory("ADSmode",1)
	    TNT1 A 0 A_TakeInventory("Zoomed",1)
	    2NIP A 0 A_AlertMonsters
		2NIP A 0 A_ZoomFactor(1.0)
		2NIP A 0 A_TakeInventory ("Sniper_Zoomed", 2)
		2NIP A 0 A_PlaySound("SNIPFIRE",3)
        TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,15)
		2NIP A 1 A_FireBullets(2,2,5,200,"BulletPuff",5)
		2NIP A 0 A_Recoil(2)
		SNIF ACEDCB 1
		2NIP A 20
		SPRL AB 1
		//SPRL C 1 A_PlaySound("CLIPIN")
		//SPRL DEFGHIJKLMNOPQ 1
		//SPRL R 0 A_PlaySound("sniper/bolt")
		//SPRL R 10
		//SPRL Q 1
		//SPRL PONMLKJIHGFEDCBA 1
		SPRL ABCDEF 2
		TNT1 A 0 A_PlaySound("CLIPIN10")
		SPRL GHIJKLMMLJKA 3
		2NIP A 5
		2NIP A 1 A_WeaponReady
		2NIP A 1 A_Refire
		Goto Ready+6
	  AltFire:
		2NIP A 0 A_JumpIfInventory("Sniper_Zoomed", 2, "ZoomOut")
		2NIP A 0 A_JumpIfInventory("Sniper_Zoomed", 1, "Zoom2")
	  Zoom1:
	    TNT1 A 0 A_Giveinventory("ADSmode",1)
		TNT1 A 0 A_Giveinventory("Zoomed",1)
		2NIP A 0 A_ZoomFactor(4.0)
		2NIP A 0 A_GiveInventory ("Sniper_Zoomed", 1)
		ZOM1 A 1 A_PlayWeaponSound("ZOOMIN")
		Goto "AltFireDone2"
	  Zoom2:
		TNT1 A 0 A_Giveinventory("Zoomed",1)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
		2NIP A 0 A_ZoomFactor(8.0)
		2NIP A 0 A_GiveInventory ("Sniper_Zoomed", 1)
		ZOM1 A 1 A_PlayWeaponSound("ZOOMIN")
		Goto "AltFireDone2"
	  ZoomOut:
	    TNT1 A 0 A_TakeInventory("ADSmode",1)
	    TNT1 A 0 A_TakeInventory("Zoomed",1)
	    2NIP A 1
		2NIP A 0 A_ZoomFactor(1.0)
		2NIP A 0 A_TakeInventory ("Sniper_Zoomed", 2)
		2NIP A 1 A_PlayWeaponSound("ZOOMOUT")
		Goto "AltFireDone"
	  AltFireDone:
		2NIP A 0
		Goto Ready+6
	  AltFireDone2:
	    TNT1 A 0 A_Giveinventory("ADSmode",1)
		TNT1 A 0 A_Giveinventory("Zoomed",1)
	    2NIP A 0
		Goto "ReadySniper"
     }
  }
  
  /*ACTOR SniperAmmo : Ammo
{
  Inventory.PickupMessage "Picked up 12 Sniper Rounds."
  Inventory.Amount 12
  Inventory.MaxAmount 225
  Ammo.BackpackAmount 12
  Ammo.BackpackMaxAmount 450
  Inventory.Icon "SNA1A0"
  States
  {
  Spawn:
    SNA1 A -1
    stop
  }
}*/

actor Sniper_Zoomed : Inventory
{
inventory.maxamount 2
}