ACTOR ZamasuNightmare : LegendaryNightmare
{
//Creator: Nemesiscaptain(uwu)and Makarov
//$Category Monsters/HEM
//$Sprite ZNIT
//$Title "ZamasuNightmare"
Monster
Health 7500 //27000
Speed 30
PainChance 20
BloodColor "Black"
DamageFactor 0.4
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "Explosion", 0.2
DamageFactor "PlayerDTRG", 0.4
DamageFactor "DTRailgun", 0.4
DamageFactor "PDTPuff", 0.4
DamageFactor "RailG", 0.3
DamageFactor "Cyber10K", 0.0
DamageFactor "CDTBFG", 0.0
DropItem "Zamasu Plasmatic Cannon", 256, 33
 DropItem "LegAmmoSphere", 256, 1
  DropItem "ZamasuStrongSphere", 256, 1
  DropItem "LegendaryPowerShard", 135, 1
  DropItem "TrueLegendaryRune", 200, 1
  DropItem "TrueLegendaryPowerSphere", 200, 1
  DropItem "TarmidhesRune", 200, 1
  DropItem "LegendaryArmor", 100, 1
  DropItem "ModdedBackPack", 256, 1
  DropItem "ZamasuDemonAmmoBox", 200 
  DropItem "ZamasuDemonAmmo", 250  
SeeSound "LNightmare/sight"
PainSound "LNightmare/pain"
DeathSound "LNightmare/death"
ActiveSound "LNightmare/active"
Bloodcolor "Black"
Obituary "%o was consumed in a storm of shadows by ZamasuNightmare."
Tag "\c[s5]Zamasu Nightmare\c-"
var int user_missile;
var int user_music;  
States
{
  Spawn:
  	TNT1 A 0
	TNT1 A 0 A_PlaySoundEx("NDemonHeart/Pickup","Voice",0,2)
	ZNIT B 8 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZNIT AAAAA 2 Bright A_SetTranslucent(alpha-0.2,1)
	Stop
  StealthSpawnLoop:
	TNT1 A 10 A_LookEx(0,0,0,0,180,"StealthAttack")
	Loop
  StealthAttack:
	TNT1 A 1 Bright A_UnSetShootable
	TNT1 A 2 A_PlaySound("LNightmare/sight",CHAN_AUTO,1.0,0,ATTN_NONE)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	TNT1 A 2 A_PlaySound("boss/teleport",CHAN_AUTO,1.0,0)
	TNT1 A 0 A_FaceTarget
	ZNIT AAAAA 2 A_SetTranslucent(alpha+0.2,1)
	ZNIT A 1 Bright A_SetShootable
	Goto Missile
  See:
	TNT1 A 0 A_SetTranslucent(1.0,1)
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6749,910)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_Chase
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZNIT A 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_Chase
	ZNIT A 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_Chase
	ZNIT B 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_Chase
	ZNIT B 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_Chase
	ZNIT C 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_Chase
	ZNIT C 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_Chase
	ZNIT D 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_Chase
	ZNIT D 1 Bright A_SpawnItemEx("ZNightmareGhost")
	TNT1 A 0 A_Jump(15,"Teleport")
	Loop
  Missile:
	TNT1 A 0
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_SetTranslucent(0.2)
	TNT1 A 0 A_Jump(256,"ZamasuDevastator","ZamasuDarkMatter")
	Goto Teleport
  Teleport:
	ZNIT A 1 Bright A_UnSetShootable
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZNIT AAAAA 2 A_SetTranslucent(alpha-0.2,1)
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 Bright A_Wander
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 Bright A_Wander
	ZNIT A 2 A_PlayWeaponSound("boss/teleport")
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZNIT AAAAA 2 A_SetTranslucent(alpha+0.2,1)
	ZNIT A 1 Bright A_SetShootable
	Goto See
  ZamasuDevastator:
	TNT1 A 0 A_PlaySound("LNightmare/sight",CHAN_AUTO,1.0,0,0.5)
	ZNIT E 1 Bright A_FaceTarget
	TNT1 A 0 A_SetInvulnerable
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZNIT E 2 Bright A_FaceTarget
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZNIT F 2 Bright A_FaceTarget
	TNT1 A 0 A_UnSetInvulnerable
	TNT1 A 0 A_playSound("legimp/fiyabetch")
	ZNIT GG 7 A_CustomMissile("NemImpDevastatorBall", 32, 0, 0)
	Goto See
  ZamasuDarkMatter:
    ZNIT E 0 A_SetInvulnerable
	ZNIT E 0 A_PlaySound("zamasuimp/sight",7,1,0,0.5)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 0 A_UnSetInvulnerable
	ZNIT F 7 Bright A_CustomMissile("ActualDarkMatter",32,0,0)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT F 7 Bright A_CustomMissile("ActualDarkMatter",32,0,0)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 3 Bright A_FaceTarget
	ZNIT E 0 Bright A_GiveInventory("NLegZombieStrafing3",1)
	ZNIT E 8 Bright A_FaceTarget
	Goto See
  Melee:
	ZNIT EEFF 1 Bright A_FaceTarget
	ZNIT G 2 Bright A_MeleeAttack
	ZNIT E 2 Bright A_FaceTarget
	Goto See
  Pain:
	TNT1 A 0
	TNT1 A 0 A_ChangeFlag("SLIDESONWALLS",0)
	TNT1 A 0 A_Jump(35,"Teleport")
	TNT1 A 0 A_Jump(88,"PainMissile")
	ZNIT H 2 Bright
	ZNIT H 2 Bright A_Pain
	Goto See
  PainMissile:
	ZNIT H 2 Bright
	ZNIT H 2 Bright A_Pain
	Goto Missile
  Death:
	TNT1 A 0 
	TNT1 A 0 A_ChangeFlag("SLIDESONWALLS",0)
	TNT1 A 0 A_SetTranslucent(0.2)
	ZNIT IIIIIIII 1 A_SetScale(ScaleX+0.01)
	TNT1 A 0 A_SpawnItemEx("ZamasuimpDeathEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Scream
	TNT1 A 0 A_SpawnItem("NemesisDeathBall")
	ZNIT JJJJJJJJKKKKKKKKLLLLLLLLMMMMMMMMNNNNNNNNOOOOOOOO 1 A_SetScale(ScaleX+0.01)
	TNT1 A 0 A_SpawnItem("ZamasuNuke",0,0,0,0)
	TNT1 A 1 A_NoBlocking
	Stop
	}
}

Actor INFZamasuNightmare : ZamasuNightmare
{
Tag "\c[s5]Zamasu Nightmare\c-"
States
{
  Spawn:
    TNT1 A 0 A_Jump(175,"Remove")
    TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RuneTier3SpawnCheck") == 2,1)
	Goto Remove
  Idle:
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZPHI A 10 A_Look
	Loop
  Remove:
	TNT1 A 1
	TNT1 A 0 A_SpawnItemEx("LegendaryImp",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 0 A_ChangeFlag("COUNTKILL", FALSE)
	TNT1 A 0
	Stop
	}
}

ACTOR ZamasuNightmareGhostA
{
PROJECTILE
Height 56
Radius 20
Speed 0
Scale 1.1
RENDERSTYLE Translucent
Alpha 0.7
+NOTIMEFREEZE
+NOINTERACTION
+CLIENTSIDEONLY
States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	ZNIT A 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}

ACTOR ZamasuNightmareGhostB : ZamasuNightmareGhostA
{

States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	ZNIT B 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}

ACTOR ZamasuNightmareGhostC : ZamasuNightmareGhostA
{

States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	ZNIT C 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}

ACTOR ZamasuNightmareGhostD : ZamasuNightmareGhostA
{

States
  {
  Spawn:
	TNT1 A 0
	TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
	Goto Fade
  Fade:
	ZNIT D 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1
	Stop
  }
}

Actor ZNightmareGhost : LFGhost
{
Alpha 0.6
Renderstyle Add
+NOINTERACTION
+NONETID
States
{
  Spawn:
	TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
	TNT1 A 1 Bright
	Goto Fade
  Fade:
	ZANM A 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1 Bright
	Stop
	}
}