Classes:BaronOfHell

From ZDoom Wiki
Jump to navigation Jump to search
Note: Wait! Stop! You do not need to copy this actor's code into your project! Here's why:
  1. This actor is already defined in GZDoom, there's no reason to define it again.
  2. In fact, trying to define an actor with the same name will cause an error (because it already exists).
  3. If you want to make your own version of this actor, use inheritance.
  4. Definitions for existing actors are put on the wiki for reference purpose only.
Baron of Hell
Actor type Monster Game MiniDoomLogoIcon.png (Doom)
DoomEd Number 3003 Class Name BaronOfHell
Spawn ID 3 Identifier T_BARON


Classes: BaronOfHell
 →HellKnight
  →StealthHellKnight
 →StealthBaron


The Baron of Hell is akin to the Hell Knight, but has twice as much health. A pair of Barons serve as the endbosses for the first episode of Doom before becoming a far more common foe later on in the series.

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 BaronOfHell : Actor
{
	Default
	{
		Health 1000;
		Radius 24;
		Height 64;
		Mass 1000;
		Speed 8;
		PainChance 50;
		Monster;
		+FLOORCLIP
		+BOSSDEATH
		SeeSound "baron/sight";
		PainSound "baron/pain";
		DeathSound "baron/death";
		ActiveSound "baron/active";
		Obituary "$OB_BARON";
		HitObituary "$OB_BARONHIT";
		Tag "$FN_BARON";
	}
	States
	{
	Spawn:
		BOSS AB 10 A_Look ;
		Loop;
	See:
		BOSS AABBCCDD 3 A_Chase;
		Loop;
	Melee:
	Missile:
		BOSS EF 8 A_FaceTarget;
		BOSS G 8 A_BruisAttack;
		Goto See;
	Pain:
		BOSS H  2;
		BOSS H  2 A_Pain;
		Goto See;
	Death:
		BOSS I  8;
		BOSS J  8 A_Scream;
		BOSS K  8;
		BOSS L  8 A_NoBlocking;
		BOSS MN 8;
		BOSS O -1 A_BossDeath;
		Stop;
	Raise:
		BOSS O 8;
		BOSS NMLKJI 8;
		Goto See;
	}
}

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

Nuvolabomb.png Warning: This is legacy code, kept for archival purposes only. DECORATE is deprecated in GZDoom and is completely superseded by ZScript. GZDoom internally uses the ZScript definition above.
ACTOR BaronOfHell
{
  Health 1000
  Radius 24
  Height 64
  Mass 1000
  Speed 8
  PainChance 50
  Monster
  +FLOORCLIP
  +BOSSDEATH
  SeeSound "baron/sight"
  PainSound "baron/pain"
  DeathSound "baron/death"
  ActiveSound "baron/active"
  Obituary "$OB_BARON"
  HitObituary "$OB_BARONHIT"
  States
  {
  Spawn:
    BOSS AB 10 A_Look
    Loop
  See:
    BOSS AABBCCDD 3 A_Chase
    Loop
  Melee:
  Missile:
    BOSS EF 8 A_FaceTarget
    BOSS G 8 A_BruisAttack
    Goto See
  Pain:
    BOSS H 2
    BOSS H 2 A_Pain
    Goto See
  Death:
    BOSS I 8
    BOSS J 8 A_Scream
    BOSS K 8
    BOSS L 8 A_NoBlocking
    BOSS MN 8
    BOSS O -1 A_BossDeath
    Stop
  Raise:
    BOSS O 8
    BOSS NMLKJI 8
    Goto See
  }
}