



ACTOR Unmaker : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 1800
	Weapon.AmmoUse1 2
	Weapon.AmmoGive 100
	Weapon.AmmoType1 "SoulAmmo"
    Inventory.PickupSound "BFGREADY"
    +WEAPON.NOAUTOAIM
	Inventory.PickupMessage "You got the sinister Unmaker, the power of hell itself. (Slot 8)"
	States
	{
	Steady:
	TNT1 A 1
	Goto Ready
	Ready:
	Ready3:
	Reload:
		UNHG ABCDD 2 A_WeaponReady
		UNHG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        UNHG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		UNHG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		UNHG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		
		UNHG DCBA 2 A_WeaponReady
		UNHG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        UNHG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		UNHG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		UNHG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		
		
		UNHG AAAA 2 A_WeaponReady
		UNHG A 0 A_JumpIfInventory("GoFatality", 1, "Steady")
        UNHG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
		UNHG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
		UNHG A 0 A_JumpIfInventory("TossGrenade",1,"TossGrenade")
		UNHG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
		Goto Ready3
		
	CheckSprint:
		UNHG A 1 A_WeaponReady(WRF_NOFIRE)
		UNHG A 0 A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		UNHG A 0 A_JumpIfInventory("IsTacticalClass", 1, "StartSprint")
		Goto Ready
		
	StartSprint:
		UNHG A 1 A_WeaponReady(WRF_NOFIRE)
		UNHG A 0 A_Takeinventory("Zoomed",1)
		UNHG A 0 A_Takeinventory("ADSmode",1)
		UNHG A 0 A_ZoomFactor(1.0)
		UNHG A 0 A_JumpIfInventory("UsedStamina", 40, "StopSprintTired")
		
	Sprinting:	
		UNHG A 0 offset(-9,32) 
		UNHG A 0 offset(-9,32) A_JumpIfInventory("IsStandingStill", 1, "Ready3")
		UNHG 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.
		UNHG A 0 offset(-9,32) A_JumpIfInventory("PowerStrength", 1, 2)
		UNHG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 12)
		UNHG A 0 offset(-9,32)
		UNHG A 1 offset(-9,34) A_SetPitch(pitch -0.5)
		UNHG A 1 offset(-6,36) A_SetPitch(pitch -0.5)
		UNHG A 1 offset(-3,38) A_SetPitch(pitch -0.5)
		UNHG A 1 offset(0,38) A_SetPitch(pitch -0.5)
		UNHG A 1 offset(3,36) A_SetPitch(pitch -0.5)
		UNHG A 1 offset(6,34) A_SetPitch(pitch -0.5)
		UNHG A 1 offset(9,32) A_SetPitch(pitch -0.5)
		UNHG A 0 offset(9,32) A_WeaponReady(WRF_NOBOB)
		UNHG A 0 A_JumpIfInventory("Kicking",1,"DoKick")
        UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
        UNHG A 0 A_JumpIfInventory("Reloading",1,"Reload")
		UNHG A 0 offset(-9,32) A_GiveInventory("UsedStamina", 12)
		UNHG A 0 offset(9,33) A_SpawnItemEx("FootStep", 0, 0, 2, 0, 0, -4)
		UNHG A 1 offset(9,34) A_SetPitch(pitch +0.5)
		UNHG A 1 offset(6,36) A_SetPitch(pitch +0.5)
		UNHG A 1 offset(3,38) A_SetPitch(pitch +0.5)
		UNHG A 1 offset(0,38) A_SetPitch(pitch +0.5)
		UNHG A 1 offset(-3,36) A_SetPitch(pitch +0.5)
		UNHG A 1 offset(-6,34) A_SetPitch(pitch +0.5)
		UNHG A 1 offset(-9,32) A_SetPitch(pitch +0.5)
		UNHG A 0 offset(-9,32) A_WeaponReady(WRF_NOBOB)
		UNHG A 0 offset(-9,32) A_JumpIfInventory("IsRunning", 1, "Sprinting")
		Goto StopSprint
		
	StopSprintTired:
		UNHG A 1
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		UNHG A 0 A_PlaySound("Tired", 2)
		UNHG A 0 A_TakeInventory("UsedStamina", 2)
		UNHG A 5 A_WeaponReady
		UNHG A 0 A_TakeInventory("UsedStamina", 2)
		UNHG A 5 A_WeaponReady
		UNHG A 0 A_TakeInventory("UsedStamina", 2)
		UNHG A 5 A_WeaponReady
		UNHG A 0 A_TakeInventory("UsedStamina", 2)
		UNHG A 5 A_WeaponReady
		UNHG A 0 A_TakeInventory("UsedStamina", 2)
		UNHG A 5 A_WeaponReady
		Goto Ready
	StopSprint:
		UNHG A 1
		UNHG A 0 A_JumpIfInventory("UsedStamina", 60, "StopSprintTired")
		PLAY A 0 ACS_ExecuteAlways(853, 0, 0, 0, 0)//Makes player slower.
		Goto Ready
		
	Deselect:
		UNHG A   1 A_Lower
		UNHG A 0 A_StopSOund(1)
		UNHG A 0 A_StopSOund(6)
		UNHG A 0 A_TakeInventory("TossGrenade", 1)
		Loop
	Select:
		UNHG A 0 A_Giveinventory("GoSpecial",1)
		UNHG A 0 A_Takeinventory("FistsSelected",1)
		UNHG A 0 A_Takeinventory("SawSelected",1)
		UNHG A 0 A_Takeinventory("ShotgunSelected",1)
		UNHG A 0 A_Takeinventory("SSGSelected",1)
		UNHG A 0 A_Takeinventory("MinigunSelected",1)
		UNHG A 0 A_Takeinventory("PlasmaGunSelected",1)
		UNHG A 0 A_Takeinventory("RocketLauncherSelected",1)
		UNHG A 0 A_Takeinventory("GrenadeLauncherSelected",1)
		UNHG A 0 A_Takeinventory("BFGSelected",1)
		UNHG A 0 A_Takeinventory("BFG10kSelected",1)
		UNHG A 0 A_Takeinventory("RailGunSelected",1)
		UNHG A 0 A_Takeinventory("SubMachineGunSelected",1)
		UNHG A 0 A_Giveinventory("RevenantLauncherSelected",1)
		UNHG A 0 A_Takeinventory("LostSoulSelected",1)
		UNHG A 0 A_Takeinventory("FlameCannonSelected",1)
		UNHG A 0 A_Takeinventory("HasBarrel",1)
		UNHG A 0 A_TakeInventory("TossGrenade", 1)
		TNT1 AAAAAAAAAA 0 A_RAise
		TNT1 A 1 A_Raise
		UNHG A 0 A_PlaySound("BFGREADY")
        TNT1 AAA 0
		
		Goto SelectAnimation
		
	SelectAnimation:
		UNHS ABCD 1
		UNHG A 0 A_GunFlash
		GOto Ready
		
    Spawn:
        UNHW A 1
        Loop
		
	Fire:
		UNHG A 0
		UNHG A 0 A_PlaySOund("UNMSTA", 1)
		UNHF ABCD 1
		UNHG A 0 A_ZoomFactor(0.95)
	Hold:	
	    UNHF E 1 BRIGHT
		UNHG A 0 A_PlaySOund("UNMLOP", 6, 1, 1)
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHF F 1 BRIGHT
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser2", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHF G 1 BRIGHT
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHF H 1 BRIGHT
		CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser2", 0, 1, 0, 0, 0, 0)
		UNHG A 0 A_RailAttack(1, 0, 0, "none", "red", RGF_NOPIERCING | RGF_SILENT | RGF_CENTERZ | RGF_FULLBRIGHT, 0, "hitpuff", 0, 0, 9999, 1)
		UNHG A 0 A_SetAngle(random(1, -1) + angle)
		UNHG A 0 A_SetPitch(-0.5 + pitch)
		
		UNHG A 0 A_Refire
		
		UNHG A 0 A_ZoomFactor(1.0)
		UNHG A 0 A_StopSOund(1)
		UNHG A 0 A_StopSOund(6)
		UNHG A 0 A_PlaySOund("UNMSTO", 1)
		UNHF DCBA 1
		Goto Ready3
		
	}
}


Actor UnmakerLaser: FastProjectile
{
	+RANDOMIZE
	+FORCEXYBILLBOARD
	+DONTSPLASH
	-BLOODSPLATTER
	damage (random(50, 50))
	radius 1
	height 1
	speed 500
	renderstyle ADD
	alpha 0.9
	scale .15
	decal "scorch"
	damagetype "desintegrate"
	missiletype "UnmakerLaserTrail"
	states
		{
		Spawn:
			LEYS R 1 BRIGHT
			Loop
	Death:
	XDeath:
	UNHG A 0
	UNHG A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	EXPL A 0 A_CustomMissile ("FlamethrowerFireParticles", 6, 0, random (0, 360), 2, random (0, 90))
	//FRFX ZZZ 0 BRIGHT A_CustomMissile ("BigBlackSmoke", 2, 0, random (0, 360), 2, random (0, 30))
	//TNT1 A 2 A_SpawnItem("BurningGroundLowDamage")
	UNHG A 0 A_CustomMissile("FlamethrowerBurningStuff", random (-32, 0), random (-32, 32), random (-32, 32), 2, random (-32, 32))
	UNHG A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	UNHG A 0 A_SpawnItemEx ("DetectCeilCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	UNHG A 0 A_explode(20, 100)
	TNT1 A 20 A_CustomMissile ("BigBlackSmoke", 0, 0, random (0, 360), 2, random (40, 160))
	Stop
		}
	}
	
	
Actor UnmakerLaser2: UnmakerLaser
{
	
	decal "none"
	states
		{
		Spawn:
			LEYS R 1 BRIGHT
			Loop
	Death:
	XDeath:
	UNHG A 0
	UNHG A 0 A_SpawnItemEx ("ExplosionFlareSpawner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	EXPL A 0 A_SpawnItem("ExplosionParticleSpawner")
	EXPL A 0 A_CustomMissile ("FlamethrowerFireParticles", 6, 0, random (0, 360), 2, random (0, 90))
	//UNHG A 0 A_CustomMissile("FlamethrowerBurningStuff", random (-32, 0), random (-32, 32), random (-32, 32), 2, random (-32, 32))
	//UNHG A 0 A_SpawnItemEx ("DetectFloorCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	//UNHG A 0 A_SpawnItemEx ("DetectCeilCraterSmall",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	UNHG A 0 A_explode(20, 100)
	//TNT1 A 20 A_CustomMissile ("BigBlackSmoke", 0, 0, random (0, 360), 2, random (40, 160))
	Stop
		}
	}	
	
	
Actor UnmakerLaserTrail
{
	+FORCEXYBILLBOARD
	+CLIENTSIDEONLY
	+NOBLOCKMAP
	+NOGRAVITY
	+SHADOW
	+NOTELEPORT
	+CANNOTPUSH
	+NODAMAGETHRUST
	renderstyle ADD
	alpha 0.9
	scale .15
	states
		{
		Spawn:
			LEYS R 0
			LEYS R 1 BRIGHT
			Stop
		}
	}	
