

ACTOR D4Pistol : DoomWeapon
{
	Weapon.SelectionOrder 1300
	Weapon.AmmoUse1 0
	Weapon.AmmoGive1 0
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Inventory.PickupMessage "You got the Plasma Pistol!"
	Obituary "$OB_MPSHOTGUN"
	+WEAPON.NOAUTOFIRE
	+WEAPON.NOAUTOAIM
	Tag "$TAG_SHOTGUN"
	States
	{
	Ready:
		PISG A 1 A_WeaponReady
		//TNT1 A 0 A_JumpIfInventory("IsUpgradingWeapons",1,"UpgradeWeapons")
		TNT1 A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        TNT1 A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        //TNT1 A 0 A_JumpIfInventory("Reloading",1,"ChangeAltMode")
		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:
		PISS CBA 0
		PISG AAAAAAAAAAAA 0 A_Lower
		TNT1 A 1 A_Lower
		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_Takeinventory("HasPlasmaWeapon",1)
		PISG AAAAAAAAA 0 A_Raise
		Select2:
		PISS ABC 1
		Goto Ready
		
	Fire:
		TNT1 A 0 A_FireCustomMissile("PistolplasmaTracer", 0,0,9,-4,0,0)
		TNT1 A 0 A_PlaySound("BLFIRE01", 1)
		PISF A 1 BRIGHT A_SetPitch(-0.4 + pitch)
		PISF B 1
		PISF CD 1 A_SetPitch(0.2 + pitch)
		PISF EFFF 1 A_WeaponReady(1)
		TNT1 A 0 A_Refire
		Goto Ready
		
	AltFire:
		TNT1 A 0
		TNT1 A 0 A_PlaySound("BCHARGE", 1)
		PISG A 6
		TNT1 A 0 A_PlaySound("CHRGLOAD1", 1)
		PISG A 12
		TNT1 A 0 A_PlaySound("CHRGCLIC", 3)
	
	AltHold:
		PISC A 1 BRIGHT A_PlaySound("CHRGLOAD1", 1)
		PISC ABCDABCD 1 BRIGHT
		TNT1 A 0 A_Refire
		TNT1 A 0 A_FireCustomMissile("PistolheavyplasmaTracer", 0,0,9,-4,0,0)
		TNT1 A 0 A_PlaySound("CHARGDF1", 1)
		PISF A 1 BRIGHT A_SetPitch(-1.2 + pitch)
		PISF B 1
		PISF CD 1 A_SetPitch(0.6 + pitch)
		PISF EFFFF 1 A_WeaponReady(1)
		TNT1 A 0 A_Refire
		Goto Ready
		
	Spawn:
		D4W1 A 1
		TNT1 A 0 A_SpawnItemEx("D4PistolOnTheFloor", 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 PistolplasmaTracer: FastProjectile
{
+BLOODSPLATTER 
-DONTSPLASH
speed 200
damage (random(15,20))
Species "Marines"
scale .2
RenderStyle Add
Alpha 0.9
radius 2
height 2
damagetype Normal
Decal "BulletPuff"
States
{

	Spawn:
		TNT1 A 1 BRIGHT A_SpawnItemEx("PistolplasmaTracerTrail", 0,               0,              2)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolplasmaTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		Loop
	Death:
		TNT1 AAAAA 0 A_SpawnItem("BlueFlareSmall")
		TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
		BL1I ABCD 1 BRIGHT A_SpawnItem("BlueFlareSmall")
		TNT2 AA 3 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
}
}

actor PistolplasmaTracerTrail
{
    Scale 0.03
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        SPKB A 2 BRIGHT
        stop
    }
}



actor PistolplasmaTracerTrail2: PistolplasmaTracerTrail {    Alpha 0.85 }
actor PistolplasmaTracerTrail3: PistolplasmaTracerTrail {    Alpha 0.80 }
actor PistolplasmaTracerTrail4: PistolplasmaTracerTrail {    Alpha 0.75 }
actor PistolplasmaTracerTrail5: PistolplasmaTracerTrail {    Alpha 0.70 }
actor PistolplasmaTracerTrail6: PistolplasmaTracerTrail {    Alpha 0.65 }
actor PistolplasmaTracerTrail7: PistolplasmaTracerTrail {    Alpha 0.60 }
actor PistolplasmaTracerTrail8: PistolplasmaTracerTrail {    Alpha 0.55 }
actor PistolplasmaTracerTrail9: PistolplasmaTracerTrail {    Alpha 0.50 }
actor PistolplasmaTracerTrail10: PistolplasmaTracerTrail {    Alpha 0.45 }
actor PistolplasmaTracerTrail11: PistolplasmaTracerTrail {    Alpha 0.40 }
actor PistolplasmaTracerTrail12: PistolplasmaTracerTrail {    Alpha 0.35 }
actor PistolplasmaTracerTrail13: PistolplasmaTracerTrail {    Alpha 0.30 }
actor PistolplasmaTracerTrail14: PistolplasmaTracerTrail {    Alpha 0.25 }
actor PistolplasmaTracerTrail15: PistolplasmaTracerTrail {    Alpha 0.20 }
actor PistolplasmaTracerTrail16: PistolplasmaTracerTrail {    Alpha 0.15 }
actor PistolplasmaTracerTrail17: PistolplasmaTracerTrail {    Alpha 0.10 }
actor PistolplasmaTracerTrail18: PistolplasmaTracerTrail {    Alpha 0.05 }





















Actor PistolheavyplasmaTracer: FastProjectile
{
+BLOODSPLATTER 
-DONTSPLASH
speed 200
damage (random(80,90))
scale .6
RenderStyle Add
Alpha 0.9
radius 2
height 2
damagetype Plasma
Decal "BulletPuff"
States
{

	Spawn:
		TNT1 A 1 BRIGHT A_SpawnItemEx("PistolheavyplasmaTracerTrail", 0,               0,              2)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail2", (2 *momx)/-35.0, -(2 *momy)/-35.0, 2+(2 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail3", (4 *momx)/-35.0, -(4 *momy)/-35.0, 2+(4 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail4", (6 *momx)/-35.0, -(6 *momy)/-35.0, 2+(6 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail5", (8 *momx)/-35.0, -(8 *momy)/-35.0, 2+(8 *momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail6", (10*momx)/-35.0, -(10*momy)/-35.0, 2+(10*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail7", (12*momx)/-35.0, -(12*momy)/-35.0, 2+(12*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail8", (14*momx)/-35.0, -(14*momy)/-35.0, 2+(14*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail9", (16*momx)/-35.0, -(16*momy)/-35.0, 2+(16*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail10", (18*momx)/-35.0, -(18*momy)/-35.0, 2+(18*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail11", (20*momx)/-35.0, -(20*momy)/-35.0, 2+(20*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
        TNT1 A 0 A_SpawnItemEx("PistolheavyplasmaTracerTrail12", (22*momx)/-35.0, -(22*momy)/-35.0, 2+(22*momz)/-35.0, 0,0,0, 0, SXF_ABSOLUTEANGLE)
		Loop
	Death:
		TNT1 AAAAA 0 A_SpawnItem("BlueFlareSmall")
		TNT1 AAAAA 0 A_CustomMissile ("BluePlasmaFireNonStatic", 2, 0, random (0, 360), 2, random (0, 180))
		TNT1 AAAAAAAAAAAA 0 A_CustomMissile ("BlueplasmaParticle", 0, 0, random (0, 360), 2, random (0, 360))
		BL1I ABCD 1 BRIGHT A_SpawnItem("BlueFlareSmall")
		TNT2 AA 3 A_CustomMissile ("PlasmaSmoke", 1, 0, random (0, 360), 2, random (0, 160))
		Stop
}
}

actor PistolheavyplasmaTracerTrail
{
    Scale 0.2
    RenderStyle Add
    Alpha 0.9
    +NOINTERACTION
    +CLIENTSIDEONLY
    States
    {
    Spawn:
        SPKB A 2 BRIGHT
        stop
    }
}



actor PistolheavyplasmaTracerTrail2: PistolheavyplasmaTracerTrail {    Alpha 0.85 }
actor PistolheavyplasmaTracerTrail3: PistolheavyplasmaTracerTrail {    Alpha 0.80 }
actor PistolheavyplasmaTracerTrail4: PistolheavyplasmaTracerTrail {    Alpha 0.75 }
actor PistolheavyplasmaTracerTrail5: PistolheavyplasmaTracerTrail {    Alpha 0.70 }
actor PistolheavyplasmaTracerTrail6: PistolheavyplasmaTracerTrail {    Alpha 0.65 }
actor PistolheavyplasmaTracerTrail7: PistolheavyplasmaTracerTrail {    Alpha 0.60 }
actor PistolheavyplasmaTracerTrail8: PistolheavyplasmaTracerTrail {    Alpha 0.55 }
actor PistolheavyplasmaTracerTrail9: PistolheavyplasmaTracerTrail {    Alpha 0.50 }
actor PistolheavyplasmaTracerTrail10: PistolheavyplasmaTracerTrail {    Alpha 0.45 }
actor PistolheavyplasmaTracerTrail11: PistolplasmaTracerTrail {    Alpha 0.40 }
actor PistolheavyplasmaTracerTrail12: PistolheavyplasmaTracerTrail {    Alpha 0.35 }
actor PistolheavyplasmaTracerTrail13: PistolheavyplasmaTracerTrail {    Alpha 0.30 }
actor PistolheavyplasmaTracerTrail14: PistolheavyplasmaTracerTrail {    Alpha 0.25 }
actor PistolheavyplasmaTracerTrail15: PistolheavyplasmaTracerTrail {    Alpha 0.20 }
actor PistolheavyplasmaTracerTrail16: PistolheavyplasmaTracerTrail {    Alpha 0.15 }
actor PistolheavyplasmaTracerTrail17: PistolheavyplasmaTracerTrail {    Alpha 0.10 }
actor PistolheavyplasmaTracerTrail18: PistolheavyplasmaTracerTrail {    Alpha 0.05 }



