ACTOR BDSMGAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 41
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 41
   Inventory.Icon "TNT1A0"
}



ACTOR SMG : BDWeapon 18005
{
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 41
	Weapon.AmmoUse2 0
	weapon.slotnumber 2
	Weapon.AmmoGive2 0
	weapon.slotnumber 2
	Weapon.AmmoType1 "Magazine"
	Weapon.AmmoType2 "BDSMGAmmo"
	Obituary "%o was perforated by %k's SMG."
    AttackSound "None"
    Inventory.PickupSound "pistol/select"
	Inventory.Pickupmessage "You got a SMG!"
	+WEAPON.WIMPY_WEAPON
    +WEAPON.NOAUTOAIm
    +WEAPON.NOAUTOFIRE
	+WEAPON.NOAlert
	+WEAPON.NO_AUTO_SWITCH
    Scale 0.8
	States
	{
	PickUp:
	TNT1 A 0
	TNT1 A 0 A_Playsound("pistol/select")
	TNT1 A 0
	Stop
	lowhealth:
		tnt1 a 0 A_jumpifhealthlower(30,2)
		tnt1 a 4
		loop
		tnt1 a 0
		blsc a 4
		loop
	Ready:
		tnt1 a 0 //A_gunflash("lowhealth")
		tnt1 a 0
        TNT1 A 0 A_selectweapon("Impshield")
		TNT1 A 0 A_selectweapon("ZMANshield")
		TNT1 A 0 A_selectweapon("SGUYshield")
        TNT1 A 0 A_PlaySound("SMG/select")
        SMGS AB 1
        TNT1 AAAAAAAA 0
        TNT1 A 0 //A_JumpIfInventory("BDSMGAmmo",1,2)
        //Goto Reload
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        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, "MeatShield")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		TNT1 A 0 A_JumpIfInventory("ADSmode",1,"ready2")
		SMGG A 1 A_WeaponReady
		goto Ready+13
	Ready2:
		TNT1 A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
        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, "MeatShield")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SMSG A 1 A_WeaponReady
		Goto Ready2
	Deselect:
	tnt1 a 0 A_takeinventory("ADSmode",1)
        SMGS BA 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_custommissile("Alerter",0,0,random(-2,2),0,random(-2,2))
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Fire2")
        TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0 A_setpitch(+0.1 + pitch)
		tnt1 a 0 A_alertmonsters
		tnt1 a 0 radius_quake(2,2,0,1,0)
        TNT1 A 0 A_PlaySound("SMG/loud",3)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SMGF C 1 BRIGHT A_FireBullets (6, 4, 1, 14, "SMGPuff",0,2500)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-2,2), 0, 0, -14,0,random(-2,2))
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDSMGAmmo",2)
        SMGG B 1 A_setpitch(-0.6 + pitch)
		SMGG A 1
		TNT1 A 0 A_PlaySound("SMG/loud",2)
		TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SMGF D 1 BRIGHT A_FireBullets (5, 5, 1, 14, "SMGPuff",0,2000)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		tnt1 a 0 A_jump(220,"slow2")
		SMGG b 1
	slow2:
		SMGG A 1 A_refire
		goto Ready+13
		
	Fire2:
        TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0 A_setpitch(+0.1 + pitch)
		tnt1 a 0 radius_quake(1,2,0,1,0)
        TNT1 A 0 A_PlaySound("SMG/silence",3,0.8)
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SMSF A 1 BRIGHT A_FireBullets (4, 2, 1, 10, "SMGPuff",0,2500)
        RIFF A 0 A_FireCustomMissile("Tracer", random(-1,1), 0, 0, -14,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("ShakeYourAssMinor", 0, 0, 0, 0)
		TNT1 A 0 A_Takeinventory("BDSMGAmmo",2)
        SMSG B 1 A_setpitch(-0.6 + pitch)
		SMSG A 1
		TNT1 A 0 A_PlaySound("SMG/silence",2,0.7)
		//TNT1 A 0 A_FireCustomMissile("YellowFlareSpawn",0,0,0,0)
		SMSf B 1 BRIGHT A_FireBullets (3, 3, 1, 10, "SMGPuff",0,2000)
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,8,-9)
		tnt1 a 0 A_jump(220,"slow2")
		SMSG b 1 A_alertmonsters
	slow2:
		SMSG A 1 A_refire
		Goto Ready +11
	NoAmmo:
	SMGG A 1
	Goto Ready+10
	
    Reload:
	TNT1 A 0 A_JumpIfInventory("ADSmode",1,"Reload2")
		SMGG A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("ADSmode",1)
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",41,46)
        TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_Playsound("SMG/reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		RIFR C 0 A_FireCustomMissile("EmptyPISTOLClipSpawn",-5,0,8,-4)
        SMGR ABCDEFGGGGHHIKKLMMNOPPPPPFEDCBA 1
		
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAA 0
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",41,15)
		TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
		goto Ready+13
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDSMGAmmo",1)
		TNT1 A 0 A_Takeinventory("Magazine",1)
		Goto Reload+61
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        goto Ready+13
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        goto Ready+13
	
	Reload2:
		SMGG A 1 A_WeaponReady
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",41,46)
        TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
        Goto NoAmmo
        TNT1 AAA 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 0 A_Playsound("SMG/reload")
		TNT1 A 0 A_GiveInventory ("Pumping", 1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		RIFR C 0 A_FireCustomMissile("EmptyPISTOLClipSpawn",-5,0,8,-4)
        SMSR ABCDEFGGGGHHIKKLMMNOPPPPPFEDCBA 1
		
		TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAA 0
		TNT1 A 0 A_JumpIfInventory("BDSMGAmmo",41,15)
		TNT1 A 0 A_JumpIfInventory("Magazine",1,3)
		Goto Ready2 +6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("BDSMGAmmo",1)
		TNT1 A 0 A_Takeinventory("Magazine",1)
		Goto Reload2 +61
		
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready2 +6
		TNT1 AAAA 0
				TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready2 +6
 	Spawn:
		ATFL A -1
		Stop
    DoKick:
	    TNT1 A 0
		Tnt1 a 0 A_jumpifinventory("ADSMode",1,"SDoKick")
        TNT1 A 0 A_ZoomFactor(1.0)
		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)
		SMGK ABCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        SMGK H 4
		SMGK A 0 A_Takeinventory("Kicking",1)
		SMGK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		goto Ready+13
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		SMGK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        SMGK H 3
		SMGK A 0 A_Takeinventory("Kicking",1)
		SMGK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		goto Ready+13
	SDoKick:
	    TNT1 A 0
        TNT1 A 0 A_ZoomFactor(1.0)
		NULL A 0 A_JumpIf (momZ > 0, "AirKick")
		NULL A 0 A_JumpIf (momZ < 0, "AirKick")
		
        TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SBerserkerKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		SMSK ABCD 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        SMSK H 4
		SMGK A 0 A_Takeinventory("Kicking",1)
		SMSK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		goto Ready+13
    SBerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		SMSK ABCDEFG 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        SMSK H 3
		SMGK A 0 A_Takeinventory("Kicking",1)
		SMSK IGFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		goto Ready+13
	
	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+13
		
	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+13
Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_Takeinventory("Taunting",1)
		TNT1 A 0 A_JumpIfInventory("RealismMode", 1, "CheckGrab")
        TNT1 A 10
		FUCK A 1
		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 1 A_PlaySound("FUCK", 2)
        FUCK CD 1 A_AlertMonsters
		FUCK E 15 A_Takeinventory("Taunting",1)
        FUCK DCBA 1
        TNT1 A 10
		Goto Ready+1
	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+1
	meatshield:
	    TNT1 A 0 SetPlayerProperty(0,1,0)
		PUNG BCD 1
        TNT1 A 0 A_PlaySound("skeleton/swing")
		PUNG A 0 A_FireCustomMissile("MeleeStrikegrab", 0, 0, 0, -9)
		PUNG E 1
		PUNG DCB 1
        PUNG AA 1
		TNT1 A 0 A_Refire("meatshield")
		tnt1 a 0 A_weaponready
		TNT1 A 0 A_TakeInventory("Salute1",1)
		TNT1 A 0 A_TakeInventory("Salute2",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		Goto Ready+1
	altfire:
		tnt1 a 0 A_print("Silencer Attached",2)
		tnt1 a 0 A_jumpifinventory("ADSmode",1, "RemoveSilencer")
		tnt1 a 0 A_Giveinventory("ADSmode",1)
		tnt1 a 0 A_jumpifinventory("ADSmode",1, "AttachSilencer")
	AttachSilencer:
	tnt1 a 0 A_PlaySound("PISATCH")
		tnt1 a 3
		SMGS A 1 A_print("Silencer Attached",2)
		SMGS b 1
		SMGS c 1
		SMGS d 1
		goto ready2
	RemoveSilencer:
		tnt1 a 0 A_PlaySound("PISATCH")
		SMGS a 1 A_print("silencer detached",2)
		SMGS b 1
		SMGS c 1
		SMGS d 1
		SMGG A 3 A_takeinventory("ADSmode",1)
		goto Ready+13
	
	TossGrenade:	
		TNT1 A 0
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 A 0 A_JumpIfInventory("GrenadeAmmo", 1, 1)
		Goto NoGrenade
		GRTH ABCD 1
		TNT1 A 0 A_GiveInventory("FiredGrenade", 1)
		TNT1 A 0 A_PLaySound ("GRNPIN")
		GRTH EEFG 1
		TNT1 A 0 A_PLaySound ("GRNTOSS")
		GRTH HI 1
		TNT1 A 0 A_TakeInventory("GrenadeAmmo", 1)
		TNT1 A 0 A_FireCustomMissile("HandGrenade", random(-2,2), 0, 0, 0, 0, 0)
	    TNT1 A 0 A_TakeInventory("FiredGrenade", 1)
		GRTH JKLM 1
		TNT1 A 1 
		TNT1 A 0 A_TakeInventory("TossGrenade", 1)
		Goto Ready+1	
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.")
		goto Ready+13
	}
}