

ACTOR D4PlasmaGun : DoomWeapon
{
	Weapon.AmmoUse1 1
	Weapon.AmmoGive1 0
	Weapon.AmmoType1 "Cell"
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Cell"
	Inventory.PickupMessage "You got the Plasma Gun!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		PLRG A 1 A_WeaponReady
		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("TossGrenade",1,"TossGrenade")
		Loop
		
	Steady:	
		TNT1 A 0
		TNT1 A 5
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
		
	
	Deselect:
		PLRS CBA 0
		PLRG AAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		TNT1 A 0 A_Takeinventory("HasPlasmaWeapon",1)
		Loop
	Select:
		TNT1 A 1 A_Raise
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_TakeInventory("IsFiringPrimary",1)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 A_GiveInventory("StopDualWield", 1)
		TNT1 A 0 A_Takeinventory("FistsSelected",1)
		TNT1 A 0 A_Takeinventory("Reloading",1)
		TNT1 A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 A_Takeinventory("TossGrenade",1)
		TNT1 A 0 A_Giveinventory("HasPlasmaWeapon",1)
		PLRG AAAAAAAAA 0 A_Raise
		Select2:
		PLRS ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0 A_FireCustomMissile("PlasmaBallWeak", random(-1,1),1,6,-3,0,random(-1,1))
		TNT1 A 0 A_PlaySound("PLMFIR", 1)
		PLRF A 1 BRIGHT A_SetPitch(-1.0 + pitch)
		PLRF BC 1 A_SetPitch(0.5 + pitch)
		TNT1 A 0 A_Refire
		PLRG A 6 A_WeaponReady(1)
		Goto Ready
		
	Spawn:
		D4W6 A 1
		TNT1 A 0 A_SpawnItemEx("D4PlasmagunOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		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")
		RIFF A 0 A_FireCustomMissile("KickAttackDetectDowned", 0, 0, 0, 0)
        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 5
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK I 1
		KICK GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KICK BCD 1
        RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KICK H 5
		KICK A 0 A_Takeinventory("Kicking",1)
		KICK I 1
		KICK GFEDCBA 1 
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto Select2
	
	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 Select2
		
	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 Select2

    Taunt:
        TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
		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
		Goto Select2
	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 Select2
	TossGrenade:	
		TNT1 A 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 Select2
	NoGrenade:
		TNT1 A 0
		TNT1 A 0 A_Print("No Grenades Left.", 2)
		Goto Ready	
	}
}

ACTOR PlasmaBallWeak: Plasma_Ball
{
	Damage 5
	SeeSound "PLSM9"
	Radius 4
	Height 4
}