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

// --------------------------------------------------------------------------
//
// 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
	{
	Ready:
        PLS9 ABC 1
        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("PlasmaAmmo",1,2)
		PLSG A 1 A_WeaponReady
        Goto Reload
        TNT1 AAAA 0
        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 BCB 1
		TNT1 A 0 A_Takeinventory("PlasmaAmmo",1)
		TNT1 A 0 A_ReFire
        TNT1 A 0 A_PlaySound("PLSCOOL")
        PLSG BCD 1
		PLSG EEEEEE 3 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		PLSG DCB 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_JumpIfInventory("Cell",1,2)
        Goto Reload
        TNT1 AAAA 0
		
        TNT1 A 0 A_PlaySound("BEP")
		PLSA ABCD 1 BRIGHT A_FireCustomMissile("BlueFlareSpawn",0,0,0,0)
		TNT1 A 0 A_ReFire
        PLSF B 2 BRIGHT A_Recoil(3)
		TNT1 A 0 A_FireCustomMissile("BlueFlareSpawn",-5,0,0,0)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 0, 1, 0, 0)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 5, 1, -1, 10)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", -7, 1, 3, 0)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 7, 1, -3, 0)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 5, 1, 1, -10)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", -5, 1, 1, 10)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", -5, 1, -1, -10)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 0, 1, 0, 0)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 5, 1, -1, 10)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", -7, 1, 3, 0)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 7, 1, -3, 0)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", 5, 1, 1, -10)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", -5, 1, 1, 10)
		TNT1 A 0 A_FireCustomMissile("PlasmaBall75", -5, 1, -1, -10)
		TNT1 A 0 A_Takeinventory("PlasmaAmmo",14)
		TNT1 A 0 A_Takeinventory("Cell",14)
        PLSG JKLKJ 1
        PLSG BCD 1
		PLSG EEEEEEEEEEEE 3 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		PLSG DCB 1
        TNT1 A 0 A_JumpIfInventory("PlasmaAmmo",1,2)
        Goto Reload
        TNT1 AAAA 0
        TNT1 A 0 A_PlaySound("BEPBEP")
		Goto Ready+6
	Flash:
		TNT1 A 4
        Goto LightDone
	Spawn:
		PLAS A -1
		Stop

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

        PLSR AB 2
		TNT1 A 0 A_FireCustomMissile("PlasmaCaseSpawn",-30,0,-4,-4)
		PLSR CDEEEEEEEEEF 2
        PLSR GHIIIJKLAA 2
		
		
		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 Reload+42
		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)
		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)
		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
		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
		Goto Ready+6

    Taunt:
        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 Plasma_Ball Replaces PlasmaBall
{
	Radius 10
	Height 10
	Speed 60
	Damage 6
    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_Explode(10,50,0)
		Stop

	Death:
    TNT1 A 0 A_SpawnItem ("PlasmaPuff", 0)
    //TNT1 A 0 A_SpawnItem ("RailPuff", 0)
	TNT1 A 0 A_SpawnItemEx ("DetectFloorScorch",-5,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_SpawnItemEx ("DetectCeilScorch",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
    TNT1 B 2 A_Explode(10,50,1)
    TNT1 AAA 19 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
	}
}


ACTOR PlasmaBall75: Plasma_Ball
{

	SeeSound "PLSM9"
}