ACTOR NemesisNightmare
{
//Creator: Eshkere_Jason
//Origin: Divine Infinity
//Sprite: NTIG
//Title: "Nemesis Nightmare"
Monster
Health 1650
Radius 20
Height 56
Mass 250
Speed 22
Scale 1.25
RenderStyle Add
Alpha 1.0
BloodColor "Black"
PainChance 50
MeleeRange 84
MeleeDamage 60
Species "Imps"
DamageFactor "PlayerDTRG", 0.5
DamageFactor "PDTBFG", 0.15
DamageFactor "PDTBFGTracer", 0.15
DamageFactor "PlayerDevBall", 0.115
DamageFactor "PlayerDevBall2", 0.115
DamageFactor "PlayerDevTracer", 0.115
DamageFactor "DBFG2", 0.65
DamageFactor "DBFG10K2", 0.65
DamageFactor "DBFGSplash2", 0.65
DamageFactor "PlayerDBFG2", 0.65
DamageFactor "PlayerDBFG10K2", 0.65
DamageFactor "PlayerDBFGSplash2", 0.65
DamageFactor "LegendaryPlayer", 0.3
DamageFactor "LegendaryGuruPlayer", 0.3
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 "PlayerPyro", 0.2
DamageFactor "VileFires", 0.0
DamageFactor "DarkDemoEx", 0.0
DamageFactor 0.4
//No Infighting
DamageFactor "Legendary", 0.0
DamageFactor "Legendary1", 0.0
DamageFactor "LegendaryGuru", 0.0
DropItem "NemesisBossLifeEssence" 256
DropItem "NemesisBossArmorBonusMax" 256
DropItem "LegTimeFreezeSphere", 35
DropItem "LegendaryInvisibilitySphere", 65
DropItem "LegendaryRune", 55, 1
DropItem "NemesisArmor", 128, 1
DropItem "LegDemonicEnergy", 256
SeeSound "LNightmare/sight"
PainSound "LNightmare/pain"
DeathSound "LNightmare/death"
ActiveSound "LNightmare/active"
Obituary "%o was haunted by a Nemesis Nightmare."
Tag "\c[g3]Nemesis Nightmare\c-"
+NOBLOOD
+NOFEAR
+BOSS
+BOSSDEATH
+NOICEDEATH
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+DONTGIB
+NOTARGET
+NOTIMEFREEZE
+NORADIUSDMG
+BRIGHT
+SHADOW
+DontHurtSpecies
+DontHarmSpecies
var int user_music;
States
{
  Spawn:
	TNT1 A 0
	NTIG A 1 Bright A_PlaySound("boss/teleport",CHAN_AUTO,1.0,0)
	NTIG AAAAA 2 Bright A_SetTranslucent(alpha-0.2,1)
  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
	NTIG AAAAA 2 A_SetTranslucent(alpha+0.2,1)
	NTIG 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,6803,561)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_Chase
	NTIG A 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Chase
	NTIG A 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Chase
	NTIG B 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Chase
	NTIG B 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	TNT1 A 0 A_Chase
	NTIG C 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Chase
	NTIG C 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Chase
	NTIG D 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Chase
	NTIG D 1 Bright A_SpawnItemEx("NNightmareGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_Jump(15,"Teleport")
	Loop
  Teleport:
	NTIG A 1 Bright A_UnSetShootable
	TNT1 AAAA 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG AAAAA 2 A_SetTranslucent(alpha-0.2,1)
	NTIG A 2 
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 Bright A_Wander
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 Bright A_Wander
	TNT1 A 0 A_FaceTarget
	NTIG A 2 A_PlayWeaponSound("boss/teleport")
	TNT1 AAAA 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG AAAAA 2 A_SetTranslucent(alpha+0.2,1)
	NTIG A 1 Bright A_SetShootable
	Goto See
  Missile:
	TNT1 A 0
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_Jump(96,"StealthMissile","WarpToTarget")
	TNT1 A 0 A_SetTranslucent(0.2)
	TNT1 A 0 A_Jump(48,"Balls")
	TNT1 A 0 A_JumpIfCloser(250,"Lunge")
	GoTo Normal
  WarpToTarget:
	NTIG E 1 Bright A_UnSetShootable
	TNT1 A 0 A_ChangeFlag("THRUACTORS",1)
	TNT1 A 0 A_PlaySound("boss/teleport",CHAN_AUTO,1.0,0)
	TNT1 AAAA 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG EEEEE 2 A_SetTranslucent(alpha-0.2,1)
	NTIG E 2
	//TNT1 A 0 A_Warp(AAPTR_TARGET,0,0,0,0,WARPF_NOCHECKPOSITION)
	TNT1 A 0 A_FaceTarget
	NTIG E 2 A_PlaySound("boss/teleport",CHAN_AUTO,1.0,0)
	TNT1 AAAA 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG EEEEE 2 A_SetTranslucent(alpha+0.2,1)
	NTIG E 1 Bright A_SetShootable
	TNT1 A 0 A_ChangeFlag("THRUACTORS",0)
	TNT1 A 0 A_Jump(192,2)
	TNT1 A 0 A_Jump(48,"Balls")
	TNT1 A 0 A_JumpIfCloser(250,"Lunge")
	Goto Normal
  StealthMissile:
	NTIG E 1 Bright A_UnSetShootable
	TNT1 A 0 A_PlaySound("boss/teleport",CHAN_AUTO,1.0,0)
	TNT1 AAAA 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG EEEEE 2 A_SetTranslucent(alpha-0.2,1)
	NTIG E 2
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	TNT1 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	TNT1 A 0 A_FaceTarget
	NTIG E 2 A_PlaySound("boss/teleport",CHAN_AUTO,1.0,0)
	TNT1 AAAA 0 A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG EEEEE 2 A_SetTranslucent(alpha+0.2,1)
	NTIG E 1 Bright A_SetShootable
	TNT1 A 0 A_Jump(192,2)
	TNT1 A 0 A_Jump(48,"Balls")
	TNT1 A 0 A_JumpIfCloser(250,"Lunge")
  Normal:
	NTIG EF 6 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NTIG GGG 4 Bright A_CustomMissile("NemesisImpBallSeek",32,0,0)
	NTIG FE 2 Bright A_FaceTarget
	Goto See
  Balls:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("LNightmare/sight",CHAN_AUTO,1.0,0,0.5)
	NTIG E 2 Bright A_FaceTarget
	TNT1 A 0 A_SetInvulnerable
	NTIG EEEEEEEEE 2 Bright A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG E 2 Bright A_FaceTarget
	NTIG FFFFFFFFF 2 Bright A_SpawnItem("NemesisSoulFlameSpawner",0,0,0,0)
	NTIG F 2 Bright A_FaceTarget
	TNT1 A 0 A_UnSetInvulnerable
	TNT1 A 0 A_playSound("legimp/fiyabetch")
	NTIG G 8 Bright A_CustomMissile("NemesisImpLaserBall",32,0,0)
	GoTo See
  Lunge:
	TNT1 A 0
	TNT1 A 0 A_PlaySound("LNightmare/Attack")
	NTIG EEEEEEEFFFFFFF 1 Bright A_FaceTarget
	TNT1 A 0 A_ChangeFlag("SLIDESONWALLS",1)
	TNT1 A 0 ThrustThingZ(0,20,0,1)
	NTIG F 2 Bright A_Recoil(-26)
	NTIG F 3 Bright A_CustomMissile("BigLFLunge",18,0,0,CMF_AIMDIRECTION)
	NTIG G 6 Bright
	NTIG G 2 Bright A_ScaleVelocity(0.2)
	TNT1 A 0 A_ChangeFlag("SLIDESONWALLS",0)
	NTIG G 1 Bright A_ScaleVelocity(0)
	Goto See
  Melee:
	NTIG EEFF 1 Bright A_FaceTarget
	NTIG G 2 Bright A_MeleeAttack
	NTIG 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")
	NTIG H 2 Bright
	NTIG H 2 Bright A_Pain
	Goto See
  PainMissile:
	NTIG H 2 Bright
	NTIG 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)
	NTIG IIIIIIII 1 A_SetScale(ScaleX+0.01)
	TNT1 A 0 A_Scream
	NTIG JJJJJJJJKKKKKKKKLLLLLLLLMMMMMMMMNNNNNNNNOOOOOOOO 1 A_SetScale(ScaleX+0.01)
	TNT1 A 1 A_NoBlocking
	Stop
	}
}

Actor INFNemesisNightmare : NemesisNightmare
{
Tag "\c[g3]Nemesis Nightmare\c-"
States
{
  Spawn:
    TNT1 A 0 A_Jump(130,"Remove")
    TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RuneTier2SpawnCheck") == 2,1)
	Goto Remove
  Idle:
	TNT1 A 0
	NTIG A 1 Bright A_PlaySound("boss/teleport",CHAN_AUTO,1.0,0)
	NTIG AAAAA 2 Bright A_SetTranslucent(alpha-0.2,1)
  StealthSpawnLoop:
	TNT1 A 10 A_LookEx(0,0,0,0,180,"StealthAttack")
	Loop
  Remove:
	TNT1 A 1
	TNT1 A 0 A_SpawnItemEx("Imp",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 0 A_ChangeFlag("COUNTKILL", FALSE)
	TNT1 A 0
	Stop
	}
}

Actor NNightmareGhost : 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:
	NTIG A 2 A_FadeOut(0.1,1)
	Loop
  Toaster:
	TNT1 A 1 Bright
	Stop
	}
}