/* Corridor 7 enemy families. The released maps retain the Wolf/Blake
 * stand/path/difficulty numbering bands, while the artwork lives in the
 * GFXTILES sprite pages named by co7map.txt. */

actor C7Monster : WolfensteinMonster
{
	points 1000
	health 25, 25, 25, 100
	speed 1, 3
	sighttime 1, 5
}

actor C7OrganicEye : C7Monster
{
	// Ailoprobe / ORGANIC EYE (released executable class 3).
	// seesound, not activesound: the capture shows the whine exactly once, on
	// noticing the player, which is where FirstSighting plays seesound.
	seesound "c7/monster/active/class3"
	attacksound "c7/monster/attack/class3"
	deathsound "c7/monster/death/class3"
	points 100
	health 25, 25, 25, 100
	speed 1, 2
	states
	{
		Spawn:
			AILO A -1 NOP A_Look
			stop
		Path:
			AILO ABCD 8 NOP A_Chase
			loop
		See:
			// The alarm is the Ailoprobe's whole job -- it is a sentry that
			// trades lethality for the ability to bring other aliens down on
			// the player ("clear it quickly before it draws traffic"). Raising
			// it only from the attack sequence made a sentry that has seen the
			// player but not yet fired stay silent, so it goes here, on
			// sighting, the same way the Eitak calls for support.
			AILO A 6 NOP A_C7AlienAlarm
			AILO A 6 NOP A_Chase
			AILO BCD 6 NOP A_Chase
			loop
		Missile:
			C119 A 5 A_FaceTarget
			C121 A 5 A_C7AlienAlarm
			C122 A 5 bright
			C123 A 5 bright A_WolfAttack(0, "*", 1.0, 16)
			goto See
		Pain:
			C115 A 5
			goto See
		Death:
			C116 A 0 A_Fall
			C117 A 7 A_Scream
			C118 A -1
			stop
	}
}

actor C7ProbeEye : C7Monster
{
	// Animated Probe / PROBE EYE (class 4).
	seesound "c7/monster/active/class4"
	attacksound "c7/monster/attack/class4"
	deathsound "c7/monster/death/class4"
	points 400
	health 25, 50, 100, 150
	speed 1, 6
	states
	{
		Spawn:
			PROB A -1 NOP A_Look
			stop
		Path:
			// CORR7CD.EXE 39ac:0012..006c: raised A is idle only.
			// Preserve the short thinker-free dwells on B and D as well.
			PROB B 10 NOP A_Chase
			PROB B 2.5
			PROB C 7.5 NOP A_Chase
			PROB D 10 NOP A_Chase
			PROB D 2.5
			PROB E 7.5 NOP A_Chase
			loop
		See:
			// 39ac:00ea..0144, in native 70Hz ticks: 10,3,8,10,3,8.
			PROB B 5 NOP A_Chase
			PROB B 1.5
			PROB C 4 NOP A_Chase
			PROB D 5 NOP A_Chase
			PROB D 1.5
			PROB E 4 NOP A_Chase
			loop
		Missile:
			C286 A 3 A_FaceTarget
			C287 A 10 bright A_WolfAttack(0, "*", 1.0, 12)
			C288 A 5
			goto See
		Pain:
			C283 A 5
			goto See
		Death:
			C280 A 0 A_Fall
			C281 A 6 A_Scream
			C282 A 6
			C284 A 6
			C285 A -1
			stop
	}
}

// Bandor disguise tuning, shared by the four furniture slots below.
//
// A Bandor is supposed to be scenery until the player is on top of it -- the
// guide tells the player to check behind them after walking into a furnished
// room. Left as an ordinary monster it unfolds the moment it sees or hears
// anything, so a shot fired two rooms away turns every chair on the floor into
// an alien before the player has even opened the door, and the ambush never
// happens once.
//
// The original's trigger condition is not documented and no radius survives in
// any source, so this is a deliberate design choice rather than a
// reconstruction: sight and hearing are both capped at four tiles. Beyond that
// it is furniture and stays furniture.
//
// Distances are in the engine's sight units, which are fixed-point times 64 --
// one tile is 65536*64 = 4194304, so four tiles is 16777216. (Compare MINSIGHT
// in wl_state.cpp, which is 1.5 tiles written the same way.)
//
// What this produces in play: facing the player it unfolds at four tiles;
// facing away the field-of-view test holds it until the player is inside the
// automatic close-range radius of 1.5 tiles, so they walk past it and it comes
// up behind them. Both read as an ambush, which is the point.
//
// Deliberately NOT limited: a Bandor killed nearby still calls the others in.
// That path is P_AlertCorridor7MonstersNear, which wakes them directly instead
// of going through the sight check, so the documented loyalty behavior is
// unaffected by the hearing cap.

actor C7Bandor : C7Monster
{
	// The four disguised Bandor slots share this revealed combat body.
	attacksound "c7/monster/attack/class8"
	deathsound "c7/monster/death/class8"
	points 500
	health 25, 25, 50, 100
	dropitem "C7ChargePack", 64
	states
	{
		Spawn:
			TNAJ A -1 NOP A_Look
			stop
		Path:
			TNAJ ABCD 8 NOP A_Chase
			loop
		See:
			TNAJ ABCD 5 NOP A_Chase
			loop
		Missile:
			C182 A 10 A_FaceTarget
			C183 A 10 bright A_WolfAttack(0, "*", 1.0, 56)
			C184 A 5
			C183 A 5 bright A_WolfAttack(0, "*", 1.0, 56)
			C184 A 5
			C183 A 5 bright A_WolfAttack(0, "*", 1.0, 56)
			C184 A 5
			C183 A 5 bright A_WolfAttack(0, "*", 1.0, 56)
			C184 A 5
			goto See
		Pain:
			C176 A 2.5
			goto See
		Death:
			C177 A 0 A_C7AlienAlarm
			C177 A 0 A_Fall
			C177 A 7.5 A_Scream
			C178 A 7.5
			C179 A 7.5
			C181 A -1
			stop
	}
}

actor C7Tenaj : C7Monster
{
	// Native common class 2 (runtime class 5), not the misleading OTRB art alias.
	attacksound "c7/monster/attack/class5"
	deathsound "c7/monster/death/class5"
	points 700
	health 50, 50, 150, 300
	speed 1, 4
	dropitem "C7ChargePack", 96
	states
	{
		Spawn: OTRB A -1 NOP A_Look stop
		Path: OTRB ABCD 7.5 NOP A_Chase loop
		See:
			OTRB A 5 NOP A_Chase("*", "*", CHF_BACKOFF)
			OTRB BCD 5 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			loop
		Missile:
			C340 A 3 A_FaceTarget
			C341 A 10 bright A_WolfAttack(0, "*", 1.0, 32)
			C342 A 5
			C343 A 10
			goto See
		Pain: C338 A 5 goto See
		Death:
			C330 A 0 A_Fall
			C331 A 3.5 A_Scream
			C332 A 3.5
			C333 A 3.5
			C334 A 3.5
			C335 A 3.5
			C336 A 3.5
			C337 A -1
			stop
	}
}

actor C7MorphChair : C7Bandor
{
	// Bandor furniture disguises occupy released classes 8-11.
	attacksound "c7/monster/attack/class8"
	deathsound "c7/monster/death/class8"
	points 500
	health 25, 25, 50, 100
	dropitem "C7ChargePack", 64
	states
	{
		// Four tiles of sight and hearing: furniture until you are close.
		Spawn: C124 A -1 NOP A_Look(0, 0, 16777216, 16777216) stop
		See:
			C125 A 0 A_PlaySound("c7/monster/morph/class8")
			C125 A 5
			C126 A 5
			C127 A 5
			C128 A 5
			goto C7Bandor::See
	}
}

actor C7MorphFile : C7Bandor
{
	attacksound "c7/monster/attack/class8"
	deathsound "c7/monster/death/class8"
	points 500
	health 25, 25, 50, 100
	dropitem "C7ChargePack", 64
	states
	{
		// Four tiles of sight and hearing: furniture until you are close.
		Spawn: C129 A -1 NOP A_Look(0, 0, 16777216, 16777216) stop
		See:
			C130 A 0 A_PlaySound("c7/monster/morph/class8")
			C130 A 5
			C131 A 5
			C132 A 5
			C133 A 5
			goto C7Bandor::See
	}
}

actor C7MorphPlant : C7Bandor
{
	attacksound "c7/monster/attack/class10"
	deathsound "c7/monster/death/class8"
	points 500
	health 25, 25, 50, 100
	dropitem "C7ChargePack", 64
	states
	{
		// Four tiles of sight and hearing: furniture until you are close.
		Spawn: C134 A -1 NOP A_Look(0, 0, 16777216, 16777216) stop
		See:
			C135 A 0 A_PlaySound("c7/monster/morph/class8")
			C135 A 5
			C136 A 5
			C137 A 5
			C138 A 5
			goto C7Bandor::See
	}
}

actor C7MorphBarrel : C7Bandor
{
	attacksound "c7/monster/attack/class8"
	deathsound "c7/monster/death/class8"
	points 500
	health 25, 25, 50, 100
	dropitem "C7ChargePack", 64
	states
	{
		// Four tiles of sight and hearing: furniture until you are close.
		Spawn: C139 A -1 NOP A_Look(0, 0, 16777216, 16777216) stop
		See:
			C140 A 0 A_PlaySound("c7/monster/morph/class8")
			C140 A 5
			C141 A 5
			C142 A 5
			C143 A 5
			goto C7Bandor::See
	}
}

actor C7Rodex : C7Monster
{
	// Rodex: native common class 4 (runtime class 7), fast and cowardly.
	seesound "c7/monster/active/class7"
	attacksound "c7/monster/attack/class7"
	deathsound "c7/monster/death/class7"
	points 700
	health 25, 25, 50, 100
	speed 1, 4
	states
	{
		Spawn:
			RODX A -1 NOP A_Look
			stop
		Path:
			RODX A 7 NOP A_Chase
			RODX BCD 7 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			loop
		See:
			RODX A 5 NOP A_Chase("*", "*", CHF_BACKOFF)
			RODX BCD 5 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			loop
		Missile:
			C233 A 3 A_FaceTarget
			C234 A 10
			C235 A 5 bright A_WolfAttack(0, "*", 1.0, 24)
			C236 A 10
			goto See
		Pain:
			C225 A 3
			C226 A 4
			goto See
		Death:
			C227 A 0 A_Fall
			C228 A 6 A_Scream
			C229 A 6
			C230 A 6
			C231 A 6
			C232 A -1
			stop
	}
}

actor C7Ttocs : C7Monster
{
	// Ttocs: native common class 3 (runtime class 6), slow brute warrior.
	seesound "c7/monster/active/class6"
	attacksound "c7/monster/attack/class6"
	deathsound "c7/monster/death/class6"
	points 700
	health 50, 50, 150, 300
	speed 1, 2
	states
	{
		Spawn:
			TTCS A -1 NOP A_Look
			stop
		Path:
			TTCS ABCD 7 NOP A_Chase
			loop
		See:
			TTCS ABCD 5 NOP A_Chase
			loop
		Missile:
			C392 A 3 A_FaceTarget
			C393 A 10 bright A_WolfAttack(0, "*", 1.0, 32)
			C394 A 5
			C395 A 10
			goto See
		Pain:
			C396 A 5
			goto See
		Death:
			C384 A 0 A_Fall
			C385 A 6 A_Scream
			C386 A 6
			C387 A 6
			C388 A 6
			C389 A 6
			C390 A 6
			C391 A -1
			stop
	}
}

actor C7Eniram : C7Monster
{
	// Native common class 19. C665-C668 are invisible outside infrared;
	// materialization, firing, pain, and death are visible in every visor mode.
	deathsound "c7/monster/death/class22"
	points 1000
	health 50, 50, 200, 500
	states
	{
		Spawn: C665 A -1 NOP A_Look stop
		Path: C665 A 5 NOP A_Chase C666 A 5 NOP A_Chase C667 A 5 NOP A_Chase C668 A 5 NOP A_Chase loop
		See:
			C665 A 5 NOP A_Chase
			C665 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C666 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C667 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C667 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C668 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			loop
		Missile:
			C669 A 0 A_PlaySound("c7/monster/cloak/materialize")
			C669 A 5 A_FaceTarget
			C670 A 5
			C671 A 5
			C672 A 0 A_PlaySound("c7/monster/cloak/fire")
			C672 A 5 bright A_WolfAttack(0, "", 1.0, 32)
			C673 A 5
			C674 A 5
			C675 A 5
			goto See
		Pain:
			C683 A 5
			C683 A 5
			goto See
		Death:
			C684 A 0 A_Fall
			C684 A 5 A_Scream
			C685 A 5
			C686 A 5
			C687 A 5
			C688 A 5
			C689 A -1
			stop
	}
}

actor C7Otrebor : C7Monster
{
	// Native common class 10 (runtime class 13): solitary blaster sub-boss.
	activesound "c7/monster/active/class13"
	attacksound "c7/monster/attack/class13"
	deathsound "c7/monster/death/class13"
	points 700
	health 50, 50, 200, 300
	states
	{
		Spawn: C397 A -1 NOP A_Look stop
		Path: C405 A 10 NOP A_Chase C413 A 7.5 NOP A_Chase C421 A 10 NOP A_Chase C429 A 7.5 NOP A_Chase loop
		See:
			C405 A 5 NOP A_Chase
			C405 A 1.5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C413 A 4 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C421 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C421 A 1.5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C429 A 4 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			loop
		Missile:
			C445 A 10 A_FaceTarget
			C446 A 3
			C447 A 10 bright A_WolfAttack(0, "*", 1.0, 64)
			C448 A 3
			goto See
		Pain: C449 A 5 goto See
		Death:
			C437 A 0 A_Fall
			C438 A 3.5 A_Scream
			C439 A 3.5
			C440 A 3.5
			C441 A 3.5
			C442 A 3.5
			C443 A 3.5
			C444 A -1
			stop
	}
}

actor C7Nerraw : C7Monster
{
	// The unclassified alien introduced on floor 31: small, quick, and lethal.
	attacksound "c7/monster/attack/class17"
	points 1000
	health 25, 25, 50, 100
	speed 1, 6
	states
	{
		Spawn: C574 A 1 NOP A_Look C575 A 1 NOP A_Look loop
		See:
			C576 A 5 NOP A_Chase
			C577 A 5 NOP A_Chase
			C576 A 5 NOP A_Chase
			C577 A 5 NOP A_Chase
			C574 A 5 NOP A_Chase
			C575 A 5 NOP A_Chase
			loop
		Missile:
			C578 A 5 A_FaceTarget
			C579 A 10
			C580 A 5 bright A_WolfAttack(0, "*", 1.0, 112)
			C581 A 5
			goto See
		Pain:
			C582 A 5
			C583 A 5
			goto See
		Death:
			C582 A 0 A_Fall
			C583 A 5 A_Scream
			C584 A 5
			C585 A 5
			C586 A 5
			C587 A 5
			C588 A 5
			C589 A -1
			stop
	}
}

actor C7Eitak : C7Monster
{
	// Native common class 15 (runtime class 18); accurate guards assist packs.
	attacksound "c7/monster/attack/class18"
	deathsound "c7/monster/death/class18"
	points 800
	health 75, 75, 225, 450
	states
	{
		Spawn: EITK A -1 NOP A_Look stop
		Path: EITK ABCD 7.5 NOP A_Chase loop
		See:
			EITK A 5 NOP A_C7AlienAlarm
			EITK A 1.5 NOP A_Chase
			EITK B 4 NOP A_Chase
			EITK C 5 NOP A_Chase
			EITK C 1.5 NOP A_Chase
			EITK D 4 NOP A_Chase
			loop
		Missile:
			C634 A 3 A_FaceTarget
			C635 A 10
			C636 A 5 bright A_WolfAttack(0, "*", 1.0, 36)
			C637 A 10
			goto See
		Pain: C630 A 5 goto See
		Death:
			C630 A 0 A_Fall
			C631 A 3.5 A_Scream
			C632 A 3.5
			C633 A -1
			stop
	}
}

actor C7Semaj : C7Monster
{
	// Native common class 13 (runtime class 16): a melee-only slime.
	deathsound "c7/monster/death/class16"
	points 100
	health 25, 25, 50, 100
	speed 1, 3
	states
	{
		Spawn:
			C561 A 1 NOP A_Look
			C562 A 1 NOP A_Look
			loop
		See:
			C561 A 5 NOP A_Chase
			C561 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C562 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C562 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C561 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C562 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			loop
		Missile:
			C563 A 5 A_FaceTarget
			C564 A 5
			C565 A 5
			C566 A 5 A_MeleeAttack(random(1, 15))
			goto See
		Pain:
			C567 A 5
			C568 A 5
			goto See
		Death:
			C569 A 0 A_Fall
			C569 A 5 A_Scream
			C570 A 5
			C571 A 5
			C572 A 5
			C573 A -1
			stop
	}
}

actor C7Solrac : C7Monster
{
	// Solrac's ordinary red-skull appearances are handled separately by
	// C7SkullApparition. This shootable form is the floor 25/30 boss.
	activesound "c7/monster/active/class20"
	attacksound "c7/monster/attack/class20"
	deathsound "c7/monster/death/class20"
	points 2500
	health 1000, 1500, 3000, 5000
	speed 1, 3
	states
	{
		Spawn:
			C638 A -1 NOP A_Look
			stop
		See:
			C638 A 5 NOP A_Chase("*", "*", CHF_BACKOFF)
			C638 A 1.5 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C639 A 4 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C640 A 5 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C640 A 1.5 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C641 A 4 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			loop
		Missile:
			C642 A 15 A_FaceTarget
			C643 A 0 A_PlaySound("c7/monster/attack/class20")
			C643 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C644 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C643 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C644 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C643 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C644 A 5
			C642 A 5
			goto See
		Pain:
			C645 A 5
			goto See
		Death:
			C645 A 0 A_Fall
			C645 A 7.5 A_Scream
			C646 A 7.5
			C647 A 7.5
			C648 A 7.5
			C649 A 7.5
			C650 A 7.5
			C651 A 7.5
			C652 A -1
			stop
	}
}

actor C7EniramBoss : C7Monster
{
	// The golden-horned Eniram Boss is C653-C664. Unlike ordinary Eniram,
	// it never cloaks and therefore remains visible outside infrared.
	activesound "c7/monster/active/class21"
	deathsound "c7/monster/death/class19"
	points 2500
	health 1000, 1500, 2000, 4000
	speed 1, 3
	states
	{
		Spawn: C653 A -1 NOP A_Look stop
		See:
			C653 A 5 NOP A_Chase
			C653 A 1.5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C654 A 4 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C655 A 5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C655 A 1.5 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			C656 A 4 NOP A_Chase("*", "*", CHF_NOPLAYACTIVE)
			loop
		Missile:
			C657 A 15 A_FaceTarget
			C657 A 0 A_PlaySound("c7/weapon/plasma")
			C658 A 5 bright A_CustomMissile("C7BossPlasmaBolt")
			goto See
		Death:
			C659 A 0 A_Fall
			C659 A 5 A_Scream
			C660 A 5
			C661 A 5
			C662 A 5
			C663 A 5
			C664 A -1
			stop
	}
}

actor C7Tymok : C7Monster
{
	// Tymok dodges quickly and attacks with the alien Plasma Rifle.
	activesound "c7/monster/active/class25"
	attacksound "c7/monster/attack/class25"
	deathsound "c7/monster/death/class22"
	points 2500
	health 1000, 1500, 2000, 4000
	speed 1, 5
	dropitem "C7PlasmaRifle"
	states
	{
		Spawn:
			C726 A -1 NOP A_Look
			stop
		See:
			C726 A 5 NOP A_Chase("*", "*", CHF_ALWAYSDODGE|CHF_BACKOFF)
			C726 A 1.5 NOP A_Chase("*", "*", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C727 A 4 NOP A_Chase("*", "*", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C728 A 5 NOP A_Chase("*", "*", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C728 A 1.5 NOP A_Chase("*", "*", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C729 A 4 NOP A_Chase("*", "*", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			loop
		Missile:
			C730 A 15 A_FaceTarget
			C731 A 0 A_PlaySound("c7/weapon/plasma")
			C731 A 5 bright A_CustomMissile("C7BossPlasmaBolt")
			C732 A 0 A_PlaySound("c7/monster/attack/class25")
			C732 A 5
			C733 A 5 bright A_WolfAttack(0, "", 1.0, 48)
			C732 A 5 bright A_WolfAttack(0, "", 1.0, 48)
			C733 A 5
			goto See
		Death:
			C734 A 0 A_Fall
			C734 A 0.5 A_Scream
			C734 A 5
			C735 A 5
			C736 A 5
			C737 A -1
			stop
	}
}

actor C7Mechanoid : C7Monster
{
	// Mechanoid Warrior: slow and devastating nearby, but inaccurate and
	// comparatively weak at medium/long range. Its C690/C692 steps are audible.
	activesound "c7/monster/active/class20"
	attacksound "c7/monster/attack/class20"
	deathsound "c7/monster/death/class20"
	points 2500
	health 500, 500, 1000, 1500
	speed 1, 2
	dropitem "C7DualBlaster"
	states
	{
		Spawn:
			C690 A -1 NOP A_Look
			stop
		See:
			C690 A 0 A_PlaySound("c7/monster/active/class20")
			C690 A 10 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C690 A 3
			C691 A 4 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C692 A 0 A_PlaySound("c7/monster/active/class20")
			C692 A 10 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C692 A 3
			C693 A 4 NOP A_Chase("*", "*", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			loop
		Missile:
			C694 A 5 A_FaceTarget
			C695 A 5
			C696 A 5 bright A_WolfAttack(0, "*", 1.0, 96, 128, 1, 2)
			C697 A 5 A_FaceTarget
			C695 A 5
			C696 A 5 bright A_WolfAttack(0, "*", 1.0, 96, 128, 1, 2)
			goto See
		Death:
			C698 A 0 A_Fall
			C698 A 5 A_Scream
			C699 A 5
			C700 A 5
			C701 A 5
			C702 A 5
			C703 A 5
			C704 A 5
			C705 A -1
			stop
	}
}

actor C7Tebazile : C7Monster
{
	// Tebazile has one shared health pool and five visible phases. Crossing
	// each fifth plays the native six-frame transformation before changing AI.
	attacksound "c7/monster/attack/class19"
	points 10000
	health 5000, 6000, 7000, 9000
	speed 1, 3
	states
	{
		Spawn:
			C818 A -1 NOP A_Look
			stop
		See:
			TNT1 A 0 A_C7TebazileMorph
			C818 A 5 NOP A_Chase("*", "NaturalAttack")
			C818 A 1.5 NOP A_Chase("*", "NaturalAttack", CHF_NOPLAYACTIVE)
			C819 A 4 NOP A_Chase("*", "NaturalAttack", CHF_NOPLAYACTIVE)
			C820 A 5 NOP A_Chase("*", "NaturalAttack", CHF_NOPLAYACTIVE)
			C820 A 1.5 NOP A_Chase("*", "NaturalAttack", CHF_NOPLAYACTIVE)
			C821 A 4 NOP A_Chase("*", "NaturalAttack", CHF_NOPLAYACTIVE)
			loop
		NaturalAttack:
			C814 A 15 A_FaceTarget
			C815 A 5 bright A_WolfAttack(0, "*", 1.0, 64)
			C816 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C815 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C816 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C815 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C816 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C814 A 5
			goto See
		TransformEniram:
			C822 A 9
			C823 A 9
			C824 A 9
			C825 A 9
			C826 A 9
			C827 A 9
			goto PhaseEniram
		PhaseEniram:
			TNT1 A 0 A_C7TebazileMorph
			C653 A 5 NOP A_Chase("*", "EniramAttack", CHF_BACKOFF)
			C653 A 1.5 NOP A_Chase("*", "EniramAttack", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C654 A 4 NOP A_Chase("*", "EniramAttack", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C655 A 5 NOP A_Chase("*", "EniramAttack", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C655 A 1.5 NOP A_Chase("*", "EniramAttack", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C656 A 4 NOP A_Chase("*", "EniramAttack", CHF_BACKOFF|CHF_NOPLAYACTIVE)
			loop
		EniramAttack:
			C657 A 15 A_FaceTarget
			C657 A 0 A_PlaySound("c7/weapon/plasma")
			C658 A 5 bright A_CustomMissile("C7BossPlasmaBolt")
			goto PhaseEniram
		TransformTymok:
			C828 A 9
			C829 A 9
			C830 A 9
			C831 A 9
			C832 A 9
			C833 A 9
			goto PhaseTymok
		PhaseTymok:
			TNT1 A 0 A_C7TebazileMorph
			C726 A 5 NOP A_Chase("*", "TymokAttack", CHF_ALWAYSDODGE|CHF_BACKOFF)
			C726 A 1.5 NOP A_Chase("*", "TymokAttack", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C727 A 4 NOP A_Chase("*", "TymokAttack", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C728 A 5 NOP A_Chase("*", "TymokAttack", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C728 A 1.5 NOP A_Chase("*", "TymokAttack", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			C729 A 4 NOP A_Chase("*", "TymokAttack", CHF_ALWAYSDODGE|CHF_BACKOFF|CHF_NOPLAYACTIVE)
			loop
		TymokAttack:
			C730 A 15 A_FaceTarget
			C731 A 0 A_PlaySound("c7/weapon/plasma")
			C731 A 5 bright A_CustomMissile("C7BossPlasmaBolt")
			C732 A 0 A_PlaySound("c7/monster/attack/class25")
			C732 A 5
			C733 A 5 bright A_WolfAttack(0, "", 1.0, 48)
			C732 A 5 bright A_WolfAttack(0, "", 1.0, 48)
			C733 A 5
			goto PhaseTymok
		TransformSolrac:
			C834 A 9
			C835 A 9
			C836 A 9
			C837 A 9
			C838 A 9
			C839 A 9
			goto PhaseSolrac
		PhaseSolrac:
			TNT1 A 0 A_C7TebazileMorph
			C638 A 5 NOP A_Chase("*", "SolracAttack")
			C638 A 1.5 NOP A_Chase("*", "SolracAttack", CHF_NOPLAYACTIVE)
			C639 A 4 NOP A_Chase("*", "SolracAttack", CHF_NOPLAYACTIVE)
			C640 A 5 NOP A_Chase("*", "SolracAttack", CHF_NOPLAYACTIVE)
			C640 A 1.5 NOP A_Chase("*", "SolracAttack", CHF_NOPLAYACTIVE)
			C641 A 4 NOP A_Chase("*", "SolracAttack", CHF_NOPLAYACTIVE)
			loop
		SolracAttack:
			C642 A 15 A_FaceTarget
			C643 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C644 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C643 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C644 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C643 A 5 bright A_CustomMissile("C7BossEnergyBolt")
			C644 A 5
			C642 A 5
			goto PhaseSolrac
		TransformFinal:
			C840 A 9
			C841 A 9
			C842 A 9
			C843 A 9
			C844 A 9
			C845 A 9
			goto PhaseFinal
		PhaseFinal:
			TNT1 A 0 A_C7TebazileMorph
			C818 A 5 NOP A_Chase("*", "FinalAttack")
			C818 A 1.5 NOP A_Chase("*", "FinalAttack", CHF_NOPLAYACTIVE)
			C819 A 4 NOP A_Chase("*", "FinalAttack", CHF_NOPLAYACTIVE)
			C820 A 5 NOP A_Chase("*", "FinalAttack", CHF_NOPLAYACTIVE)
			C820 A 1.5 NOP A_Chase("*", "FinalAttack", CHF_NOPLAYACTIVE)
			C821 A 4 NOP A_Chase("*", "FinalAttack", CHF_NOPLAYACTIVE)
			loop
		FinalAttack:
			C814 A 15 A_FaceTarget
			C815 A 5 bright A_WolfAttack(0, "*", 1.0, 64)
			C816 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C815 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C816 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C815 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C816 A 5 bright A_WolfAttack(0, "", 1.0, 64)
			C814 A 5
			goto PhaseFinal
		Death:
			C846 A 0 A_Fall
			C846 A 7.5 A_Scream
			C847 A 7.5
			C848 A 7.5
			C849 A 7.5
			C850 A 7.5
			C851 A 7.5
			C852 A 7.5
			C853 A 7.5
			C854 A 7.5
			C855 A 7.5
			C856 A 7.5
			C857 A -1
			stop
	}
}

actor C7BossEnergyBolt
{
	radius 4
	height 4
	speed 14
	damage (random[MissileDamage](30, 62))
	PROJECTILE
	states
	{
		Spawn:
			C706 A 2 bright
			loop
		Death:
			C707 A 0 bright A_PlaySound("c7/teleport")
			C707 A 4 bright
			C708 A 4 bright
			C709 A 4 bright
			stop
	}
}

actor C7BossPlasmaBolt : C7BossEnergyBolt
{
	speed 18
	damage (random[MissileDamage](20, 48))
}

actor C7Vortex
{
	states
	{
		Spawn:
			C710 A 5
			C711 A 5
			C712 A 5
			C713 A 5
			C714 A 5
			C715 A 5
			C716 A 5
			C717 A 5
			loop
	}
}

actor C7TransporterField
{
	states
	{
		Spawn:
			C453 A 5
			C454 A 5
			C455 A 5
			C456 A 5
			C457 A 5
			loop
	}
}

actor C7TransporterExit
{
	states { Spawn: C458 A -1 stop }
}

actor C7ExitVortex : CustomInventory
{
	inventory.pickupsound "c7/teleport"
	states
	{
		Spawn:
			C738 A 0 A_C7VortexSound
			C738 A 5
			C739 A 5
			C740 A 5
			C741 A 5
			loop
		Pickup:
			TNT1 A 0 Exit_Normal
			stop
	}
}

actor C7Inert
{
	states
	{
		Spawn:
			C444 A -1
			stop
	}
}

// Compatibility names for saves made by earlier Corridor 7 port builds.
// Released maps no longer spawn these provisional/misidentified classes.
actor C7Technician : C7Tenaj {}
actor C7Ugly : C7Rodex {}
actor C7Grunt : C7Ttocs {}
actor C7Morph : C7Eniram {}
actor C7SpaceMarine : C7Otrebor {}
actor C7SpaceSeal : C7Nerraw {}
actor C7HungryPuddle : C7Eitak {}
actor C7PurpleBoss : C7Tymok {}
actor C7IronFoot : C7Mechanoid {}
actor C7SkullBoss : C7Solrac {}
actor C7HornedBoss : C7Tebazile {}
