//// --------------------------------------------------------------------------
//
// Thompson m1a1
//
// --------------------------------------------------------------------------

ACTOR Thompson : Weapon
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 10
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip"
	Weapon.AmmoType2 "RifleAmmo"
	Obituary "%o was shot down by %k's Thompson."
	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 take the M1A1 Thompson!"
	+WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
    +WEAPON.NOAUTOFIRE
Inventory.Icon "TOMBACK"
    Scale 0.9
	States
	{
	PickUp:
	TNT1 A 0
	TNT1 A 0 A_Playsound("mp40_take")
	TNT1 A 0
	Stop
	
	Steady:
	TNT1 A 1
	Goto Ready
	
	Ready:
        THOS AB 1  A_JumpIfInventory("GoFatality", 1, "Steady")
        Thog A 0 A_PlaySound("WEAPONCHANGE")
        Thog A 0
        Thog A 0 
        Thog A 0 A_ZoomFactor(1.0)

        Thog A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("BWgrenade",1,"LaunchGrenade")
	TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
       Thog A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		Thog A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		Thog A 0 A_JumpIfInventory("Salute2", 1, "Salute")
        Thog A 0 A_JumpIfInventory("Reloading",1,"Reload")
		Thog A 4 A_WeaponReady

		Goto Ready+5
    Ready2:
        TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
TNT1 A 0 A_JumpIfInventory("BWgrenade",1,"LaunchGrenade")
	TNT1 A 0 A_JumpIfInventory("Meleeattack",1,"KnifeAttack")
        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")
		TH2G A 2 A_WeaponReady
		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)
                THOS BA 1
		TNT1 A 0 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,1)
                Goto Reload
                TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_PlaySound("weapons/thompson")
        THOG A 0 A_AlertMonsters
	TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,5)
	THOF A 1 BRIGHT A_FireBullets (2, 2, -1, 15, "HitPuff")
     TNT1 A 0 A_SetPitch(pitch - 0.5)
                       TNT1 A 0 A_Jump(140,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
        THof B 0 BRIGHT A_FireCustomMissile("Tracer", 0, 0, -1, 0)
	TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
	TNT1 A 0 A_Takeinventory("RifleAmmo",1)
	THOF C 1 A_WeaponReady(1)
	TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",-2,0,8,0)
        THOF B 1 A_WeaponReady(1)
     TNT1 A 0 A_SetPitch(pitch + 0.5)
	TNT1 A 0 A_Refire
	Goto Ready+4


      Fire2:
        TNT1 A 0 A_PlaySound("weapons/thompson")
        TH2G A 0 A_AlertMonsters
	TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,5)
	TH2G B 1 BRIGHT A_FireBullets (0.1, 0.1, -1, 15, "HitPuff")
     TNT1 A 0 A_SetPitch(pitch - 0.5)
                TNT1 A 0 A_Jump(140,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
        THG2 B 0 BRIGHT A_FireCustomMissile("Tracer", 0, 0, -1, 0)
	TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
	TNT1 A 0 A_Takeinventory("RifleAmmo",1)
	TH2G C 1 A_WeaponReady(1)
	TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",-2,0,8,0)
        TH2G D 1 A_WeaponReady(1)
        TH2G C 0
     TNT1 A 0 A_SetPitch(pitch + 0.5)
	TNT1 A 0 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_Giveinventory("GoSpecial",1)
        TNT1 A 0 A_ZoomFactor(2.3)
		TNT1 A 0 A_Giveinventory("ADSmode",1)
        THOZ AB 1
        Goto Ready2
        TNT1 AAAAAA 0
        THOZ 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+4
		
	NoAmmo:
	THOG A 1 A_PlaySound("weapons/empty")
	TNT1 A 0 A_Takeinventory("Zoomed",1)
    TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1)
	Goto Ready+13

///DIO PORCO,I BUG!

Nobug:
TNT1 a 0 a_weaponready
goto ready+5

	
    Reload:
		TNT1 A 0 A_Takeinventory("Reloading",1)
   TNT1 A 0 A_JumpIfInventory("RifleAmmo",1,"Reload2")
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("RifleAmmo",20,"InsertBullets")

        TNT1 A 0 A_JumpIfInventory("Clip",1,3)
        Goto NoAmmo
                    TNT1 A 0 A_Jump(90,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 a 0 a_playsound("thomp1")
        THOM ABCDEF 2 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_FireCustomMissile("EmptyClip",-5,0,8,-4)
        TNT1 AAAAA 0
TNT1 a 0 a_playsound("thomp2")
THOM GGGG 2 A_JumpIfInventory("Kicking",1,"DoKick")
        THOM FEDCBBBA 2 A_JumpIfInventory("Kicking",1,"DoKick")
THMC A 4
        TNT1 A 0 A_PLAYSOUND("GESOO")
THMC B 4
THMC C 8
	    TNT1 A 0 A_TakeInventory("Reloading", 1)
	    TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0
		
		InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("RifleAmmo",20,"NOBUG")
		TNT1 A 0 A_JumpIfInventory("Clip",1,3)
		Goto Ready+4
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("RifleAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip",1)
		Goto InsertBullets
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+4
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+4


    Reload2:
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("RifleAmmo",20,"InsertBullets")

        TNT1 A 0 A_JumpIfInventory("Clip",1,3)
        Goto NoAmmo
               TNT1 A 0 A_Jump(90,2)
		TNT1 A 0 A_PlaySound("*taunt", CHAN_VOICE)
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
		TNT1 A 0 A_GiveInventory("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 a 0 a_playsound("thomp1")
        THOM ABCDEF 2 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_FireCustomMissile("EmptyClip",-5,0,8,-4)
        TNT1 AAAAA 0
TNT1 a 0 a_playsound("thomp2")
THOM GGGG 2 A_JumpIfInventory("Kicking",1,"DoKick")
        THOM FEDCBBBA 2 A_JumpIfInventory("Kicking",1,"DoKick")
	    TNT1 A 0 A_TakeInventory("Reloading", 1)
	    TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0
		
		InsertBullets:
		TNT1 AAAA 0
		TNT1 A 0 A_JumpIfInventory("RifleAmmo",20,"NOBUG")
		TNT1 A 0 A_JumpIfInventory("Clip",1,3)
		Goto Ready+4
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("RifleAmmo",1)
		TNT1 A 0 A_Takeinventory("Clip",1)
		Goto InsertBullets
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+4
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+4
 	



Spawn:
		THMP 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_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 Ready
	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

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 Ready
	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left!")
TNT1 A 0 A_Takeinventory("BWgrenade",1)
		Goto Ready+5



KnifeAttack:
                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 READY+5


	}
}

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

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
}