Actor Reloading : Inventory
{
inventory.maxamount 1
}
Actor ADSMode : Inventory
{
inventory.maxamount 1
}
// --------------------------------------------------------------------------
//
//  MP40 Plasmagun Prototype
//
// --------------------------------------------------------------------------
ACTOR PLASMAMP40 : Weapon Replaces PlasmaRifle
{
	Weapon.AmmoUse1 0
        Weapon.AmmoUse2 1
	Weapon.AmmoGive 16
	Weapon.AmmoType "PlasmaClip"
        Weapon.AmmoType2 "PLAmmo"
	Obituary "%o was shot down by %k's MP40."
    AttackSound "None"
    Inventory.PickupSound "PLSDRAW"
	Inventory.Pickupmessage "MP40 PlasmaGun prototype"
    +WEAPON.NOAUTOAIM
    +WEAPON.NOALERT
	+WEAPON.NOAUTOFIRE
    Scale 0.6
	States
	{
	
	Steady:
	TNT1 A 1
	Goto Ready
	
	Ready:
        TNT1 A 1
        TNT1 A 0 A_PlaySound("PLSDRAW")
        MP4T AB 1
 TNT1 A 1 A_ZoomFactor(1.0)
        TNT1 AAAAAAAA 0
        TNT1 A 0 A_JumpIfInventory("PLAmmo",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("Reloading",1,"Reload")
        TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
	TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
	MP50 A 1 A_WeaponReady
	Goto Ready+6
		
	Ready2:
        
        TNT1 A 0 A_JumpIfInventory("PLAmmo",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("Reloading",1,"Reload")
	TNT1 A 0 A_JumpIfInventory("Salute1", 1, "Salute")
	TNT1 A 0 A_JumpIfInventory("Salute2", 1, "Salute")
	MP42 A 3 A_WeaponReady
	Loop
        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")
	MP42 A 3 A_WeaponReady
	Loop
	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")
	MP42 B 3 A_WeaponReady
	Loop
	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")
	MP42 A 3 A_WeaponReady
	Loop

	Deselect:
	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	TNT1 A 0 A_Takeinventory("ADSmode",1) 
        MP4T 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_Giveinventory("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

	TNT1 A 0 A_JumpIfInventory("Zoomed",1,"Fire2")
        TNT1 A 0 A_JumpIfInventory("PLAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("PLSM9",3)
	TNT1 A 0 A_Takeinventory("PLAmmo",1)
        TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
	TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",-5,0,0,0)
	MP50 B 1 BRIGHT A_AlertMonsters
	MP50 C 1  A_FireCustomMissile("PlasmaBall", 0, 1, 0, 0)
        //TNT1 A 0 ACS_Execute(278, 0, 0, 0, 0)
	MP50 D 1 
        //MP40 E 1
        TNT1 A 0 A_Refire
		Goto Ready+6
		
	Fire2:
        TNT1 A 0 A_JumpIfInventory("PLAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("PLSM9",3)
	TNT1 A 0 A_Takeinventory("PLAmmo",1)
        TNT1 A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
	TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",-5,0,0,0)
	MP42 F 1 BRIGHT A_AlertMonsters
	MP42 C 1  A_FireCustomMissile("PlasmaBall", 0, 1, 0, 0)
        //TNT1 A 0 ACS_Execute(278, 0, 0, 0, 0)
	MP42 H 1 
       // MP41 G 1
        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_ZoomFactor(1.7)
	TNT1 A 0 A_Giveinventory("ADSmode",1)
        MP4E CBA 1
        Goto Ready2
        TNT1 AAAAAA 0
        MP4E ABC 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:
	MP50 A 1 
	TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
	Goto Ready+10

 	Reload:
	    MP50 A 1 A_WeaponReady
	    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_JumpIfInventory("PLAmmo", 32, 62)

        TNT1 A 0 A_JumpIfInventory("PlasmaClip",1,3)
        Goto NoAmmo
        TNT1 AAA 0
        TNT1 A 0 A_PlaySound("MP40/RELOAD", 6)
	    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_TakeInventory("ADSmode",1)
        MPPL ABCDEE 2 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_FireCustomMissile("EmptyCell",-5,0,8,-4)
        TNT1 AAAAA 0
        MPPL EEEEEEEEEEEDCBA 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("PlAmmo",32,15)
		TNT1 A 0 A_JumpIfInventory("PlasmaClip",1,3)
		Goto Ready+3
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("PLAmmo",1)
		TNT1 A 0 A_Takeinventory("PlasmaClip",1)
		Goto InsertBullets

		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+3
		TNT1 AAAA 0
		TNT1 A 0 A_Takeinventory("Reloading",1)
        Goto Ready+3

 	Spawn:
		MP50 I -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)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		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)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		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
        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
	}
}

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

ACTOR PlasmaClip : Ammo Replaces Cell
{
	Inventory.PickupSound "pickups/ammo"
	Inventory.PickupMessage "Mp40 Plasma Gun Clip"
	Inventory.Amount 16
	Inventory.MaxAmount 192
	Ammo.BackpackAmount 16
	Ammo.BackpackMaxAmount 192
	Mass 10000
        Inventory.Icon "ECELA0"
	States
	{
	Spawn:
		ECEL A -1
		Loop
	}
}

ACTOR Plasma_Ball Replaces PlasmaBall
{
	Radius 10
	Height 10
	Speed 60
	Damage 7
    DamageType Plasma
	Decal "Scorch"
	Projectile
	+RANDOMIZE
renderstyle ADD
alpha 0.90
Scale 0.10
	DeathSound "weapons/plasmax"
	//SeeSound "PLSM9"
    SeeSound "None"
	Obituary "$OB_MPPLASMARIFLE"
	States
	{
	Spawn:
         PBAL C 1 BRIGHT A_SpawnItem("PlasmaFlare",0,0)
		Loop

Xdeath:
    //TNT1 A 0 A_SpawnItem ("PlasmaPuff", 0)
    //TNT1 A 0 A_SpawnItem ("RailPuff", 0)
	TNT1 A 0 A_CustomMissile ("BluePlasmaFire", 0, 0, random (0, 360), 2, random (0, 360))
	//TNT1 A 0 A_SpawnItem("BluePlasmaRife")
	TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
    TNT1 B 1 A_Explode(10,50,0)
	TNT1 B 4
	TNT2 AAA 4 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		
		Stop

	Death:
    //TNT1 A 0 A_SpawnItem ("PlasmaPuff", 0)
    //TNT1 A 0 A_SpawnItem ("RailPuff", 0)
	TNT1 B 1 A_Explode(10,50,1)
	TNT1 A 0 A_CustomMissile ("BluePlasmaFire", 0, 0, random (0, 360), 2, random (0, 360))
	TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
		TNT1 B 4	
    TNT2 AAAAAAAAA 4 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}


ACTOR PlasmaBall75: Plasma_Ball
{

	SeeSound "PLSM9"
}