Actor NemesisDoomguy
{
Monster
Height 56
Radius 16
Health 3800
Mass 500
Speed 40
FastSpeed 60
MaxStepHeight 32
MaxDropOffHeight 32
MeleeRange 80
BloodColor "Black"
PainChance 40
PainChance "Crush", 256
Species "LegendaryDoomguy"
Damagetype "Legendary"
DamageFactor 0.25
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 "PlayerNemesisPlasma", 0.0
DamageFactor "Crush", 0.05
DamageFactor "Acid", 0.2
DamageFactor "Fire", 0.15
DamageFactor "Ice", 0.2
DamageFactor "Poison", 0.0
DamageFactor "PoisonCloud", 0.0
DamageFactor "PyroShot", 0.10
DamageFactor "NuclearFire", 0.15
DamageFactor "BFG9500Ball", 0.5
DamageFactor "BFGSplash", 0.5
DamageFactor "UpBFG9500Ball", 0.5
DamageFactor "UpBFGSplash", 0.25
DamageFactor "PDTBFG", 0.02
DamageFactor "PDTBFGTracer", 0.02
DamageFactor "PlayerDevBall", 0.01
DamageFactor "PlayerDevBall2", 0.01
DamageFactor "PlayerDevTracer", 0.01
DamageFactor "PlayerDBFG2", 0.45
DamageFactor "PlayerDBFG10K2", 0.45
DamageFactor "PlayerDBFGSplash2", 0.45
DamageFactor "PlayerBHole", 0.05
DamageFactor "LegendaryPlayer", 0.3
DamageFactor "Player", 0.6
DamageFactor "PlayerHellfire", 0.1
DamageFactor "SuperWeapon", 0.0
DamageFactor "LegendaryGuruPlayer", 0.0
DamageFactor "SS", 0.05
//No Infighting
DamageFactor "Legendary", 0.0
DamageFactor "Legendary1", 0.0
DamageFactor "LegendaryGuru", 0.0
DamageFactor "UltimateLegendary", 0.0
DamageFactor "LegendaryZombie", 0.0
DamageFactor "LACGrenade", 0.0
DamageFactor "LSSGGrenade", 0.0
DamageFactor "ZExplosiveBullets", 0.0
DamageFactor "MiniRocket", 0.0
DamageFactor "ZombieDev", 0.0
DamageFactor "SoapOpera", 0.0
DamageFactor "HTZombie", 0.0
DamageFactor "ZGrenade", 0.0
DamageFactor "ZombieCannon", 0.0
DamageFactor "GeneralTracer", 0.0
DamageFactor "BloodSkull", 0.0
DamageFactor "BloodElemental", 0.0
DamageFactor "Broat", 0.0
DamageFactor "SatanGuard", 0.0
DamageFactor "CurseComet", 0.0
DamageFactor "HelementalComet", 0.0
DamageFactor "DementedTerminator", 0.0
DamageFactor "Terminator", 0.0
DamageFactor "Cyber10K", 0.0
DamageFactor "UBDTR", 0.0
DamageFactor "DemolisherEx", 0.0
DamageFactor "DarkDemoEx", 0.0
DamageFactor "Commander", 0.0
DamageFactor "CerChainguns", 0.0	
DamageFactor "CerEnergyBall", 0.0
DamageFactor "Hell", 0.0
DamageFactor "HFCyber", 0.0
DamageFactor "DBFG2", 0.0
DamageFactor "DBFG10K2", 0.0
DamageFactor "DBFGSplash2", 0.0
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisArmor", 180, 1
DropItem "NemesisAmmoSphere", 128, 1
DropItem "NemesisPowerShard", 110, 1
DropItem "HandGrenadeAmmo", 235, 2
DropItem "MineAmmo", 235, 2
DropItem "Backpack", 198, 1
DropItem "Armorplate", 205, 1
DropItem "Portablemedkit", 210, 1
DropItem "NLDemonAmmoBox", 200 
DropItem "NLDemonAmmo", 250 
DropItem "NemesisRuneSpawnerTier1", 60, 1
SeeSound "LDoomguy/Sight"
ActiveSound "LDoomguy/Active"
PainSound "LDoomguy/Pain"
DeathSound "legdoomguy/death"
AttackSound " "
Obituary "%o was sent a ticket back to hell by the Nemesis Doomguy."
Tag "\c[v9]Nemesis Doomguy\c-"
+BRIGHT
+BOSS
+NOFEAR
+NOICEDEATH
+NOTIMEFREEZE
+FLOORCLIP
+MISSILEMORE
+MISSILEEVENMORE
+QUICKTORETALIATE
+NODROPOFF
+NOTARGET
+DONTGIB
+DONTRIP
+DONTMORPH
+DONTBLAST
+NORADIUSDMG
+CANUSEWALLS
+NOBLOCKMONST
+THRUSPECIES
+DONTHARMSPECIES
+LOOKALLAROUND
+DONTHARMCLASS
+SEEINVISIBLE
+CANTSEEK
var int user_music;
var int user_missile;
var int user_powershard;
var int user_powershardlimit;
var int user_powersphere;
var int user_resistancebufflimit;
var int user_resistancebuff;
var int user_skullofpower;
var int user_infammo;
var int user_bfg;
States
{
  Spawn:
	NMD0 A 10 A_Look
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("StartMonsterMusic",0,1813,907)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_JumpIfInventory("RunesCheck",1,2)
	TNT1 A 0 ACS_NamedExecuteWithResult("CheckRunes")
	TNT1 A 0 A_UnSetInvulnerable
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 AA 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 BB 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 CC 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 DD 3 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Jump(64,"Mine")
	TNT1 A 0 A_Jump(80,"Rush")
	Loop
  Rush:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostA")
	NMD0 A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostA")
	NMD0 A 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostB")
	NMD0 B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostB")
	NMD0 B 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostC")
	NMD0 C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostC")
	NMD0 C 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostD")
	NMD0 D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("NemDoomguyGhostD")
	NMD0 D 1 A_Chase
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Jump(80,"See")
	Loop
  Strafing:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NMD0 AA 3 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NMD0 BB 3 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("FootStep")
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NMD0 CC 3 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NMD0 DD 3 A_GiveInventory("NemesisLegZombieStrafing",1)
	Goto See
  Taunt:
	TNT1 A 0 A_PlaySound("legdoomguy/rekt",2,0.8,0,ATTN_NONE)
	TNT1 A 0 A_TakeInventory("MarineKilled",1)
	Goto See
  Missile:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnSetInvulnerable
	TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_MonsterRefire(0,"See")
	TNT1 A 0 A_Jump(64,2)
	TNT1 A 0 A_JumpIfHealthLower(500,"TryShard2")
	TNT1 A 0 A_Jump(32,"AmmoSphere","PowerSphere","SkullOfPower")
  MissileContinue:
	TNT1 A 0 A_JumpIfTargetInLOS("FarRange",360,JLOSF_CLOSENOJUMP|JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,0,1000)
	TNT1 A 0 A_JumpIfTargetInLOS("LongRange",360,JLOSF_CLOSENOJUMP|JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,0,750)
	TNT1 A 0 A_JumpIfTargetInLOS("NearRange",360,JLOSF_CLOSENOJUMP|JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,0,500)
	TNT1 A 0 A_JumpIfTargetInLOS("CloseRange",360,JLOSF_DEADNOJUMP|JLOSF_TARGETLOS,500,0)
	Goto LMG
  FarRange:
	TNT1 A 0 A_Jump(256,"BFGAlt","10k","10kAlt","CannonAlt","BFG")
	Goto LMG
  LongRange:
	TNT1 A 0 A_Jump(200,"PlasmaticRifle","Cannon")
	TNT1 A 0 A_Jump(256,"BFG","BFGAlt","10k","10kAlt","CannonAlt")
	Goto LMG
  NearRange:	
	TNT1 A 0 A_Jump(200,"PlasmaticRifle","Cannon")
	TNT1 A 0 A_Jump(256,"BFG","BFGAlt","10k","10kAlt","CannonAlt")
	Goto LMG
  CloseRange:
	TNT1 A 0 A_Jump(128,"ASG","Coachgun")
	TNT1 A 0 A_Jump(200,"PlasmaticRifle","Cannon")
	TNT1 A 0 A_Jump(256,"BFGAlt","10k","CannonAlt")
	Goto LMG
  TryShard2:
	TNT1 A 0 A_Jump(128,"TryResistance2")
	TNT1 A 0 A_JumpIf(user_powershardlimit >= 3,"TryResistance2")
	TNT1 A 0 A_JumpIf(user_powershard == 1,"TryResistance2")
	Goto PowerShard
  TryResistance2:
	TNT1 A 0 A_JumpIf(user_resistancebufflimit >= 4,"MissileContinue")
	TNT1 A 0 A_JumpIf(user_resistancebuff == 1,"MissileContinue")
	Goto ResistanceBuff
  AmmoSphere:
	TNT1 A 0 A_JumpIf(user_infammo == 1,"MissileContinue")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 E 10
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 ACS_NamedExecuteAlways("EnemyInfiniteAmmo",0)
	TNT1 A 0 A_PlaySound("legammo/use",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  SkullOfPower:
	TNT1 A 0 A_JumpIf(user_skullofpower == 1,"MissileContinue")
	TNT1 A 0 A_JumpIfHealthLower(800,2)
	TNT1 A 0 A_Jump(256,"MissileContinue")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 E 10
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_GiveInventory("LegDoomguySkullOfPower")
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguySkullOfPower",0)
	TNT1 A 0 A_PlaySound("legdoomguy/quaddmg",7,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("soterror/use",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  PowerSphere:
	TNT1 A 0 A_JumpIf(user_powersphere == 1,"MissileContinue")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 E 10
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_ChangeFlag("ALWAYSFAST",1)
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguyPowerSphere",0)
	TNT1 A 0 A_PlaySound("legpowersphere/use",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  PowerShard:
	TNT1 A 0 A_JumpIf(user_powershardlimit >= 3,"See")
	TNT1 A 0 A_SetUserVar(user_powershardlimit,user_powershardlimit+1)
	TNT1 A 0 A_JumpIf(user_powershard == 1,"See")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD0 E 10
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguyPowerShard",0)
	TNT1 A 0 A_PlaySound("legendary/defense",6,1.0,0,0.4)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	Goto See
  ResistanceBuff:
	TNT1 A 0 A_JumpIf(user_resistancebufflimit >= 4,"See")
	TNT1 A 0 A_SetUserVar(user_resistancebufflimit,user_resistancebufflimit+1)
	TNT1 A 0 A_JumpIf(user_resistancebuff == 1,"See")
	TNT1 A 0 A_PlaySound("Saber/Pickup",7,1.0,0,0.5)
	NMD2 E 10
	TNT1 A 0 A_PlaySound("Saber/Buff",1,1.0,0,0.5)
	TNT1 A 0 A_PlaySound("Saber/Resistance",6,1.0,0,0.5)
	TNT1 A 0 A_PlaySound("LDoomguy/Taunt",2,1.0,0,0.4)
	TNT1 A 0 A_GiveInventory("LegDoomguySaberResistance")
	TNT1 A 0 ACS_NamedExecuteAlways("LegDoomguyResistanceBuff",0)
	NLD2 F 20
	Goto See
  Mine:
	NMD0 C 4 Fast
	NMD0 E 15 Fast A_CustomMissile("NemesisSpringMineSet",32,0,0,2,15)
	NMD0 C 4 Fast
	Goto See
  Grenade:
	"####" A 0 A_PlaySound("weapons/hgrenadepin",0,1.0,0)
	"####" E 4 Fast A_FaceTarget
	"####" A 0 A_PlaySound("weapons/hgrenadethrow",0,1.0,0)
	"####" E 1 A_CustomMissile("LegThrownGrenade",32,0,0,2,4)
	"####" A 0 A_GiveInventory("MonsterAvoid",1)
	Goto See
  Pause:
	"####" EE 5 A_SpawnItemEx("NewLegDoomguySmokeSpawner")
	TNT1 A 0 A_PlaySound("weapons/LMGReload3",7,1.0,0,0.5)
	Goto See
  ASG:
	TNT1 A 0 A_PlaySound("LShotgun/Cock",7,1.0,0,0.5)
	NMD7 E 10 A_FaceTarget
  ASGLoop:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_JumpIfInventory("ASGZAmmo",16,"ReloadASG")
	NMD7 E 5 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_JumpIf(user_infammo == 1,2)
	TNT1 A 0 A_GiveInventory("ASGZAmmo",1)
	TNT1 AAAAAAA 0 A_CustomMissile("NemesisASGBall",32,0,frandom(-10,10),CMF_OFFSETPITCH,frandom(-6,6))
	NMD7 F 0 A_CustomMissile("NemesisASGBall",32,0,frandom(-10,10),CMF_OFFSETPITCH,frandom(-6,6))
	TNT1 A 0 A_SpawnItemEx("NemesisShellCasing",-8,7,30,4,0,(0.1)*Random(30,40),Random(-80,-90),128)
	TNT1 A 0 A_PlaySound("Weapons/LegAutoShotgun",1)
	NMD7 E 5 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	NMD7 A 0 A_Jump(60,"Pause","TryCoachgun")
	NMD7 A 0 A_Jump(15,"Grenade")
	Loop
  ReloadASG:
	TNT1 A 0 A_Jump(128,2)
	TNT1 A 0 A_JumpIfCloser(350,"Coachgun")
    TNT1 A 0 A_ChangeFlag("NOPAIN",1)
	NMD7 E 7 Fast A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
	NMD7 E 5 Fast A_PlaySound("lasgguy/asgout")
	TNT1 A 0 A_TakeInventory("ASGZAmmo",16)
    NMD7 EEEEEEEE 6 Fast A_SpawnItemEx("NemesisHellionSmokeSpawner")
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
    NMD7 E 11 Fast A_PlaySound("lasgguy/asgin") 
    TNT1 A 0 A_ChangeFlag("NOPAIN",0)
    Goto See
  TryCoachgun:
	TNT1 A 0 A_JumpIfCloser(350,"Coachgun")
	Goto Pause
  Coachgun:
	NMD8 E 10 Fast
	NMD8 EE 5 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_PlaySoundEx("NemesisSSG/Fire1","Weapon")
	TNT1 AAAA 0 A_CustomMissile("NemesisTracer",Random(32,38),0,Random(6,-6),0)
	TNT1 A 0 A_PlaySound("Coachgun/Fire1",1)
	NMD8 F 4 Bright A_CustomBulletAttack(20,14,15,Random(5,15)*6,"NemesisASGBulletPuff",0,CBAF_NORANDOM)
	NMD8 EEE 2 Bright A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	NMD8 E 6 Fast A_PlaySound("NemesisSSG/Open")
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItemEx("NemesisShellCasing",-8,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	NMD8 E 1 A_SpawnItemEx("NemesisShellCasing",-10,6,36,Random(2,6),0,random(1,3),random(-80,-90),128)
	NMD8 E 6 Fast A_PlaySound("NemesisSSG/Load")
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	NMD8 E 6 Fast A_PlaySound("NemesisSSG/Close")
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	NMD8 E 6 Fast
	NMD8 A 0 A_Jump(64,"Grenade")
	Goto See
  PlasmaticRifle:
	TNT1 A 0 A_PlaySound("weapons/legup",7,1.0,0,0.5)
	NMD9 E 10 A_FaceTarget
  PlasmaticRifleLoop:
	TNT1 A 0 A_JumpIfInventory("MarineKilled",1,"Taunt")
	TNT1 A 0 A_JumpIf(user_infammo == 1,2)
	TNT1 A 0 A_GiveInventory("LegZombieRifleAmmo",1)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_PlaySoundEx("NemesisRifle/Fire","Weapon")
	NMD9 F 4 Fast A_CustomMissile("NemesisRifleShotEnemy",32,0,random(-2,2),CMF_TRACKOWNER)
	TNT1 A 0 A_JumpIf(user_infammo == 1,2)
	TNT1 A 0 A_GiveInventory("LegZombieRifleAmmo",1)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_PlaySoundEx("NemesisRifle/Fire","Weapon")
	NMD9 E 4 Fast A_CustomMissile("NemesisRifleShotEnemy",32,0,random(-2,2),CMF_TRACKOWNER)
	NMD9 A 0 A_MonsterRefire(128,"Pause")
	TNT1 A 0 A_Jump(24,"PausePlasmaticRifle")
	NMD9 A 0 A_Jump(10,"Grenade")
	Loop
  PausePlasmaticRifle:
	NMD9 A 0 A_PlaySound("weapons/demontechsteam",6)
	Goto Pause
  Cannon:
	NMD6 E 15 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_missile,random(0,5))
  CannonLoop:
	NMD6 A 0 A_JumpIf(user_missile >= 10,"Pause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NMD6 EE 5 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	NMD6 FF 5 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_CustomMissile("NemesisZombieCannonProj",32)
	TNT1 A 0 A_PlaySound("NemesisCannon/Fire",7)
	NMD6 A 0 A_MonsterRefire(128,"Pause")
	Loop
  CannonAlt:
	TNT1 A 0 A_PlaySound("cydes/mischrg",7,1,0,0.5)
	NMD6 E 1 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_missile,random(0,4))
  CannonAltLoop:
	NMD6 A 0 A_JumpIf(user_missile >= 8,"Pause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NMD6 EEE 6 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("NemesisCannon/BigLaser",CHAN_WEAPON)
	TNT1 AAA 0 A_CustomMissile("NemesisZombieCannonIonBeam",32,0,0)
	NMD6 F 6 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	NMD6 A 0 A_MonsterRefire(128,"Pause")
	Loop
  BFG:
	TNT1 A 0 A_PlaySound("LDoomguy/BFG2",2,1.0,0,0.5)
	TNT1 A 0 A_JumpIf(user_bfg == 0,3)
	TNT1 A 0 A_SetUserVar(user_bfg,1)
	TNT1 A 0 A_PlaySound("LDoomguy/BFG",2,1.0,0,0.5)
	NMD3 E 30 A_FaceTarget
	TNT1 A 0 A_PlaySound("Weapons/GuruTrigger",6,1.0,0,0.5)
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlaySound("NemesisBFG/charge",1)	
	NMD3 EEEEEEEEEEEEEEEEEEEE 5 A_GiveInventory("LegZombieStrafing",1)
    TNT1 A 0 A_PlaySound("NemesisBFG/Fire",1)
	NMD3 F 20 A_CustomMissile("NemesisGuruBall",32)
	Goto Pause
  BFGAlt:
	TNT1 A 0 A_PlaySound("Weapons/GuruUp",7,1.0,0,0.5)
	NMD3 E 15 A_FaceTarget
	TNT1 A 0 A_SetUserVar(user_missile,random(0,2))
  BFGAltLoop:
	NMD3 A 0 A_JumpIf(user_missile >= 3,"Pause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NMD3 EE 5 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
  	TNT1 A 0 A_PlayWeaponSound("star/fire")
	NMD3 F 15 Fast A_CustomMissile("MiniNemesisBFGBall")
	NMD3 EEEEE 5 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	NMD3 A 0 A_MonsterRefire(128,"Pause")
	Loop
  10k:
    NMD5 E 15 A_FaceTarget
	TNT1 A 0 A_PlayWeaponSound("Leg10K/PCharge")
	NMD5 EEEEE 6 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_SetUserVar(user_missile,random(0,10))
  10kLoop:
	TNT1 A 0 A_JumpIf(user_missile >= 20,"10kPause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NMD5 E 2 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_PlaySound("Leg10K/PFire")
	NMD5 F 1 Bright A_CustomMissile("Nemesis10kProjectile", 30, 0, Random(-3, 3))
	Loop
  10kPause:
	NMD5 A 0 A_PlaySound("Leg10K/PCool")
	Goto Pause
  10kAlt:
    NMD5 E 15 A_FaceTarget
	TNT1 A 0 A_PlayWeaponSound("Leg10K/ACharge")
	NMD5 EEEEE 8 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_SetUserVar(user_missile,random(0,2))
  10kAltLoop:
	TNT1 A 0 A_JumpIf(user_missile >= 6,"10kPause")
	TNT1 A 0 A_SetUserVar(user_missile,user_missile+1)
	NMD5 E 4 Fast A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_PlayWeaponSound("Leg10K/AFire")
	NMD4 F 6 Fast A_CustomMissile("NemesisHKSuperBall",30,0,random(-4,4),0)
	Loop
  Pain:
	TNT1 A 0 A_JumpIfHealthLower(800,"TryShard")
	TNT1 A 0 A_Jump(32,"PowerShard","ResistanceBuff")
  PainContinue:
	NMD0 G 3
	NMD0 G 3 A_Pain
	TNT1 A 0 A_Jump(192,"Missile")
	Goto See
  TryShard:
	TNT1 A 0 A_Jump(128,"TryResistance")
	TNT1 A 0 A_JumpIf(user_powershardlimit >= 3,"TryResistance")
	TNT1 A 0 A_JumpIf(user_powershard == 1,"TryResistance")
	Goto PowerShard
  TryResistance:
	TNT1 A 0 A_JumpIf(user_resistancebufflimit >= 4,"PainContinue")
	TNT1 A 0 A_JumpIf(user_resistancebuff == 1,"PainContinue")
	Goto ResistanceBuff
  Death:
	TNT1 A 0 A_ChangeFlag("Bright",0)
	TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem",1,"VexedSpawn")
	TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem2",1,"VexedSpawn")
	TNT1 A 0 A_SpawnItemEx("RingOfRegenerationHalf",0,0,12,random(0,8),random(0,8),2,random(0,360),0,0)
	TNT1 A 0 A_SpawnItemEx("Nemesis Sawed-Off Shotgun",0,0,12,random(0,8),random(0,8),2,random(0,360),0,32)
	TNT1 A 0 A_SpawnItemEx("Nemesis Assault Shotgun",0,0,12,random(0,8),random(0,8),2,random(0,360),0,32)
	TNT1 A 0 A_SpawnItemEx("Nemesis Rifle",0,0,12,random(0,8),random(0,8),2,random(0,360),0,32)
	TNT1 A 0 A_SpawnItemEx("Nemesis Plasmatic Cannon",0,0,12,random(0,8),random(0,8),2,random(0,360),0,128)
	TNT1 A 0 A_SpawnItemEx("LegendaryBFG10k",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("Nemesis BFG",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisHealthBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisHealthBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisHealthBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisHealthBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisArmorBonus64",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisArmorBonus64",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisArmorBonus64",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	TNT1 A 0 A_SpawnItemEx("NemesisHealthBonusMax",0,0,12,random(0,8),random(0,8),2,random(0,360),0,200)
	NMD0 H 5 A_Scream
	NMD0 I 5 A_NoBlocking
	NMD0 JK 5
	NMD0 L 5 A_SpawnItem("BodyCrash",0,0,0,0)
	NMD0 M 5
	TNT1 A 0 A_SpawnItemEx("NemDoomguySoulEffect",0,0,0,0,0,0,0)
	NMD0 N 5 ACS_NamedExecuteAlways("DropDoll",0,75)
	NMD0 N 20
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	NMD0 N 1 A_SpawnItemEx("NemesisSoul",0,0,16,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TELEFRAG)
	NMD0 N -1
	Stop
  VexedSpawn:
	NMD0 G 3 Bright A_Pain
	TNT1 A 0 A_Scream
	NMD0 G 0 A_PlaySoundEx("brain/spit",7,0,2)
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_Fall
	NMD0 GGGGGGGGGGGGGGGGG 2 Bright A_GiveInventory("NemesisSoulEvent",1)
	NMD0 GGGGGGGGGGGGGGGGG 2 Bright A_GiveInventory("NemesisSoulEvent",1)
	NMD0 GGGGGGGGGGGGGGGGG 2 Bright A_GiveInventory("NemesisSoulEvent",1)
	TNT1 A 0 A_SpawnItemEx("NemesisLightning")
	NMD0 GGGGGGGGGGGG 2 Bright A_SpawnItemEx("VexedNemesisFlameSpawner")
	TNT1 A 0 A_SpawnItemEx("VexedNemesisDoomguy",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TELEFRAG)
	TNT1 A -1
	}
}

ACTOR INFNemesisDoomguy : NemesisDoomguy
{
Tag "\c[v9]Nemesis Doomguy\c-"
States
{
  Spawn:
    TNT1 A 0 
    TNT1 A 0 A_Jump(128,"Remove")
	TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("SimpleProgSys") == 0,2)
    TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("RuneTier3SpawnCheck") == 2,1)
	Goto Remove
  Idle:
	NMD0 A 10 A_Look
	TNT1 A 0 A_SpawnItemEx("NemesisHellionSmokeSpawner")
    Loop
  Remove:
	TNT1 A 1
	TNT1 A 0 A_SpawnItemEx("Chaingunner",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	TNT1 A 0 A_ChangeFlag("COUNTKILL", FALSE)
	TNT1 A 0
	Stop
	}
}

Actor NemDoomguyGhostA
{
Renderstyle Translucent
Alpha 0.7
+NOTIMEFREEZE
+NOINTERACTION
+CLIENTSIDEONLY
States
{
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
	TNT1 A 0 A_CheckSight("NULL")
	TNT1 A 1
	Goto Fade
  Fade:
	NMD0 A 2 A_FadeOut(0.1)
	Loop
	}
}

Actor NemDoomguyGhostB : NemDoomguyGhostA
{
States
{
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
	TNT1 A 0 A_CheckSight("NULL")
	TNT1 A 1
	Goto Fade
  Fade:
	NMD0 B 2 A_FadeOut(0.1)
	Loop
	}
}

Actor NemDoomguyGhostC : NemDoomguyGhostA
{
States
{
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
	TNT1 A 0 A_CheckSight("NULL")
	TNT1 A 1
	Goto Fade
  Fade:
	NMD0 C 2 A_FadeOut(0.1)
	Loop
	}
}

Actor NemDoomguyGhostD : NemDoomguyGhostA
{
States
{
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "NULL")
	TNT1 A 0 A_CheckSight("NULL")
	TNT1 A 1
	Goto Fade
  Fade:
	NMD0 D 2 A_FadeOut(0.1)
	Loop
	}
}


ACTOR NemDoomguySoulEffect
{
Scale 1.25
RenderStyle add
Alpha 1
+MISSILE
+DROPOFF
+NOGRAVITY
+NOBLOCKMAP
+NOTELEPORT
+NOTIMEFREEZE
+NOINTERACTION
+CLIENTSIDEONLY
States
{
  Spawn:
	TNT1 A 0
	NPIR ABCDEF 5 Bright
	Stop
	}
}
