ACTOR Rifle : BrutalWeapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	YScale 0.6
	XScale 0.8
	Weapon.SelectionOrder 2500
	Weapon.AmmoType1 "Clip2"
	Weapon.AmmoType2 "RifleAmmo"
	Obituary "%k [AM-X] %o"
    AttackSound "None"
    Inventory.PickupSound "Clip2IN"
	Inventory.Pickupmessage "$GOTRIFLE"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
	+WEAPON.NOAUTOFIRE
	+FORCEXYBILLBOARD
	Tag "AM-X"
    Scale 0.8
	States
	{
	PickUp:
	TNT1 A 0
	TNT1 A 0 A_Playsound("PICKUPONELINER")
	TNT1 A 0
	Stop
	
	Ready:
        TNT1 A 1
        TNT1 A 0 A_PlaySound("FAMABOLT")
        VIFS ABC 1
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("RifleAmmo",1,2)
        //Goto Reload
        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")
		VIFG 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")
		VIFG 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")
		VIFG 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")
		VIFG 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")
		VIFG 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")
		VI2G AB 2 A_WeaponReady
        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")
		VI2G CB 2 A_WeaponReady
        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")
        VI2G AD 2 A_WeaponReady
		Loop
	Deselect:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        VIFS CBA 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
    Fire:
        TNT1 A 0 A_JumpIfInventory("RifleAmmo",1,2)
        Goto Reload
        TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_PlaySound("FAMFIRE")
        //TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		VIFF A 1 BRIGHT //A_AlertMonsters
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		VIFF B 1 BRIGHT A_FireBullets (2.8, 2.8, -1, 47, "HitPuff")
        VIFF A 0 A_FireCustomMissile("RifleTracer", random(-2,2), 0, -1, 0)
        //TNT1 A 0 ACS_Execute(373, 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		TNT1 A 0 A_Takeinventory("RifleAmmo",1)
		TNT1 A 0 A_setpitch(Pitch-.8)
		VIFF C 1 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		VIFG AA 1
		VIFG A 1 A_Refire
		VIFG A 7 A_WeaponReady(1)
		Goto Ready+6

      Fire2:
        TNT1 A 0 A_PlaySound("FAMFIRE")
        //TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		VI2G A 0 //A_AlertMonsters
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,5)
		VI2F A 1 BRIGHT A_FireBullets (1.4, 1.4, -1, 47, "HitPuff")
        VI2F A 0 BRIGHT A_FireCustomMissile("RifleTracer", 0, 0, -1, 0)
        //TNT1 A 0 ACS_Execute(373, 0, 0, 0, 0)
		//TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("RifleAmmo",1)
		TNT1 A 0 A_setpitch(Pitch-.8)
		VI2F B 1 A_FireCustomMissile("RifleCaseSpawn",-2,0,8,0)
        VI2F CC 1
        //VI2F B 1
		VI2G A 1 A_WeaponReady(1)
   		VI2G A 1 A_Refire
		Goto Ready2

    AltFire:
        TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,8)
		TNT1 A 0 A_Giveinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.9)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
        VIFZ AB 1
        Goto Ready2
        TNT1 AAAAAA 0
        VIFZ BA 1
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
        Goto Ready+6
		
	NoAmmo:
	RIFG A 1
	Goto Ready+12
	
    Reload:
		VIFG A 1 A_WeaponReady
		TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		//TNT1 A 0 A_PlaySound("M4A1BOLT", 3)
		TNT1 A 0 A_JumpIfInventory("RifleAmmo",30,64)

        TNT1 A 0 A_JumpIfInventory("Clip2",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        //TNT1 A 0 A_PlaySound("Reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
        VKFR ABCD 1  A_JumpIfInventory("Kicking",1,"DoKick")
		VKFR E 1 A_PlaySound("SUPPIN")
        VKFR F 1 A_FireCustomMissile("EmptyClip2Spawn",-5,0,8,-4)
		//TNT1 A 0 A_PlaySound("M4A1Clip2", 1)
        VKFR GGGGGGGGGGHIKLMMMM 1 A_JumpIfInventory("Kicking",1,"DoKick")
		VKFR M 1 A_PlaySound("M4A1Clip2", 1)
		VKFR NOPQRST 1
		
		
		InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("RifleAmmo",30,15)
		TNT1 A 0 A_JumpIfInventory("Clip2",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("RifleAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip2",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:
		WOSR 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 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 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 Zoomed : Inventory
{
inventory.maxamount 1
}

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

ACTOR RifleAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 31
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 31
   Inventory.Icon "RIFLA0"
}

ACTOR MeatshieldGunAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 30
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 30
}

ACTOR MeatAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 100
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 100
}