
// HEAVY REVENANT
//
ACTOR RLCyberneticRevenant : RLRevenantBase 16547
{
  Health 340
  GibHealth -75
  
  MeleeThreshold 160
  
  DamageFactor "Bullet", 0.75
  DamageFactor "Fire", 0.50
  
  SeeSound "heavyrevenant/sight"
  ActiveSound "heavyrevenant/active"
  PainSound "heavyrevenant/pain"
  DeathSound "heavyrevenant/death"
  
  Obituary "%o was tracked relentlessly by a Heavy Revenant."
  HitObituary "%o was tysoned by a Heavy Revenant."
  Tag "Heavy Revenant"
    //$category "MP Technophobia"
  
	// Guncaster compatibility
	DropItem "Ruby"
	DropItem "Ruby"
  States
  {
  Spawn:
    CREV AB Random(9,10) A_Look
    Loop
	
  See:
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseA")
    CREV AA 3 A_Chase
    Goto SeeB
  SeeB:
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseB")
    CREV BB 3 A_Chase
    Goto SeeC
  SeeC:
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseC")
    CREV CC 3 A_Chase
    Goto SeeD
  SeeD:
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseD")
    CREV DD 3 A_Chase
    Goto SeeE
  SeeE:
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseE")
    CREV EE 3 A_Chase
    Goto SeeF
  SeeF:
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseF")
    CREV FF 3 A_Chase
    Goto See
  ChaseA:
    CREV AA 4 A_Chase ("Melee", "")
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseB")
    Goto SeeB
  ChaseB:
    CREV BB 4 A_Chase ("Melee", "")
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseC")
    Goto SeeC
  ChaseC:
    CREV CC 4 A_Chase ("Melee", "")
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseD")
    Goto SeeD
  ChaseD:
    CREV DD 4 A_Chase ("Melee", "")
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseE")
    Goto SeeE
  ChaseE:
    CREV EE 4 A_Chase ("Melee", "")
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseF")
    Goto SeeF
  ChaseF:
    CREV FF 4 A_Chase ("Melee", "")
    TNT1 A 0 A_JumpIfInventory("RLCyberneticRevenantMissileToken", 1, "ChaseA")
    Goto See
	
  MeleeProper:
    CREV G 1 A_FaceTarget
    TNT1 A 0 A_PlaySound("skeleton/swing", CHAN_VOICE)
    CREV G 6 A_FaceTarget
    CREV H 6 A_FaceTarget
    CREV I 6 A_CustomBulletAttack (0, 0, 1, (8 * random(1, 10)), "RLEnemyRevenantBluntMeleePuff", 50, CBAF_NORANDOM | CBAF_AIMFACING)
//    CREV I 6 A_CustomMeleeAttack (8 * random(1, 10), "skeleton/melee", "", "Melee")
    Goto See
	
  MissileProper:
    TNT1 A 0 A_PlaySound("heavyrevenant/target", 5, 0.7, 0, 1.2)
    CREV SRSRSRSR 1 A_FaceTarget
    TNT1 A 0 A_PlaySound("heavyrevenant/target", 5, 0.7, 0, 1.2)
    CREV SRSRSRSR 1 A_FaceTarget
    TNT1 A 0 A_PlaySound("heavyrevenant/target", 5, 0.7, 0, 1.2)
    CREV SRSRSRSR 1 A_FaceTarget
    TNT1 A 0 A_PlaySound("heavyrevenant/targetlocked", 5, 1, 0, 1.1)
    CREV SRSR 1 A_FaceTarget
    TNT1 A 0 A_GiveInventory("RLCyberneticRevenantMissileToken", 1)
    TNT1 A 0 A_CheckFlag ("FRIENDLY", "SummonMissile") // Friendly monsters do not harm you
    TNT1 A 0 A_CustomMissile("RLCyberneticRevenantMissile", 52, 14, 0)
    CREV J 10 Bright A_FaceTarget
    CREV K 20
    Goto See
	
  SummonMissile:
    TNT1 A 0 A_CustomMissile("RLSummonCyberneticRevenantMissile", 52, 14, 0)
    CREV J 10 Bright A_FaceTarget
    CREV K 20
    Goto See
	
  PainMain:
    CREV L 5
    CREV L 5 A_Pain
    Goto See
	
  DeathMain:
    TNT1 A 0 A_GiveInventory ("RLCyberneticRevenantKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    CREV LM 7
    CREV N 7 A_Scream
    CREV O 7 A_NoBlocking
    TNT1 A 0 A_SpawnItem ("RLBodyThud", 0, 0, 0, 0)
    CREV P 7
    CREV Q 0
    "####" "#" 0 A_Jump(256, "DeathEnd")
    Goto DeathEnd
  DeathFrame:
    CREV Q 0
    "####" "#" 0 A_Jump(256, "DeathEnd")
    Goto DeathEnd
	
  XDeathMain:
    TNT1 A 0 A_GiveInventory ("RLCyberneticRevenantKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    REV2 A 4
    REV2 B 4 A_XScream
    REV2 C 4 A_NoBlocking
    REV2 D 4
    TNT1 A 0 A_SpawnItem ("RLGibThud", 0, 0, 0, 0)
    REV2 E 4
    REV2 F 0
    "####" "#" 0 A_Jump(256, "XDeathEnd")
    Goto XDeathEnd
  SimpleXDeathMain:
    TNT1 A 0 A_GiveInventory ("RLCyberneticRevenantKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    REV2 A 4
    REV2 B 4 A_XScream
    REV2 C 4 A_NoBlocking
    REV2 D 4
    REV2 E 4
    REV2 F 0
    "####" "#" 0 A_Jump(256, "XDeathEnd")
    Goto XDeathEnd
	
	//Ice
  GenericFreezeDeath:
	"####" "#" 0 A_GiveInventory ("RLCyberneticRevenantKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    "####" "#" 0 A_Jump(256, "GenericFreezeMana")
    Goto GenericFreezeMana
	
  Raise:
	TNT1 A 0 ACS_NamedExecuteAlways("DRLA_Normalization") // Removes any palette abnormalities
	TNT1 A 0 A_SetScale(1) // resets altered enemies to default, make sure to match the scale factor in properties here!
    TNT1 A 0 A_ChangeFlag ("NOBLOCKMAP", 0)
    TNT1 A 0 A_ChangeFlag ("NOPAIN", 1)
    CREV Q 2
    TNT1 A 0 A_ChangeFlag ("NOPAIN", 0)
    TNT1 A 0 A_JumpIfInventory ("RLNightmareResurrectionToken", 1, "NightmareRaise")
    TNT1 A 0 A_JumpIfInventory ("RLCyberneticResurrectionToken", 1, "CyberneticRaise")
    TNT1 A 0 A_SpawnItemEx ("RLResurrectionFire", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION) 
  RaiseContinue:
    TNT1 A 0 A_ChangeFlag ("NOPAIN", 0)
    CREV QPONML 5
    Goto See
  NightmareRaise:
    TNT1 A 0 A_SpawnItemEx ("RLNightmareResurrectionFire", 0, 0, 0, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    Goto RaiseContinue
  CyberneticRaise:
    TNT1 A 0 A_SpawnItemEx ("RLCyberneticResurrectionSparks", 0, 0, 20, 0, 0, 0, 0, SXF_NOCHECKPOSITION)
    Goto RaiseContinue
	
  CrushDRLA:
    TNT1 A 30 A_SpawnItemEx("RLCrushedSmall",0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION)
    "####" "#" 0 A_Jump(256, "CrushEnd")
    Goto CrushEnd
//==============================================================================
//					--	DOOMRL ARSENAL STUFF  --
//==============================================================================
  Pain.RigelBlast:
    TNT1 A 0 A_PlaySound("weapons/dn2gunhit", CHAN_BODY)
    D2F2 M 2 Bright
    Goto See
  Pain.NeuralStun:
    D2F2 M 2 Bright
    Goto See
  Pain.CyberDisruptor:
    TNT1 A 0
    Goto Pain.LightningBlue
	
  Death.NeuralStun:
    TNT1 A 0
    Goto Death
  Death.RigelBlast:
    TNT1 A 0 A_GiveInventory ("RLDuke2Score", 800, AAPTR_TARGET)
    TNT1 A 0 A_GiveInventory ("RLCyberneticRevenantKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    TNT1 A 0 A_PlaySound("weapons/dn2gunexplosion", CHAN_BODY)
    TNT1 A 0 A_NoBlocking
    TNT1 A 0 A_SpawnItemEx ("RLDuke2BasicEnemyExplosions", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION)
    TNT1 A 35
    Stop
  XDeath.RigelBlast:
	TNT1 A 0 A_JumpIf(CallACS("DRLA_Gibs"), 1)
	Goto Death.RigelBlast
    TNT1 A 0 A_GiveInventory ("RLDuke2Score", 800, AAPTR_TARGET)
    TNT1 A 0 A_GiveInventory ("RLCyberneticRevenantKillIncrementer", 1, AAPTR_PLAYER1) // Used for tallying total kills and bestiary info
    TNT1 A 0 A_PlaySound("weapons/dn2gungib", CHAN_BODY)
    TNT1 A 0 A_NoBlocking
    TNT1 A 0 A_SpawnItemEx ("RLDuke2BasicEnemyExplosions", 0,0,0, 0,0,0, 0, SXF_NOCHECKPOSITION)
    TNT1 A 0 A_SpawnItemEx ("RLDuke2RedGibber", 0,0,0, VelX,VelY,VelZ, 0, SXF_ABSOLUTEMOMENTUM | SXF_NOCHECKPOSITION)
    TNT1 A 35
    Stop
	
//==============================================================================
//					--	Special Monster Attacks  --
//==============================================================================

//==============================================================================
//					--	Final Doomer Compatibility Stuff  --
//==============================================================================
  DeathXSparkFrame:
    "####" "#" 0 A_JumpIfInTargetInventory("Mana",0,2)
    "####" "#" 0 A_DropItem("MajorManaPod",-1,54)
    CREV L 0
    "####" "#" 0 A_Jump(256, "DeathXSpark")
	Goto DeathXSpark
	
//==============================================================================
//					--	Guncaster Compatibility Stuff  --
//==============================================================================
	MidasFrame1:
		CREV L 0 A_SpawnItemEx("Midas_Statue_Agitation", 0,0,0, 0,0,0, 0,SXF_TRANSFERPOINTERS|SXF_TRANSFERSPRITEFRAME)
		TNT1 A 0 A_JumpIf(1, "DestroyedEnd")
		Goto DestroyedEnd
	MidasFrame2:
		CREV L 0 A_SpawnItemEx("Midas_Statue_Agitation", 0,0,0, frandom(-10.0,-12.0),0,frandom(1.0,3.0), 0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSPRITEFRAME)
		TNT1 A 10 A_KillChildren
		TNT1 A 0 A_JumpIf(1, "DestroyedEnd")
		Goto DestroyedEnd
	MidasFrame3:
		CREV L 0 A_SpawnItemEx("Midas_Statue_Agitation", 0,0,0, frandom(-15.0,-20.0),0,frandom(10.0,15.0), 0,SXF_TRANSFERPOINTERS|SXF_SETMASTER|SXF_TRANSFERSPRITEFRAME)
		TNT1 A 10 A_KillChildren
		TNT1 A 0 A_JumpIf(1, "DestroyedEnd")
		Goto DestroyedEnd
		
	//Gumpop
	Death.Acid:
		CREV L 1 A_ChangeFlag("SOLID",0)
		"####" "#" 1 A_Playsound("Gumpop/Expand",5)
		"####" "###################################" 1 A_SetScale(ScaleX+frandom(0.01,0.025))
		"####" "#" 1 A_Playsound("Gumpop/Pop",5)
		"####" "#" 0 A_Jump(256,"XDeathMain")
		Goto XDeathMain
		
	//Thunderstruck
	Pain.Lightning:
		"####" "#" 0 A_Jump(164,1)
		Goto Pain
		CREV L 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
		"####" "#" 0 A_Jump(256,"LightningLock")
		Goto LightningLock
		
	//Cauterizer
	Pain.LightningBlue:
		"####" "#" 0 A_Jump(48,1)
		Goto Pain
		CREV L 0 A_ChangeFlag("NOPAIN",1)
		"####" "#" 0 A_SetUserVar("User_LightningLock", User_LightningLock + 10)
		"####" "#" 0 A_Jump(256,"BlueLightningLock")
		Goto BlueLightningLock
  }
}

ACTOR RLCyberneticRevenantMissile : RLRevenantMissile
{
   +THRUGHOST
   +SEEKERMISSILE
   +SCREENSEEKER
   +DONTSEEKINVISIBLE
   +NOTIMEFREEZE
   +DONTREFLECT
   +BLOODSPLATTER
   RenderStyle Normal
   Speed 12
   DamageType "Fire"
   PainType "Explosion"
   DeathType "Explosion"
   SeeSound "heavyrevenant/fire"
   DeathSound "rlmonsters/mediumexp"
  States
  {
  Spawn:
    TNT1 A 0
    TNT1 A 0 A_PlaySound("heavyrevenant/loop", CHAN_BODY, 0.6, 1, 1.2)
    TNT1 A 0 A_SpawnItemEx ("RLCyberneticRevenantMissileTrail", 16, 0, 0, 0, 0, 0, 180, SXF_NOCHECKPOSITION)
    TNT1 A 0 A_JumpIfTracerCloser (192, 4)
    TNT1 A 0 A_JumpIfInventory ("RLCyberneticRevenantMissileLoopToken", 1, "AfterClose")
  AfterCloseFinish:
    PPSR A 1 Bright A_FaceTracer (5, 5)
    TNT1 A 0 A_Jump (256, 3)
    TNT1 A 0 A_GiveInventory ("RLCyberneticRevenantMissileLoopToken", 1)
    PPSR A 1 Bright A_FaceTracer (1, 1)
    TNT1 A 0 A_SeekerMissile (0, 0, SMF_LOOK | SMF_PRECISE | SMF_CURSPEED)
    TNT1 A 0 A_JumpIfTracerCloser (128, "Beep1")
    TNT1 A 0 A_JumpIfTracerCloser (256, "Beep2")
    TNT1 A 0 A_JumpIfTracerCloser (384, "Beep3")
    TNT1 A 0 A_JumpIfTracerCloser (512, "Beep4")
    TNT1 A 0 A_JumpIfTracerCloser (640, "Beep5")
    TNT1 A 0 A_JumpIfTracerCloser (768, "Beep6")
    TNT1 A 0 A_JumpIfTracerCloser (896, "Beep7")
    TNT1 A 0 A_JumpIfTracerCloser (1024, "Beep8")
    Goto Beep9
  AfterClose:
    TNT1 A 0 A_PlaySound("heavyrevenant/boost", 7, 1)
    TNT1 A 0 A_SpawnItemEx ("RLCyberneticRevenantMissileTrailBlast", 16, 0, 8, 0, 0, 0, 180, SXF_NOCHECKPOSITION)
    TNT1 A 0 A_ScaleVelocity (1.05)
    TNT1 A 0 A_TakeInventory ("RLCyberneticRevenantMissileLoopToken", 1)
    Goto AfterCloseFinish
  Beep1:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep1", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep2:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep2", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep3:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep3", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep4:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep4", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep5:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep5", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep6:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep6", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep7:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep7", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep8:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep8", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Beep9:
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep1", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep2", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep3", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep4", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep5", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep6", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep7", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep8", 1, "Spawn")
    TNT1 A 0 A_JumpIfInventory ("PowerRLHeavyRevenantMissileBeep9", 1, "Spawn")
    TNT1 A 0 A_GiveInventory("PowerRLHeavyRevenantMissileBeep9", 1)
    TNT1 A 0 A_PlaySound ("heavyrevenant/lockon", 5)
    Goto Spawn
  Death:
    TNT1 A 0 A_StopSound(CHAN_BODY)
    TNT1 A 0 A_TakeFromTarget ("RLCyberneticRevenantMissileToken", 1)
    TNT1 A 0 A_SetTranslucent (0.80, 1)
	TNT1 A 0 A_JumpIf(CallACS("DRLA_MonsterQuake") == 0, 3)
    TNT1 A 0 A_Quake(1, 18, 0, 512, "")
    TNT1 A 0 A_Quake(5, 12, 0, 256, "")
    TNT1 A 0 A_Explode (75, 128)
    TNT1 A 0 A_JumpIf(CallACS("GnuCustardCheck"), "GuncasterImpact")
    MEXP A 4 Bright
    MEXP B 4 Bright
    MEXP C 3 Bright
    MEXP D 3 Bright
    MEXP E 2 Bright
    MEXP F 2 Bright
    Stop
	  
  GuncasterImpact:
    TNT1 A 0 A_PlaySound("Matriarch/Hit", 5, 0.8)
    TNT1 A 0 A_PlaySound("Matriarch/Exp", 6, 1.0)
    TNT1 A 0 A_PlaySound("Matriarch/Exp", CHAN_ITEM, 0.05, 0, 0.05)
    TNT1 A 20 A_SpawnItemEx("RLGuncasterMonsterExplosionBig", 0,0,0, 0,0,0, 0, SXF_CLIENTSIDE | SXF_NOCHECKPOSITION)
    Stop
  }
}

ACTOR RLSummonCyberneticRevenantMissile : RLCyberneticRevenantMissile
{
   +MTHRUSPECIES
}

ACTOR PowerRLHeavyRevenantMissileBeep1 : Powerup
{
	Powerup.Duration 6
}

ACTOR PowerRLHeavyRevenantMissileBeep2 : Powerup
{
	Powerup.Duration 9
}

ACTOR PowerRLHeavyRevenantMissileBeep3 : Powerup
{
	Powerup.Duration 12
}

ACTOR PowerRLHeavyRevenantMissileBeep4 : Powerup
{
	Powerup.Duration 15
}

ACTOR PowerRLHeavyRevenantMissileBeep5 : Powerup
{
	Powerup.Duration 18
}

ACTOR PowerRLHeavyRevenantMissileBeep6 : Powerup
{
	Powerup.Duration 21
}

ACTOR PowerRLHeavyRevenantMissileBeep7 : Powerup
{
	Powerup.Duration 24
}

ACTOR PowerRLHeavyRevenantMissileBeep8 : Powerup
{
	Powerup.Duration 27
}

ACTOR PowerRLHeavyRevenantMissileBeep9 : Powerup
{
	Powerup.Duration 30
}

ACTOR RLCyberneticRevenantMissileTrail
{
   Projectile
   Radius 8
   Height 8
   Speed 1
   Scale 0.4
   Damage 0
   RENDERSTYLE ADD
   Alpha 0.75
   +NOCLIP
   +NOINTERACTION
   +NOTONAUTOMAP
   +NOTIMEFREEZE
   States
   {
   Spawn:
   CRES ABCDE 3 A_SetScale (ScaleX+0.2)
   Stop
   }
}

ACTOR RLCyberneticRevenantMissileTrailBlast : RLCyberneticRevenantMissileTrail
{
   Scale 1.1
   Alpha 0.95
   States
   {
   Spawn:
   CRES ABCDE 3 A_SetScale (ScaleX+0.5)
   Stop
   }
}

Actor RLCyberneticRevenantMissileLoopToken : Inventory
{
inventory.maxamount 1
}

Actor RLCyberneticRevenantMissileToken : Inventory
{
inventory.maxamount 1
}

ACTOR RLCyberneticRevenantReborn : RLCyberneticRevenant
{
  +LOOKALLAROUND
  +NOPAIN
  States
  {
  Spawn:
    TNT1 A 0 NoDelay A_JumpIfInventory("RLResurrectionComplete", 1, "SpawnNormal")
    CREV QPONML 5
    TNT1 A 0 A_ChangeFlag("NOPAIN", 0)
    TNT1 A 0 A_GiveInventory("RLResurrectionComplete", 1)
  SpawnNormal:
    CREV BE 10 A_Look
    Loop
  }
}

ACTOR RLDRPGSummonedCyberneticRevenant : RLCyberneticRevenant
{
  -COUNTKILL
  +NOBLOCKMONST
  +NOTELESTOMP
  +NOFEAR
  +SEEINVISIBLE
  +DONTDRAIN
  +ALWAYSFAST
  +QUICKTORETALIATE
  +MISSILEMORE
  +THRUSPECIES
  Species "Player"
  States
  {
  Spawn:
	TNT1 A 0 NoDelay ACS_NamedExecuteAlways("MonsterInit", 0)
    TNT1 A 0 A_GiveInventory ("RLMonsterInitializerToken", 1)
    TNT1 A 0 A_GiveInventory ("DRPGDRLASummonedMonsterToken", 1)
	Goto Super::Spawn
	See:
	TNT1 A 0 ACS_NamedExecuteAlways("MonsterInit", 0)
    TNT1 A 0 A_GiveInventory ("RLMonsterInitializerToken", 1)
    TNT1 A 0 A_GiveInventory ("DRPGDRLASummonedMonsterToken", 1)
	Goto Super::See
  Raise:
    Stop
  }
}

ACTOR RLCCCyberneticRevenant : RLCyberneticRevenant
{
  +TOUCHY
  States
  {
  See:
    CREV AABBCCDDEEFF 3 A_Chase
    Loop
  Melee:
    CREV G 1
    CREV G 6
    CREV H 6
    CREV I 6
    Goto See
  Missile:
    CREV R 2
    CREV S 6
    CREV R 2
    CREV S 6
    CREV R 2
    CREV S 6
    CREV R 4
    CREV J 10 Bright
    CREV K 20
    Goto See
  Death:
    CREV LM 7
    CREV N 7 A_Scream
    CREV O 7 A_NoBlocking
    CREV P 7
    CREV Q -1
    Stop
  }
}
