
ACTOR DualD4PeaShooter: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	//Weapon.SlotNumber 2
	//Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	//Weapon.AmmoUse2 0
	//Weapon.AmmoGive2 0
	//Weapon.AmmoType1 "RocketAmmo" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Pistols." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra Pistol." //Pickup message
    +WEAPON.NOAUTOAIM //Makes this weapon never autoaim, so recoil can work better
    //Scale 0.6 //Weapon's pickup sprite size
	+WEAPON.NOAUTOFIRE
	States
	{
	
	Spawn:
		D4W1 A 1
		TNT1 A 0 A_SpawnItemEx("D4PistolOnTheFloor", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		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_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)
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory("D4Pistol", 1, 1)
		Goto CantDualNow
		DWS2 ABCD 1
		TNT1 A 0 A_TakeInventory("StopDualWield", 1)
		TNT1 A 0 A_GunFlash
		Goto ReadyToFire
	
	CantDualNow:
		TNT1 A 1
		TNT1 A 0 A_GiveInventory("D4Pistol", 1)
		TNT1 A 0 A_TakeInventory("DualD4PeaShooter", 1)
		Stop
	
	ReadyToFire:
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun") //Check if player wants to reload
		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")
		PI2G A 1 A_WeaponReady// Weapon is ready to fire
		//TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, 1)
		Loop
		
	Flash:	//Right gun ready state
	    TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		PISG A 1
		TNT1 A 0 A_JumpIfInventory("IsFiringSecondary", 1, "DontFlash")
		TNT1 A 0 A_JumpIfInventory("FiredSecondary", 1, "FireRightGun")
		Loop
		
		
	Deselect:
		TNT1 AAAAAA 0 A_Lower
		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 1 A_Lower //Makes player switch weapons faster
		Wait
	Select:
		TNT1 A 0 A_Raise //Makes the weapon always be selected fast
		Wait
	
	DryFire:
	    RK2G A 2 A_PlaySound("DRYFIRE", 1)
		RK2G A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		PI2G A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    RK2G A 0
		TNT1 A 0 A_FireCustomMissile("PistolplasmaTracer", random(-8,1), 0, -11, -4, 0, random(-1,2))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		PI2F A 1 BRIGHT
		TNT1 A 0 A_SetPitch(-0.45 + pitch)
		TNT1 A 0 A_PlaySound("BLFIRE01", 1)
		PI2F BCDEF 1 A_SetPitch(0.025 + pitch)
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		PI2G AAA 1 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	
	DontFlash:
	    TNT1 A 1
		Goto Flash
	
	FireRightGun:
	    P2W1 A 0
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_FireCustomMissile("PistolplasmaTracer", random(-1,8), 0, 11, -4, 0, random(-1,2))//Horizontal Spread, Vertical Spread, Numbers of Projectiles (Leave as -1 if its a single one), Damage Factor
		PISF A 1 BRIGHT
		TNT1 A 0 A_SetPitch(-0.45 + pitch)
		TNT1 A 0 A_PlaySound("BLFIRE01", 1)
		PISF BCDEF 1 A_SetPitch(0.025 + pitch)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		PISG AAA 1 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    RKLG A 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		RKLG AAAAAAAAAAA 1 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		Goto Flash
		
		
	DoKick:
		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)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("KickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		KICK A 0 A_Takeinventory("Kicking",1)
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
    BerserkerKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 SetPlayerProperty(0,1,0)
		KIK1 ABC 1
		RIFF A 0 A_FireCustomMissile("SuperKickAttack", 0, 0, 0, -7)
        KIK1 D 6
		KIK1 EEBCA 1
		TNT1 A 0 SetPlayerProperty(0,0,0)
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	
	AirKick:
	    TNT1 A 0 A_jumpifinventory("PowerStrength",1,"SuperAirKick")
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("AirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
		
	SuperAirKick:
		TNT1 A 0 A_PlaySound("KICK")
		TNT1 A 0 A_Recoil (-6)
		KLCK JKLMN 1
        RIFF A 0 A_FireCustomMissile("SuperAirKickAttack", 0, 0, 0, -31)
        KLCK O 3
		KLCK A 0 A_Takeinventory("Kicking",1)
		KLCK PQRST 2
		TNT1 A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
		Goto ReadyToFire
	Taunt:
		TNT1 A 0 A_Takeinventory("Zoomed",1)
        TNT1 A 0 A_ZoomFactor(1.0)
        TNT1 A 10
		FUCK F 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 G 1 A_PlaySound("FUCK", 2)
        FUCK HI 1 A_AlertMonsters
		FUCK J 15 A_Takeinventory("Taunting",1)
        FUCK IHGF 1
        TNT1 A 10
		Goto ReadyToFire
	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 ReadyToFire	
	Steady:
	TNT1 A 1
	Goto ReadyToFire			
	}
}