Actor BWBar : Weapon
{
Weapon.AmmoUse1 0 
Weapon.AmmoGive1 8
Weapon.AmmoUse2 0
Weapon.AmmoGive2 0
Weapon.AmmoType1 "M1CLIP"
Weapon.AmmoType2 "BarReserve"
Weapon.BobRangeX 0.75
Weapon.BobRangeY 0.5
Weapon.BobSpeed 1.5
Weapon.BobStyle "InverseAlpha" //Denis Belmondo's Bobstyle
AttackSound "None"
Inventory.PickupSound "mp40_take"
Inventory.Pickupmessage "You got the Bar Assault Rifle"
+WEAPON.WIMPY_WEAPON
+WEAPON.NOAUTOAIM
+WEAPON.NOALERT
+WEAPON.NOAUTOFIRE
tag "Browning automatic rifle"
Inventory.Icon "BARBACK"
States
{
Ready:
TNT1 A 0 A_PlaySound("Deploy/stg44")
BARS ABDEFGH 1
Goto RealReady

RealReady:
BARG A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(0)
LUGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
LUGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
TNT1 A 0 A_JumpIfInventory("BWgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
LUGG A 0 A_JumpIfInventory("Reloading",1,"Reload")
Loop

Ready2:
BA2G A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(5)
LUGG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
LUGG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
TNT1 A 0 A_JumpIfInventory("BWgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
LUGG A 0 A_JumpIfInventory("Reloading",1,"Reload")
Loop

Deselect:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_Takeinventory("Meleeattack",1)
TNT1 A 0 A_Takeinventory("BWgrenade",1)
TNT1 A 0 A_Takeinventory("Reloading",1)
TNT1 A 0 A_ZoomFactor(1.0)
BARS HGFEDCBA 1 
TNT1 A 0 A_Lower
Wait

Select:
tnt1 a 0 a_raise
Wait

Fire:
TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
TNT1 A 0 A_JumpIfInventory("BarReserve",1,1)
Goto Reload
TNT1 AAAA 0
TNT1 A 0 A_PlaySound("BAR/Fire")
TNT1 A 0 A_AlertMonsters
BARF A 1 Bright A_FireBullets (2, 3, 1, 30, "HitPuff")
BARF B 2
TNT1 A 0 A_SetPitch(pitch - 1.0)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
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("BarReserve",1)
TNT1 A 0 A_Giveinventory("BarMagCounter",1)
TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
BARF C 2
BARF B 2
TNT1 A 0 A_Refire
Goto RealReady

Fire2:
TNT1 A 0 A_JumpIfInventory("BarReserve",1,1)
Goto Reload
TNT1 AAAA 0
TNT1 A 0 A_PlaySound("BAR/Fire")
TNT1 A 0 A_AlertMonsters
BA2G B 1 Bright A_FireBullets (1, 1, 1, 40, "HitPuff")
BA2G C 2
TNT1 A 0 A_SetPitch(pitch - 0.3)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
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("BarReserve",1)
TNT1 A 0 A_Giveinventory("BarMagCounter",1)
TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
BA2G D 2
BA2G C 2
TNT1 A 0 A_Refire
Goto Ready2


NoAmmo:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_ZoomFactor(1.0)
Goto RealReady

AltFire:
TNT1 A 0 A_JumpIfInventory("Zoomed",1,"UnZoom")
TNT1 A 0 A_Giveinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.7)
TNT1 A 0 A_Giveinventory("ADSmode",1)
BARX ABCDE 1 
Goto Ready2

UnZoom:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Takeinventory("ADSmode",1)
BARX EDCBA 1
Goto RealReady

Reload2:
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_ZoomFactor(1.0)
TNT1 A 0 A_JumpIfInventory("BarReserve",20,"InsertBullets")
TNT1 A 0 A_JumpIfInventory("M1CLIP",1,3)
Goto NoAmmo
TNT1 AAA 0 
BARR ABCDEFG 1 
BRR1 ABCD 2 
TNT1 a 0 a_playsound("BAR1")
BRR1 EFG 2 
TNT1 A 0 A_JumpIfInventory("BarMagCounter",20,"ReleaseMag")
Goto ContinueReload

ReleaseMag:
TNT1 A 0 A_TakeInventory("BarMagCounter",20)
TNT1 A 0 A_FireCustomMissile("BarEmptyClip",-5,0,8,-4)

ContinueReload:
BRR1 hhhh 3
BRR1 GFE 2
TNT1 a 0 a_playsound("BAR2")
BRR1 DDDD 2 
BRR1 IJK 3
TNT1 A 0 A_PlaySound("bar4")
BRR1 L 4
BRR1 KJI 3
BARR GFEDCBA 1 
Goto InsertBullets2

InsertBullets2:
TNT1 A 0 A_JumpIfInventory("BarReserve",21,"RealReady")
TNT1 A 0 A_JumpIfInventory("M1CLIP",1,"AmmoIn2")
Goto RealReady

AmmoIn2:
TNT1 A 0 A_Giveinventory("BarReserve",1)
TNT1 A 0 A_Takeinventory("M1CLIP",1)
Goto InsertBullets2


InsertBullets:
TNT1 A 0 A_JumpIfInventory("BarReserve",20,"RealReady")
TNT1 A 0 A_JumpIfInventory("M1CLIP",1,"AmmoIn")
Goto RealReady

AmmoIn:
TNT1 A 0 A_Giveinventory("BarReserve",1)
TNT1 A 0 A_Takeinventory("M1CLIP",1)
Goto InsertBullets

Reload:
TNT1 A 0 A_JumpIfInventory("BarReserve",1,"Reload2")
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_ZoomFactor(1.0)
TNT1 A 0 A_JumpIfInventory("BarReserve",20,"InsertBullets")
TNT1 A 0 A_JumpIfInventory("M1CLIP",1,3)
Goto NoAmmo
TNT1 AAA 0 
BARR ABCDEFG 1
TNT1 A 0 A_PlayWeaponSound("BAR3")
BRR2 HIJJ 3
TNT1 A 0 A_PlayWeaponSound("BAR3")
brr2 jih 3
BRR1 ABCD 2 
TNT1 a 0 a_playsound("BAR1")
BRR2 ABCDEFG 2
TNT1 A 0 A_TakeInventory("BarMagCounter",20)
TNT1 A 0 A_FireCustomMissile("BarEmptyClip",-5,0,8,-4)
BRR1 hhh 2
BRR1 GFE 2
TNT1 a 0 a_playsound("BAR2")
BRR1 DDDD 2 
BRR1 IJK 3
TNT1 A 0 A_PlaySound("bar4")
BRR1 L 4
BRR1 KJI 3
BARR GFEDCBA 1 
Goto InsertBullets



Spawn:
BARW 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)
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 RealReady

Taunt:
TNT1 A 0 A_Takeinventory("Zoomed",1)
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("FUCK", 1)
FUCK C 2 A_AlertMonsters
FUCK D 15 A_Takeinventory("Taunting",1)
FUCK CBA 5
TNT1 A 5
Goto RealReady

LaunchGrenade:	
TNT1 A 0
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_TakeInventory("LaunchGrenade", 1)
TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
Goto NoGrenade
NGRA ABCD 2
TNT1 A 0 A_playSound("Pick/granate")
NGRA DD 2
TNT1 A 0 A_Jump(90,2)
TNT1 A 0 A_PlaySound("*grenadecall", CHAN_VOICE)
NGRA DEFG 2
TNT1 A 0 A_PLaySound ("Launch/granate")
TNT1 A 0 A_FireCustomMissile("HandGrenade2", random(-3,3), 1, 0, 0, 0, 0)
GRWF STUVW 2 
TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
TNT1 A 1 
TNT1 A 0 A_TakeInventory("LaunchGrenade", 1)
TNT1 A 0 A_Takeinventory("BWgrenade",1)
Goto RealReady

NoGrenade:
TNT1 A 0
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_Takeinventory("ADSmode",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Print("No Grenades Left!")
TNT1 A 0 A_Takeinventory("BWgrenade",1)
Goto RealReady



KnifeAttack:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_Jump(90,2)
TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
KNIF ABCDE 1
KNIF F 1 A_PlaySound("weapons/wknife")
KNIF F 0 A_Custompunch(16,0,1,"KnifePuff")
KNIF GHI 1 
TNT1 A 0 A_Takeinventory("Meleeattack",1)
GOTO RealREADY
}
}

ACTOR BarReserve : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 21
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 21
}

ACTOR BarMagCounter : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 20
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 20
}