- Added an Active and Inactive state for monsters.

- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
  GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.


SVN r1144 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-10 11:29:19 +00:00
parent 9ad93639c5
commit 5ea4b37373
22 changed files with 853 additions and 1261 deletions

View file

@ -1,4 +1,8 @@
August 10, 2008
- Added an Active and Inactive state for monsters.
- Made the speed a parameter to A_RaiseMobj and A_SinkMobj and deleted
GetRaiseSpeed and GetSinkSpeed.
- Added some remaining DECORATE conversions for Hexen by Karate Chris.
- Changed Windows to use the performance counter instead of rdtsc.
- Changed Linux to use clock_gettime for profiling instead of rdtsc. This
avoids potential erroneous results on multicore and variable speed

View file

@ -496,12 +496,6 @@ public:
// Made a metadata property so no longer virtual
void Howl ();
// Called by A_SinkMobj
virtual fixed_t GetSinkSpeed ();
// Called by A_RaiseMobj
virtual fixed_t GetRaiseSpeed ();
// Actor just hit the floor
virtual void HitFloor ();

View file

@ -313,6 +313,35 @@ ACTOR(TeloSpawnB)
ACTOR(TeloSpawnC)
ACTOR(TeloSpawnD)
ACTOR(CheckTeleRing)
ACTOR(IceGuyLook)
ACTOR(IceGuyChase)
ACTOR(IceGuyAttack)
ACTOR(IceGuyMissileExplode)
ACTOR(SerpentHumpDecide)
ACTOR(SerpentHide)
ACTOR(SerpentCheckForAttack)
ACTOR(SerpentSpawnGibs)
ACTOR(SerpentUnHide)
ACTOR(SerpentRaiseHump)
ACTOR(SerpentLowerHump)
ACTOR(SerpentChooseAttack)
ACTOR(SerpentMeleeAttack)
ACTOR(SerpentHeadCheck)
ACTOR(FloatGib)
ACTOR(DelayGib)
ACTOR(SinkGib)
ACTOR(ThrustRaise)
ACTOR(ThrustImpale)
ACTOR(ThrustLower)
ACTOR(ThrustInitDn)
ACTOR(ThrustInitUp)
ACTOR(WraithInit)
ACTOR(WraithRaiseInit)
ACTOR(WraithRaise)
ACTOR(WraithChase)
ACTOR(WraithFX3)
ACTOR(WraithMelee)
ACTOR(WraithFX2)
ACTOR(TemplarAttack)
ACTOR(SentinelAttack)

View file

@ -9,267 +9,10 @@
static FRandom pr_iceguylook ("IceGuyLook");
static FRandom pr_iceguychase ("IceGuyChase");
void A_IceGuyLook (AActor *);
void A_IceGuyChase (AActor *);
void A_IceGuyAttack (AActor *);
void A_IceGuyDie (AActor *);
void A_IceGuyMissilePuff (AActor *);
void A_IceGuyMissileExplode (AActor *);
// Ice Guy ------------------------------------------------------------------
class AIceGuy : public AActor
static const char *WispTypes[2] =
{
DECLARE_ACTOR (AIceGuy, AActor)
public:
void Deactivate (AActor *activator);
};
FState AIceGuy::States[] =
{
#define S_ICEGUY_LOOK 0
S_NORMAL (ICEY, 'A', 10, A_IceGuyLook , &States[S_ICEGUY_LOOK]),
#define S_ICEGUY_WALK1 (S_ICEGUY_LOOK+1)
S_NORMAL (ICEY, 'A', 4, A_Chase , &States[S_ICEGUY_WALK1+1]),
S_NORMAL (ICEY, 'B', 4, A_IceGuyChase , &States[S_ICEGUY_WALK1+2]),
S_NORMAL (ICEY, 'C', 4, A_Chase , &States[S_ICEGUY_WALK1+3]),
S_NORMAL (ICEY, 'D', 4, A_Chase , &States[S_ICEGUY_WALK1]),
#define S_ICEGUY_PAIN1 (S_ICEGUY_WALK1+4)
S_NORMAL (ICEY, 'A', 1, A_Pain , &States[S_ICEGUY_WALK1]),
#define S_ICEGUY_ATK1 (S_ICEGUY_PAIN1+1)
S_NORMAL (ICEY, 'E', 3, A_FaceTarget , &States[S_ICEGUY_ATK1+1]),
S_NORMAL (ICEY, 'F', 3, A_FaceTarget , &States[S_ICEGUY_ATK1+2]),
S_BRIGHT (ICEY, 'G', 8, A_IceGuyAttack , &States[S_ICEGUY_ATK1+3]),
S_NORMAL (ICEY, 'F', 4, A_FaceTarget , &States[S_ICEGUY_WALK1]),
#define S_ICEGUY_DEATH (S_ICEGUY_ATK1+4)
S_NORMAL (ICEY, 'A', 1, A_IceGuyDie , NULL),
#define S_ICEGUY_DORMANT (S_ICEGUY_DEATH+1)
S_NORMAL (ICEY, 'A', -1, NULL , &States[S_ICEGUY_LOOK]),
};
IMPLEMENT_ACTOR (AIceGuy, Hexen, 8020, 20)
PROP_SpawnHealth (120)
PROP_PainChance (144)
PROP_SpeedFixed (14)
PROP_RadiusFixed (22)
PROP_HeightFixed (75)
PROP_Mass (150)
PROP_DamageType (NAME_Ice)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD|MF_COUNTKILL)
PROP_Flags2 (MF2_PASSMOBJ|MF2_TELESTOMP|MF2_PUSHWALL|MF2_MCROSS)
PROP_Flags4 (MF4_NOICEDEATH)
PROP_SpawnState (S_ICEGUY_LOOK)
PROP_SeeState (S_ICEGUY_WALK1)
PROP_PainState (S_ICEGUY_PAIN1)
PROP_MissileState (S_ICEGUY_ATK1)
PROP_DeathState (S_ICEGUY_DEATH)
PROP_SeeSound ("IceGuySight")
PROP_AttackSound ("IceGuyAttack")
PROP_ActiveSound ("IceGuyActive")
PROP_Obituary("$OB_ICEGUY")
END_DEFAULTS
void AIceGuy::Deactivate (AActor *activator)
{
Super::Deactivate (activator);
SetState (&States[S_ICEGUY_DORMANT]);
}
// Ice Guy Projectile -------------------------------------------------------
class AIceGuyFX : public AActor
{
DECLARE_ACTOR (AIceGuyFX, AActor)
};
FState AIceGuyFX::States[] =
{
#define S_ICEGUY_FX1 0
S_BRIGHT (ICPR, 'A', 3, A_IceGuyMissilePuff , &States[S_ICEGUY_FX1+1]),
S_BRIGHT (ICPR, 'B', 3, A_IceGuyMissilePuff , &States[S_ICEGUY_FX1+2]),
S_BRIGHT (ICPR, 'C', 3, A_IceGuyMissilePuff , &States[S_ICEGUY_FX1]),
#define S_ICEGUY_FX_X1 (S_ICEGUY_FX1+3)
S_BRIGHT (ICPR, 'D', 4, NULL , &States[S_ICEGUY_FX_X1+1]),
S_BRIGHT (ICPR, 'E', 4, A_IceGuyMissileExplode , &States[S_ICEGUY_FX_X1+2]),
S_BRIGHT (ICPR, 'F', 4, NULL , &States[S_ICEGUY_FX_X1+3]),
S_BRIGHT (ICPR, 'G', 4, NULL , &States[S_ICEGUY_FX_X1+4]),
S_BRIGHT (ICPR, 'H', 3, NULL , NULL),
};
IMPLEMENT_ACTOR (AIceGuyFX, Hexen, -1, 0)
PROP_SpeedFixed (14)
PROP_RadiusFixed (8)
PROP_HeightFixed (10)
PROP_Damage (1)
PROP_DamageType (NAME_Ice)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_SpawnState (S_ICEGUY_FX1)
PROP_DeathState (S_ICEGUY_FX_X1)
PROP_DeathSound ("IceGuyMissileExplode")
END_DEFAULTS
// Ice Guy Projectile's Puff ------------------------------------------------
class AIceFXPuff : public AActor
{
DECLARE_ACTOR (AIceFXPuff, AActor)
};
FState AIceFXPuff::States[] =
{
S_NORMAL (ICPR, 'I', 3, NULL , &States[1]),
S_NORMAL (ICPR, 'J', 3, NULL , &States[2]),
S_NORMAL (ICPR, 'K', 3, NULL , &States[3]),
S_NORMAL (ICPR, 'L', 2, NULL , &States[4]),
S_NORMAL (ICPR, 'M', 2, NULL , NULL),
};
IMPLEMENT_ACTOR (AIceFXPuff, Hexen, -1, 0)
PROP_RadiusFixed (1)
PROP_HeightFixed (1)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_SHADOW)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_RenderStyle (STYLE_Translucent)
PROP_Alpha (HX_ALTSHADOW)
PROP_SpawnState (0)
END_DEFAULTS
// Secondary Ice Guy Projectile (ejected by the primary projectile) ---------
class AIceGuyFX2 : public AActor
{
DECLARE_ACTOR (AIceGuyFX2, AActor)
public:
int DoSpecialDamage (AActor *target, int damage);
};
FState AIceGuyFX2::States[] =
{
S_BRIGHT (ICPR, 'N', 3, NULL , &States[1]),
S_BRIGHT (ICPR, 'O', 3, NULL , &States[2]),
S_BRIGHT (ICPR, 'P', 3, NULL , &States[0]),
};
IMPLEMENT_ACTOR (AIceGuyFX2, Hexen, -1, 0)
PROP_SpeedFixed (10)
PROP_RadiusFixed (4)
PROP_HeightFixed (4)
PROP_Damage (1)
PROP_DamageType (NAME_Ice)
PROP_Gravity (FRACUNIT/8)
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_SpawnState (0)
END_DEFAULTS
int AIceGuyFX2::DoSpecialDamage (AActor *target, int damage)
{
return damage >> 1;
}
// Ice Guy Bit --------------------------------------------------------------
class AIceGuyBit : public AActor
{
DECLARE_ACTOR (AIceGuyBit, AActor)
};
FState AIceGuyBit::States[] =
{
S_BRIGHT (ICPR, 'Q', 50, NULL , NULL),
#define S_ICEGUY_BIT2 (1)
S_BRIGHT (ICPR, 'R', 50, NULL , NULL),
};
IMPLEMENT_ACTOR (AIceGuyBit, Hexen, -1, 0)
PROP_RadiusFixed (1)
PROP_HeightFixed (1)
PROP_Gravity (FRACUNIT/8)
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_SpawnState (0)
END_DEFAULTS
// Ice Guy Wisp 1 -----------------------------------------------------------
class AIceGuyWisp1 : public AActor
{
DECLARE_ACTOR (AIceGuyWisp1, AActor)
};
FState AIceGuyWisp1::States[] =
{
S_NORMAL (ICWS, 'A', 2, NULL , &States[1]),
S_NORMAL (ICWS, 'B', 2, NULL , &States[2]),
S_NORMAL (ICWS, 'C', 2, NULL , &States[3]),
S_NORMAL (ICWS, 'D', 2, NULL , &States[4]),
S_NORMAL (ICWS, 'E', 2, NULL , &States[5]),
S_NORMAL (ICWS, 'F', 2, NULL , &States[6]),
S_NORMAL (ICWS, 'G', 2, NULL , &States[7]),
S_NORMAL (ICWS, 'H', 2, NULL , &States[8]),
S_NORMAL (ICWS, 'I', 2, NULL , NULL),
};
IMPLEMENT_ACTOR (AIceGuyWisp1, Hexen, -1, 0)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_RenderStyle (STYLE_Translucent)
PROP_Alpha (HX_ALTSHADOW)
PROP_SpawnState (0)
END_DEFAULTS
// Ice Guy Wisp 2 -----------------------------------------------------------
class AIceGuyWisp2 : public AActor
{
DECLARE_ACTOR (AIceGuyWisp2, AActor)
};
FState AIceGuyWisp2::States[] =
{
S_NORMAL (ICWS, 'J', 2, NULL , &States[1]),
S_NORMAL (ICWS, 'K', 2, NULL , &States[2]),
S_NORMAL (ICWS, 'L', 2, NULL , &States[3]),
S_NORMAL (ICWS, 'M', 2, NULL , &States[4]),
S_NORMAL (ICWS, 'N', 2, NULL , &States[5]),
S_NORMAL (ICWS, 'O', 2, NULL , &States[6]),
S_NORMAL (ICWS, 'P', 2, NULL , &States[7]),
S_NORMAL (ICWS, 'Q', 2, NULL , &States[8]),
S_NORMAL (ICWS, 'R', 2, NULL , NULL),
};
IMPLEMENT_ACTOR (AIceGuyWisp2, Hexen, -1, 0)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_RenderStyle (STYLE_Translucent)
PROP_Alpha (HX_ALTSHADOW)
PROP_SpawnState (0)
END_DEFAULTS
// Wisp types, for randomness below -----------------------------------------
static const PClass *const WispTypes[2] =
{
RUNTIME_CLASS(AIceGuyWisp1),
RUNTIME_CLASS(AIceGuyWisp2)
"IceGuyWisp1",
"IceGuyWisp2",
};
//============================================================================
@ -346,27 +89,15 @@ void A_IceGuyAttack (AActor *actor)
P_SpawnMissileXYZ(actor->x+FixedMul(actor->radius>>1,
finecosine[an]), actor->y+FixedMul(actor->radius>>1,
finesine[an]), actor->z+40*FRACUNIT, actor, actor->target,
RUNTIME_CLASS(AIceGuyFX));
PClass::FindClass ("IceGuyFX"));
an = (actor->angle-ANG90)>>ANGLETOFINESHIFT;
P_SpawnMissileXYZ(actor->x+FixedMul(actor->radius>>1,
finecosine[an]), actor->y+FixedMul(actor->radius>>1,
finesine[an]), actor->z+40*FRACUNIT, actor, actor->target,
RUNTIME_CLASS(AIceGuyFX));
PClass::FindClass ("IceGuyFX"));
S_Sound (actor, CHAN_WEAPON, actor->AttackSound, 1, ATTN_NORM);
}
//============================================================================
//
// A_IceGuyMissilePuff
//
//============================================================================
void A_IceGuyMissilePuff (AActor *actor)
{
AActor *mo;
mo = Spawn<AIceFXPuff> (actor->x, actor->y, actor->z+2*FRACUNIT, ALLOW_REPLACE);
}
//============================================================================
//
// A_IceGuyDie
@ -396,8 +127,7 @@ void A_IceGuyMissileExplode (AActor *actor)
for (i = 0; i < 8; i++)
{
mo = P_SpawnMissileAngleZ (actor, actor->z+3*FRACUNIT,
RUNTIME_CLASS(AIceGuyFX2),
i*ANG45, (fixed_t)(-0.3*FRACUNIT));
PClass::FindClass("IceGuyFX2"), i*ANG45, (fixed_t)(-0.3*FRACUNIT));
if (mo)
{
mo->target = actor->target;

View file

@ -14,364 +14,6 @@ static FRandom pr_serpentmeattack ("SerpentMeAttack");
static FRandom pr_serpentgibs ("SerpentGibs");
static FRandom pr_delaygib ("DelayGib");
void A_DoChase(AActor * actor, bool fastchase, FState * meleestate, FState * missilestate, bool playactive, bool nightmarefast,bool dontmove);
void A_SerpentChase (AActor *);
void A_SerpentHumpDecide (AActor *);
void A_SerpentDiveSound (AActor *);
void A_SerpentHide (AActor *);
void A_SerpentBirthScream (AActor *);
void A_SerpentDiveSound (AActor *);
void A_SerpentCheckForAttack (AActor *);
void A_SerpentHeadPop (AActor *);
void A_SerpentSpawnGibs (AActor *);
void A_SerpentWalk (AActor *);
void A_SerpentUnHide (AActor *);
void A_SerpentRaiseHump (AActor *);
void A_SerpentLowerHump (AActor *);
void A_SerpentMeleeAttack (AActor *);
void A_SerpentMissileAttack (AActor *);
void A_SerpentChooseAttack (AActor *);
void A_SerpentFXSound (AActor *);
void A_StopSerpentFXSound (AActor *);
void A_SerpentHeadCheck (AActor *);
void A_FloatGib (AActor *);
void A_DelayGib (AActor *);
void A_SinkGib (AActor *);
// Serpent ------------------------------------------------------------------
class ASerpent : public AActor
{
DECLARE_ACTOR (ASerpent, AActor)
public:
bool bLeader;
void Serialize (FArchive &arc);
};
FState ASerpent::States[] =
{
#define S_SERPENT_LOOK1 0
S_NORMAL (SSPT, 'H', 10, A_Look , &States[S_SERPENT_LOOK1]),
#define S_SERPENT_SWIM1 (S_SERPENT_LOOK1+1)
S_NORMAL (SSPT, 'H', 1, A_SerpentChase , &States[S_SERPENT_SWIM1+1]),
S_NORMAL (SSPT, 'H', 1, A_SerpentChase , &States[S_SERPENT_SWIM1+2]),
S_NORMAL (SSPT, 'H', 2, A_SerpentHumpDecide , &States[S_SERPENT_SWIM1]),
#define S_SERPENT_PAIN1 (S_SERPENT_SWIM1+3)
S_NORMAL (SSPT, 'L', 5, NULL , &States[S_SERPENT_PAIN1+1]),
S_NORMAL (SSPT, 'L', 5, A_Pain , &States[S_SERPENT_PAIN1+2]),
S_NORMAL (SSDV, 'A', 4, NULL , &States[S_SERPENT_PAIN1+3]),
S_NORMAL (SSDV, 'B', 4, NULL , &States[S_SERPENT_PAIN1+4]),
S_NORMAL (SSDV, 'C', 4, NULL , &States[S_SERPENT_PAIN1+5]),
S_NORMAL (SSDV, 'D', 4, A_UnSetShootable , &States[S_SERPENT_PAIN1+6]),
S_NORMAL (SSDV, 'E', 3, A_SerpentDiveSound , &States[S_SERPENT_PAIN1+7]),
S_NORMAL (SSDV, 'F', 3, NULL , &States[S_SERPENT_PAIN1+8]),
S_NORMAL (SSDV, 'G', 4, NULL , &States[S_SERPENT_PAIN1+9]),
S_NORMAL (SSDV, 'H', 4, NULL , &States[S_SERPENT_PAIN1+10]),
S_NORMAL (SSDV, 'I', 3, NULL , &States[S_SERPENT_PAIN1+11]),
S_NORMAL (SSDV, 'J', 3, A_SerpentHide , &States[S_SERPENT_SWIM1]),
#define S_SERPENT_SURFACE1 (S_SERPENT_PAIN1+12)
S_NORMAL (SSPT, 'A', 1, A_UnHideThing , &States[S_SERPENT_SURFACE1+1]),
S_NORMAL (SSPT, 'A', 1, A_SerpentBirthScream , &States[S_SERPENT_SURFACE1+2]),
S_NORMAL (SSPT, 'B', 3, A_SetShootable , &States[S_SERPENT_SURFACE1+3]),
S_NORMAL (SSPT, 'C', 3, NULL , &States[S_SERPENT_SURFACE1+4]),
S_NORMAL (SSPT, 'D', 4, A_SerpentCheckForAttack , &States[S_SERPENT_PAIN1+2]),
#define S_SERPENT_DIE1 (S_SERPENT_SURFACE1+5)
S_NORMAL (SSPT, 'O', 4, NULL , &States[S_SERPENT_DIE1+1]),
S_NORMAL (SSPT, 'P', 4, A_Scream , &States[S_SERPENT_DIE1+2]),
S_NORMAL (SSPT, 'Q', 4, A_NoBlocking , &States[S_SERPENT_DIE1+3]),
S_NORMAL (SSPT, 'R', 4, NULL , &States[S_SERPENT_DIE1+4]),
S_NORMAL (SSPT, 'S', 4, NULL , &States[S_SERPENT_DIE1+5]),
S_NORMAL (SSPT, 'T', 4, NULL , &States[S_SERPENT_DIE1+6]),
S_NORMAL (SSPT, 'U', 4, NULL , &States[S_SERPENT_DIE1+7]),
S_NORMAL (SSPT, 'V', 4, NULL , &States[S_SERPENT_DIE1+8]),
S_NORMAL (SSPT, 'W', 4, NULL , &States[S_SERPENT_DIE1+9]),
S_NORMAL (SSPT, 'X', 4, NULL , &States[S_SERPENT_DIE1+10]),
S_NORMAL (SSPT, 'Y', 4, NULL , &States[S_SERPENT_DIE1+11]),
S_NORMAL (SSPT, 'Z', 4, NULL , NULL),
#define S_SERPENT_XDIE1 (S_SERPENT_DIE1+12)
S_NORMAL (SSXD, 'A', 4, NULL , &States[S_SERPENT_XDIE1+1]),
S_NORMAL (SSXD, 'B', 4, A_SerpentHeadPop , &States[S_SERPENT_XDIE1+2]),
S_NORMAL (SSXD, 'C', 4, A_NoBlocking , &States[S_SERPENT_XDIE1+3]),
S_NORMAL (SSXD, 'D', 4, NULL , &States[S_SERPENT_XDIE1+4]),
S_NORMAL (SSXD, 'E', 4, NULL , &States[S_SERPENT_XDIE1+5]),
S_NORMAL (SSXD, 'F', 3, NULL , &States[S_SERPENT_XDIE1+6]),
S_NORMAL (SSXD, 'G', 3, NULL , &States[S_SERPENT_XDIE1+7]),
S_NORMAL (SSXD, 'H', 3, A_SerpentSpawnGibs , NULL),
#define S_SERPENT_WALK1 (S_SERPENT_XDIE1+8)
S_NORMAL (SSPT, 'I', 5, A_SerpentWalk , &States[S_SERPENT_WALK1+1]),
S_NORMAL (SSPT, 'J', 5, A_SerpentWalk , &States[S_SERPENT_WALK1+2]),
S_NORMAL (SSPT, 'I', 5, A_SerpentWalk , &States[S_SERPENT_WALK1+3]),
S_NORMAL (SSPT, 'J', 5, A_SerpentCheckForAttack , &States[S_SERPENT_PAIN1+2]),
#define S_SERPENT_HUMP1 (S_SERPENT_WALK1+4)
S_NORMAL (SSPT, 'H', 3, A_SerpentUnHide , &States[S_SERPENT_HUMP1+1]),
S_NORMAL (SSPT, 'E', 3, A_SerpentRaiseHump , &States[S_SERPENT_HUMP1+2]),
S_NORMAL (SSPT, 'F', 3, A_SerpentRaiseHump , &States[S_SERPENT_HUMP1+3]),
S_NORMAL (SSPT, 'G', 3, A_SerpentRaiseHump , &States[S_SERPENT_HUMP1+4]),
S_NORMAL (SSPT, 'E', 3, A_SerpentRaiseHump , &States[S_SERPENT_HUMP1+5]),
S_NORMAL (SSPT, 'F', 3, A_SerpentRaiseHump , &States[S_SERPENT_HUMP1+6]),
S_NORMAL (SSPT, 'G', 3, NULL , &States[S_SERPENT_HUMP1+7]),
S_NORMAL (SSPT, 'E', 3, NULL , &States[S_SERPENT_HUMP1+8]),
S_NORMAL (SSPT, 'F', 3, NULL , &States[S_SERPENT_HUMP1+9]),
S_NORMAL (SSPT, 'G', 3, A_SerpentLowerHump , &States[S_SERPENT_HUMP1+10]),
S_NORMAL (SSPT, 'E', 3, A_SerpentLowerHump , &States[S_SERPENT_HUMP1+11]),
S_NORMAL (SSPT, 'F', 3, A_SerpentLowerHump , &States[S_SERPENT_HUMP1+12]),
S_NORMAL (SSPT, 'G', 3, A_SerpentLowerHump , &States[S_SERPENT_HUMP1+13]),
S_NORMAL (SSPT, 'E', 3, A_SerpentLowerHump , &States[S_SERPENT_HUMP1+14]),
S_NORMAL (SSPT, 'F', 3, A_SerpentHide , &States[S_SERPENT_SWIM1]),
#define S_SERPENT_MELEE1 (S_SERPENT_HUMP1+15)
S_NORMAL (SSPT, 'N', 5, A_SerpentMeleeAttack , &ASerpent::States[S_SERPENT_PAIN1+2]),
#define S_SERPENT_MISSILE1 (S_SERPENT_MELEE1+1)
S_NORMAL (SSPT, 'N', 5, A_SerpentMissileAttack , &ASerpent::States[S_SERPENT_PAIN1+2]),
#define S_SERPENT_ATK1 (S_SERPENT_MISSILE1+1)
S_NORMAL (SSPT, 'K', 6, A_FaceTarget , &States[S_SERPENT_ATK1+1]),
S_NORMAL (SSPT, 'L', 5, A_SerpentChooseAttack , &States[S_SERPENT_MELEE1]),
#define S_SERPENT_ICE (S_SERPENT_ATK1+2)
S_NORMAL (SSPT, '[', 5, A_FreezeDeath , &States[S_SERPENT_ICE+1]),
S_NORMAL (SSPT, '[', 1, A_FreezeDeathChunks , &States[S_SERPENT_ICE+1]),
};
IMPLEMENT_ACTOR (ASerpent, Hexen, 121, 6)
PROP_SpawnHealth (90)
PROP_PainChance (96)
PROP_SpeedFixed (12)
PROP_RadiusFixed (32)
PROP_HeightFixed (70)
PROP_MassLong (0x7fffffff) // [RH] Is this a mistake?
PROP_Flags (MF_SOLID|MF_NOBLOOD|MF_COUNTKILL)
PROP_Flags2 (MF2_PASSMOBJ|MF2_MCROSS|MF2_CANTLEAVEFLOORPIC|MF2_NONSHOOTABLE)
PROP_Flags3 (MF3_STAYMORPHED|MF3_DONTBLAST|MF3_NOTELEOTHER)
PROP_RenderFlags (RF_INVISIBLE)
PROP_SpawnState (S_SERPENT_LOOK1)
PROP_SeeState (S_SERPENT_SWIM1)
PROP_PainState (S_SERPENT_PAIN1)
PROP_MeleeState (S_SERPENT_SURFACE1)
PROP_DeathState (S_SERPENT_DIE1)
PROP_XDeathState (S_SERPENT_XDIE1)
PROP_IDeathState (S_SERPENT_ICE)
PROP_SeeSound ("SerpentSight")
PROP_AttackSound ("SerpentAttack")
PROP_PainSound ("SerpentPain")
PROP_DeathSound ("SerpentDeath")
PROP_HitObituary("$OB_SERPENTHIT")
END_DEFAULTS
void ASerpent::Serialize (FArchive &arc)
{
Super::Serialize (arc);
arc << bLeader;
}
// Serpent Leader -----------------------------------------------------------
class ASerpentLeader : public ASerpent
{
DECLARE_STATELESS_ACTOR (ASerpentLeader, ASerpent)
public:
void BeginPlay ();
};
IMPLEMENT_STATELESS_ACTOR (ASerpentLeader, Hexen, 120, 7)
PROP_Mass (200)
PROP_Obituary("$OB_SERPENT")
END_DEFAULTS
void ASerpentLeader::BeginPlay ()
{
bLeader = true;
}
// Serpent Missile Ball -----------------------------------------------------
class ASerpentFX : public AActor
{
DECLARE_ACTOR (ASerpentFX, AActor)
public:
void Tick ()
{
Super::Tick ();
}
};
FState ASerpentFX::States[] =
{
#define S_SERPENT_FX1 0
// [RH] This 0-length state was added so that the looping sound can start
// playing as soon as possible, because action functions are not called
// when an actor is spawned. (Should I change that? No.)
S_BRIGHT (SSFX, 'A', 0, NULL , &States[S_SERPENT_FX1+1]),
S_BRIGHT (SSFX, 'A', 3, A_SerpentFXSound , &States[S_SERPENT_FX1+2]),
S_BRIGHT (SSFX, 'B', 3, NULL , &States[S_SERPENT_FX1+3]),
S_BRIGHT (SSFX, 'A', 3, NULL , &States[S_SERPENT_FX1+4]),
S_BRIGHT (SSFX, 'B', 3, NULL , &States[S_SERPENT_FX1+1]),
#define S_SERPENT_FX_X1 (S_SERPENT_FX1+5)
S_BRIGHT (SSFX, 'C', 4, A_StopSerpentFXSound , &States[S_SERPENT_FX_X1+1]),
S_BRIGHT (SSFX, 'D', 4, NULL , &States[S_SERPENT_FX_X1+2]),
S_BRIGHT (SSFX, 'E', 4, NULL , &States[S_SERPENT_FX_X1+3]),
S_BRIGHT (SSFX, 'F', 4, NULL , &States[S_SERPENT_FX_X1+4]),
S_BRIGHT (SSFX, 'G', 4, NULL , &States[S_SERPENT_FX_X1+5]),
S_BRIGHT (SSFX, 'H', 4, NULL , NULL),
};
IMPLEMENT_ACTOR (ASerpentFX, Hexen, -1, 0)
PROP_SpeedFixed (15)
PROP_RadiusFixed (8)
PROP_HeightFixed (10)
PROP_Damage (4)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_RenderStyle (STYLE_Add)
PROP_SpawnState (S_SERPENT_FX1)
PROP_DeathState (S_SERPENT_FX_X1)
PROP_DeathSound ("SerpentFXHit")
END_DEFAULTS
// Serpent Head -------------------------------------------------------------
class ASerpentHead : public AActor
{
DECLARE_ACTOR (ASerpentHead, AActor)
};
FState ASerpentHead::States[] =
{
#define S_SERPENT_HEAD1 0
S_NORMAL (SSXD, 'I', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1+1]),
S_NORMAL (SSXD, 'J', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1+2]),
S_NORMAL (SSXD, 'K', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1+3]),
S_NORMAL (SSXD, 'L', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1+4]),
S_NORMAL (SSXD, 'M', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1+5]),
S_NORMAL (SSXD, 'N', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1+6]),
S_NORMAL (SSXD, 'O', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1+7]),
S_NORMAL (SSXD, 'P', 4, A_SerpentHeadCheck , &States[S_SERPENT_HEAD1]),
#define S_SERPENT_HEAD_X1 (S_SERPENT_HEAD1+8)
S_NORMAL (SSXD, 'S', -1, NULL , &States[S_SERPENT_HEAD_X1]),
};
IMPLEMENT_ACTOR (ASerpentHead, Hexen, -1, 0)
PROP_RadiusFixed (5)
PROP_HeightFixed (10)
PROP_Gravity (FRACUNIT/8)
PROP_Flags (MF_NOBLOCKMAP)
PROP_SpawnState (S_SERPENT_HEAD1)
PROP_DeathState (S_SERPENT_HEAD_X1)
END_DEFAULTS
// Serpent Gib 1 ------------------------------------------------------------
class ASerpentGib1 : public AActor
{
DECLARE_ACTOR (ASerpentGib1, AActor)
};
FState ASerpentGib1::States[] =
{
#define S_SERPENT_GIB1_1 0
S_NORMAL (SSXD, 'Q', 6, NULL , &States[S_SERPENT_GIB1_1+1]),
S_NORMAL (SSXD, 'Q', 6, A_FloatGib , &States[S_SERPENT_GIB1_1+2]),
S_NORMAL (SSXD, 'Q', 8, A_FloatGib , &States[S_SERPENT_GIB1_1+3]),
S_NORMAL (SSXD, 'Q', 8, A_FloatGib , &States[S_SERPENT_GIB1_1+4]),
S_NORMAL (SSXD, 'Q', 12, A_FloatGib , &States[S_SERPENT_GIB1_1+5]),
S_NORMAL (SSXD, 'Q', 12, A_FloatGib , &States[S_SERPENT_GIB1_1+6]),
S_NORMAL (SSXD, 'Q', 232, A_DelayGib , &States[S_SERPENT_GIB1_1+7]),
S_NORMAL (SSXD, 'Q', 12, A_SinkGib , &States[S_SERPENT_GIB1_1+8]),
S_NORMAL (SSXD, 'Q', 12, A_SinkGib , &States[S_SERPENT_GIB1_1+9]),
S_NORMAL (SSXD, 'Q', 8, A_SinkGib , &States[S_SERPENT_GIB1_1+10]),
S_NORMAL (SSXD, 'Q', 8, A_SinkGib , &States[S_SERPENT_GIB1_1+11]),
S_NORMAL (SSXD, 'Q', 8, A_SinkGib , NULL),
};
IMPLEMENT_ACTOR (ASerpentGib1, Hexen, -1, 0)
PROP_RadiusFixed (3)
PROP_HeightFixed (3)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY)
PROP_SpawnState (S_SERPENT_GIB1_1)
END_DEFAULTS
// Serpent Gib 2 ------------------------------------------------------------
class ASerpentGib2 : public AActor
{
DECLARE_ACTOR (ASerpentGib2, AActor)
};
FState ASerpentGib2::States[] =
{
#define S_SERPENT_GIB2_1 0
S_NORMAL (SSXD, 'R', 6, NULL , &States[S_SERPENT_GIB2_1+1]),
S_NORMAL (SSXD, 'R', 6, A_FloatGib , &States[S_SERPENT_GIB2_1+2]),
S_NORMAL (SSXD, 'R', 8, A_FloatGib , &States[S_SERPENT_GIB2_1+3]),
S_NORMAL (SSXD, 'R', 8, A_FloatGib , &States[S_SERPENT_GIB2_1+4]),
S_NORMAL (SSXD, 'R', 12, A_FloatGib , &States[S_SERPENT_GIB2_1+5]),
S_NORMAL (SSXD, 'R', 12, A_FloatGib , &States[S_SERPENT_GIB2_1+6]),
S_NORMAL (SSXD, 'R', 232, A_DelayGib , &States[S_SERPENT_GIB2_1+7]),
S_NORMAL (SSXD, 'R', 12, A_SinkGib , &States[S_SERPENT_GIB2_1+8]),
S_NORMAL (SSXD, 'R', 12, A_SinkGib , &States[S_SERPENT_GIB2_1+9]),
S_NORMAL (SSXD, 'R', 8, A_SinkGib , &States[S_SERPENT_GIB2_1+10]),
S_NORMAL (SSXD, 'R', 8, A_SinkGib , &States[S_SERPENT_GIB2_1+11]),
S_NORMAL (SSXD, 'R', 8, A_SinkGib , NULL),
};
IMPLEMENT_ACTOR (ASerpentGib2, Hexen, -1, 0)
PROP_RadiusFixed (3)
PROP_HeightFixed (3)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY)
PROP_SpawnState (S_SERPENT_GIB2_1)
END_DEFAULTS
// Serpent Gib 3 ------------------------------------------------------------
class ASerpentGib3 : public AActor
{
DECLARE_ACTOR (ASerpentGib3, AActor)
};
FState ASerpentGib3::States[] =
{
#define S_SERPENT_GIB3_1 0
S_NORMAL (SSXD, 'T', 6, NULL , &States[S_SERPENT_GIB3_1+1]),
S_NORMAL (SSXD, 'T', 6, A_FloatGib , &States[S_SERPENT_GIB3_1+2]),
S_NORMAL (SSXD, 'T', 8, A_FloatGib , &States[S_SERPENT_GIB3_1+3]),
S_NORMAL (SSXD, 'T', 8, A_FloatGib , &States[S_SERPENT_GIB3_1+4]),
S_NORMAL (SSXD, 'T', 12, A_FloatGib , &States[S_SERPENT_GIB3_1+5]),
S_NORMAL (SSXD, 'T', 12, A_FloatGib , &States[S_SERPENT_GIB3_1+6]),
S_NORMAL (SSXD, 'T', 232, A_DelayGib , &States[S_SERPENT_GIB3_1+7]),
S_NORMAL (SSXD, 'T', 12, A_SinkGib , &States[S_SERPENT_GIB3_1+8]),
S_NORMAL (SSXD, 'T', 12, A_SinkGib , &States[S_SERPENT_GIB3_1+9]),
S_NORMAL (SSXD, 'T', 8, A_SinkGib , &States[S_SERPENT_GIB3_1+10]),
S_NORMAL (SSXD, 'T', 8, A_SinkGib , &States[S_SERPENT_GIB3_1+11]),
S_NORMAL (SSXD, 'T', 8, A_SinkGib , NULL),
};
IMPLEMENT_ACTOR (ASerpentGib3, Hexen, -1, 0)
PROP_RadiusFixed (3)
PROP_HeightFixed (3)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY)
PROP_SpawnState (S_SERPENT_GIB3_1)
END_DEFAULTS
//============================================================================
//
// A_SerpentUnHide
@ -395,16 +37,6 @@ void A_SerpentHide (AActor *actor)
actor->renderflags |= RF_INVISIBLE;
actor->floorclip = 0;
}
//============================================================================
//
// A_SerpentChase
//
//============================================================================
void A_SerpentChase (AActor *actor)
{
A_DoChase (actor, false, actor->MeleeState, NULL, false, true, false);
}
//============================================================================
//
@ -439,7 +71,7 @@ void A_SerpentLowerHump (AActor *actor)
void A_SerpentHumpDecide (AActor *actor)
{
if (static_cast<ASerpent *>(actor)->bLeader)
if (actor->MissileState != NULL)
{
if (pr_serpenthump() > 30)
{
@ -447,7 +79,7 @@ void A_SerpentHumpDecide (AActor *actor)
}
else if (pr_serpenthump() < 40)
{ // Missile attack
actor->SetState (&ASerpent::States[S_SERPENT_SURFACE1]);
actor->SetState (actor->MeleeState);
return;
}
}
@ -457,53 +89,18 @@ void A_SerpentHumpDecide (AActor *actor)
}
if (!actor->CheckMeleeRange ())
{ // The hump shouldn't occur when within melee range
if (static_cast<ASerpent *>(actor)->bLeader &&
pr_serpenthump() < 128)
if (actor->MissileState != NULL && pr_serpenthump() < 128)
{
actor->SetState (&ASerpent::States[S_SERPENT_SURFACE1]);
actor->SetState (actor->MeleeState);
}
else
{
actor->SetState (&ASerpent::States[S_SERPENT_HUMP1]);
actor->SetState (actor->FindState ("Hump"));
S_Sound (actor, CHAN_BODY, "SerpentActive", 1, ATTN_NORM);
}
}
}
//============================================================================
//
// A_SerpentBirthScream
//
//============================================================================
void A_SerpentBirthScream (AActor *actor)
{
S_Sound (actor, CHAN_VOICE, "SerpentBirth", 1, ATTN_NORM);
}
//============================================================================
//
// A_SerpentDiveSound
//
//============================================================================
void A_SerpentDiveSound (AActor *actor)
{
S_Sound (actor, CHAN_BODY, "SerpentActive", 1, ATTN_NORM);
}
//============================================================================
//
// A_SerpentWalk
//
// Similar to A_Chase, only has a hardcoded entering of meleestate
//============================================================================
void A_SerpentWalk (AActor *actor)
{
A_DoChase (actor, false, &ASerpent::States[S_SERPENT_ATK1], NULL, true, true, false);
}
//============================================================================
//
// A_SerpentCheckForAttack
@ -516,27 +113,27 @@ void A_SerpentCheckForAttack (AActor *actor)
{
return;
}
if (static_cast<ASerpent *>(actor)->bLeader)
if (actor->MissileState != NULL)
{
if (!actor->CheckMeleeRange ())
{
actor->SetState (&ASerpent::States[S_SERPENT_ATK1]);
actor->SetState (actor->FindState ("Attack"));
return;
}
}
if (P_CheckMeleeRange2 (actor))
{
actor->SetState (&ASerpent::States[S_SERPENT_WALK1]);
actor->SetState (actor->FindState ("Walk"));
}
else if (actor->CheckMeleeRange ())
{
if (pr_serpentattack() < 32)
{
actor->SetState (&ASerpent::States[S_SERPENT_WALK1]);
actor->SetState (actor->FindState ("Walk"));
}
else
{
actor->SetState (&ASerpent::States[S_SERPENT_ATK1]);
actor->SetState (actor->FindState ("Attack"));
}
}
}
@ -553,9 +150,9 @@ void A_SerpentChooseAttack (AActor *actor)
{
return;
}
if (static_cast<ASerpent *>(actor)->bLeader)
if (actor->MissileState != NULL)
{
actor->SetState (&ASerpent::States[S_SERPENT_MISSILE1]);
actor->SetState (actor->MissileState);
}
}
@ -584,34 +181,6 @@ void A_SerpentMeleeAttack (AActor *actor)
}
}
//============================================================================
//
// A_SerpentMissileAttack
//
//============================================================================
void A_SerpentMissileAttack (AActor *actor)
{
AActor *mo;
if (!actor->target)
{
return;
}
mo = P_SpawnMissile (actor, actor->target, RUNTIME_CLASS(ASerpentFX));
}
//============================================================================
//
// A_SerpentHeadPop
//
//============================================================================
void A_SerpentHeadPop (AActor *actor)
{
Spawn<ASerpentHead> (actor->x, actor->y, actor->z+45*FRACUNIT, ALLOW_REPLACE);
}
//============================================================================
//
// A_SerpentSpawnGibs
@ -621,11 +190,11 @@ void A_SerpentHeadPop (AActor *actor)
void A_SerpentSpawnGibs (AActor *actor)
{
AActor *mo;
static const PClass *const GibTypes[] =
static const char *GibTypes[] =
{
RUNTIME_CLASS(ASerpentGib3),
RUNTIME_CLASS(ASerpentGib2),
RUNTIME_CLASS(ASerpentGib1)
"SerpentGib3",
"SerpentGib2",
"SerpentGib1"
};
for (int i = countof(GibTypes)-1; i >= 0; --i)
@ -698,27 +267,3 @@ void A_SerpentHeadCheck (AActor *actor)
}
}
//============================================================================
//
// A_SerpentFXSound
//
//============================================================================
void A_SerpentFXSound (AActor *actor)
{
if (!S_IsActorPlayingSomething (actor, CHAN_BODY, -1))
{
S_Sound (actor, CHAN_BODY|CHAN_LOOP, "SerpentFXContinuous", 1, ATTN_NORM);
}
}
//============================================================================
//
// A_StopSerpentFXSound
//
//============================================================================
void A_StopSerpentFXSound (AActor *actor)
{
S_StopSound (actor, CHAN_BODY);
}

View file

@ -9,31 +9,12 @@
static FRandom pr_thrustraise ("ThrustRaise");
// Dirt clump (spawned by spike) --------------------------------------------
class ADirtClump : public AActor
{
DECLARE_ACTOR (ADirtClump, AActor)
};
FState ADirtClump::States[] =
{
S_NORMAL (TSPK, 'C', 20, NULL, &States[0])
};
IMPLEMENT_ACTOR (ADirtClump, Hexen, -1, 0)
PROP_Flags (MF_NOBLOCKMAP)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_SpawnState (0)
END_DEFAULTS
// Spike (thrust floor) -----------------------------------------------------
void A_ThrustInitUp (AActor *);
void A_ThrustInitDn (AActor *);
void A_ThrustRaise (AActor *);
void A_ThrustLower (AActor *);
void A_ThrustBlock (AActor *);
void A_ThrustImpale (AActor *);
// AThrustFloor is just a container for all the spike states.
@ -41,23 +22,17 @@ void A_ThrustImpale (AActor *);
class AThrustFloor : public AActor
{
DECLARE_ACTOR (AThrustFloor, AActor)
HAS_OBJECT_POINTERS
DECLARE_CLASS (AThrustFloor, AActor)
public:
void Serialize (FArchive &arc);
fixed_t GetSinkSpeed () { return 6*FRACUNIT; }
fixed_t GetRaiseSpeed () { return special2*FRACUNIT; }
void Activate (AActor *activator);
void Deactivate (AActor *activator);
TObjPtr<ADirtClump> DirtClump;
TObjPtr<AActor> DirtClump;
};
IMPLEMENT_POINTY_CLASS (AThrustFloor)
DECLARE_POINTER (DirtClump)
END_POINTERS
IMPLEMENT_CLASS (AThrustFloor)
void AThrustFloor::Serialize (FArchive &arc)
{
@ -65,73 +40,6 @@ void AThrustFloor::Serialize (FArchive &arc)
arc << DirtClump;
}
FState AThrustFloor::States[] =
{
#define S_THRUSTRAISING 0
S_NORMAL (TSPK, 'A', 2, A_ThrustRaise , &States[S_THRUSTRAISING]),
#define S_BTHRUSTRAISING (S_THRUSTRAISING+1)
S_NORMAL (TSPK, 'B', 2, A_ThrustRaise , &States[S_BTHRUSTRAISING]),
#define S_THRUSTIMPALE (S_BTHRUSTRAISING+1)
S_NORMAL (TSPK, 'A', 2, A_ThrustImpale , &States[S_THRUSTRAISING]),
#define S_BTHRUSTIMPALE (S_THRUSTIMPALE+1)
S_NORMAL (TSPK, 'B', 2, A_ThrustImpale , &States[S_BTHRUSTRAISING]),
#define S_THRUSTBLOCK (S_BTHRUSTIMPALE+1)
S_NORMAL (TSPK, 'A', 10, NULL , &States[S_THRUSTBLOCK]),
#define S_BTHRUSTBLOCK (S_THRUSTBLOCK+1)
S_NORMAL (TSPK, 'B', 10, NULL , &States[S_BTHRUSTBLOCK]),
#define S_THRUSTLOWER (S_BTHRUSTBLOCK+1)
S_NORMAL (TSPK, 'A', 2, A_ThrustLower , &States[S_THRUSTLOWER]),
#define S_BTHRUSTLOWER (S_THRUSTLOWER+1)
S_NORMAL (TSPK, 'B', 2, A_ThrustLower , &States[S_BTHRUSTLOWER]),
#define S_THRUSTSTAY (S_BTHRUSTLOWER+1)
S_NORMAL (TSPK, 'A', -1, NULL , &States[S_THRUSTSTAY]),
#define S_BTHRUSTSTAY (S_THRUSTSTAY+1)
S_NORMAL (TSPK, 'B', -1, NULL , &States[S_BTHRUSTSTAY]),
#define S_THRUSTINIT2 (S_BTHRUSTSTAY+1)
S_NORMAL (TSPK, 'A', 3, NULL , &States[S_THRUSTINIT2+1]),
S_NORMAL (TSPK, 'A', 4, A_ThrustInitUp , &States[S_THRUSTBLOCK]),
#define S_BTHRUSTINIT2 (S_THRUSTINIT2+2)
S_NORMAL (TSPK, 'B', 3, NULL , &States[S_BTHRUSTINIT2+1]),
S_NORMAL (TSPK, 'B', 4, A_ThrustInitUp , &States[S_BTHRUSTBLOCK]),
#define S_THRUSTINIT1 (S_BTHRUSTINIT2+2)
S_NORMAL (TSPK, 'A', 3, NULL , &States[S_THRUSTINIT1+1]),
S_NORMAL (TSPK, 'A', 4, A_ThrustInitDn , &States[S_THRUSTSTAY]),
#define S_BTHRUSTINIT1 (S_THRUSTINIT1+2)
S_NORMAL (TSPK, 'B', 3, NULL , &States[S_BTHRUSTINIT1+1]),
S_NORMAL (TSPK, 'B', 4, A_ThrustInitDn , &States[S_BTHRUSTSTAY]),
#define S_THRUSTRAISE (S_BTHRUSTINIT1+2)
S_NORMAL (TSPK, 'A', 8, A_ThrustRaise , &States[S_THRUSTRAISE+1]),
S_NORMAL (TSPK, 'A', 6, A_ThrustRaise , &States[S_THRUSTRAISE+2]),
S_NORMAL (TSPK, 'A', 4, A_ThrustRaise , &States[S_THRUSTRAISE+3]),
S_NORMAL (TSPK, 'A', 3, A_ThrustBlock , &States[S_THRUSTIMPALE]),
#define S_BTHRUSTRAISE (S_THRUSTRAISE+4)
S_NORMAL (TSPK, 'B', 8, A_ThrustRaise , &States[S_BTHRUSTRAISE+1]),
S_NORMAL (TSPK, 'B', 6, A_ThrustRaise , &States[S_BTHRUSTRAISE+2]),
S_NORMAL (TSPK, 'B', 4, A_ThrustRaise , &States[S_BTHRUSTRAISE+3]),
S_NORMAL (TSPK, 'B', 3, A_ThrustBlock , &States[S_BTHRUSTIMPALE]),
};
BEGIN_DEFAULTS (AThrustFloor, Hexen, -1, 0)
PROP_RadiusFixed (20)
PROP_HeightFixed (128)
END_DEFAULTS
void AThrustFloor::Activate (AActor *activator)
{
if (args[0] == 0)
@ -139,9 +47,9 @@ void AThrustFloor::Activate (AActor *activator)
S_Sound (this, CHAN_BODY, "ThrustSpikeLower", 1, ATTN_NORM);
renderflags &= ~RF_INVISIBLE;
if (args[1])
SetState (&States[S_BTHRUSTRAISE]);
SetState (FindState ("BloodThrustRaise"));
else
SetState (&States[S_THRUSTRAISE]);
SetState (FindState ("ThrustRaise"));
}
}
@ -151,38 +59,12 @@ void AThrustFloor::Deactivate (AActor *activator)
{
S_Sound (this, CHAN_BODY, "ThrustSpikeRaise", 1, ATTN_NORM);
if (args[1])
SetState (&States[S_BTHRUSTLOWER]);
SetState (FindState ("BloodThrustLower"));
else
SetState (&States[S_THRUSTLOWER]);
SetState (FindState ("ThrustLower"));
}
}
// Spike up -----------------------------------------------------------------
class AThrustFloorUp : public AThrustFloor
{
DECLARE_STATELESS_ACTOR (AThrustFloorUp, AThrustFloor)
};
IMPLEMENT_STATELESS_ACTOR (AThrustFloorUp, Hexen, 10091, 104)
PROP_Flags (MF_SOLID)
PROP_Flags2 (MF2_NOTELEPORT|MF2_FLOORCLIP)
PROP_SpawnState (S_THRUSTINIT2)
END_DEFAULTS
// Spike down ---------------------------------------------------------------
class AThrustFloorDown : public AThrustFloor
{
DECLARE_STATELESS_ACTOR (AThrustFloorDown, AThrustFloor)
};
IMPLEMENT_STATELESS_ACTOR (AThrustFloorDown, Hexen, 10090, 105)
PROP_Flags2 (MF2_NOTELEPORT|MF2_FLOORCLIP)
PROP_RenderFlags (RF_INVISIBLE)
PROP_SpawnState (S_THRUSTINIT1)
END_DEFAULTS
//===========================================================================
//
// Thrust floor stuff
@ -213,7 +95,7 @@ void A_ThrustInitDn (AActor *actor)
actor->flags2 = MF2_NOTELEPORT|MF2_FLOORCLIP;
actor->renderflags = RF_INVISIBLE;
static_cast<AThrustFloor *>(actor)->DirtClump =
Spawn<ADirtClump> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
Spawn("DirtClump", actor->x, actor->y, actor->z, ALLOW_REPLACE);
}
@ -221,13 +103,13 @@ void A_ThrustRaise (AActor *self)
{
AThrustFloor *actor = static_cast<AThrustFloor *>(self);
if (A_RaiseMobj (actor))
if (A_RaiseMobj (actor, self->special2*FRACUNIT))
{ // Reached it's target height
actor->args[0] = 1;
if (actor->args[1])
actor->SetStateNF (&AThrustFloor::States[S_BTHRUSTINIT2]);
actor->SetStateNF (actor->FindState ("BloodThrustInit2"));
else
actor->SetStateNF (&AThrustFloor::States[S_THRUSTINIT2]);
actor->SetStateNF (actor->FindState ("ThrustInit2"));
}
// Lose the dirt clump
@ -245,21 +127,16 @@ void A_ThrustRaise (AActor *self)
void A_ThrustLower (AActor *actor)
{
if (A_SinkMobj (actor))
if (A_SinkMobj (actor, 6*FRACUNIT))
{
actor->args[0] = 0;
if (actor->args[1])
actor->SetStateNF (&AThrustFloor::States[S_BTHRUSTINIT1]);
actor->SetStateNF (actor->FindState ("BloodThrustInit1"));
else
actor->SetStateNF (&AThrustFloor::States[S_THRUSTINIT1]);
actor->SetStateNF (actor->FindState ("ThrustInit1"));
}
}
void A_ThrustBlock (AActor *actor)
{
actor->flags |= MF_SOLID;
}
void A_ThrustImpale (AActor *actor)
{
AActor *thing;

View file

@ -7,308 +7,11 @@
#include "m_random.h"
#include "a_sharedglobal.h"
void A_WraithInit (AActor *);
void A_WraithLook (AActor *);
void A_WraithRaiseInit (AActor *);
void A_WraithRaise (AActor *);
void A_WraithChase (AActor *);
void A_WraithMelee (AActor *);
void A_WraithMissile (AActor *);
void A_WraithFX2 (AActor *);
void A_WraithFX3 (AActor *);
void A_WraithChase (AActor *);
static FRandom pr_stealhealth ("StealHealth");
static FRandom pr_wraithfx2 ("WraithFX2");
static FRandom pr_wraithfx3 ("WraithFX3");
static FRandom pr_wraithfx4 ("WraithFX4");
// Wraith -------------------------------------------------------------------
class AWraith : public AActor
{
DECLARE_ACTOR (AWraith, AActor)
};
FState AWraith::States[] =
{
#define S_WRAITH_LOOK1 0
S_NORMAL (WRTH, 'A', 15, A_WraithLook , &States[S_WRAITH_LOOK1+1]),
S_NORMAL (WRTH, 'B', 15, A_WraithLook , &States[S_WRAITH_LOOK1]),
#define S_WRAITH_RAISE1 (S_WRAITH_LOOK1+2)
S_NORMAL (WRTH, 'A', 2, A_WraithRaiseInit , &States[S_WRAITH_RAISE1+1]),
S_NORMAL (WRTH, 'A', 2, A_WraithRaise , &States[S_WRAITH_RAISE1+2]),
S_NORMAL (WRTH, 'A', 2, A_FaceTarget , &States[S_WRAITH_RAISE1+3]),
S_NORMAL (WRTH, 'B', 2, A_WraithRaise , &States[S_WRAITH_RAISE1+4]),
S_NORMAL (WRTH, 'B', 2, A_WraithRaise , &States[S_WRAITH_RAISE1+1]),
#define S_WRAITH_ICE (S_WRAITH_RAISE1+5)
S_NORMAL (WRT2, 'I', 5, A_FreezeDeath , &States[S_WRAITH_ICE+1]),
S_NORMAL (WRT2, 'I', 1, A_FreezeDeathChunks , &States[S_WRAITH_ICE+1]),
#define S_WRAITH_INIT1 (S_WRAITH_ICE+2)
S_NORMAL (WRTH, 'A', 10, NULL , &States[S_WRAITH_INIT1+1]),
S_NORMAL (WRTH, 'B', 5, A_WraithInit , &States[S_WRAITH_LOOK1]),
#define S_WRAITH_CHASE1 (S_WRAITH_INIT1+2)
S_NORMAL (WRTH, 'A', 4, A_WraithChase , &States[S_WRAITH_CHASE1+1]),
S_NORMAL (WRTH, 'B', 4, A_WraithChase , &States[S_WRAITH_CHASE1+2]),
S_NORMAL (WRTH, 'C', 4, A_WraithChase , &States[S_WRAITH_CHASE1+3]),
S_NORMAL (WRTH, 'D', 4, A_WraithChase , &States[S_WRAITH_CHASE1+0]),
#define S_WRAITH_PAIN1 (S_WRAITH_CHASE1+4)
S_NORMAL (WRTH, 'A', 2, NULL , &States[S_WRAITH_PAIN1+1]),
S_NORMAL (WRTH, 'H', 6, A_Pain , &States[S_WRAITH_CHASE1]),
#define S_WRAITH_ATK1_1 (S_WRAITH_PAIN1+2)
S_NORMAL (WRTH, 'E', 6, A_FaceTarget , &States[S_WRAITH_ATK1_1+1]),
S_NORMAL (WRTH, 'F', 6, A_WraithFX3 , &States[S_WRAITH_ATK1_1+2]),
S_NORMAL (WRTH, 'G', 6, A_WraithMelee , &States[S_WRAITH_CHASE1]),
#define S_WRAITH_ATK2_1 (S_WRAITH_ATK1_1+3)
S_NORMAL (WRTH, 'E', 6, A_FaceTarget , &States[S_WRAITH_ATK2_1+1]),
S_NORMAL (WRTH, 'F', 6, NULL , &States[S_WRAITH_ATK2_1+2]),
S_NORMAL (WRTH, 'G', 6, A_WraithMissile , &States[S_WRAITH_CHASE1]),
#define S_WRAITH_DEATH1_1 (S_WRAITH_ATK2_1+3)
S_NORMAL (WRTH, 'I', 4, NULL , &States[S_WRAITH_DEATH1_1+1]),
S_NORMAL (WRTH, 'J', 4, A_Scream , &States[S_WRAITH_DEATH1_1+2]),
S_NORMAL (WRTH, 'K', 4, NULL , &States[S_WRAITH_DEATH1_1+3]),
S_NORMAL (WRTH, 'L', 4, NULL , &States[S_WRAITH_DEATH1_1+4]),
S_NORMAL (WRTH, 'M', 4, A_NoBlocking , &States[S_WRAITH_DEATH1_1+5]),
S_NORMAL (WRTH, 'N', 4, A_QueueCorpse , &States[S_WRAITH_DEATH1_1+6]),
S_NORMAL (WRTH, 'O', 4, NULL , &States[S_WRAITH_DEATH1_1+7]),
S_NORMAL (WRTH, 'P', 5, NULL , &States[S_WRAITH_DEATH1_1+8]),
S_NORMAL (WRTH, 'Q', 5, NULL , &States[S_WRAITH_DEATH1_1+9]),
S_NORMAL (WRTH, 'R', -1, NULL , NULL),
#define S_WRAITH_DEATH2_1 (S_WRAITH_DEATH1_1+10)
S_NORMAL (WRT2, 'A', 5, NULL , &States[S_WRAITH_DEATH2_1+1]),
S_NORMAL (WRT2, 'B', 5, A_Scream , &States[S_WRAITH_DEATH2_1+2]),
S_NORMAL (WRT2, 'C', 5, NULL , &States[S_WRAITH_DEATH2_1+3]),
S_NORMAL (WRT2, 'D', 5, NULL , &States[S_WRAITH_DEATH2_1+4]),
S_NORMAL (WRT2, 'E', 5, A_NoBlocking , &States[S_WRAITH_DEATH2_1+5]),
S_NORMAL (WRT2, 'F', 5, A_QueueCorpse , &States[S_WRAITH_DEATH2_1+6]),
S_NORMAL (WRT2, 'G', 5, NULL , &States[S_WRAITH_DEATH2_1+7]),
S_NORMAL (WRT2, 'H', -1, NULL , NULL),
};
IMPLEMENT_ACTOR (AWraith, Hexen, 34, 8)
PROP_SpawnHealth (150)
PROP_PainChance (25)
PROP_SpeedFixed (11)
PROP_HeightFixed (55)
PROP_Mass (75)
PROP_Damage (10)
PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOGRAVITY|MF_DROPOFF|MF_FLOAT|MF_COUNTKILL)
PROP_Flags2 (MF2_FLOORCLIP|MF2_PASSMOBJ|MF2_TELESTOMP|MF2_PUSHWALL)
PROP_SpawnState (S_WRAITH_INIT1)
PROP_SeeState (S_WRAITH_CHASE1)
PROP_PainState (S_WRAITH_PAIN1)
PROP_MeleeState (S_WRAITH_ATK1_1)
PROP_MissileState (S_WRAITH_ATK2_1)
PROP_DeathState (S_WRAITH_DEATH1_1)
PROP_XDeathState (S_WRAITH_DEATH2_1)
PROP_IDeathState (S_WRAITH_ICE)
PROP_SeeSound ("WraithSight")
PROP_AttackSound ("WraithAttack")
PROP_PainSound ("WraithPain")
PROP_DeathSound ("WraithDeath")
PROP_ActiveSound ("WraithActive")
PROP_HitObituary("$OB_WRAITHHIT")
PROP_Obituary("$OB_WRAITH")
END_DEFAULTS
// Buried wraith ------------------------------------------------------------
class AWraithBuried : public AWraith
{
DECLARE_STATELESS_ACTOR (AWraithBuried, AWraith)
public:
fixed_t GetRaiseSpeed ()
{
return 2*FRACUNIT;
}
};
IMPLEMENT_STATELESS_ACTOR (AWraithBuried, Hexen, 10011, 9)
PROP_HeightFixed (68)
PROP_Flags (MF_NOGRAVITY|MF_DROPOFF|MF_FLOAT|MF_COUNTKILL)
PROP_Flags2 (MF2_FLOORCLIP|MF2_PASSMOBJ|MF2_TELESTOMP|MF2_PUSHWALL)
PROP_Flags3 (MF3_DONTMORPH|MF3_DONTBLAST|MF3_SPECIALFLOORCLIP|MF3_STAYMORPHED)
PROP_RenderFlags (RF_INVISIBLE)
PROP_PainChance (0)
PROP_SpawnState (S_WRAITH_LOOK1)
PROP_SeeState (S_WRAITH_RAISE1)
END_DEFAULTS
// --------------------------------------------------------------------------
class AWraithFX1 : public AActor
{
DECLARE_ACTOR (AWraithFX1, AActor)
};
FState AWraithFX1::States[] =
{
#define S_WRTHFX_MOVE1 0
S_BRIGHT (WRBL, 'A', 3, NULL , &States[S_WRTHFX_MOVE1+1]),
S_BRIGHT (WRBL, 'B', 3, A_WraithFX2 , &States[S_WRTHFX_MOVE1+2]),
S_BRIGHT (WRBL, 'C', 3, NULL , &States[S_WRTHFX_MOVE1]),
#define S_WRTHFX_BOOM1 (S_WRTHFX_MOVE1+3)
S_BRIGHT (WRBL, 'D', 4, NULL , &States[S_WRTHFX_BOOM1+1]),
S_BRIGHT (WRBL, 'E', 4, A_WraithFX2 , &States[S_WRTHFX_BOOM1+2]),
S_BRIGHT (WRBL, 'F', 4, NULL , &States[S_WRTHFX_BOOM1+3]),
S_BRIGHT (WRBL, 'G', 3, A_WraithFX2 , &States[S_WRTHFX_BOOM1+4]),
S_BRIGHT (WRBL, 'H', 3, A_WraithFX2 , &States[S_WRTHFX_BOOM1+5]),
S_BRIGHT (WRBL, 'I', 3, NULL , NULL),
};
IMPLEMENT_ACTOR (AWraithFX1, Hexen, -1, 0)
PROP_SpeedFixed (14)
PROP_RadiusFixed (10)
PROP_HeightFixed (6)
PROP_Mass (5)
PROP_Damage (5)
PROP_DamageType (NAME_Fire)
PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_FLOORCLIP|MF2_NOTELEPORT|MF2_IMPACT|MF2_PCROSS)
PROP_SpawnState (S_WRTHFX_MOVE1)
PROP_DeathState (S_WRTHFX_BOOM1)
PROP_SeeSound ("WraithMissileFire")
PROP_DeathSound ("WraithMissileExplode")
END_DEFAULTS
// --------------------------------------------------------------------------
class AWraithFX2 : public AActor
{
DECLARE_ACTOR (AWraithFX2, AActor)
};
FState AWraithFX2::States[] =
{
#define S_WRTHFX_SIZZLE1 0
S_BRIGHT (WRBL, 'J', 4, NULL , &States[S_WRTHFX_SIZZLE1+1]),
S_BRIGHT (WRBL, 'K', 4, NULL , &States[S_WRTHFX_SIZZLE1+2]),
S_BRIGHT (WRBL, 'L', 4, NULL , &States[S_WRTHFX_SIZZLE1+3]),
S_BRIGHT (WRBL, 'M', 4, NULL , &States[S_WRTHFX_SIZZLE1+4]),
S_BRIGHT (WRBL, 'N', 4, NULL , &States[S_WRTHFX_SIZZLE1+5]),
S_BRIGHT (WRBL, 'O', 4, NULL , &States[S_WRTHFX_SIZZLE1+6]),
S_BRIGHT (WRBL, 'P', 4, NULL , NULL),
};
IMPLEMENT_ACTOR (AWraithFX2, Hexen, -1, 108)
PROP_RadiusFixed (2)
PROP_HeightFixed (5)
PROP_Mass (5)
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF)
PROP_Flags2 (MF2_FLOORCLIP|MF2_NOTELEPORT)
PROP_SpawnState (S_WRTHFX_SIZZLE1)
END_DEFAULTS
// --------------------------------------------------------------------------
class AWraithFX3 : public AActor
{
DECLARE_ACTOR (AWraithFX3, AActor)
};
FState AWraithFX3::States[] =
{
#define S_WRTHFX_DROP1 0
S_BRIGHT (WRBL, 'Q', 4, NULL , &States[S_WRTHFX_DROP1+1]),
S_BRIGHT (WRBL, 'R', 4, NULL , &States[S_WRTHFX_DROP1+2]),
S_BRIGHT (WRBL, 'S', 4, NULL , &States[S_WRTHFX_DROP1]),
#define S_WRTHFX_DEAD1 (S_WRTHFX_DROP1+3)
S_BRIGHT (WRBL, 'S', 4, NULL , NULL),
};
IMPLEMENT_ACTOR (AWraithFX3, Hexen, -1, 0)
PROP_RadiusFixed (2)
PROP_HeightFixed (5)
PROP_Mass (5)
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_FLOORCLIP|MF2_NOTELEPORT)
PROP_SpawnState (S_WRTHFX_DROP1)
PROP_DeathState (S_WRTHFX_DEAD1)
PROP_DeathSound ("Drip")
END_DEFAULTS
// --------------------------------------------------------------------------
class AWraithFX4 : public AActor
{
DECLARE_ACTOR (AWraithFX4, AActor)
};
FState AWraithFX4::States[] =
{
#define S_WRTHFX_ADROP1 0
S_NORMAL (WRBL, 'T', 4, NULL , &States[S_WRTHFX_ADROP1+1]),
S_NORMAL (WRBL, 'U', 4, NULL , &States[S_WRTHFX_ADROP1+2]),
S_NORMAL (WRBL, 'V', 4, NULL , &States[S_WRTHFX_ADROP1+3]),
S_NORMAL (WRBL, 'W', 4, NULL , &States[S_WRTHFX_ADROP1]),
#define S_WRTHFX_ADEAD1 (S_WRTHFX_ADROP1+4)
S_NORMAL (WRBL, 'W', 10, NULL , NULL),
};
IMPLEMENT_ACTOR (AWraithFX4, Hexen, -1, 106)
PROP_RadiusFixed (2)
PROP_HeightFixed (5)
PROP_Mass (5)
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_SpawnState (S_WRTHFX_ADROP1)
PROP_DeathState (S_WRTHFX_ADEAD1)
PROP_DeathSound ("Drip")
END_DEFAULTS
// --------------------------------------------------------------------------
class AWraithFX5 : public AActor
{
DECLARE_ACTOR (AWraithFX5, AActor)
};
FState AWraithFX5::States[] =
{
#define S_WRTHFX_BDROP1 0
S_NORMAL (WRBL, 'X', 7, NULL , &States[S_WRTHFX_BDROP1+1]),
S_NORMAL (WRBL, 'Y', 7, NULL , &States[S_WRTHFX_BDROP1+2]),
S_NORMAL (WRBL, 'Z', 7, NULL , &States[S_WRTHFX_BDROP1]),
#define S_WRTHFX_BDEAD1 (S_WRTHFX_BDROP1+3)
S_NORMAL (WRBL, 'Z', 35, NULL , NULL),
};
IMPLEMENT_ACTOR (AWraithFX5, Hexen, -1, 107)
PROP_RadiusFixed (2)
PROP_HeightFixed (5)
PROP_Mass (5)
PROP_Flags (MF_NOBLOCKMAP|MF_DROPOFF|MF_MISSILE)
PROP_Flags2 (MF2_NOTELEPORT)
PROP_SpawnState (S_WRTHFX_BDROP1)
PROP_DeathState (S_WRTHFX_BDEAD1)
PROP_DeathSound ("Drip")
END_DEFAULTS
//============================================================================
// Wraith Variables
//
@ -357,15 +60,15 @@ void A_WraithRaiseInit (AActor *actor)
void A_WraithRaise (AActor *actor)
{
if (A_RaiseMobj (actor))
if (A_RaiseMobj (actor, 2*FRACUNIT))
{
// Reached it's target height
// [RH] Once a buried wraith is fully raised, it should be
// morphable, right?
actor->flags3 &= ~(MF3_DONTMORPH|MF3_SPECIALFLOORCLIP);
actor->SetState (&AWraith::States[S_WRAITH_CHASE1]);
actor->SetState (actor->FindState("Chase"));
// [RH] Reset PainChance to a normal wraith's.
actor->PainChance = GetDefault<AWraith>()->PainChance;
actor->PainChance = GetDefaultByName ("Wraith")->PainChance;
}
P_SpawnDirt (actor, actor->radius);
@ -390,20 +93,6 @@ void A_WraithMelee (AActor *actor)
}
}
//============================================================================
//
// A_WraithMissile
//
//============================================================================
void A_WraithMissile (AActor *actor)
{
if (actor->target != NULL)
{
P_SpawnMissile (actor, actor->target, RUNTIME_CLASS(AWraithFX1));
}
}
//============================================================================
//
// A_WraithFX2 - spawns sparkle tail of missile
@ -418,7 +107,7 @@ void A_WraithFX2 (AActor *actor)
for (i = 2; i; --i)
{
mo = Spawn<AWraithFX2> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
mo = Spawn ("WraithFX2", actor->x, actor->y, actor->z, ALLOW_REPLACE);
if(mo)
{
if (pr_wraithfx2 ()<128)
@ -455,7 +144,7 @@ void A_WraithFX3 (AActor *actor)
while (numdropped-- > 0)
{
mo = Spawn<AWraithFX3> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
mo = Spawn ("WraithFX3", actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (mo)
{
mo->x += (pr_wraithfx3()-128)<<11;
@ -503,7 +192,7 @@ void A_WraithFX4 (AActor *actor)
if (spawn4)
{
mo = Spawn<AWraithFX4> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
mo = Spawn ("WraithFX4", actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (mo)
{
mo->x += (pr_wraithfx4()-128)<<12;
@ -514,7 +203,7 @@ void A_WraithFX4 (AActor *actor)
}
if (spawn5)
{
mo = Spawn<AWraithFX5> (actor->x, actor->y, actor->z, ALLOW_REPLACE);
mo = Spawn ("WraithFX5", actor->x, actor->y, actor->z, ALLOW_REPLACE);
if (mo)
{
mo->x += (pr_wraithfx4()-128)<<11;
@ -525,18 +214,6 @@ void A_WraithFX4 (AActor *actor)
}
}
//============================================================================
//
// A_WraithLook
//
//============================================================================
void A_WraithLook (AActor *actor)
{
// A_WraithFX4(actor); // too expensive
A_Look(actor);
}
//============================================================================
//
// A_WraithChase

View file

@ -2766,11 +2766,11 @@ int P_Massacre ()
// Sink a mobj incrementally into the floor
//
bool A_SinkMobj (AActor *actor)
bool A_SinkMobj (AActor *actor, fixed_t speed)
{
if (actor->floorclip < actor->height)
{
actor->floorclip += actor->GetSinkSpeed ();
actor->floorclip += speed;
return false;
}
return true;
@ -2781,14 +2781,14 @@ bool A_SinkMobj (AActor *actor)
// Raise a mobj incrementally from the floor to
//
bool A_RaiseMobj (AActor *actor)
bool A_RaiseMobj (AActor *actor, fixed_t speed)
{
bool done = true;
// Raise a mobj from the ground
if (actor->floorclip > 0)
{
actor->floorclip -= actor->GetRaiseSpeed ();
actor->floorclip -= speed;
if (actor->floorclip <= 0)
{
actor->floorclip = 0;

View file

@ -53,8 +53,8 @@ void A_FireScream (AActor *mo);
void A_PlayerScream (AActor *mo);
void A_ClassBossHealth (AActor *);
bool A_RaiseMobj (AActor *);
bool A_SinkMobj (AActor *);
bool A_RaiseMobj (AActor *, fixed_t speed);
bool A_SinkMobj (AActor *, fixed_t speed);
bool CheckBossDeath (AActor *);
int P_Massacre ();

View file

@ -2330,16 +2330,6 @@ void AActor::Howl ()
}
}
fixed_t AActor::GetSinkSpeed ()
{
return FRACUNIT;
}
fixed_t AActor::GetRaiseSpeed ()
{
return 2*FRACUNIT;
}
void AActor::HitFloor ()
{
}
@ -3370,9 +3360,17 @@ void AActor::Activate (AActor *activator)
if (flags2 & MF2_DORMANT)
{
flags2 &= ~MF2_DORMANT;
FState *state = FindState("Active");
if (state != NULL)
{
SetState(state);
}
else
{
tics = 1;
}
}
}
}
void AActor::Deactivate (AActor *activator)
@ -3382,9 +3380,17 @@ void AActor::Deactivate (AActor *activator)
if (!(flags2 & MF2_DORMANT))
{
flags2 |= MF2_DORMANT;
FState *state = FindState("Inactive");
if (state != NULL)
{
SetState(state);
}
else
{
tics = -1;
}
}
}
}
//

View file

@ -168,6 +168,7 @@ static flagdef ActorFlags[]=
DEFINE_FLAG(MF3, CEILINGHUGGER, AActor, flags3),
DEFINE_FLAG(MF3, NORADIUSDMG, AActor, flags3),
DEFINE_FLAG(MF3, GHOST, AActor, flags3),
DEFINE_FLAG(MF3, SPECIALFLOORCLIP, AActor, flags3),
DEFINE_FLAG(MF3, ALWAYSPUFF, AActor, flags3),
DEFINE_FLAG(MF3, DONTSPLASH, AActor, flags3),
DEFINE_FLAG(MF3, DONTOVERLAP, AActor, flags3),

View file

@ -504,8 +504,9 @@ ACTOR ZFireBullUnlit : ZFireBull 8043
// Suit of armor ------------------------------------------------------------
ACTOR ZSuitOfArmor
ACTOR ZSuitOfArmor 8064
{
Game Hexen
Health 60
Radius 16
Height 72

View file

@ -0,0 +1,169 @@
// Ice Guy ------------------------------------------------------------------
ACTOR IceGuy 8020
{
Game Hexen
SpawnID 20
Health 120
PainChance 144
Speed 14
Radius 22
Height 75
Mass 150
DamageType "Ice"
Monster
+NOBLOOD
+TELESTOMP
+NOICEDEATH
SeeSound "IceGuySight"
AttackSound "IceGuyAttack"
ActiveSound "IceGuyActive"
Obituary "$OB_ICEGUY"
action native A_IceGuyLook();
action native A_IceGuyChase();
action native A_IceGuyAttack();
States
{
Spawn:
ICEY A 10 A_IceGuyLook
Loop
See:
ICEY A 4 A_Chase
ICEY B 4 A_IceGuyChase
ICEY CD 4 A_Chase
Loop
Pain:
ICEY A 1 A_Pain
Goto See
Missile:
ICEY EF 3 A_FaceTarget
ICEY G 8 Bright A_IceGuyAttack
ICEY F 4 A_FaceTarget
Goto See
Death:
ICEY A 1 A_IceGuyDie
Stop
Inactive:
ICEY A -1
Goto See
}
}
// Ice Guy Projectile -------------------------------------------------------
ACTOR IceGuyFX
{
Speed 14
Radius 8
Height 10
Damage 1
DamageType "Ice"
Projectile
-ACTIVATEIMPACT -ACTIVATEPCROSS
DeathSound "IceGuyMissileExplode"
action native A_IceGuyMissileExplode();
States
{
Spawn:
ICPR ABC 3 Bright A_SpawnItemEx("IceFXPuff", 0,0,2)
Loop
Death:
ICPR D 4 Bright
ICPR E 4 Bright A_IceGuyMissileExplode
ICPR FG 4 Bright
ICPR H 3 Bright
Stop
}
}
// Ice Guy Projectile's Puff ------------------------------------------------
ACTOR IceFXPuff
{
Radius 1
Height 1
+NOBLOCKMAP +NOGRAVITY +DROPOFF +SHADOW
+NOTELEPORT
RenderStyle Translucent
Alpha 0.4
States
{
Spawn:
ICPR IJK 3
ICPR LM 2
Stop
}
}
// Secondary Ice Guy Projectile (ejected by the primary projectile) ---------
ACTOR IceGuyFX2
{
Speed 10
Radius 4
Height 4
Damage 1
DamageType "Ice"
Gravity 0.125
+NOBLOCKMAP +DROPOFF +MISSILE
+NOTELEPORT
+STRIFEDAMAGE
States
{
Spawn:
ICPR NOP 3 Bright
Loop
}
}
// Ice Guy Bit --------------------------------------------------------------
ACTOR IceGuyBit
{
Radius 1
Height 1
Gravity 0.125
+NOBLOCKMAP +DROPOFF
+NOTELEPORT
States
{
Spawn:
ICPR Q 50 Bright
Stop
ICPR R 50 Bright
Stop
}
}
// Ice Guy Wisp 1 -----------------------------------------------------------
ACTOR IceGuyWisp1
{
+NOBLOCKMAP +NOGRAVITY +DROPOFF +MISSILE
+NOTELEPORT
RenderStyle Translucent
Alpha 0.4
States
{
Spawn:
ICWS ABCDEFGHI 2
Stop
}
}
// Ice Guy Wisp 2 -----------------------------------------------------------
ACTOR IceGuyWisp2 : IceGuyWisp1
{
States
{
Spawn:
ICWS JKLMNOPQR 2
Stop
}
}

View file

@ -0,0 +1,228 @@
// Serpent ------------------------------------------------------------------
ACTOR Serpent 121
{
Game Hexen
SpawnID 6
Health 90
PainChance 96
Speed 12
Radius 32
Height 70
Mass 0x7fffffff
Monster
-SHOOTABLE
+NOBLOOD
+CANTLEAVEFLOORPIC +NONSHOOTABLE
+STAYMORPHED +DONTBLAST +NOTELEOTHER
+INVISIBLE
SeeSound "SerpentSight"
AttackSound "SerpentAttack"
PainSound "SerpentPain"
DeathSound "SerpentDeath"
HitObituary "$OB_SERPENTHIT"
action native A_SerpentHumpDecide();
action native A_SerpentHide();
action native A_SerpentCheckForAttack();
action native A_SerpentSpawnGibs();
action native A_SerpentUnHide();
action native A_SerpentRaiseHump();
action native A_SerpentLowerHump();
action native A_SerpentChooseAttack();
action native A_SerpentMeleeAttack();
States
{
Spawn:
SSPT H 10 A_Look
Loop
See:
SSPT HH 1 A_Chase("Melee", "None", CHF_NIGHTMAREFAST|CHF_NOPLAYACTIVE)
SSPT H 2 A_SerpentHumpDecide
Loop
Pain:
SSPT L 5
SSPT L 5 A_Pain
Dive:
SSDV ABC 4
SSDV D 4 A_UnSetShootable
SSDV E 3 A_PlaySoundEx("SerpentActive", "Body")
SSDV F 3
SSDV GH 4
SSDV I 3
SSDV J 3 A_SerpentHide
Goto See
Melee:
SSPT A 1 A_UnHideThing
SSPT A 1 A_PlaySoundEx("SerpentBirth", "Voice")
SSPT B 3 A_SetShootable
SSPT C 3
SSPT D 4 A_SerpentCheckForAttack
Goto Dive
Death:
SSPT O 4
SSPT P 4 A_Scream
SSPT Q 4 A_NoBlocking
SSPT RSTUVWXYZ 4
Stop
XDeath:
SSXD A 4
SSXD B 4 A_SpawnItemEx("SerpentHead", 0, 0, 45)
SSXD C 4 A_NoBlocking
SSXD DE 4
SSXD FG 3
SSXD H 3 A_SerpentSpawnGibs
Stop
Ice:
SSPT [ 5 A_FreezeDeath
SSPT [ 1 A_FreezeDeathChunks
Wait
Walk:
SSPT IJI 5 A_Chase("Attack", "None", CHF_NIGHTMAREFAST)
SSPT J 5 A_SerpentCheckForAttack
Goto Dive
Hump:
SSPT H 3 A_SerpentUnHide
SSPT EFGEF 3 A_SerpentRaiseHump
SSPT GEF 3
SSPT GEFGE 3 A_SerpentLowerHump
SSPT F 3 A_SerpentHide
Goto See
Attack:
SSPT K 6 A_FaceTarget
SSPT L 5 A_SerpentChooseAttack
Goto MeleeAttack
MeleeAttack:
SSPT N 5 A_SerpentMeleeAttack
Goto Dive
}
}
// Serpent Leader -----------------------------------------------------------
ACTOR SerpentLeader : Serpent 120
{
Game Hexen
SpawnID 7
Mass 200
Obituary "$OB_SERPENT"
States
{
Missile:
SSPT N 5 A_CustomMissile("SerpentFX", 32, 0)
Goto Dive
}
}
// Serpent Missile Ball -----------------------------------------------------
ACTOR SerpentFX
{
Speed 15
Radius 8
Height 10
Damage 4
Projectile
-ACTIVATEIMPACT -ACTIVATEPCROSS
RenderStyle Add
DeathSound "SerpentFXHit"
States
{
Spawn:
SSFX A 0
SSFX A 3 Bright A_PlaySoundEx("SerpentFXContinuous", "Body", 1)
SSFX BAB 3 Bright
Goto Spawn+1
Death:
SSFX C 4 Bright A_StopSoundEx("Body")
SSFX DEFGH 4 Bright
Stop
}
}
// Serpent Head -------------------------------------------------------------
ACTOR SerpentHead
{
Radius 5
Height 10
Gravity 0.125
+NOBLOCKMAP
action native A_SerpentHeadCheck();
States
{
Spawn:
SSXD IJKLMNOP 4 A_SerpentHeadCheck
Loop
Death:
SSXD S -1
Loop
}
}
// Serpent Gib 1 ------------------------------------------------------------
ACTOR SerpentGib1
{
Radius 3
Height 3
+NOBLOCKMAP +NOGRAVITY
action native A_FloatGib();
action native A_DelayGib();
action native A_SinkGib();
States
{
Spawn:
SSXD Q 6
SSXD Q 6 A_FloatGib
SSXD QQ 8 A_FloatGib
SSXD QQ 12 A_FloatGib
SSXD Q 232 A_DelayGib
SSXD QQ 12 A_SinkGib
SSXD QQQ 8 A_SinkGib
Stop
}
}
// Serpent Gib 2 ------------------------------------------------------------
ACTOR SerpentGib2 : SerpentGib1
{
States
{
Spawn:
SSXD R 6
SSXD R 6 A_FloatGib
SSXD RR 8 A_FloatGib
SSXD RR 12 A_FloatGib
SSXD R 232 A_DelayGib
SSXD RR 12 A_SinkGib
SSXD RRR 8 A_SinkGib
Stop
}
}
// Serpent Gib 3 ------------------------------------------------------------
ACTOR SerpentGib3 : SerpentGib1
{
States
{
Spawn:
SSXD T 6
SSXD T 6 A_FloatGib
SSXD TT 8 A_FloatGib
SSXD TT 12 A_FloatGib
SSXD T 232 A_DelayGib
SSXD TT 12 A_SinkGib
SSXD TTT 8 A_SinkGib
Stop
}
}

View file

@ -0,0 +1,98 @@
// Dirt clump (spawned by spike) --------------------------------------------
ACTOR DirtClump
{
+NOBLOCKMAP
+NOTELEPORT
States
{
Spawn:
TSPK C 20
Loop
}
}
// Spike (thrust floor) -----------------------------------------------------
ACTOR ThrustFloor native
{
Radius 20
Height 128
action native A_ThrustRaise();
action native A_ThrustImpale();
action native A_ThrustLower();
action native A_ThrustInitDn();
action native A_ThrustInitUp();
States
{
ThrustRaising:
TSPK A 2 A_ThrustRaise
Loop
BloodThrustRaising:
TSPK B 2 A_ThrustRaise
Loop
ThrustLower:
TSPK A 2 A_ThrustLower
Loop
BloodThrustLower:
TSPK B 2 A_ThrustLower
Loop
ThrustInit1:
TSPK A 3
TSPK A 4 A_ThrustInitDn
TSPK A -1
Loop
BloodThrustInit1:
TSPK B 3
TSPK B 4 A_ThrustInitDn
TSPK B -1
Loop
ThrustInit2:
TSPK A 3
TSPK A 4 A_ThrustInitUp
TSPK A 10
Loop
BloodThrustInit2:
TSPK B 3
TSPK B 4 A_ThrustInitUp
TSPK B 10
Loop
ThrustRaise:
TSPK A 8 A_ThrustRaise
TSPK A 6 A_ThrustRaise
TSPK A 4 A_ThrustRaise
TSPK A 3 A_SetSolid
TSPK A 2 A_ThrustImpale
Loop
BloodThrustRaise:
TSPK B 8 A_ThrustRaise
TSPK B 6 A_ThrustRaise
TSPK B 4 A_ThrustRaise
TSPK B 3 A_SetSolid
TSPK B 2 A_ThrustImpale
Loop
}
}
// Spike up -----------------------------------------------------------------
ACTOR ThrustFloorUp : ThrustFloor 10091
{
Game Hexen
SpawnID 104
+SOLID
+NOTELEPORT +FLOORCLIP
}
// Spike down ---------------------------------------------------------------
ACTOR ThrustFloorDown : ThrustFloor 10090
{
Game Hexen
+NOTELEPORT +FLOORCLIP
+INVISIBLE
SpawnID 105
}

View file

@ -0,0 +1,229 @@
// Wraith -------------------------------------------------------------------
ACTOR Wraith 34
{
Game Hexen
SpawnID 8
Health 150
PainChance 25
Speed 11
Height 55
Mass 75
Damage 10
Monster
+NOGRAVITY +DROPOFF +FLOAT
+FLOORCLIP +TELESTOMP
-ACTIVATEIMPACT
SeeSound "WraithSight"
AttackSound "WraithAttack"
PainSound "WraithPain"
DeathSound "WraithDeath"
ActiveSound "WraithActive"
HitObituary "$OB_WRAITHHIT"
Obituary "$OB_WRAITH"
action native A_WraithInit();
action native A_WraithChase();
action native A_WraithFX3();
action native A_WraithMelee();
States
{
Spawn:
WRTH A 10
WRTH B 5 A_WraithInit
Goto Look
Look:
WRTH AB 15 A_Look
Loop
See:
WRTH ABCD 4 A_WraithChase
Loop
Pain:
WRTH A 2
WRTH H 6 A_Pain
Goto See
Melee:
WRTH E 6 A_FaceTarget
WRTH F 6 A_WraithFX3
WRTH G 6 A_WraithMelee
Goto See
Missile:
WRTH E 6 A_FaceTarget
WRTH F 6
WRTH G 6 A_CustomMissile("WraithFX1", 32, 0)
Goto See
Death:
WRTH I 4
WRTH J 4 A_Scream
WRTH KL 4
WRTH M 4 A_NoBlocking
WRTH N 4 A_QueueCorpse
WRTH O 4
WRTH PQ 5
WRTH R -1
Stop
XDeath:
WRT2 A 5
WRT2 B 5 A_Scream
WRT2 CD 5
WRT2 E 5 A_NoBlocking
WRT2 F 5 A_QueueCorpse
WRT2 G 5
WRT2 H -1
Stop
Ice:
WRT2 I 5 A_FreezeDeath
WRT2 I 1 A_FreezeDeathChunks
Wait
}
}
// Buried wraith ------------------------------------------------------------
ACTOR WraithBuried : Wraith 10011
{
Game Hexen
SpawnID 9
Height 68
-SHOOTABLE
-SOLID
+DONTMORPH
+DONTBLAST
+SPECIALFLOORCLIP
+STAYMORPHED
+INVISIBLE
PainChance 0
action native A_WraithRaiseInit();
action native A_WraithRaise();
States
{
Spawn:
Goto Super::Look
See:
WRTH A 2 A_WraithRaiseInit
WRTH A 2 A_WraithRaise
WRTH A 2 A_FaceTarget
WRTH BB 2 A_WraithRaise
Goto See + 1
Chase:
Goto Super::See
}
}
// Wraith FX 1 --------------------------------------------------------------
ACTOR WraithFX1
{
Speed 14
Radius 10
Height 6
Mass 5
Damage 5
DamageType "Fire"
Projectile
+FLOORCLIP
SeeSound "WraithMissileFire"
DeathSound "WraithMissileExplode"
action native A_WraithFX2();
States
{
Spawn:
WRBL A 3 Bright
WRBL B 3 Bright A_WraithFX2
WRBL C 3 Bright
Loop
Death:
WRBL D 4 Bright
WRBL E 4 Bright A_WraithFX2
WRBL F 4 Bright
WRBL GH 3 Bright A_WraithFX2
WRBL I 3 Bright
Stop
}
}
// Wraith FX 2 --------------------------------------------------------------
ACTOR WraithFX2
{
Game Hexen
SpawnID 108
Radius 2
Height 5
Mass 5
+NOBLOCKMAP +DROPOFF
+FLOORCLIP +NOTELEPORT
States
{
Spawn:
WRBL JKLMNOP 4 Bright
Stop
}
}
// Wraith FX 3 --------------------------------------------------------------
ACTOR WraithFX3
{
Radius 2
Height 5
Mass 5
+NOBLOCKMAP +DROPOFF +MISSILE
+FLOORCLIP +NOTELEPORT
DeathSound "Drip"
States
{
Spawn:
WRBL QRS 4 Bright
Loop
Death:
WRBL S 4 Bright
Stop
}
}
// Wraith FX 4 --------------------------------------------------------------
ACTOR WraithFX4
{
Game Hexen
SpawnID 106
Radius 2
Height 5
Mass 5
+NOBLOCKMAP +DROPOFF +MISSILE
+NOTELEPORT
DeathSound "Drip"
States
{
Spawn:
WRBL TUVW 4
Loop
Death:
WRBL W 10
Stop
}
}
// Wraith FX 5 --------------------------------------------------------------
ACTOR WraithFX5 : WraithFX4
{
Game Hexen
SpawnID 107
States
{
Spawn:
WRBL XYZ 7
Loop
Death:
WRBL Z 35
Stop
}
}

View file

@ -127,6 +127,10 @@
#include "actors/hexen/dragon.txt"
#include "actors/hexen/healingradius.txt"
#include "actors/hexen/teleportother.txt"
#include "actors/hexen/iceguy.txt"
#include "actors/hexen/serpent.txt"
#include "actors/hexen/spike.txt"
#include "actors/hexen/wraith.txt"
#include "actors/strife/strifehumanoid.txt"
#include "actors/strife/strifeplayer.txt"