Actor MP40Akimbo:Weapon
{
Weapon.AmmoUse1 0
Weapon.AmmoUse2 0
Weapon.AmmoGive1 0
Weapon.AmmoGive2 0
Weapon.AmmoType1 "WolfClip"
Weapon.AmmoType2 "MP40X2AMMO"
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 "Machine Pistole 1940 Akimbo"
+WEAPON.NOAUTOAIM
+WEAPON.NOALERT
+WEAPON.NOAUTOFIRE
scale 0.5
tag "Machine Pistole 1940 Akimbo"
Inventory.Icon "MPBAC2"
States
{
Ready:
tnt1 a 0 a_playsound("mpdep")
ZDMS ABCDEF 1 
Goto RealReady

RealReady:
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",1,"RealReadyNoBug")
tnt1 a 0 a_giveinventory("cazzafa",1)
ZDMG A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(0)
tnt1 a 0 
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
TNT1 A 0 A_JumpIfInventory("bwgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
Loop

RealReadyNoBug:
ZDMG A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(0)
tnt1 a 0 
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
TNT1 A 0 A_JumpIfInventory("bwgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
Loop

Ready2NoBug:
ZDM2 A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(5)
TNT1 A 0 
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
TNT1 A 0 A_JumpIfInventory("bwgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
Loop

Ready2:
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",1,"Ready2NoBug")
tnt1 a 0 a_giveinventory("cazzafa",1)
ZDM2 A 1 A_WeaponReady
TNT1 A 0 A_SetCrosshair(5)
TNT1 A 0 
TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
TNT1 A 0 A_JumpIfInventory("bwgrenade",1,"LaunchGrenade")
TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
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)
ZDMS FEDCBA 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("MP40AmmoRight",1,1)
Goto Fire3
TNT1 A 0 A_JumpIfInventory("MP40AmmoLeft",1,1)
Goto Reload
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",1,1)
Goto Reload
TNT1 A 0 A_PlaySound("GMP402")
TNT1 A 0 A_Takeinventory("mp40ammoright",1)
TNT1 A 0 A_TakeInventory("MP40AmmoLeft",1)
TNT1 A 0 A_GiveInventory("MP40MAGCounter2",1)
TNT1 A 0 A_TakeInventory("MP40X2AMMO",2)
TNT1 A 0 A_TakeInventory("MPAMMO",1)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
ZDMG B 1 Bright a_alertmonsters
TNT1 A 0 A_FireBullets (6, 4, -1, 12, "2MP40Puff")
TNT1 A 0 A_FireBullets (6, 4, -1, 12, "2MP40Puff")
TNT1 A 0 A_SetPitch(pitch - 0.8)
ZDMG CD 1 
TNT1 A 0  A_FireCustomMissile("RifleCaseSpawn",-5,0,8,-4)
TNT1 A 0  A_FireCustomMissile("RifleCaseSpawn",-15,0,-8,-4)
ZDMG EF 1 
TNT1 A 0 A_Refire
Goto RealReady

Fire2:
TNT1 A 0 A_JumpIfInventory("MP40AmmoRight",1,1)
Goto Fire4
TNT1 A 0 A_JumpIfInventory("MP40AmmoLeft",1,1)
Goto Reload
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",1,1)
Goto Reload
TNT1 A 0 A_PlaySound("GMP402")
TNT1 A 0 A_Takeinventory("MP40X2AMMO",2)
TNT1 A 0 A_Takeinventory("MPAmmo",1)
TNT1 A 0 A_Takeinventory("mp40ammoright",1)
TNT1 A 0 A_TakeInventory("MP40AmmoLeft",1)
TNT1 A 0 A_GiveInventory("MP40MAGCounter2",1)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
ZDM2 b 1 Bright a_alertmonsters
TNT1 A 0 A_FireBullets (2, 1, -1, 12, "2MP40Puff")
TNT1 A 0 A_FireBullets (6, 4, -1, 12, "2MP40Puff")
TNT1 A 0 A_SetPitch(pitch - 0.8)
ZDM2 CD 1 
TNT1 A 0  A_FireCustomMissile("RifleCaseSpawn",-5,0,8,-4)
TNT1 A 0  A_FireCustomMissile("RifleCaseSpawn",-15,0,-8,-4)
ZDM2 EF 1 
TNT1 A 0 A_Refire
Goto Ready2

Fire3:
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",1,1)
Goto Reload
TNT1 A 0 A_PlaySound("mp40")
TNT1 A 0 A_GiveInventory("MP40MAGCounter2",1)
TNT1 A 0 A_TakeInventory("MP40X2AMMO",1)
TNT1 A 0 A_TakeInventory("MP40AmmoLeft",1)
TNT1 A 0 A_TakeInventory("MPAMMO",1)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
ZDM3 A 1 Bright a_alertmonsters
TNT1 A 0 A_FireBullets (6, 4, -1, 12, "HitPuff")
TNT1 A 0 A_SetPitch(pitch - 0.4)
ZDM3 BC 1 
TNT1 A 0  A_FireCustomMissile("RifleCaseSpawn",-5,0,8,-4)
ZDM3 DE 1 
TNT1 A 0 A_Refire
Goto RealReady

Fire4:
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",1,1)
Goto Reload
TNT1 A 0 A_PlaySound("mp40")
TNT1 A 0 A_Takeinventory("MP40X2AMMO",1)
TNT1 A 0 A_Takeinventory("MPAmmo",1)
TNT1 A 0 A_TakeInventory("MP40AmmoLeft",1)
TNT1 A 0 A_GiveInventory("MP40MAGCounter2",1)
TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",-5,0,0,0)
ZDM4 A 1 Bright a_alertmonsters
TNT1 A 0 A_FireBullets (6, 4, -1, 12, "HitPuff")
TNT1 A 0 A_SetPitch(pitch - 0.2)
ZDM4 BC 1 
TNT1 A 0  A_FireCustomMissile("RifleCaseSpawn",-15,0,-8,-4)
ZDM4 DE 1 
TNT1 A 0 A_Refire
Goto Ready2


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)
ZDMX ABCDEFGHI 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)
ZDMX IHGFEDCBA 1 
Goto RealReady

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

Reload:
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",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("MP40X2AMMO", 64,"RealReady")
TNT1 A 0 A_JumpIfInventory("WolfClip",1,3)
Goto NoAmmo
TNT1 AAA 0
//Reloading left

Tiodio:
ZMDR ABCDEFGHIJKL 1 
ZDR1 A 2
TNT1 a 0 a_playsound("mp401")
ZDR5 ABCDEF 2 
tnt1 a 0 a_TakeInventory("MP40MAGCounter2",32)
TNT1 A 0 A_FireCustomMissile("MP40EmptyClip",-5,0,8,-4)
ZDR1 JJ 4
ZDR1 EDCB 2 
TNT1 a 0 a_playsound("mp402")
ZDR1 A 2 
ZDR5 MGHI 2
TNT1 A 0 A_PlayWeaponSound("COCKEN")
ZDR5 JKLMN 2 
ZMDR LKJIHGFEDCBA 1 
TNT1 A 0 A_TakeInventory("Cazzafa",1)
TNT1 A 0 A_JumpIfInventory("MP40AmmoRight",1,"ehi2")
//Reloading Right

ehi:
TNT1 A 0 A_JumpIfInventory("MP40AmmoRight",32,"InsertBullets")
ZDR3 ABCFGHIJKLM 1 
ZDR4 A 2 
TNT1 a 0 a_playsound("mp401")
ZDR6 ABCDEF 2 
tnt1 a 0 a_TakeInventory("MP40MAGCounter2",32)
TNT1 A 0 A_FireCustomMissile("MP40EmptyClip",-5,0,8,-4)
ZDR4 HH 4
ZDR4 GFEDCB 2 
TNT1 a 0 a_playsound("mp402")
ZDR4 A 2 
ZDR6 GHI 2 
TNT1 A 0 A_PlayWeaponSound("COCKEN")
ZDR6 JKLM 2 
ZDR3 MLKJIHGFCBA 1 


InsertBullets:
TNT1 AAAA 0
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",64,"RealReady")
TNT1 A 0 A_JumpIfInventory("WolfClip",1,"AmmoIn")
Goto RealReady
	
AmmoIn:
TNT1 AAAAAA 0
TNT1 A 0 A_Giveinventory("MP40X2AMMO",1)
TNT1 A 0 A_GiveInventory("MPAmmo",1)
TNT1 A 0 A_GiveInventory("mp40ammoright",1)
TNT1 A 0 A_GiveInventory("mp40ammoleft",1)
TNT1 A 0 A_Takeinventory("WolfClip",1)
Goto InsertBullets

Spawn:
MP40 I -1
Stop

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("MP40X2AMMO", 64,"InsertBullets")
TNT1 A 0 A_JumpIfInventory("WolfClip",1,3)
Goto NoAmmo
//Reloading left
TNT1 A 0 
TNT1 A 0 
TNT1 A 0 
TNT1 A 0 //FOTTUTO 1 
TNT1 A 0 A_JumpIfInventory("MP40AmmoLeft",32,"ehi2")
TNT1 A 0 A_JumpIfInventory("Cazzafa",1,"Tiodio")
ZMDR ABCDEFGHIJKL 1 
ZDR1 A 2
TNT1 a 0 a_playsound("mp401")
ZDR1 BCDE 2 
TNT1 A 0 A_JumpIfInventory("MP40MAGCounter2",32,"ReleaseMag1")
Goto continueReload1

ReleaseMag1:
tnt1 a 0 a_TakeInventory("MP40MAGCounter2",32)
TNT1 A 0 A_FireCustomMissile("MP40EmptyClip",-5,0,8,-4)

ContinueReload1:
ZDR1 JJ 6
ZDR1 EDCB 2 
TNT1 a 0 a_playsound("mp402")
ZDR1 A 2 
ZMDR LKJIHGFEDCBA 1 

//Reloading Right
Ehi2:
TNT1 A 0 A_JumpIfInventory("MP40AmmoRight",32,"InsertBullets2")
TNT1 A 0 A_JumpIfInventory("MP40AmmoRight",1,1)
Goto Ehi
ZDR3 ABCFGHIJKLM 1 
ZDR4 A 2 
TNT1 a 0 a_playsound("mp401")
ZDR4 BCDEFG 2
TNT1 A 0 A_JumpIfInventory("MP40MAGCounter2",32,"ReleaseMag2")
Goto ContinueReload2

ReleaseMag2:
tnt1 a 0 a_TakeInventory("MP40MAGCounter2",32)
TNT1 A 0 A_FireCustomMissile("MP40EmptyClip",-5,0,8,-4)

ContinueReload2:
ZDR4 HH 6
ZDR4 GFEDCB 2 
TNT1 a 0 a_playsound("mp402")
ZDR3 MLKJIHGFCBA 1 

InsertBullets2:
TNT1 AAAA 0
TNT1 A 0 A_JumpIfInventory("MP40X2AMMO",64,"RealReady")
TNT1 A 0 A_JumpIfInventory("WolfClip",1,"AmmoIn2")
Goto RealReady
	
AmmoIn2:
TNT1 AAAAAA 0
TNT1 A 0 A_Giveinventory("MP40X2AMMO",1)
TNT1 A 0 A_GiveInventory("MPAmmo",1)
TNT1 A 0 A_GiveInventory("mp40ammoright",1)
TNT1 A 0 A_GiveInventory("mp40ammoLeft",1)
TNT1 A 0 A_Takeinventory("WolfClip",1)
Goto InsertBullets2

DoKick:
TNT1 A 0 A_gunflash
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)
ZMDR I 5
FUCK E 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 F 2 A_PlaySound("FUCK", 1)
FUCK G 2 A_AlertMonsters
FUCK H 15 A_Takeinventory("Taunting",1)
FUCK GFE 5
ZMDR I 5
Goto RealReady

LaunchGrenade:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_TakeInventory("BWGRENADE", 1)
TNT1 A 0 A_Print("You can't toss right now!")
Goto RealReady

KnifeAttack:
TNT1 A 0 A_Takeinventory("Zoomed",1)
TNT1 A 0 A_ZoomFactor(1.0)
TNT1 A 0 A_TakeInventory("Meleeattack", 1)
TNT1 A 0 A_Print("You can't melee right now!")
Goto RealReady

Flash:
ZDMG AAAA 1
ZDMG A 4
ZDMG AAAAAAAA 1 
Goto LightDone

}
}

ACTOR MP40X2AMMO : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 64
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 64
}

ACTOR MP40MAGCounter2 : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 64
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 64
}

ACTOR MP40AmmoRight : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 32
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 32
}

ACTOR MP40AmmoLeft : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 32
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 32
}

Actor Cazzafa :inventory
{
Inventory.MaxAmount 1 
}
