ACTOR CorruptedAnnihilatorImp : LegendaryAnnihilatorImp
{
//Creator: Nemesiscaptain(uwu)and Makarov
//Origin: Infinity Gods
//Sprite: CATI
//Title: "CorruptedAnnhilatorImp"
Health 1500
Radius 20 
Height 56 
Speed 14
Scale 1.15
PainChance 50
MeleeDamage 15
Monster
+BRIGHT
//Corrupted Sent Damage Factors
DamageFactor 0.5
DamageFactor "PlayerDTRG", 0.4
DamageFactor "DTRailgun", 0.4
DamageFactor "Player",0.3
DamageFactor "LegendaryPlayer",0.5
DamageFactor "Legendary",0.5
DamageFactor "CChainTracer",0.0
DamageFactor "SuperWeapon", 0.75
DamageFactor "LegendaryGuruPlayer", 0.75
DamageFactor "PlayerDevBall", 0.65
DamageFactor "PlayerDevTracer", 0.15
DamageFactor "PowerDoubleDamage", 0.5
DamageFactor "BFG10K", 0.65
DamageFactor "BFG9500Ball", 0.4
DamageFactor "CustomSpray", 0.1
DamageFactor "BFGSplash", 0.1
DamageFactor "BFGSpray", 0.1
DamageFactor "Explosion", 0.1
DamageFactor "PDTBFG", 0.1
DamageFactor "PDTBFGTracer", 0.1
DamageFactor "PlayerDTBFGRailgunSlug", 0.1
DamageFactor "PDTPuff", 0.1
DamageFactor "SatanGuard", 0.0
DamageFactor "Moloch", 0.0
DamageFactor "ZombieDev", 0.0
DamageFactor "Terminator", 0.0
DamageFactor "Legendary1", 0.0
DamageFactor "LegendaryGuru", 0.0
DamageFactor "UltimateLegendary", 0.0
DamageFactor "Cybers", 0.0
DamageFactor "Hell", 0.0
DamageFactor "Commander", 0.0
DamageFactor "Baby15K", 0.0
DamageFactor "Cyber10K", 0.0
DamageFactor "DemolisherEx", 0.0
DamageFactor "DarkDemoEx", 0.0
DamageFactor "CerChainguns", 0.0
DamageFactor "CerEnergyBall", 0.0
DamageFactor "HellComet", 0.0
DamageFactor "HFCyber", 0.0
DamageFactor "DBFG2", 0.0
DamageFactor "DBFG10K2", 0.0
DamageFactor "DBFGSplash2", 0.0
DropItem "HandGrenadeAmmo" 256 2
DropItem "MineAmmo" 256 2
DropItem "Backpack" 256 1
DropItem "Armorplate" 256 1
DropItem "Portablemedkit" 256 1
Dropitem "MarineSquadBeacon", 80, 1
Dropitem "DCellPack", 256, 32
Dropitem "DCellPack", 128, 30
Dropitem "DCell", 256, 10
Dropitem "DCell", 256, 10
Dropitem "DCell", 256, 10
DropItem "Randomcorrupteditem", 256, 1
Bloodcolor "Blue"
Species "Imps"
SeeSound "cimp/sight"
PainSound "cimp/pain"
DeathSound "cimp/death"
ActiveSound "cimp/active"
MeleeSound "weapons/fistwiff"
Obituary "%o was disintegrated by the Corrupted annhilator Imp's corrupted energy."
HitObituary "%o foolishly tried to fight the Corrupted annhilator Imp up close."
Tag "\c[o7]Corrupted annhilator imp\c-"
var int user_music;
States
	{
  Spawn:
  	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
    CATI A 10 Bright A_Look
	Loop
  See:
	TNT1 A 0 A_JumpIf(user_music == 1,3)
	TNT1 A 0 ACS_NamedExecuteAlways("InfinityMusic",0,6750,50)
	TNT1 A 0 A_SetUserVar("user_music",1)
	TNT1 A 0 A_ChangeFlag(NODROPOFF,1)
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	CATI AA 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	CATI BB 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_PlaySound("HumanishStep")
	CATI CC 3 Bright A_Chase
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	CATI DD 3 Bright A_Chase
	TNT1 A 0 A_PlaySound("HumanishStep")
	TNT1 A 0 A_Jump(30,"Teleport")
  	TNT1 A 0 A_Jump(46,"Evade")
	CATI A 0 A_Jump(87,"Rush")
	Loop
  Evade:
	TNT1 A 0 A_Jump(128,3)
	TNT1 A 0 ThrustThing(Angle*256/360+64,16,0,0)
	TNT1 A 0 A_Jump(256,2)
	TNT1 A 0 ThrustThing(Angle*256/360+192,16,0,0)
  	CATI AAAA 3 A_Chase
	TNT1 A 0 A_Stop
	TNT1 A 0 A_JumpIfTargetInLOS("Missile")
	Goto See
  Rush:
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
	TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostA",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI A 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostB",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI B 1 Bright A_Chase
	TNT1 A 0 A_SpawnItem("HumanishStep",0,0,0,0)
    TNT1 A 0 A_SpawnItem("CBoysFireSpawner",0,0,0,0)
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostC",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI C 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI D 1 Bright A_Chase
	TNT1 A 0 A_SpawnItemEx("CorruptedannhilatorimpGhostD",0,0,0,0,0,0,0,SXF_CLIENTSIDE|SXF_NOCHECKPOSITION)
	CATI D 1 Bright A_Chase
	TNT1 A 0 A_Jump(30,"Teleport")
  	TNT1 A 0 A_Jump(46,"Evade")
	TNT1 A 0 A_Jump(84,"See")
    Loop
  Teleport:
	CATI A 1 Bright A_UnSetShootable
	CATI AAAA 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	CATI AAAAAAAAAA 1  A_FadeOut(0.1,0)
	CATI A 2 
	CATI AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
	CATI AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 0 A_Wander
    CATI A 1 A_PlayWeaponSound("boss/teleport")
	CATI AAAA 0 A_SpawnItem("BHellionSmokeSpawner",0,0,0,0)
	CATI AAAAAAAAAA 1 A_FadeIn(0.1)
    CATI A 1 Bright A_SetShootable
	Goto See
  Melee:
	TNT1 A 0 A_Jump(128,"Melee2")
    CATI F 3 A_FaceTarget
    CATI E 3 A_MeleeAttack
	CATI F 3 A_FaceTarget
    Goto See
  Melee2:
    CATI F 3 A_FaceTarget
    CATI G 3 A_MeleeAttack
	CATI F 3 A_FaceTarget
    Goto See 
 Lunge:
	TNT1 A 0 A_JumpIfCloser(300,1)
	Goto See
	TNT1 A 0 A_PlaySound("weapons/fistwiff")
	CATI EF 5 A_FaceTarget
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,1)
	TNT1 A 0 ThrustThingZ(0,25,0,1)
	CATI G 2 A_Recoil(-30)
	CATI G 3 A_CustomMissile("LFLunge",18,0,0,CMF_AIMDIRECTION)
	CATI G 3 
	CATI F 2 A_ScaleVelocity(0.2)
	TNT1 A 0 A_ChangeFlag(SLIDESONWALLS,0)
	CATI E 1 A_ScaleVelocity(0)
	Goto See
  Missile:
    TNT1 A 0 A_SetShootable
    TNT1 A 0 A_UnsetInvulnerable
    TNT1 A 0 A_SetTranslucent(1)
    TNT1 A 0 A_Jump(96,2)
    TNT1 A 0 A_JumpIfCloser(300,"ASG")
	TNT1 A 0 A_JumpIfCloser(250,"Lunge")
    TNT1 A 0 A_Jump(140,"LightMachineGun","LegCannon","MiniRockets","ExpLasers")
  Normal:
	TNT1 A 0 A_PlaySound("weapons/charge15k")
    CATI EE 6 A_FaceTarget
    CATI W 10 Bright A_CustomMissile("CorruptedImp10kBall",39,-10,Random(2,-2)) 
	CATI F 5 A_FaceTarget
	CATI G 6 A_FaceTarget
    CATI V 10 Bright A_CustomMissile("CorruptedImp10kBall",39,10,Random(2,-2)) 
	CATI G 5
	Goto See
  LightMachineGun:
    CATI G 10 A_FaceTarget
	TNT1 A 0 A_CustomMissile("CImpExplosiveTracer",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing",0,-12,36,Random(2,6),0,Random(1,3),Random(-80,-90),128)
	TNT1 A 0 A_CustomBulletAttack(42.5,14,1,Random(10,20)*3,"LegModdedBulletPuff")
    CATI V 2 Bright A_PlaySoundEx("weapons/LMGFire","Weapon")
    CATI G 4 A_FaceTarget
	TNT1 A 0 A_CustomMissile("CImpExplosiveTracer",Random(28,34),0,Random(6,-6),0)
    TNT1 A 0 A_SpawnItemEx("LegRifleCasing",0,-12,36,Random(2,6),0,Random(1,3),Random(-80,-90),128)
	TNT1 A 0 A_CustomBulletAttack(42.5,14,1,Random(10,20)*3,"LegModdedBulletPuff")
    CATI V 2 Bright A_PlaySoundEx("weapons/LMGFire","Weapon")
    CATI G 4 A_FaceTarget
    TNT1 A 0 A_CPosRefire
	Goto LightMachineGun+1
  ASG:
    CATI E 8 A_FaceTarget
	CATI E 8 A_FaceTarget
	TNT1 A 0 A_SpawnItemEx("CorruptShellCasing",0,-12,36,Random(2,6),0,Random(1,3),Random(80,90),128)
	TNT1 A 0 A_CustomMissile("PulsePlasmaBallEnemy",Random(28,34),0,Random(6,-6),0)
	TNT1 A 0 Bright A_CustomMissile("PulseFlareSpawn",Random(28,34),0,-5,0)
	CATI W 4 Bright A_PlaySoundEx("Weapons/pulasshotgun/fire","Weapon")
    TNT1 A 0 A_SpidRefire
	Goto ASG+1
  LegCannon:
    TNT1 A 0 A_PlayWeaponSound("Weapons/dbfgcharge2")
    CATI E 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("Weapons/dbfgfire2")
	CATI EE 3 Bright A_FaceTarget
    CATI W 3 Bright A_CustomMissile("CorruptedImpRevBall",39,-10,0,0)
    CATI EE 3 Bright A_FaceTarget
    CATI W 3 Bright A_CustomMissile("CorruptedImpRevBall",39,-10,0,0)
    CATI EE 3 Bright A_FaceTarget
    CATI W 3 Bright A_CustomMissile("CorruptedImpRevBall",39,-10,0,0)
    CATI EE 3 Bright A_FaceTarget
    CATI W 3 Bright A_CustomMissile("CorruptedImpRevBall",39,-10,0,0)
    CATI EE 3 Bright A_FaceTarget
    TNT1 A 0 A_Jump(128,1)
    Goto See
  LegCannon2:
    TNT1 A 0 A_PlayWeaponSound("Weapons/dbfgcharge2")
    CATI F 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("Weapons/dbfgfire2")
	CATI GG 3 Bright A_FaceTarget
    CATI V 3 Bright A_CustomMissile("CorruptedImpRevBall",39,10,0,0)
    CATI GG 3 Bright A_FaceTarget
    CATI V 3 Bright A_CustomMissile("CorruptedImpRevBall",39,10,0,0)
    CATI GG 3 Bright A_FaceTarget
    CATI V 3 Bright A_CustomMissile("CorruptedImpRevBall",39,10,0,0)
    CATI GG 3 Bright A_FaceTarget
    CATI V 3 Bright A_CustomMissile("CorruptedImpRevBall",39,10,0,0)
    CATI GG 3 Bright A_FaceTarget
    Goto See
  MiniRockets:
    CATI E 4 Bright A_FaceTarget
    CATI W 3 Bright A_CustomMissile("CorruptedImpRocket",39,-10,0,0)
	CATI E 4 Bright A_FaceTarget
    CATI W 3 Bright A_CustomMissile("CorruptedImpRocket",39,-10,0,0)
	CATI E 4 Bright A_FaceTarget
    CATI W 3 Bright A_CustomMissile("CorruptedImpRocket",39,-10,0,0)
    CATI F 4 Bright A_FaceTarget
    CATI G 4 Bright A_FaceTarget
    CATI V 3 Bright A_CustomMissile("CorruptedImpRocket",39,10,0,0)
	CATI G 4 Bright A_FaceTarget
    CATI V 3 Bright A_CustomMissile("CorruptedImpRocket",39,10,0,0)
	CATI G 4 Bright A_FaceTarget
    CATI V 3 Bright A_CustomMissile("CorruptedImpRocket",39,10,0,0)
    Goto See
  ExpLasers:
	CATI E 10 A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail")
	CATI W 3 Bright A_CustomMissile("CorruptedImpRail",39,-10,frandom(2,-2))
	CATI E 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail")
	CATI W 3 Bright A_CustomMissile("CorruptedImpRail",39,-10,frandom(2,-2))
	CATI E 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail")
	CATI W 3 Bright A_CustomMissile("CorruptedImpRail",39,-10,frandom(2,-2))
	CATI E 4 Bright A_FaceTarget
	TNT1 A 0 A_PlaySound("monsters/darkcyberrail")
	CATI W 3 Bright A_CustomMissile("CorruptedImpRail",39,-10,frandom(2,-2))
	CATI E 4 Bright A_FaceTarget
    Goto See
  Pause:
	CATI EEEEE 3 Bright
	Goto See
  Pause2:
	CATI GGGGG 3 Bright
	Goto See
  Pain:
    TNT1 A 0 A_Jump(128,"PainMissile")
    CATI H 2 Bright
    CATI H 2 Bright A_Pain
	Goto See
  PainMissile:
    CATI H 2 Bright
    CATI H 2 Bright A_Pain
	Goto Missile
  XDeath:
  Death:
	CATI H 20 A_StopSound(6)
	CATI J 0 A_PlaySound("Gore/Splat")
    CATI K 8 Bright A_CustomMissile("BlueCardRocketExplosion", random(10,60), random(30,-30), random(0,360), 2, random(0,360))  
	CATI K 0 A_Scream
    CATI L 6 Bright A_CustomMissile("BlueCardRocketExplosion", random(10,60), random(30,-30), random(0,360), 2, random(0,360))  	
    CATI M 6 A_NoBlocking
	CATI M 0 Bright A_CustomMissile("BlueCardRocketExplosion", random(10,60), random(30,-30), random(0,360), 2, random(0,360))  
    CATI M -1
	Stop
    }
}

ACTOR CorruptedannhilatorimpGhostA
{
Scale 1.15
Radius 20
Height 56
Speed 0
Alpha 0.7
PROJECTILE
RENDERSTYLE Translucent
+CLIENTSIDEONLY
+NOINTERACTION
+NOTIMEFREEZE
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    CATI A 2 A_FadeOut(0.10)
    Wait
    }
}

ACTOR CorruptedannhilatorimpGhostB : CorruptedannhilatorimpGhostA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    CATI B 2 A_FadeOut(0.10)
    Wait
    }
}

ACTOR CorruptedannhilatorimpGhostC : CorruptedannhilatorimpGhostA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    CATI C 2 A_FadeOut(0.10)
    Wait
    }
}

ACTOR CorruptedannhilatorimpGhostD : CorruptedannhilatorimpGhostA
{   
States
{
  Spawn:
    TNT1 A 0
    TNT1 A 1 A_JumpIf(ACS_ExecuteWithResult(304) == 1,"NULL")
    CATI D 2 A_FadeOut(0.10)
    Wait
    }
}

Actor CImpExplosiveTracer : BlueSentientExplosiveTracer
{
Species "Imps"
DamageType "DBFG2"
States
{
  Spawn:
	TRC5 A 1 Bright
	Loop
  Death:
	TNT1 A 0
	TNT1 A 0 A_SetTranslucent(0.75,1)
	TNT1 A 0 A_SpawnItem("BlueSentientExplosiveEffect")
	BCRC C 4 Bright A_Explode(Random(5,10)*3,72)
	BCRC DE 3 Bright
	Stop
	}
}

ACTOR CorruptedImp10kBall : T3DBFG10KBall
{
Species "Imps"
DamageType "DBFG2"
}

Actor CorruptedImpRail : BlueCyberRail
{
Species "Imps"
DamageType "DBFG2"
}

ACTOR CorruptedImpRocket : BlueCardinalRocket
{
Species "Imps"
DamageType "DBFG2"
}

Actor CorruptedImpRevBall //Which i could be using it for corrupted revenant in the future updates ;D
{
    Radius 8
    Height 8
    Speed 42
    Damage 75
	Species "Imps"
	DamageType "ImpComet"
    Scale 1.5
    PROJECTILE
    RENDERSTYLE ADD
    +SPAWNSOUNDSOURCE
	+SEEKERMISSILE
    +NOTIMEFREEZE
    ALPHA 0.8
    SeeSound "lrball1/shot"
    DeathSound "lrball1/exp"
    Damagetype "CadaverRocket"
    Decal CacoScorch
    States
    {
	Spawn:
		TNT1 A 0
		TNT1 A 0 A_Jump(128,"Homing")	
    Normal:
        CSTA ABCD 2 A_CustomMissile("CorruptedRevBallFX",0,0,0,0)
        Loop
    Homing:
	    TNT1 A 0 A_SeekerMissile(15,0)
        CSTA A 2 A_CustomMissile("CorruptedRevBallFX",0,0,0,0)
	    TNT1 A 0 A_SeekerMissile(15,0)
        CSTA B 2 A_CustomMissile("CorruptedRevBallFX",0,0,0,0)
	    TNT1 A 0 A_SeekerMissile(15,0)
        CSTA C 2 A_CustomMissile("CorruptedRevBallFX",0,0,0,0)
	    TNT1 A 0 A_SeekerMissile(15,0)
        CSTA D 2 A_CustomMissile("CorruptedRevBallFX",0,0,0,0)		
        Loop	
    Death:
	    CSTA ABCD 4
		TNT1 A 0 A_Explode(48,64,0) 
		TNT1 A 0 A_PlaySound("weapons/clrocketexplode")
	    TNT1 A 0 A_SpawnItemEx("BlueBFGShockwave", 0, 0, 15, 0, 0, 0, 0, 128)
        TNT1 A 20 A_SpawnItem("BlueParticleSpawner",0,-10)
		CSTA E 3 Bright A_BFGSpray("BlueKaboom3")
        CSTA FGHIJKLMNO 3
        Stop
    }
}

Actor CorruptedRevBallFX
{   
   Radius 2
   Height 2
   Speed 0
   PROJECTILE
   RENDERSTYLE ADD
   +CLIENTSIDEONLY
   +NOTIMEFREEZE
   Scale 0.9
   ALPHA 0.67
   States
   {
   Spawn:
	  TNT1 A 0
      TNT1 A 0 A_JumpIf(ACS_ExecuteWithResult(304) == 1, "Toaster")
	  TNT1 A 1
      CT4R PQ 4 Bright A_FadeOut(0.1)
      Loop
   Toaster:
    TNT1 A 0
	Stop	  
   }
}
