

// *** MODIFIED BY CHEBMASTER
// I mark most important places modified by me with //***Che -- unless I forget to.

// reason: splitting laser into a separate file for monsters only -- my supermasterminds need it


ACTOR Unmaker : BrutalWeapon
{
	Height 20
	Weapon.SelectionOrder 1800
	Weapon.AmmoUse1 0 //2
	Weapon.AmmoGive 10 //100
	Weapon.AmmoType1 "SoulAmmo"
    Inventory.PickupSound "UNMREADY"
    +WEAPON.NOAUTOAIM
	+WEAPON.CHEATNOTWEAPON
	Inventory.PickupMessage "$GOTUNMAKER" // "You got the sinister Unmaker, the power of hell itself. (Slot 7)"
	States
	{
	
	
		HoldFire:
			UNHG A 0 A_StopSound(6)
			UNHG A 0 A_JumpIfInventory("Salute1", 1, "Salute")
			UNHG A 0 A_JumpIfInventory("Salute2", 1, "Salute")
			UNHG A 0 A_JumpIfInventory("Taunting",1,"Taunt")
			UNHG A 0 A_JumpIfInventory("IsRunning",1,"CheckSprint")
			UNHG ABCDD 2 offset(-100,18) A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			TNT1 A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire")
			Goto Ready			
	
		NoAmmo:
			UNHG A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
			UNHG A 0 A_PlaySOund("UNMSTO", 1)
			UNHG ABCDD 2 offset(-18,18) A_WeaponReady(WRF_NOBOB | WRF_NOFIRE)
			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 Ready
	
		Steady:
			TNT1 A 1
			Goto Ready
		Ready:
		Ready3:
		Reload:
			UNHG A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
			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)
			
			//***Che
			//UNHG A 0 A_Giveinventory("RevenantLauncherSelected",1)
			UNHG A 0 A_Giveinventory("UnmakerSelected",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
		
		InterruptAndHoldFire: //***Che
			UNHG A 0 A_PlaySOund("UNMSTO", 1)
			UNHF DCBA 1
			Goto HoldFire
		
		Fire:
			UNHG A 0
			UNHG A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "HoldFire") //***Che
			
			
			"----" A 0 A_JumpIfInventory("SoulAmmo",1,1)
			Goto NoAmmo
			
			UNHG A 0 A_PlaySOund("UNMSTA", 1)
			
			UNHF ABCD 1
			UNHG A 0 A_ZoomFactor(0.95)
		Hold:	
			"----" A 0 A_JumpIfInventory("SoulAmmo",1,1)
			Goto NoAmmo
			
			"----" A 0 A_TakeInventory("SoulAmmo",1)
			UNHF E 1 BRIGHT
			UNHG A 0 A_JumpIfInventory("DisablePlayerWeapons", 1, "InterruptAndHoldFire") //***Che
			
				//***Che you sneeze and everything unravels
				"----" A 0 A_JumpIfInventory("QPowerQuadDamage", 1, 2)
				"----" A 0 A_JumpIf(true, 2)
				"----" A 0 A_PlaySound("quaddamage/echo", CHAN_7)
				"----" A 0 A_GiveInventory ("PlayerIsFighting", 150) //***Che encourages the follower NPCs to get da fug out of your line of fire
			
			
			UNHG A 0 A_PlaySOund("UNMLOP", 6, 1, 1)
			CHAF A 0 BRIGHT A_FireCustomMissile("UnmakerLaser", 0, 0, 0, 0, 0, 0) //***Che: do *not* use ammo, managed manually!
			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, 0, 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, 0, 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, 0, 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)
			
			"----" A 0 A_JumpIfInventory("SoulAmmo",1,1)
			Goto StopFiring
			
			UNHG A 0 A_Refire
		
		StopFiring:	
			
			
			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
		
	}
}

#include DemonEleTech.txt
