mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-06 13:01:03 +00:00
010fd038be
- added an 'exact' parameter to FThinkerIterator's Next function. This is mainly for scripting which allows to do a lot more checks natively when running the iterator while looking for one specific class.
81 lines
1.3 KiB
Text
81 lines
1.3 KiB
Text
//===========================================================================
|
|
//
|
|
// Commander Keen
|
|
//
|
|
//===========================================================================
|
|
class CommanderKeen : Actor
|
|
{
|
|
Default
|
|
{
|
|
Health 100;
|
|
Radius 16;
|
|
Height 72;
|
|
Mass 10000000;
|
|
PainChance 256;
|
|
+SOLID
|
|
+SPAWNCEILING
|
|
+NOGRAVITY
|
|
+SHOOTABLE
|
|
+COUNTKILL
|
|
+NOICEDEATH
|
|
+ISMONSTER
|
|
PainSound "keen/pain";
|
|
DeathSound "keen/death";
|
|
}
|
|
States
|
|
{
|
|
Spawn:
|
|
KEEN A -1;
|
|
Loop;
|
|
Death:
|
|
KEEN AB 6;
|
|
KEEN C 6 A_Scream;
|
|
KEEN DEFGH 6;
|
|
KEEN I 6;
|
|
KEEN J 6;
|
|
KEEN K 6 A_KeenDie;
|
|
KEEN L -1;
|
|
Stop;
|
|
Pain:
|
|
KEEN M 4;
|
|
KEEN M 8 A_Pain;
|
|
Goto Spawn;
|
|
}
|
|
}
|
|
|
|
|
|
//===========================================================================
|
|
//
|
|
// Code (must be attached to Actor)
|
|
//
|
|
//===========================================================================
|
|
|
|
extend class Actor
|
|
{
|
|
|
|
//
|
|
// A_KeenDie
|
|
// DOOM II special, map 32.
|
|
// Uses special tag 666 by default.
|
|
//
|
|
|
|
void A_KeenDie(int doortag = 666)
|
|
{
|
|
A_NoBlocking(false);
|
|
|
|
// scan the remaining thinkers to see if all Keens are dead
|
|
ThinkerIterator it = ThinkerIterator.Create(GetClass());
|
|
Actor mo;
|
|
while (mo = Actor(it.Next(true)))
|
|
{
|
|
if (mo.health > 0 && mo != self)
|
|
{
|
|
// other Keen not dead
|
|
return;
|
|
}
|
|
}
|
|
Door_Open(doortag, 16);
|
|
}
|
|
}
|
|
|
|
|