
ACTOR DualRepeaters: DoomWeapon
{
	Weapon.AmmoUse1 0 
	Weapon.SelectionOrder 700
	Weapon.AmmoGive1 0 //How much ammo can be gathered with this weapon
	Weapon.AmmoUse2 0
	Weapon.AmmoGive2 0
	Weapon.AmmoType1 "Clip2" //Reserve ammo type
	Obituary "%o was destroyed by %k's Double Repeaters." //Kill message
    AttackSound "None" //You better leave this clear
	Inventory.Pickupmessage "You got an extra Repeater." //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:
		D4W2 B 1
		TNT1 A 0 A_SpawnItemEx("RepeaterOnTheFloorDroped", 0, 0, 0, velx, vely, velz, angle, SXF_ABSOLUTEANGLE | SXF_ABSOLUTEVELOCITY)
		Stop
	
	Ready:
		TNT1 A 1
		TNT1 A 0 A_JumpIfInventory("D4Repeater", 1, 1)
		Goto CantDualNow
		DWS4 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("D4Repeater", 1)
		TNT1 A 0 A_TakeInventory("DualRepeaters", 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")
		RP1G 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")
		RP2G A 1
		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:
	    RP2G A 2 A_PlaySound("DRYFIRE", 1)
		RP2G A 10
		Goto ReadyToFire
	 
	Fire:
		TNT1 A 0
		TNT1 A 0
		RP1G A 1
		TNT1 A 0 A_JumpIfInventory("FiredPrimary",1,"FireLeftGun")
		Goto ReadyToFire
		
	FireLeftGun:
	    RP2G A 0
		TNT1 A 0
		TNT1 A 0 A_JumpIfInventory("Clip2", 3, 1)
		Goto DryFire
		TNT1 A 0 A_TakeInventory("Clip2", 3)
		TNT1 A 0 A_ALertMonsters
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,-12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,-6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP1F A 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP1G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,-12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,-6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP1F B 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP1G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,1-2,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,-6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP1F C 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP1G A 1
		RP1G BC 1 A_SetPitch(0.5 + pitch)
		RP1G A 1 A_SetPitch(0.5 + pitch)
		RP1G A 4
		TNT1 A 0 A_TakeInventory("FiredPrimary",1)
		TNT1 A 0 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_GiveInventory("IsFiringSecondary", 1)
		SSG1 A 0
		TNT1 A 0
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		TNT1 A 0 A_JumpIfInventory("Clip2", 3, 1)
		Goto DryFire2
		TNT1 A 0 A_TakeInventory("Clip2", 3)
		
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP2F A 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP2G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP2F B 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP2G A 2
		TNT1 A 0 A_FireCustomMissile("Tracer", random(-1,1),0,12,-6,0,random(-1,1))
		TNT1 A 0 A_FireCustomMissile("RifleCaseSpawn",5,0,6,-14)
		TNT1 A 0 A_FireBullets (10.0, 3.0, -1, 11, "BulletPuff")
		TNT1 A 0 A_PlaySound("HARFIR", 1)
		RP2F C 1 BRIGHT A_SetPitch(-0.5 + pitch)
		RP2G A 1
		RP2G BC 1 A_SetPitch(0.5 + pitch)
		RP2G A 1 A_SetPitch(0.5 + pitch)
		RP2G A 4
		TNT1 A 0 A_JumpIfInventory("StopDualWield", 1, "LightDone")
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_JumpIfInventory("FiredSecondary",1,"FireRightGun")
		Goto Flash
		
	DryFIre2:
	    RP1G A 2 A_PlaySound("DRYFIRE", 1)
		TNT1 A 0 A_TakeInventory("IsFiringSecondary",1)
		TNT1 A 0 A_TakeInventory("FiredSecondary",1)
		RP1G 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			
	}
}