Actor NemesisPoltergeist
{
//Creator: Eshkere_Jason
//Origin: Divine Infinity
//Sprite: VNRZ
//Title: "Nemesis Railgun Zombie"
Health 1750
Radius 18
Height 56
Speed 18
Mass 10000
PainChance 2
BloodColor "Black"
DamageFactor "LegendaryZombie", 0.0
DamageFactor "PDTBFG", 0.25
DamageFactor "PDTBFGTracer", 0.25
DamageFactor "PlayerDevBall", 0.125
DamageFactor "PlayerDevBall2", 0.125
DamageFactor "PlayerDTBFGRailgunSlug", 0.125
DamageFactor "PlayerDevTracer", 0.125
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.1
DamageFactor "VileFires", 0.0
DamageFactor "DarkDemoEx", 0.0
DamageFactor 0.5
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.3
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryGuruPlayer", 0.3
DamageFactor "DBFG10K2", 0.35
DamageFactor "PlayerDBFG10K2", 0.35
DamageFactor "DBFG2", 0.35
DamageFactor "PlayerDBFG2", 0.35
DamageFactor "PlayerDTRG", 0.5
DamageFactor "Cyber10K", 0.0
DamageFactor "DemolisherEx", 0.0
DamageFactor "DarkDemoEx", 0.0
DamageFactor "CerChainguns", 0.0
DamageFactor "CerEnergyBall", 0.0
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisSphere", 40, 1
DropItem "NemesisRuneSpawnerTier2", 128, 1
DropItem "NemesisDemonicEnergy", 256
DropItem "NemesisGreaterDemonicEnergy", 256
DropItem "Nemesis Rifle", 128, 1
DropItem "Nemesis Plasmatic Cannon", 128, 1
DropItem "LegendarySalvationSphere", 128, 1
MONSTER 
+NOTIMEFREEZE
+BOSS
+BOSSDEATH
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+NOICEDEATH
+NODROPOFF
+DONTGIB
+NOTARGET
+NORADIUSDMG
+FORCERADIUSDMG
+NOFEAR
+LOOKALLAROUND
+DONTHARMSPECIES
+BRIGHT
SeeSound "LegendaryBulwark/Sight"
PainSound "LegendaryBulwark/Pain"
DeathSound "LegendaryBulwark/Death"
ActiveSound "LegendaryBulwark/Active"
Obituary "%o was denied %k was frozen from \c[g3]Nemesis Poltergeist\c-"
Tag "\c[g3]Nemesis Poltergeist\c-"
var int user_missile;
var int user_music;
States
{
Spawn:
  TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
  NMPO A 8 A_Look
  Loop
See:
  TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
  TNT1 A 0 A_JumpIf(user_music == 1,3)
  TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6809,563)
  TNT1 A 0 A_SetUserVar("user_music",1)
  NMPO AA 2 A_Chase
  TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
  NMPO BB 2 A_Chase
  TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
  NMPO CC 2 A_Chase
  TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
  NMPO DD 2 A_Chase
  Loop
Missile:
  TNT1 A 0 A_Jump(90,"Flamethrower","LegImpBalls","Barrier","Seeker","DeadHands")
  TNT1 A 0 A_JumpIfCloser(450,"Lunge")
  NMPO EF 8 A_FaceTarget
  NMPO G 8 A_CustomMissile("NemesisExileSkullShot")
  Goto See
Flamethrower:
  TNT1 A 0 A_PlaySound("agaures/swing")
  TNT1 A 0 A_PlaySound("agaures/swing")
  NMPO E 8 A_FaceTarget
  NMPO F 8 A_FaceTarget
  TNT1 A 0 A_PlaySound("devil/scream",1)
FlamethrowerLoop:
  TNT1 A 0 A_JumpIf(user_missile >= 35,"Detox")
  TNT1 A 0 A_CustomMissile("NemesisPoltFlamethrower",28)
  NMPO G 2 A_FaceTarget
  TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
  Loop
LegImpBalls:
  NMPO EF 8 A_FaceTarget
  TNT1 A 0 A_PlaySound("imp/attack")
  TNT1 A 0 A_CustomMissile("NemesisImpBall",28,0,-30)
  TNT1 A 0 A_CustomMissile("NemesisImpBall",28,0,-15)
  TNT1 A 0 A_CustomMissile("NemesisImpBall",28)
  TNT1 A 0 A_CustomMissile("NemesisImpBall",28,0,15)
  NMPO G 8 A_CustomMissile("NemesisImpBall",28,0,30)
  Goto See
Seeker:
	NSIN EF 10 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	NMPO F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	NMPO F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	NMPO F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	NMPO F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	NMPO F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	NMPO F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	NMPO F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	NMPO F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	TNT1 A 0 A_Jump(64,"Seeker")
	Goto See
Barrier:
  NMPO EF 4 A_FaceTarget
  TNT1 A 0 A_CustomMissile("NemesisLegNobleBall",28,0,-40)
  TNT1 A 0 A_CustomMissile("NemesisLegNobleBall",28,0,40)
  NMPO G 6 A_CustomMissile("NemesisLegNobleBall",28)
  NMPO EF 4 A_FaceTarget
  TNT1 A 0 A_CustomMissile("NemesisLegNobleBall",28,0,-20)
  TNT1 A 0 A_CustomMissile("NemesisLegNobleBall",28,0,20)
  NMPO G 2 A_CustomMissile("NemesisLegNobleBall",28)
  TNT1 A 0 A_CustomMissile("NemesisLegNobleBall",28,0,-10)
  TNT1 A 0 A_CustomMissile("NemesisLegNobleBall",28,0,10)
  NMPO G 10 
  Goto See
Lunge:
  TNT1 A 0 A_Jump(128,"Missile")
  TNT1 A 0 A_PlaySound("agaures/swing")
  TNT1 A 0 A_PlaySound("LegendaryBulwark/Lunge",2)
  NMPO WWWX 5 A_FaceTarget
  TNT1 A 0 A_SpawnItemEx("GoreImpLunge",0,0,0,0,0,0,0,0,SXF_SETMASTER|SXF_NOCHECKPOSITION)
  TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,1)
  TNT1 A 0 ThrustThingZ(0,30,0,1)
  NMPO "Y" 2 A_Recoil(-40)
  NMPO "Y" 25
  TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,0)
  Goto See
  DeadHands:  
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	NMPO WX 3 Bright A_FaceTarget
	NMPO "Y" 3 Bright A_CustomMissile("LegRevFloorDeadHands",0,0,0)
	TNT1 A 0 A_Jump(156,"Seeker")
	Goto See  
Pain:
  NMPO H 3 A_Pain
  NMPO H 3
Detox:
  TNT1 A 0 A_SetUserVar(user_missile,0)
  Goto See
Death:
  TNT1 A 0 A_ChangeFlag(BRIGHT,0)
  NMPO I 4 A_NoBlocking
  NMPO J 4 A_Scream
  NMPO KL 4
  NMPO N -1
  Stop
}
}

Actor INFNemesisPoltergeist : NemesisPoltergeist
{
Tag "\c[g3]Nemesis Poltergeist\c-"
States
{
  Spawn:
    TNT1 A 0 A_Jump(120,"Remove")
    TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RuneTier2SpawnCheck") == 2,1)
	Goto Remove
  Idle:
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
    NMPO A 8 A_Look
	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 NemesisPoltFlamethrower : FlameShot 
{
+NOTIMEFREEZE
Species "Legendary"
DamageType "Legendary"
States
{
  Spawn:
	TNT1 AAAA 1 A_SpawnItemEx("NPSTFlameTrail",0,0,0,Random(-1,1),Random(-1,1),Random(-1,1),0,SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 1 A_SpawnItemEx("NPSTFlameTrail",0,0,0,Random(-2,2)+MOMX,Random(-2,2)+MOMY,Random(-2,2)+MOMZ,0,SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0 A_SpawnItemEx("NPSTFlameTrail",0,0,0,Random(-3,3)+MOMX,Random(-3,3)+MOMY,Random(-3,3)+MOMZ,0,SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 1 A_SpawnItemEx("NPSTFlameTrail",0,0,0,Random(-3,3)+MOMX,Random(-3,3)+MOMY,Random(-3,3)+MOMZ,0,SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 0  A_SpawnItemEx("NPSTFlameTrail",0,0,0,Random(-3,3)+MOMX,Random(-3,3)+MOMY,Random(-3,3)+MOMZ,0,SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 1  A_SpawnItemEx("NPSTFlameTrail",0,0,0,Random(-4,4)+MOMX,Random(-4,4)+MOMY,Random(-4,4)+MOMZ,0,SXF_CLIENTSIDE|SXF_ABSOLUTEMOMENTUM)
	TNT1 A 18 
	Stop
	}
}

Actor LVDeathEffects
{
+NOINTERACTION
+ISMONSTER
-COUNTKILL
+CLIENTSIDEONLY
var int user_loop;
States
{
  Spawn:
    TNT1 A 0 A_JumpIf(user_loop >= 24, "Death")
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,7)
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(5,7),Random(7,8))
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(5,7),Random(-7,-8))
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,-7)
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(-5,-7),Random(7,8))
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(-5,-7),Random(-7,-8))
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,0,7)
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(7,8),7)
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(-7,-8),7)
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,0,Random(-5,-7))
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(7,8),Random(-5,-7))
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(-7,-8),Random(-5,-7))
	TNT1 AA 0 A_SpawnItemEx("NPSTFlameTrail",0,0,20,Random(-17,17),Random(-17,17),Random(4,10))
	TNT1 A 0 A_Warp(AAPTR_MASTER,0,0,0,0,WARPF_ABSOLUTEANGLE|WARPF_NOCHECKPOSITION|WARPF_INTERPOLATE)
	TNT1 A 2 A_SetUserVar(user_loop,user_loop+1)
	Loop
  Death:
    TNT1 A 1
	Stop
}
}

Actor NPSTFlameTrail : RocketFire
{
+NOTIMEFREEZE
+BRIGHT
Scale 0.5
States
{
  Spawn:
	NF09 ABCDEFGHIJKLMNOPQRST 1
	Stop
	}
}