- Added string replacement option to obituary strings. - Changed lock and pickup message handling so that it is either a real string or a LANGUAGE identifier. The only reason I did the mixed format in the first place were Hexen's lock messages but they have been replaced by unique strings in the mean time so the feature isn't needed any more. - Added a flags parameter to TranslucentLine. - Extended the second arg of Line_SetIdentification to set not only ML_ZONEBOUNDARY but all 8 bits of the third byte in the flag word. This allows a relatively simple means of setting all the new flags directly. - Moved ML_ZONEBOUNDARY to doomdata.h so that it is in the same place as the other line flags. - Fixed: Strife's teleport swirl didn't loop its animation. - Fixed: Strife's rat is not supposed to be shootable. SVN r110 (trunk)
118 lines
3.8 KiB
C++
118 lines
3.8 KiB
C++
#include "actor.h"
|
|
#include "info.h"
|
|
#include "m_random.h"
|
|
#include "p_local.h"
|
|
#include "p_enemy.h"
|
|
#include "gstrings.h"
|
|
#include "a_action.h"
|
|
|
|
static FRandom pr_sargattack ("SargAttack");
|
|
|
|
void A_SargAttack (AActor *);
|
|
|
|
class ADemon : public AActor
|
|
{
|
|
DECLARE_ACTOR (ADemon, AActor)
|
|
public:
|
|
const char *GetHitObituary () { return GStrings("OB_DEMONHIT"); }
|
|
};
|
|
|
|
FState ADemon::States[] =
|
|
{
|
|
#define S_SARG_STND 0
|
|
S_NORMAL (SARG, 'A', 10, A_Look , &States[S_SARG_STND+1]),
|
|
S_NORMAL (SARG, 'B', 10, A_Look , &States[S_SARG_STND]),
|
|
|
|
#define S_SARG_RUN (S_SARG_STND+2)
|
|
S_NORMAL (SARG, 'A', 2, A_Chase , &States[S_SARG_RUN+1]),
|
|
S_NORMAL (SARG, 'A', 2, A_Chase , &States[S_SARG_RUN+2]),
|
|
S_NORMAL (SARG, 'B', 2, A_Chase , &States[S_SARG_RUN+3]),
|
|
S_NORMAL (SARG, 'B', 2, A_Chase , &States[S_SARG_RUN+4]),
|
|
S_NORMAL (SARG, 'C', 2, A_Chase , &States[S_SARG_RUN+5]),
|
|
S_NORMAL (SARG, 'C', 2, A_Chase , &States[S_SARG_RUN+6]),
|
|
S_NORMAL (SARG, 'D', 2, A_Chase , &States[S_SARG_RUN+7]),
|
|
S_NORMAL (SARG, 'D', 2, A_Chase , &States[S_SARG_RUN+0]),
|
|
|
|
#define S_SARG_ATK (S_SARG_RUN+8)
|
|
S_NORMAL (SARG, 'E', 8, A_FaceTarget , &States[S_SARG_ATK+1]),
|
|
S_NORMAL (SARG, 'F', 8, A_FaceTarget , &States[S_SARG_ATK+2]),
|
|
S_NORMAL (SARG, 'G', 8, A_SargAttack , &States[S_SARG_RUN+0]),
|
|
|
|
#define S_SARG_PAIN (S_SARG_ATK+3)
|
|
S_NORMAL (SARG, 'H', 2, NULL , &States[S_SARG_PAIN+1]),
|
|
S_NORMAL (SARG, 'H', 2, A_Pain , &States[S_SARG_RUN+0]),
|
|
|
|
#define S_SARG_DIE (S_SARG_PAIN+2)
|
|
S_NORMAL (SARG, 'I', 8, NULL , &States[S_SARG_DIE+1]),
|
|
S_NORMAL (SARG, 'J', 8, A_Scream , &States[S_SARG_DIE+2]),
|
|
S_NORMAL (SARG, 'K', 4, NULL , &States[S_SARG_DIE+3]),
|
|
S_NORMAL (SARG, 'L', 4, A_NoBlocking , &States[S_SARG_DIE+4]),
|
|
S_NORMAL (SARG, 'M', 4, NULL , &States[S_SARG_DIE+5]),
|
|
S_NORMAL (SARG, 'N', -1, NULL , NULL),
|
|
|
|
#define S_SARG_RAISE (S_SARG_DIE+6)
|
|
S_NORMAL (SARG, 'N', 5, NULL , &States[S_SARG_RAISE+1]),
|
|
S_NORMAL (SARG, 'M', 5, NULL , &States[S_SARG_RAISE+2]),
|
|
S_NORMAL (SARG, 'L', 5, NULL , &States[S_SARG_RAISE+3]),
|
|
S_NORMAL (SARG, 'K', 5, NULL , &States[S_SARG_RAISE+4]),
|
|
S_NORMAL (SARG, 'J', 5, NULL , &States[S_SARG_RAISE+5]),
|
|
S_NORMAL (SARG, 'I', 5, NULL , &States[S_SARG_RUN+0])
|
|
};
|
|
|
|
IMPLEMENT_ACTOR (ADemon, Doom, 3002, 8)
|
|
PROP_SpawnHealth (150)
|
|
PROP_PainChance (180)
|
|
PROP_SpeedFixed (10)
|
|
PROP_RadiusFixed (30)
|
|
PROP_HeightFixed (56)
|
|
PROP_Mass (400)
|
|
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_COUNTKILL)
|
|
PROP_Flags2 (MF2_MCROSS|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_FLOORCLIP)
|
|
PROP_Flags5 (MF5_FASTER|MF5_FASTMELEE)
|
|
|
|
PROP_SpawnState (S_SARG_STND)
|
|
PROP_SeeState (S_SARG_RUN)
|
|
PROP_PainState (S_SARG_PAIN)
|
|
PROP_MeleeState (S_SARG_ATK)
|
|
PROP_DeathState (S_SARG_DIE)
|
|
PROP_RaiseState (S_SARG_RAISE)
|
|
|
|
PROP_SeeSound ("demon/sight")
|
|
PROP_AttackSound ("demon/melee")
|
|
PROP_PainSound ("demon/pain")
|
|
PROP_DeathSound ("demon/death")
|
|
PROP_ActiveSound ("demon/active")
|
|
END_DEFAULTS
|
|
|
|
class ASpectre : public ADemon
|
|
{
|
|
DECLARE_STATELESS_ACTOR (ASpectre, ADemon)
|
|
public:
|
|
const char *GetHitObituary () { return GStrings("OB_SPECTREHIT"); }
|
|
};
|
|
|
|
IMPLEMENT_STATELESS_ACTOR (ASpectre, Doom, 58, 9)
|
|
PROP_FlagsSet (MF_SHADOW)
|
|
PROP_RenderStyle (STYLE_OptFuzzy)
|
|
PROP_Alpha (FRACUNIT/5)
|
|
|
|
PROP_SeeSound ("spectre/sight")
|
|
PROP_AttackSound ("spectre/melee")
|
|
PROP_PainSound ("spectre/pain")
|
|
PROP_DeathSound ("spectre/death")
|
|
PROP_ActiveSound ("spectre/active")
|
|
END_DEFAULTS
|
|
|
|
void A_SargAttack (AActor *self)
|
|
{
|
|
if (!self->target)
|
|
return;
|
|
|
|
A_FaceTarget (self);
|
|
if (self->CheckMeleeRange ())
|
|
{
|
|
int damage = ((pr_sargattack()%10)+1)*4;
|
|
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
|
P_TraceBleed (damage, self->target, self);
|
|
}
|
|
}
|