ACTOR FormerAdmiral
{
  Obituary "%o was assassinated by a Former Admiral."
  Health 500
  Radius 20
  Height 56
  Mass 500
  Speed 16
  Painchance 50
  Seesound "FormerAdmiral/Sight"
  Painsound "FormerAdmiral/Pain"
  Deathsound "FormerAdmiral/Death"
  Activesound "FormerAdmiral/Active"
  DropItem "PortableMedkit" 200
  DropItem "ArmorPlate" 200
  DropItem "HandGrenadeAmmo" 225 1
  DropItem "MineAmmo" 125 1
  DropItem "AmmoPack" 125
  DropItem "BulletMag" 256 10
  DropItem "BulletBox" 128
  DropItem "Explosive Minigun" 200 1
  DropItem "Beacon" 128 1
  Scale 1.25
  Species "SpecOps"
  MONSTER
  +DONTMORPH
  +DONTHURTSPECIES
  +FLOORCLIP
  +QUICKTORETALIATE
  +SHORTMISSILERANGE 
  States
  {
  Spawn:
    TNT1 A 0
	TNT1 A 0 A_StopSound(7)
	BPO0 A 10 A_Look
	Loop
  See:
	TNT1 A 0 A_StopSound(7)
	BPO0 AABB 3 A_Chase
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	BPO0 CCDD 3 A_Chase
    TNT1 A 0 A_SpawnItem("FootStep",0,0,0,0)
	Loop
  Missile:
	TNT1 A 0
	TNT1 A 0 A_Jump(125,"Rocket")
	TNT1 A 0 A_Jump(100,"Beacon")
	TNT1 A 0 A_Jump(220,"Chaingun")
    TNT1 A 0 A_Playsound("FormerAdmiral/Attack")
  Chaingun:
	BPO0 HKHKH 4 A_GiveInventory("FormerAdmiralStrafe",1)
	TNT1 A 0 A_JumpIfTargetinLOS("ContinueShooting")
	BPO0 H 3 A_GiveInventory("FormerAdmiralStrafe",1)
	TNT1 A 0 A_JumpIfTargetinLOS("ContinueShooting")
	BPO0 K 3 A_GiveInventory("FormerAdmiralStrafe",1)
	TNT1 A 0 A_JumpIfTargetinLOS("ContinueShooting")
	TNT1 A 0 A_MonsterRefire(200,"See")
	Goto Chaingun+5
  ContinueShooting:
	TNT1 A 0 A_PlaySound("sentient/fire")
	TNT1 A 0 A_GiveInventory("FormerAdmiralStrafe",1)
	BPO0 F 4 Bright A_CustomMissile("MinigunnerExplosiveTracer",Random(30,34),0,Random(5,-5),0)
	TNT1 A 0 A_PlaySound("sentient/fire")
	TNT1 A 0 A_GiveInventory("FormerAdmiralStrafe",1)
	BPO0 E 4 Bright A_CustomMissile("MinigunnerExplosiveTracer",Random(30,34),0,Random(5,-5),0)
	TNT1 A 0 A_MonsterRefire(150,"See")
	Loop
  Rocket:
	TNT1 A 0 A_Jump(100,"Rocket3")  
	BPO0 H 8 A_FaceTarget
	BPO0 J 4
	BPO0 I 4 BRIGHT A_CustomMissile("NewRocket",40,16,0,0)
	BPO0 H 1 A_CPosRefire
	Goto See
  Rocket3:
    TNT1 A 0 A_Playsound("FormerAdmiral/Attack")
	BPO0 H 8 A_FaceTarget
	BPO0 J 8
	BPO0 I 4 BRIGHT A_CustomMissile("NewRocket",40,16,0,0)
	BPO0 H 2 A_FaceTarget
	BPO0 J 4
	BPO0 I 4 BRIGHT A_CustomMissile("NewRocket",40,16,0,0)
	BPO0 H 2 A_FaceTarget
	BPO0 J 4
	BPO0 I 4 BRIGHT A_CustomMissile("NewRocket",40,16,0,0)	
	Goto See    
  Beacon:
    BPO0 H 20 A_SpawnItem("ActiveFormerBeacon")
	Goto See
  Pain: 
	BPO0 G 3
	BPO0 G 3 A_Pain
	Goto See
  Death:
	BPO0 G 4   
	TNT1 A 0 A_Scream    
	BPOX ABCDE 7 
	TNT1 A 0 A_NoBlocking
	TNT1 A 0 A_SpawnItemEx("GibbedGenerator",0,0,0,0,0,0,0,128,0)
	BPOX FFGG 4 BRIGHT A_CustomMissile("Kaboom17", Random(10,50), 0, random(0,360), 2, random(0,360))
	BPOX H 6 BRIGHT
	BPOX I -1
	Stop
 }
}

actor ActiveFormerBeacon
{
  -SOLID
  -SHOOTABLE
  States
  {
  Spawn:
    BEAC A 105
    BEAC A 0 A_CustomMissile ("TeleportFog", 0, 0, 0, 0, 0)
    BEAC A 0 A_SpawnItemEx ("SpecOpsMachinegunner", 0, 0, 8, 0, 0, 0, 0, 1)
    BEAC A 105
    BEAC A 0 A_CustomMissile ("TeleportFog", 0, 0, 0, 0, 0)
    BEAC A 0 A_SpawnItemEx ("SpecOpsShotgunner", 0, 0, 8, 0, 0, 0, 0, 1)
    BEAC A 105
    BEAC A 0 A_CustomMissile ("TeleportFog", 0, 0, 0, 0, 0)
    BEAC A 0 A_SpawnItemEx ("SpecOpsRailgunner", 0, 0, 8, 0, 0, 0, 0, 1)
    BEAC A 105
    goto Death
  Death:
    TNT1 A 1 A_CustomMissile ("TeleportFog", 0, 0, 0, 0, 0)
    stop
  }
}

Actor FormerAdmiralStrafe : LegZombieStrafing
{
  -NOTIMEFREEZE
  States
  {
  Pickup:
    NULL A 1 
	NULL A 1 A_Jump(188,2)
	NULL A 1 A_GiveInventory("LegZombieJumping",1)
	NULL A 1 A_JumpIf(velx != 0 || vely != 0,2)
	NULL A 1 A_Jump(256,2)
	NULL A 1 A_Jump(235,5)
	NULL A 1 A_JumpIfInventory("LegZombieStrafeSens",1,3)
	NULL A 1 A_GiveInventory("LegZombieStrafeSens",1)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 A_TakeInventory("LegZombieStrafeSens",1)
	NULL A 1 A_JumpIfInventory("LegZombieStrafeSens",1,3)
	NULL A 1 ThrustThing(angle*256/360+38.7,3,0,0)
	NULL A 1 A_Jump(256,2)	
	NULL A 1 ThrustThing(angle*256/360+38.7,-3,0,0)
    NULL A 1 A_FaceTarget
	NULL A 1 A_Jump(24,2)
	NULL A 1 A_JumpIfCloser(300,2)
	NULL A 1 A_Recoil(-1)
    Stop
	NULL A 1 A_Recoil(1)
    Stop	
  }
}