Actor Chain_saw : BrutalWeapon
{
	weapon.selectionorder 240
	Weapon.UpSound "none"
	weapon.readysound "weapons/chainsaw/idle"
    +WEAPON.NOAUTOAIM
	+WEAPON.AXEBLOOD
	+FORCEXYBILLBOARD
	Weapon.KickBack 0
	Tag "Chainsaw"
states
	{
		
	Spawn:
		CSAW A 1
		CSAW A -1
		Stop	
	
	PuristGun:
		TNT1 A 1
		SAWG A 0 A_GiveInventory("ClassicSaw", 1)
		SAWG A 0 A_TakeInventory("Chain_Saw", 1)
		TNT1 A 10
		Goto Ready
		
	
	Select:
		
		SAWG A 0 
		SAWG A 0 A_Takeinventory("FistsSelected",1)
		SAWG A 0 A_Giveinventory("GoSpecial",1)
		SAWG A 0 A_Takeinventory("ShotgunSelected",1)
		SAWG A 0 A_Takeinventory("SSGSelected",1)
		SAWG A 0 A_Takeinventory("MinigunSelected",1)
		SAWG A 0 A_Takeinventory("PlasmaGunSelected",1)
		SAWG A 0 A_Takeinventory("RocketLauncherSelected",1)
		SAWG A 0 A_Takeinventory("GrenadeLauncherSelected",1)
		SAWG A 0 A_Takeinventory("BFGSelected",1)
		SAWG A 0 A_Takeinventory("BFG10kSelected",1)
		SAWG A 0 A_Takeinventory("RailGunSelected",1)
		SAWG A 0 A_Takeinventory("SubMachineGunSelected",1)
		SAWG A 0 A_Takeinventory("RevenantLauncherSelected",1)
		SAWG A 0 A_Takeinventory("LostSoulSelected",1)
		SAWG A 0 A_Takeinventory("FlameCannonSelected",1)
		SAWG A 0 A_Takeinventory("HasBarrel",1)
		KICK A 0 A_Takeinventory("PowerBloodOnVisor",1)
		KICK A 0 A_Takeinventory("PowerBlueBloodOnVisor",1)
		KICK A 0 A_Takeinventory("PowerGreenBloodOnVisor",1)
		SAWG A 0 A_Giveinventory("HasCutingWeapon",1)
		SAWG A 0 A_Giveinventory("sawSelected",1)
		TNT1 AAAAAA 1 A_RAise
		TNT1 AAAAAAAAA 0 A_Raise
		Goto SelectAnimation
		
	SelectAnimation:
		SAWY ABCDE 1 A_JumpIfInventory("GoFatality", 1, "Steady")
		SAWG A 0 A_PlaySound("DSSAWZIP", 1)
		SAWG A 0 A_GunFlash
        SAWS ABCDEFEDCB 1
		SAWS A 3 A_playsound("weapons/chainsaw/draw", 3)
		SAWS GH 1
		Goto REady
		
	Deselect:
	    SAWG A 0 
		SAWG A 0 A_StopSound(6)
		AXEG A 0 A_Takeinventory("PowerBloodOnVisor",1)
		AXEG A 0 A_Takeinventory("PowerBlueBloodOnVisor",1)
		AXEG A 0 A_Takeinventory("PowerGreenBloodOnVisor",1)
		SAWG A 0 A_Takeinventory("HasCutingWeapon",1)
		SAWG A 0 A_StopsoundEx("Weapon")
		SAWG A 0 A_Lower
		SAWN A 1 A_Lower
		wait

    Steady:
	TNT1 A 1
	Goto Ready
	
	
	Ready:
	Ready3:
	Reload:
	ReadyToFire:
		SAWG A 0

		SAWG A 0 A_StopSound(4)
		SAWG A 0 A_StopSound(1)
		SAWG A 0 A_Giveinventory("HasCutingWeapon",1)
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SAWG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SAWG A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
        SAWG A 0 A_JumpIfInventory("PowerBloodOnVisor",1,"Ready.Blood")
        SAWG A 0 A_JumpIfInventory("PowerBlueBloodOnVisor",1,"Ready.BlueBlood")
        SAWG A 0 A_JumpIfInventory("PowerGreenBloodOnVisor",1,"Ready.GreenBlood")
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG ABAB 2 A_weaponready
		Loop
	
	Ready.Blood:
		SAWG A 0
		SAWG A 0 A_TakeInventory("PowerBlueBloodOnVisor", 1)
		SAWG A 0 A_TakeInventory("PowerGreenBloodOnVisor", 1)
		SAWG A 0 A_StopSound(4)
		SAWG A 0 A_StopSound(1)
		SAW2 ABAB 2 A_weaponready
		SAWG A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SAWG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SSW2 CDEF 2 A_weaponready
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SAWG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SSW2 GHIJ 2 A_weaponready
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		Goto ReadyToFire

	Ready.BlueBlood:
		SAWG A 0
		SAWG A 0 A_TakeInventory("PowerBloodOnVisor", 1)
		SAWG A 0 A_TakeInventory("PowerGreenBloodOnVisor", 1)
		SAWG A 0 A_StopSound(4)
		SAWG A 0 A_StopSound(1)
		SAW4 ABAB 2 A_weaponready
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAWG A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SAWG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SSW4 CDEF 2 A_weaponready
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAWG A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SAWG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SSW4 GHIJ 2 A_weaponready
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		Goto ReadyToFire
	
	Ready.GreenBlood:
		SAWG A 0
		SAWG A 0 A_TakeInventory("PowerBlueBloodOnVisor", 1)
		SAWG A 0 A_TakeInventory("PowerBloodOnVisor", 1)
		SAWG A 0 A_StopSound(4)
		SAWG A 0 A_StopSound(1)
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAW3 ABAB 2 A_weaponready
		SAWG A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SAWG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SSW3 CDEF 2 A_weaponready
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		SAWG A 0 A_FireCustomMissile("SmokeSpawner",0,0,0,5)
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		SAWG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		SAWG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		SSW3 GHIJ 2 A_weaponready
		SAWG A 0 A_playsoundex("weapons/chainsaw/idle", 6)
		SAWG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Goto ReadyToFire
	
	
		
	Fire:
		SAWG A 0
		SAWG A 0
		SAWG A 0 A_StopSound(6)
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		SAWG A 0 A_Giveinventory("HasCutingWeapon",1)
		SAWG A 0 A_JumpIfInventory("PowerBloodOnVisor",1,"FireRed")
		SAWG A 0 A_JumpIfInventory("PowerGreenBloodOnVisor",1,"FireGreen")
		SAWG A 0 A_JumpIfInventory("PowerBlueBloodOnVisor",1,"FireBlue")
		SAWG A 0 A_PlaySoundEx("weapons/chainsaw/loop","Weapon",0)

		CSA1 ABCD 1
		//TNT1 A 3
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSA1 EFG 1
		TNT1 AAA 0 A_Saw("", "", 1, "SSawPuff2", 0, 120, 32,0)
		CSA1 H 1 A_FireCustomMissile("SawDamageHorizontal2", 0, 0, 0, 0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "FireContinueGreen")
		CSA1 J 1 A_FireCustomMissile("SawDamageHorizontal2", 0, 0, 0, 0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "FireContinueGreen")
		CSA1 K 1 A_FireCustomMissile("SawDamageHorizontal", 0, 0, 0, 0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "FireContinueGreen")
		CSA1 L 1 A_FireCustomMissile("SawDamageHorizontal2", 0, 0, 0, 0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "FireContinueGreen")
		TNT1 A 5
		
		CSA1 MNO 1
		SAWG A 0 A_ReFire
		goto readytofire
		
	AltFire:
		SAWG A 0
		SAWG A 0 A_PlaySoundEx("weapons/chainsaw/loop","Weapon",0)
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		SAWG A 0 A_JumpIfInventory("PowerBloodOnVisor",1,"AltFire2Red")
		SAWG A 0 A_JumpIfInventory("PowerGreenBloodOnVisor",1,"AltFire2Green")
		SAWG A 0 A_JumpIfInventory("PowerBlueBloodOnVisor",1,"AltFire2Blue")
		CSA2 ABCDDEEEF 1
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSA2 GHI 1 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		TNT1 AAA 0 A_Saw("", "", 1, "SSawPuff2", 0, 120, 0,16)
		TNT1 AAAA 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, random(-10,10))
		CSA2 J 1
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		CSA2 M 1 
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		CSA2 N 1 
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		CSA2 O 1 
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		TNT1 A 5
		CSA2 PQ 1
		goto readytofire
		
	AltContinue2:
		CSA2 JKL 1 A_FireCustomMissile("SawDamageHorizontal", 0, 0, 0, 0)
		SAWG A 0 A_PlaySound("weapons/chainsaw/loop", 4)
		SAWG A 0 A_JumpIfCloser(119, "AltContinue2")
		CSA2 MNO 1
		TNT1 A 5
		CSA2 PQ 1
		goto readytofire	
		
		
	FireRed:
		SAWG A 0
		SAWG A 0 A_PlaySoundEx("weapons/chainsaw/loop","Weapon",0)
		CSR1 ABCD 1
		TNT1 A 3
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSR1 EFG 1
		
		TNT1 AAAA 0 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		CSR1 H 1 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		
		SAWG A 0 A_PlaySound("weapons/chainsaw/loop", 4)	
		CSR1 I 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		CSR1 J 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 1,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "FireContinueGreen")
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		CSR1 K 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		
		
		
		CSR1 L 1
		TNT1 A 5
		CSR1 MNO 1
		SAWG A 0 A_ReFire
		SAWG A 0 A_StopSound(1)
		goto readytofire
		
	FireContinueRed:
		SAWG A 0
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		NULL A 0 ACS_Execute(580, 0, 0, 0, 0)
		
		SAWG A 0 A_PlaySound("weapons/chainsaw/loop", 4)	
		CSR1 RSTU 1 A_Saw("", "", 1, "SSawPuff2", 0, 120, 1,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		
		CSR1 IJ 1
		CSR1 KLM 2
		TNT1 A 5
		CSR1 MNO 2
		SAWG A 0 A_ReFire
		SAWG A 0 A_StopSound(4)
		goto Ready.Blood	
		
	
	
	
	
	
	
	AltFire2Red:
		SAWG A 0
		CSR2 ABCDDEEEF 1
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSR2 GHI 1 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		TNT1 AAA 0 A_Saw("", "", 0, "SSawPuff", 0, 90, 0,16)
		CSR2 J 1
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		CSR2 MNO 1 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		TNT1 A 5
		CSR2 PQ 1
		goto readytofire
	
	AltContinue2Red:
		SAWG A 0
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		CSR2 JK 1 A_Saw("", "", 1, "SSawPuff", 0, 120, 0,16)
		CSR2 L 1 A_Saw("", "", 2, "SSawPuff", 0, 120, 0,16)
		NULL A 0 ACS_Execute(580, 0, 0, 0, 0)
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		CSR2 MNO 1 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		TNT1 A 5 
		CSR2 PQ 1
		goto Ready.Blood
		
		
	FireBlue:
		SAWG A 0
		SAWG A 0 A_PlaySoundEx("weapons/chainsaw/loop","Weapon",0)
		CSB1 ABCD 1
		TNT1 A 3
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSB1 EFG 1
		
		TNT1 AAAA 0 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		CSB1 H 1 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		
		SAWG A 0 A_PlaySound("weapons/chainsaw/loop", 4)	
		CSB1 I 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		CSB1 J 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 1,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "FireContinueGreen")
		CSB1 K 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		
		CSB1 L 1
		TNT1 A 5
		CSB1 MNO 1
		SAWG A 0 A_ReFire
		SAWG A 0 A_StopSound(1)
		goto readytofire
		
	FireContinueBlue:
		SAWG A 0
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		NULL A 0 ACS_Execute(583, 0, 0, 0, 0)
		
		SAWG A 0 A_PlaySound("weapons/chainsaw/loop", 4)	
		CSB1 RSTU 1 A_Saw("", "", 1, "SSawPuff2", 0, 120, 1,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		
		
		CSB1 IJKLM 2
		TNT1 A 5
		CSB2 MNO 1
		SAWG A 0 A_ReFire
		SAWG A 0 A_StopSound(4)
		goto Ready.BlueBlood
	
	
	
	
	
	
	AltFire2Blue:
		SAWG A 0
		CSB2 ABCDDEEEF 1
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSB2 GHI 1 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		TNT1 AAA 0 A_Saw("", "", 1, "SSawPuff2", 0, 120, 0,16)
		TNT1 AAAA 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, random(-10,10))
		CSB2 J 1
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		CSB2 MNO 1 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "AltContinue2Red")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		TNT1 A 5
		CSB2 PQ 1
		goto readytofire
	
	AltContinue2Blue:
		SAWG A 0
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		CSB2 J 1 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSB2 K 1
		CSB2 J 1 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSB2 K 1
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		CSB2 M 1 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSB2 N 1 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSB2 O 1 A_JumpIfInventory("ChainsawHitBlue", 1, "AltContinue2Blue")
		SAWG A 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		TNT1 A 5 
		CSB2 PQ 1
		goto Ready.BlueBlood
		
		
		
		
			
		
		
		
		
   Firegreen:
		SAWG A 0
		SAWG A 0 A_PlaySoundEx("weapons/chainsaw/loop","Weapon",0)
		CSG1 ABCD 1
		TNT1 A 3
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSG1 EFG 1
		
		TNT1 AAAA 0 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		CSG1 H 1 A_JumpIfInventory("ChainsawHitgreen", 1, "FireContinuegreen")
		
		SAWG A 0 A_PlaySound("weapons/chainsaw/loop", 4)	
		CSG1 I 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		CSG1 J 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 1,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitRed", 1, "FireContinueRed")
		SAWG A 0 A_JumpIfInventory("ChainsawHitBlue", 1, "FireContinueBlue")
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "FireContinueGreen")
		CSG1 K 1 A_Saw("", "", 1, "SSawPuff2", 0, 90, 32,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitgreen", 1, "FireContinuegreen")
		
		CSG1 L 1
		TNT1 A 5
		CSG1 MNO 1
		SAWG A 0 A_ReFire
		SAWG A 0 A_StopSound(1)
		goto readytofire
		
	FireContinuegreen:
		SAWG A 0
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		NULL A 0 ACS_Execute(582, 0, 0, 0, 0)
		
		SAWG A 0 A_PlaySound("weapons/chainsaw/loop", 4)	
		CSG1 RSTU 1 A_Saw("", "", 1, "SSawPuff2", 0, 120, 1,0)
		SAWG A 0 A_JumpIfInventory("ChainsawHitgreen", 1, "FireContinuegreen")
		
		
		CSG1 IJKLM 2
		TNT1 A 5
		CSG2 MNO 1
		SAWG A 0 A_ReFire
		SAWG A 0 A_StopSound(4)
		goto Ready.GreenBlood
		
	
	
	
	
	
	
	AltFire2Green:
		SAWG A 0
		CSG2 ABCDDEEEF 1
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		CSG2 GHI 1 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		TNT1 AAA 0 A_Saw("", "", 1, "SSawPuff2", 0, 120, 0,16)
		TNT1 AAAA 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, random(-10,10))
		CSG2 J 1
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		CSG2 MNO 1 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		TNT1 A 5
		CSG2 PQ 1
		goto readytofire
	
	AltContinue2Green:
		SAWG A 0
		SAWG A 0 A_TakeInventory("ChainsawHitRed", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitBlue", 1)
		SAWG A 0 A_TakeInventory("ChainsawHitGreen", 1)
		CSG2 J 1 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSG2 K 1
		CSG2 J 1 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSG2 K 1
		SAWG A 0 A_PlaySound("weapons/chainsaw/draw", 4)
		SAWG A 0 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		SAWG A 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSG2 M 1 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		SAWG A 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSG2 N 1 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		SAWG A 0 A_FireCustomMissile("SawDamageVertical", 0, 0, 0, 0)
		CSG2 O 1 A_JumpIfInventory("ChainsawHitGreen", 1, "AltContinue2Green")
		TNT1 A 5 
		CSG2 PQ 1
		goto Ready.GreenBlood		
		
		
	CheckSprint:
		SAWG A 1 A_WeaponReady(WRF_NOFIRE)
		SAWG A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		SAWG A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready3
		
	CheckSprint2:
		RI2G A 1 A_WeaponReady(WRF_NOFIRE)
		SAWG A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		SAWG A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready3	
		
	StartSprint:
		SAWG A 1 A_WeaponReady(WRF_NOFIRE)
		SAWG A 0 A_TakeInventory("PowerBloodOnVisor", 1)
		SAWG A 0 A_TakeInventory("PowerBlueBloodOnVisor", 1)
		SAWG A 0 A_TakeInventory("PowerGreenBloodOnVisor", 1)
		SAWG A 0 A_Takeinventory("Zoomed",1)
		SAWG A 0 A_Takeinventory("ADSmode",1)
		SAWG A 0 A_ZoomFactor(1.0)
		SAWG A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		SAWG A 0 offset(-9,32) 
		SAWG A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		SAWG A 0 offset(-9,32) A_JumpIfInventory("UsedStamina", 100, "StopSprintTired")
		PLAY A 0 offset(-9,32) ACS_ExecuteAlways(852, 0, 0, 0, 0)//Makes player faster.
		SAWG A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		SAWG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		SAWG A 0 offset(-9,32)
		SAWG A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		SAWG A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		SAWG A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		SAWG A 1 offset(0,38) A_SetPitch(pitch -0.5)
		SAWG A 1 offset(3,36) A_SetPitch(pitch -0.5)
		SAWG A 1 offset(6,34) A_SetPitch(pitch -0.5)
		SAWG A 1 offset(9,32) A_SetPitch(pitch -0.5)
		SAWG A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		SAWG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        SAWG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        SAWG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		SAWG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 6)
		SAWG A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		SAWG A 1 offset(9,34) A_SetPitch(pitch +0.5)
		SAWG A 1 offset(6,36) A_SetPitch(pitch +0.5)
		SAWG A 1 offset(3,38) A_SetPitch(pitch +0.5)
		SAWG A 1 offset(0,38) A_SetPitch(pitch +0.5)
		SAWG A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		SAWG A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		SAWG A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		SAWG A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		SAWG A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		
		Goto StopSprint
	StopSprintTired:
		SAWG A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		SAWG A 0 A_PlaySound("Tired", 2)
		SAWG A 0 A_TakeInventory("UsedStamina", 2)
		SAWG A 5 A_WeaponReady
		SAWG A 0 A_TakeInventory("UsedStamina", 2)
		SAWG A 5 A_WeaponReady
		SAWG A 0 A_TakeInventory("UsedStamina", 2)
		SAWG A 5 A_WeaponReady
		SAWG A 0 A_TakeInventory("UsedStamina", 2)
		SAWG A 5 A_WeaponReady
		SAWG A 0 A_TakeInventory("UsedStamina", 2)
		SAWG A 5 A_WeaponReady
		Goto Ready3
	StopSprint:
		SAWG A 1
		SAWG A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready3
	}
}




ACTOR SawDamageHorizontal: FastProjectile
{
	Radius 22
	Height 2
	DamageType Cut
	Projectile 
	+FORCEXYBILLBOARD
	+EXTREMEDEATH
	+BLOODSPLATTER
	RenderStyle Add
	Decal "BulletDecalNew1"
	Alpha 0.6
    Damage (random(5,6))
    Speed 50
	//HitObituary "$OB_IMPHIT"
	SeeSound "none"
	DeathSound "none"
	Decal "none"
	decal "SawHorizontal"
	States
	{
	Spawn:
		SAWG A 0 BRIGHT
        TNT1 A 1 //A_PlaySound("weapons/gswing")
		Stop
	Death:
			SAWG A 0
			//SAWG A 0 A_SpawnItem("SSAwPuff")
			//SAWG A 0 A_PlaySound("DSSAWAL", 1)
			TNT1 A 1 Radius_Quake(2, 3, 0, 4, 0)
			TNT1 A 10
			Stop
	XDeath:
		SAWG A 0
		TNT1 A 1 Radius_Quake(2, 3, 0, 4, 0)
		SAWG A 0 A_PlaySound("CSAWFLESH", 1)
		TNT1 A 10
		Stop
	}
}

ACTOR SawDamageHorizontal2: SawDamageHorizontal
{
	-BLOODSPLATTER
	+BLOODLESSIMPACT
}

ACTOR SawDamageVertical: SawDamageHorizontal
{
	DamageType Saw
    Damage (random(7,8))
	decal "SawVertical"
}


ACTOR SawDamageVertical2: SawDamageVertical
{
	-BLOODSPLATTER
	+BLOODLESSIMPACT
}

