ACTOR PlasmaAmmo : Ammo
{
   Inventory.Amount 0
   Inventory.MaxAmount 50
   Ammo.BackpackAmount 0
   Ammo.BackpackMaxAmount 50
}

// --------------------------------------------------------------------------
//
// Plasma rifle
//
// --------------------------------------------------------------------------

ACTOR Plasma_Gun : PlasmaRifle Replaces PlasmaRifle
{
	Weapon.SelectionOrder 100
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 50
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
    Inventory.PickupSound "PLSDRAW"
	Weapon.AmmoType1 "Cell"
	Weapon.AmmoType2 "PlasmaAmmo"
    +WEAPON.NOAUTOAIM
	Inventory.PickupMessage "$GOTPLASMA"
	States
	{
	Steady:
	TNT1 A 1
	Goto Ready
	Ready:
        PLS9 ABC 1 A_JumpIfInventory("GoFatality", 1, "Steady")
        TNT1 A 0 A_PlaySound("PLSDRAW")
        TNT1 AA 0
        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, "Salute")
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
		PLSG A 1 A_WeaponReady
		Goto Ready+6
		
	DontNeedToReload:
	Goto Ready+6
	Deselect:
        PLS9 CBA 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_Giveinventory("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("Reloading",1,"Reload")
        TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("PLSM9",3)
		//TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",-5,0,0,0)
		
		PLSF A 1 BRIGHT A_FireCustomMissile("PlasmaBall", 0, 1, 0, 0)
		
		PLSF BCD 1
		TNT1 A 0 A_Takeinventory("PlasmaAmmo",1)
		TNT1 A 0 A_ReFire
        TNT1 A 0 A_PlaySound("PLSCOOL")
		PLSG BCDEF 1
		PLSG GGGGGG 3 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		PLSG FEDCB 1
        TNT1 A 0 A_PlaySound("BEPBEP")
		Goto Ready+6
	AltFire:
        TNT1 A 0 A_JumpIfInventory("Reloading",1,"Reload")
        TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        //TNT1 A 0 A_PlaySound("PLSM9",3)
		//TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",-5,0,0,0)
		
		PLSF AEF 1 BRIGHT A_FireCustomMissile("HotPlasmaGas", 0, 1, 0, 5)
		TNT1 A 0 A_TakeInventory("PlasmaAmmo", 2)
		
		TNT1 A 0 A_Takeinventory("PlasmaAmmo",1)
		TNT1 A 0 A_ReFire
        TNT1 A 0 A_PlaySound("PLSCOOL")
		PLSG BCDEF 1
		PLSG GGGGGG 3 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		PLSG FEDCB 1
        TNT1 A 0 A_PlaySound("BEPBEP")
		Goto Ready+6
	Flash:
		TNT1 A 4
        Goto LightDone
	Spawn:
		PLAS A -1
		Stop

    Reload:
	    PLSR A 1 A_WeaponReady
        TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",50,"DontNeedToReload")
        TNT1 A 0 A_PlaySound("BEEEP")
        TNT1 A 0 A_JumpIfInventory("Cell",1,3)
        Goto Ready+6
        TNT1 AAAA 0
       

        
		TNT1 A 0 A_PlaySound("PLREADY")
		PLSR A 12
		PLSR BCDDDEFGHHII 1
		
		PLSR JKLMN 1
		TNT1 A 0 A_FireCustomMissile("PlasmaCaseSpawn",-30,0,-4,-4)
		PLSR OPQRSSSSTU 1
		PLSR U 6
		PLSR VWXYZ 1
		PL2R ABBCBCEF 1
		PLSR A 30
		
		FinishReload:
		TNT1 AAAAAAAAAA 0
		TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",50,15)
		TNT1 A 0 A_JumpIfInventory("Cell",1,3)
		Goto Ready+6
        TNT1 AAAAAA 0
		TNT1 A 0 A_Giveinventory("PlasmaAmmo",1)
		TNT1 A 0 A_Takeinventory("Cell",1)
		Goto FinishReload
		TNT1 AAAAAAAA 0
		
		TNT1 A 0 A_Takeinventory("Reloading",1)
        TNT1 A 0 A_PlaySound("BEPBEP")
        Goto Ready+6

        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 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
	}
}



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(6,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(6,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"
}