Classes:HellKnight

From ZDoom Wiki
(Redirected from HellKnight)
Jump to navigation Jump to search
Note: Wait! Stop! Before you copy this actor's definition into your mod, remember the following things:
  1. You do not need to copy that actor, since it is already defined.
  2. In fact, it's not just useless, it's actually harmful as it can cause problems.
  3. If you want to modify it, or use a modified version, using inheritance is the way to go.
  4. The actor definitions here are put on the wiki for reference purpose only. Learn from them, don't copy them.
  5. There is only one exception: if what you want is changing Ammo capacity, you need to create a new type from Ammo.
Hell Knight
Actor type Monster Game MiniDoom2LogoIcon.png (Doom2)
DoomEd Number 69 Class Name HellKnight
Spawn ID 113 Identifier T_HELLKNIGHT


Classes: BaronOfHellHellKnight
 →StealthHellKnight


Hell Knights are a satyr-like monster similar to the Baron of Hell. Like the Baron, their primary attack is a green fireball. However, they only have half as much health as their big brothers.

ZScript definition

Note: The ZScript definition below is for reference and may be different in the current version of GZDoom.The most up-to-date version of this code can be found on GZDoom GitHub.
class HellKnight : BaronOfHell
{
	Default
	{
		Health 500;
		-BOSSDEATH;
		SeeSound "knight/sight";
		ActiveSound "knight/active";
		PainSound "knight/pain";
		DeathSound "knight/death";
		HitObituary "$OB_KNIGHTHIT";
		Obituary "$OB_KNIGHT";
		Tag "$FN_HELL";
	}
	States
	{
	Spawn:
		BOS2 AB 10 A_Look;
		Loop;
	See:
		BOS2 AABBCCDD 3 A_Chase;
		Loop;
	Melee:
	Missile:
		BOS2 EF 8 A_FaceTarget;
		BOS2 G 8 A_BruisAttack;
		Goto See;
	Pain:
		BOS2 H  2;
		BOS2 H  2 A_Pain;
		Goto See;
	Death:
		BOS2 I  8;
		BOS2 J  8 A_Scream;
		BOS2 K  8;
		BOS2 L  8 A_NoBlocking;
		BOS2 MN 8;
		BOS2 O -1;
		Stop;
	Raise:
		BOS2 O 8;
		BOS2 NMLKJI  8;
		Goto See;
	}
}

A_BruisAttack is defined only once in GZDoom (since both Baron of Hell and Hell Knight are in the same file), this is repeated here for illustration purposes.

extend class Actor
{
	void A_BruisAttack()
	{
		let targ = target;
		if (targ)
		{
			if (CheckMeleeRange())
			{
				int damage = random[pr_bruisattack](1, 8) * 10;
				A_StartSound ("baron/melee", CHAN_WEAPON);
				int newdam = target.DamageMobj (self, self, damage, "Melee");
				targ.TraceBleed (newdam > 0 ? newdam : damage, self);
			}
			else
			{
				// launch a missile
				SpawnMissile (target, "BaronBall");
			}
		}
	}
}

DECORATE definition

Note: This is legacy code, kept here for reference only. DECORATE is still supported but no longer used by GZDoom. GZDoom internally uses the ZScript definition above.
ACTOR HellKnight : BaronOfHell
{
  Health 500
  -BOSSDEATH
  SeeSound "knight/sight"
  ActiveSound "knight/active"
  PainSound "knight/pain"
  DeathSound "knight/death"
  HitObituary "$OB_KNIGHTHIT"
  Obituary "$OB_KNIGHT"
  States
  {
  Spawn:
    BOS2 AB 10 A_Look
    Loop
  See:
    BOS2 AABBCCDD 3 A_Chase
    Loop
  Melee:
  Missile:
    BOS2 EF 8 A_FaceTarget
    BOS2 G 8 A_BruisAttack
    Goto See
  Pain:
    BOS2 H 2
    BOS2 H 2 A_Pain
    Goto See
  Death:
    BOS2 I 8
    BOS2 J 8 A_Scream
    BOS2 K 8
    BOS2 L 8 A_NoBlocking
    BOS2 MN 8
    BOS2 O -1
    Stop
  Raise:
    BOS2 O 8
    BOS2 NMLKJI 8
    Goto See
  }
}