- 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:
parent
9ad93639c5
commit
5ea4b37373
22 changed files with 853 additions and 1261 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue