2016-10-17 10:58:23 +00:00
|
|
|
|
|
|
|
// Knight -------------------------------------------------------------------
|
|
|
|
|
|
|
|
class Knight : Actor
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
Health 200;
|
|
|
|
Radius 24;
|
|
|
|
Height 78;
|
|
|
|
Mass 150;
|
|
|
|
Speed 12;
|
|
|
|
Painchance 100;
|
|
|
|
Monster;
|
|
|
|
+FLOORCLIP
|
|
|
|
SeeSound "hknight/sight";
|
|
|
|
AttackSound "hknight/attack";
|
|
|
|
PainSound "hknight/pain";
|
|
|
|
DeathSound "hknight/death";
|
|
|
|
ActiveSound "hknight/active";
|
|
|
|
Obituary "$OB_BONEKNIGHT";
|
|
|
|
HitObituary "$OB_BONEKNIGHTHIT";
|
2018-06-24 10:31:55 +00:00
|
|
|
Tag "$FN_BONEKNIGHT";
|
2016-10-17 10:58:23 +00:00
|
|
|
DropItem "CrossbowAmmo", 84, 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
KNIG AB 10 A_Look;
|
|
|
|
Loop;
|
|
|
|
See:
|
|
|
|
KNIG ABCD 4 A_Chase;
|
|
|
|
Loop;
|
|
|
|
Melee:
|
|
|
|
Missile:
|
|
|
|
KNIG E 10 A_FaceTarget;
|
|
|
|
KNIG F 8 A_FaceTarget;
|
|
|
|
KNIG G 8 A_KnightAttack;
|
|
|
|
KNIG E 10 A_FaceTarget;
|
|
|
|
KNIG F 8 A_FaceTarget;
|
|
|
|
KNIG G 8 A_KnightAttack;
|
|
|
|
Goto See;
|
|
|
|
Pain:
|
|
|
|
KNIG H 3;
|
|
|
|
KNIG H 3 A_Pain;
|
|
|
|
Goto See;
|
|
|
|
Death:
|
|
|
|
KNIG I 6;
|
|
|
|
KNIG J 6 A_Scream;
|
|
|
|
KNIG K 6;
|
|
|
|
KNIG L 6 A_NoBlocking;
|
|
|
|
KNIG MN 6;
|
|
|
|
KNIG O -1;
|
|
|
|
Stop;
|
|
|
|
}
|
|
|
|
|
2016-11-11 21:14:29 +00:00
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_KnightAttack
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void A_KnightAttack ()
|
|
|
|
{
|
2017-06-06 07:12:23 +00:00
|
|
|
let targ = target;
|
|
|
|
if (!targ) return;
|
2016-11-11 21:14:29 +00:00
|
|
|
if (CheckMeleeRange ())
|
|
|
|
{
|
|
|
|
int damage = random[KnightAttack](1, 8) * 3;
|
2017-06-06 07:12:23 +00:00
|
|
|
int newdam = targ.DamageMobj (self, self, damage, 'Melee');
|
|
|
|
targ.TraceBleed (newdam > 0 ? newdam : damage, self);
|
2020-01-04 13:15:32 +00:00
|
|
|
A_StartSound ("hknight/melee", CHAN_BODY);
|
2016-11-11 21:14:29 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
// Throw axe
|
2020-01-04 13:15:32 +00:00
|
|
|
A_StartSound (AttackSound, CHAN_BODY);
|
2016-11-11 21:14:29 +00:00
|
|
|
if (self.bShadow || random[KnightAttack]() < 40)
|
|
|
|
{ // Red axe
|
2017-06-06 07:12:23 +00:00
|
|
|
SpawnMissileZ (pos.Z + 36, targ, "RedAxe");
|
2016-11-11 21:14:29 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{ // Green axe
|
2017-06-06 07:12:23 +00:00
|
|
|
SpawnMissileZ (pos.Z + 36, targ, "KnightAxe");
|
2016-11-11 21:14:29 +00:00
|
|
|
}
|
|
|
|
}
|
2016-10-17 10:58:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Knight ghost -------------------------------------------------------------
|
|
|
|
|
|
|
|
class KnightGhost : Knight
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+SHADOW
|
|
|
|
+GHOST
|
|
|
|
RenderStyle "Translucent";
|
|
|
|
Alpha 0.4;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// Knight axe ---------------------------------------------------------------
|
|
|
|
|
|
|
|
class KnightAxe : Actor
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
Radius 10;
|
|
|
|
Height 8;
|
|
|
|
Speed 9;
|
|
|
|
FastSpeed 18;
|
|
|
|
Damage 2;
|
|
|
|
Projectile;
|
|
|
|
-NOBLOCKMAP
|
|
|
|
-ACTIVATEIMPACT
|
|
|
|
-ACTIVATEPCROSS
|
|
|
|
+WINDTHRUST
|
|
|
|
+THRUGHOST
|
|
|
|
DeathSound "hknight/hit";
|
|
|
|
}
|
|
|
|
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
2020-01-04 13:15:32 +00:00
|
|
|
SPAX A 3 BRIGHT A_StartSound("hknight/axewhoosh");
|
2016-10-17 10:58:23 +00:00
|
|
|
SPAX BC 3 BRIGHT;
|
|
|
|
Loop;
|
|
|
|
Death:
|
|
|
|
SPAX DEF 6 BRIGHT;
|
|
|
|
Stop;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Red axe ------------------------------------------------------------------
|
|
|
|
|
|
|
|
class RedAxe : KnightAxe
|
|
|
|
{
|
|
|
|
Default
|
|
|
|
{
|
|
|
|
+NOBLOCKMAP
|
|
|
|
-WINDTHRUST
|
|
|
|
Damage 7;
|
|
|
|
}
|
|
|
|
|
|
|
|
States
|
|
|
|
{
|
|
|
|
Spawn:
|
|
|
|
RAXE AB 5 BRIGHT A_DripBlood;
|
|
|
|
Loop;
|
|
|
|
Death:
|
|
|
|
RAXE CDE 6 BRIGHT;
|
|
|
|
Stop;
|
|
|
|
}
|
2016-11-11 21:14:29 +00:00
|
|
|
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
//
|
|
|
|
// PROC A_DripBlood
|
|
|
|
//
|
|
|
|
//----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
void A_DripBlood ()
|
|
|
|
{
|
|
|
|
double xo = random2[DripBlood]() / 32.0;
|
|
|
|
double yo = random2[DripBlood]() / 32.0;
|
|
|
|
Actor mo = Spawn ("Blood", Vec3Offset(xo, yo, 0.), ALLOW_REPLACE);
|
2016-12-31 14:40:16 +00:00
|
|
|
if (mo != null)
|
|
|
|
{
|
|
|
|
mo.Vel.X = random2[DripBlood]() / 64.0;
|
|
|
|
mo.Vel.Y = random2[DripBlood]() / 64.0;
|
|
|
|
mo.Gravity = 1./8;
|
|
|
|
}
|
2016-11-11 21:14:29 +00:00
|
|
|
}
|
2016-10-17 10:58:23 +00:00
|
|
|
}
|