ACTOR NemesisRailgunZombie : NemesisZombie
{
//Creator: Eshkere_Jason
//Origin: Divine Infinity
//Sprite: NRZ2
//Title: "Nemesis Railgun Zombie"
Health 1750
BloodColor "Black"
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "VengefulNemesisArmor", 85, 1
DropItem "LegAmmoSphere", 88, 1
DropItem "NemesisPowerShard", 35, 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
DropItem "Nemesis Rifle", 128, 1
DropItem "NemesisAmmoSphere", 128
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 "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 "LegendaryPlayer", 0.0
DamageFactor "LegendaryGuruPlayer", 0.1
DamageFactor "LegendaryGuru", 0.0
DamageFactor "Legendary", 0.0
SeeSound "NemesisZombie/Sight"
PainSound "NemesisZombie/Pain"
DeathSound "NemesisZombie/Death"
ActiveSound "NemesisZombie/Active"
Obituary "%o was noscoped by a \c[g3]Nemesis Railgun Zombie\c-"
Tag "\c[g3]Nemesis Railgun Zombie\c-"
var int user_music;
var int user_protection;
var int user_protected;
var int user_deathtimer;
States
{
  Spawn:
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 A 10 Bright A_Look
    Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
    TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6799,562)
	TNT1 A 0 A_SetUserVar("user_music",1)
	NRZ2 A 0 A_JumpIfTargetInLOS("Strafing")
	NRZ2 AABB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 A 0 A_JumpIfTargetInLOS("Strafing")
    NRZ2 CCDD 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 A 0 A_Jump(80,"Rush")
    TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
    Loop
  Rush:
    NRZ2 A 0 A_JumpIfTargetInLOS("Strafing")
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("NemesisRailZombieGhost",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	NRZ2 D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_Jump(84,"See")
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	Loop
  Strafing:
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NRZ2 AA 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NRZ2 BB 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)
	TNT1 A 0 A_SpawnItem("LegendaryFootStep",0,0,0,0)
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
    NRZ2 CC 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)	
	TNT1 A 0 A_Chase("","Missile",CHF_DONTMOVE)
	NRZ2 DD 3 Bright A_GiveInventory("NemesisLegZombieStrafing",1)
	Goto See
  Missile:
	TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
	TNT1 A 0 A_PlaySound("weapons/rgcharge")
	NRZ2 EEEEE 5 Bright A_FaceTarget
	TNT1 A 0 A_FaceTarget
	TNT1 A 0 A_PlayWeaponSound("lrailat")
	TNT1 A 0 A_CustomMissile("RailgunImpact",30,0,0,0)
	TNT1 A 0 A_CustomMissile("NemesisRevRailLaser",30,0,0,0)
	NRZ2 F 5 Bright A_CustomRailgun(random(100,300),0,none,none,RGF_SILENT,1,0,"PlayerRailPuffBlue",0,0,0,0,0.5,0.5,"LegRailCoreTrail")
	NRZ2 E 10
	Goto See
  Pain:
	TNT1 A 0 A_Jump(25,"Protection")
	TNT1 A 0 A_Jump(192,"PainMissile")
	NRZ2 G 3 Bright
	NRZ2 G 3 Bright A_Pain
	Goto See
  PainMissile:
	NRZ2 G 3 Bright
	NRZ2 G 3 Bright A_Pain
	Goto Missile	
  Protection:
	TNT1 A 0 A_JumpIf(user_protection >= 3,"Pain")
	TNT1 A 0 A_JumpIf(user_protected == 1,"Pain")
	TNT1 A 0 A_PlaySound("legendary/defense")
	TNT1 A 0 A_FaceTarget
	NRZ2 E 2 Bright ACS_NamedExecuteAlways("NemesisZombieProtection",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	Goto See
  Death:
    TNT1 A 0 A_JumpIf(ACS_NamedExecuteWithResult("NoVexedBoys") == 1,4)
    TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem",1,"VexedSpawn")
    TNT1 A 0 A_JumpIfInTargetInventory("TrueLegendaryRuneItem2",1,"VexedSpawn")
    TNT1 A 0 A_JumpIf(user_deathtimer <= 10,"VexedSpawn")
	TNT1 A 0 A_Jump(36,"LegendarySoul")
    TNT1 A 0 A_StopSound(6)
    NRZ2 H 5 A_Scream
    NRZ2 I 5 A_Fall
    NRZ2 J 5 A_SpawnItem("BodyCrash",0,0,0,0)
    NRZ2 K 5
    NRZ2 L -1
    Stop
  LegendarySoul:
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 H 6
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 I 6 A_Scream
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("LegSSGGuyGib",0,0,12,frandom(0.1,1.0),frandom(0.1,1.0),frandom(0.1,1.0),random(0,360),SXF_CLIENTSIDE)
	NRZ2 J 6 A_Fall
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 K 6 A_SpawnItem("BodyCrash",0,0,0,0)			
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 L 6
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 L 5
	TNT1 A 0 A_PlaySoundEx("brain/spit","Voice",0,2)
	NRZ2 LLLLLLLLLLLLLLLLL 2 A_GiveInventory("NemesisSoulEvent",1)
	NRZ2 LLLLLLLLLLLLLLLLL 2 A_GiveInventory("NemesisSoulEvent",1)
	NRZ2 LLLLLLLLLLLLLLLLL 2 A_GiveInventory("NemesisSoulEvent",1)
	TNT1 A 0 A_ChangeFlag("BRIGHT",0)
	TNT1 A 0 A_SpawnItemEx("NemesisSoul",0,0,16,0,0,0,0,SXF_NOCHECKPOSITION,0)
	TNT1 A 0 A_SpawnItemEx("TeleportFog",0,0,16,0,0,0,0,32)
	NRZ2 L 525
	NRZ2 L 5 A_FadeOut(0.1,1)
	Wait
  VexedSpawn:
    NRZ2 G 3 Bright A_Pain
    NRZ2 G 0 A_PlaySoundEx("brain/spit",7,0,2)
    NRZ2 GGGGGGGGGGGGGGGGG 2 Bright A_GiveInventory("NemesisSoulEvent",1)
    NRZ2 GGGGGGGGGGGGGGGGG 2 Bright A_GiveInventory("NemesisSoulEvent",1)
    NRZ2 GGGGGGGGGGGGGGGGG 2 Bright A_GiveInventory("NemesisSoulEvent",1)
    TNT1 A 0 A_SpawnItemEx("NemesisLightning")
    NRZ2 GGGGGGGGGGGG 2 Bright A_SpawnItemEx("VexedNemesisFlameSpawner")
    TNT1 A 0 A_SpawnItemEx("VexedNemesisRailgunZombie",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION|SXF_TELEFRAG)
    TNT1 A 1
  Stop
  }
}

Actor INFNemesisRailgunZombie : NemesisRailgunZombie
{
Tag "\c[g3]Nemesis Railgun Zombie\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 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	NRZ2 A 10 Bright A_Look
	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 NemesisRailZombieGhost
{
Scale 1.1
Radius 20
Height 56
Speed 0
Alpha 0.7
PROJECTILE
RENDERSTYLE Translucent
+CLIENTSIDEONLY
+NOTIMEFREEZE
+NOINTERACTION
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    NRZ2 A 2 A_FadeOut(0.10)
    Wait
    }
}