Actor ZamasuPhaseimp
{
Health 7500
Radius 20
Height 56
Speed 27
MeleeDamage 500
PainChance 140
PainChance "SoulToxic", 60
PainChance "FatFlamer", 60
PainChance "FiendFire", 60
DamageFactor 0.5
Damagefactor "Acid", 2.5
DamageFactor "PDTBFG", 0.05
DamageFactor "PDTBFGTracer", 0.05
DamageFactor "BFGSplash", 0.25
DamageFactor "BFGSpray", 0.25
DamageFactor "PlayerDevBall", 0.025
DamageFactor "PlayerDevBall2", 0.025
DamageFactor "PlayerDTBFGRailgunSlug", 0.025
DamageFactor "PlayerDevTracer", 0.025
DamageFactor "ImpComet", 0.0
DamageFactor "Cyber10K", 0.0
DamageFactor "Legendary", 0.0
DamageFactor "LegendaryPlayer", 0.0
DamageFactor "LegendaryGuru", 0.0
DamageFactor "LegendaryGuruPlayer", 0.0
DamageFactor "CadaverRocket", 0.0
DamageFactor "DemolisherEx", 0.0
DamageFactor "DarkDemoEx", 0.0
DamageFactor "CerChainguns", 0.0
DamageFactor "CerEnergyBall", 0.0
DamageFactor "LegMind", 0.0
DamageFactor "BeheComet", 0.0
DamageFactor "NobleCOmet", 0.0
DamageFactor "CacoComet", 0.0
DamageFactor "CadaverRocket", 0.0
DamageFactor "HellComet", 0.0
DamageFactor "Legendary1", 0.0
DamageFactor "T3rm", 0.0
DamageFactor "C0mm4nder", 0.0
DamageFactor "DBFG10K2", 0.0
DamageFactor "HFCyb3r", 0.0
DamageFactor "PlayerDBFG10K2", 0.0
DamageFactor "PlayerDTRG", 0.3
DamageFactor "DBFG2", 0.0
DamageFactor "PlayerDBFG2", 0.0
DamageFactor "PyroShot", 0.0
DamageFactor "PlayerPyro", 0.0
DamageFactor "PDTPuff", 0.0
DamageFactor "Touhou", 0.0
DamageFactor "Hell", 0.0
DamageFactor "PlayerBHole", 0.0
DamageFactor "PlayerNemesisPlasma", 0.0
DamageFactor "SatanGuard", 0.0
DamageFactor "Explosion", 0.01
DamageFactor "NemesisBall", 0
DamageFactor "NemesisBeam", 0.3
DropItem "Zamasu Plasmatic Cannon", 256, 33
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "NemesisHealthBonusMax", 256, 32
DropItem "NemesisArmorBonus32", 256
DropItem "EnragedLegendaryArmor", 85, 1
DropItem "LegAmmoSphere", 88, 3
DropItem "EnragedLegendaryPowerShard", 35, 1
DropItem "HandGrenadeAmmo", 235, 2
DropItem "MineAmmo", 235, 2
DropItem "Backpack", 198, 1
DropItem "Armorplate", 205, 1
DropItem "Portablemedkit", 210, 1
DropItem "LegendaryRune", 60, 1
DropItem "Nemesis Rifle", 128, 1
DropItem "ZamasuAgilityRune", 128, 1 
DropItem "ZamasuWeakRune", 128, 1
DropItem "ZamasuVitalityRune", 256, 11
SeeSound "ZamasuImpSee"
PainSound "ZamasuImpPain"
DeathSound " "
ActiveSound "ZamasuImpActive"
MeleeSound "ZamasuImpMelee"
Obituary "%o got burned by an Imp."
HitObituary "%o was shredded by an Zamasu Phase Imp."
DropItem "LifeEssence" 50
DropItem "ArmorBonusMax" 50
Species "Imps"
MONSTER
Tag "\c[s5]Zamasu Phase Imp\c-"
+FLOORCLIP
+MISSILEMORE
var int user_music;
var int user_leapdelay;
States
{
Spawn:
	TNT1 A 0 A_SpawnItem("TrueNemesisHellionSmokeSpawner",0,0,0,0)
	ZPHI A 10 A_Look
	Loop
See:
    TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6747,910)
	TNT1 A 0 A_SetUserVar("user_music",1)
	ZPHI AABB 3 A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	ZPHI CCDD 3 A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
    //TNT1 A 0 A_Jump(32,"Leap")
    Loop
  Leap:
	ZPHI A 5 Bright A_FaceTarget
	TNT1 A 0 A_SetUserVar("user_leapdelay",0)
	//TNT1 A 0 ThrustThing(angle*256/360, 20, 0, 0)
	TNT1 A 0 ThrustThingZ(0,random(30,35),0,1)
	TNT1 A 0 A_PlaySound("Legcyber/pain6")
	ZPHI AAAA 5 Bright A_Recoil(-10)
  LeapCheck:
	TNT1 A 0 A_JumpIf(user_leapdelay >= 105,"LeapLand")
	TNT1 A 0 A_SetUserVar("user_leapdelay",user_leapdelay+1)
	//TNT1 A 0 A_Explode(8,256)
	ZPHI A 1 Bright A_CheckFloor("LeapLand")
	Loop
  LeapLand:	
    TNT1 A 0 A_Explode(20000000,500)
	TNT1 A 0 A_SpawnItem("LegendaryNuke")
	TNT1 A 0 A_SpawnItemEx("TLCFlyLandShockWave",0,0,0,0,0,0,0,128) 
	TNT1 AAA 0 A_SpawnItemEx("LegendaryBlueParticleSpawner",Random(-32, 32),Random(-32, 32),0,0,0,0,0,128)  
	TNT1 AAA 0 A_CustomMissile("SmokeFX3",0,0,random(0,360),2,random(0,360))
	TNT1 AAAAA 0 A_CustomMissile("BlueKaboom",0,0,random(0,360),2,random(0,360))
	//TNT1 A 0 A_CustomMissile("LCAExplosionBundle",0,0,random(80,100),2,random(80,100))
	TNT1 A 0 Radius_Quake(175,8,512,1024,0)
	TNT1 A 0 A_SpawnItemEx("TLCFlyLandKaBoom")
	ZPHI B 6 Bright A_PlaySound("monsters/darkcyberstomp")
	ZPHI BBBBBBB 60 Bright
	Goto See
Melee: 
    ZPHI EF 5 A_FaceTarget
    ZPHI G 4 A_MeleeAttack
	ZPHI FE 5 A_FaceTarget
    Goto See 
Missile:
	TNT1 A 0 A_SetShootable
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_Jump(88,"Devastator","ZamasuPhaseSeeker","Super","Super2")
  Devastator:
	ZPHI E 0 A_PlaySound("cydes/mischrg",7,1,0,0.5)
	ZPHI E 1 Bright A_FaceTarget
	ZPHI EEEEEEEEEEEEEE 3 Bright A_GiveInventory("NLegZombieStrafing3",1)
	TNT1 A 0 A_PlaySound("NemesisCannon/BigLaser",CHAN_WEAPON)
	TNT1 A 0 A_CustomMissile("NemImpDevastatorBall",32,0,0)
	ZPHI F 7 Bright
	ZPHI E 10 A_FaceTarget
	TNT1 A 0 A_Jump(196,"See")
	TNT1 A 0 A_PlaySound("NemesisCannon/BigLaser",CHAN_WEAPON)
	TNT1 A 0 A_CustomMissile("NemImpDevastatorBall",32,0,0)
	ZPHI F 7 Bright
	ZPHI E 10 A_FaceTarget
	Goto See
  ZamasuPhaseSeeker:
    ZPHI EF 10 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	ZPHI F 2 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("imp/attack")
	ZPHI F 4 Bright A_CustomMissile("NemesisImpBallSeek",32,20,0)
	Goto See
  Super:
	
	TNT1 A 0 A_PlaySound ("legimp/chargingsound")
	TNT1 A 0 A_SetInvulnerable
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	ZPHI F 6 Bright A_CustomMissile ("NemesisImpLaserBall",28,0,0)
	TNT1 A 0 A_playSound ("legimp/fiyabetch")
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	ZPHI F 6 Bright A_CustomMissile ("NemesisImpLaserBall",28,0,0)
	TNT1 A 0 A_playSound ("legimp/fiyabetch")
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	Goto See
  Super2:
	TNT1 A 0 A_JumpIfCloser(200,"Laser2")
	TNT1 A 0 A_PlaySound ("legimp/chargingsound")
	TNT1 A 0 A_SetInvulnerable
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI EEEEE 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	ZPHI G 6 Bright A_CustomMissile ("ZamasuPhaseImpLaserBall",28,0,0)
	TNT1 A 0 A_playSound ("legimp/fiyabetch")
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_FaceTarget
	ZPHI FFFFF 2 Bright A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	ZPHI G 6 Bright A_CustomMissile ("NemesisImpLaserBall",28,0,0)
	TNT1 A 0 A_playSound ("legimp/fiyabetch")
	TNT1 A 0 A_UnsetInvulnerable
	TNT1 A 0 A_SpawnItem("NemesisHellionSmokeSpawner",0,0,0,0)
	Goto See
Pain:
	ZPHI H 4 A_Pain
	Goto See
XDeath:
Death:
    ZPHI I 5
	ZPHI J 5 A_Scream
	ZPHI KL 5
    TNT1 A 0 A_PlaySound("zamasu/paaaahhhii")
	ZPHI M 0 A_SpawnItem("NemesisDeathBall",0,0,0,0)
	ZPHI M 5 A_Fall
	ZPHI N -1
	Stop
Raise:
	TNT1 A 0
	TNT1 A 0 A_SpawnItemEx("VileHealEffect",0,0,0,0,0,0,0,SXF_NOCHECKPOSITION)
	ZPHI LKJI 5
	Goto See
    }
}

Actor INFZamasuPhaseimp : ZamasuPhaseimp
{
Tag "\c[s5]Zamasu Phase Imp\c-"
States
{
  Spawn:
    TNT1 A 0 A_Jump(170,"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 ZamasuPhaseImpLaserBall : LegendaryImpBlueBall
{
  Decal "Scorch"
  Speed 15
  FastSpeed 12
  Scale 1.2
  Renderstyle Subtract
  DeathSound "exile/voidend"
  States
  {
  Spawn:
	TNT1 A 0 NoDelay A_Playsound("exile/voidsuck",6,1.0,1)
	Goto Fly
  Fly:
	CLBB D 3 Bright A_SpawnItemEx("BlackProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BlackProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_CustomMissile("NemesisImpLaserBallAttack",random(-1,1),random(-2,2),0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
	CLBB D 3 Bright A_SpawnItemEx("BlackProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BlackProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_CustomMissile("NemesisImpLaserBallAttack",random(-1,1),random(-2,2),0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
	CLBB D 3 Bright A_SpawnItemEx("BlackProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_SpawnItemEx("BlackProjParticleSuperLarge2",0,0,0,0,frandom(-1,1),frandom(-1,1),random(0,359))
	TNT1 A 0 A_CustomMissile("NemesisImpLaserBallAttack",random(-1,1),random(-2,2),0,CMF_AIMDIRECTION|CMF_TRACKOWNER)
	Loop
  Death:
	TNT1 A 0 A_StopSound(6)
	TNT1 A 0 A_Explode(158,138,0)
	TNT1 A 0 Radius_Quake(20,12,0,12,0)
	TNT1 AAAAAAAAA 0 A_SpawnItemEx("BlackProjParticleSuperLarge",0,0,0,frandom(-7,7),frandom(-7,7),frandom(-7,7),random(0,359))
	CLBB D 1 Bright A_FadeOut(0.2)
	Goto Death+4
	}
}