- removed the MF5_FASTER and MF5_FASTMELEE flags and replaced them with a 'Fast' state flag.

SVN r3692 (trunk)
This commit is contained in:
Christoph Oelckers 2012-06-16 08:35:51 +00:00
parent 6e5c048df8
commit ff25785781
6 changed files with 27 additions and 28 deletions

View file

@ -266,8 +266,8 @@ enum
// --- mobj.flags5 --- // --- mobj.flags5 ---
MF5_FASTER = 0x00000001, // moves faster when DF_FAST_MONSTERS or nightmare is on. /* = 0x00000001, */
MF5_FASTMELEE = 0x00000002, // has a faster melee attack when DF_FAST_MONSTERS or nightmare is on. /* = 0x00000002, */
MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances. MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances.
/* = 0x00000008, */ /* = 0x00000008, */
MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret

View file

@ -65,11 +65,12 @@ struct FState
SWORD Tics; SWORD Tics;
int Misc1; // Was changed to SBYTE, reverted to long for MBF compat int Misc1; // Was changed to SBYTE, reverted to long for MBF compat
int Misc2; // Was changed to BYTE, reverted to long for MBF compat int Misc2; // Was changed to BYTE, reverted to long for MBF compat
BYTE Frame:6; BYTE Frame;
BYTE Fullbright:1; // State is fullbright
BYTE SameFrame:1; // Ignore Frame (except when spawning actor)
BYTE DefineFlags; // Unused byte so let's use it during state creation. BYTE DefineFlags; // Unused byte so let's use it during state creation.
short Light; short Light;
BYTE Fullbright:1; // State is fullbright
BYTE SameFrame:1; // Ignore Frame (except when spawning actor)
BYTE Fast:1;
FState *NextState; FState *NextState;
actionf_p ActionFunc; actionf_p ActionFunc;
int ParameterIndex; int ParameterIndex;

View file

@ -434,26 +434,17 @@ bool AActor::InStateSequence(FState * newstate, FState * basestate)
// AActor::GetTics // AActor::GetTics
// //
// Get the actual duration of the next state // Get the actual duration of the next state
// This is a more generalized attempt to make the Demon faster in // We are using a state flag now to indicate a state that should be
// nightmare mode. Actually changing the states' durations has to // accelerated in Fast mode.
// be considered highly problematic.
// //
//========================================================================== //==========================================================================
int AActor::GetTics(FState * newstate) int AActor::GetTics(FState * newstate)
{ {
int tics = newstate->GetTics(); int tics = newstate->GetTics();
if (isFast() && newstate->Fast)
if (isFast())
{ {
if (flags5 & MF5_FASTER) return tics - (tics>>1);
{
if (InStateSequence(newstate, SeeState)) return tics - (tics>>1);
}
if (flags5 & MF5_FASTMELEE)
{
if (InStateSequence(newstate, MeleeState)) return tics - (tics>>1);
}
} }
return tics; return tics;
} }

View file

@ -182,8 +182,6 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF4, NOSKIN, AActor, flags4), DEFINE_FLAG(MF4, NOSKIN, AActor, flags4),
DEFINE_FLAG(MF4, BOSSDEATH, AActor, flags4), DEFINE_FLAG(MF4, BOSSDEATH, AActor, flags4),
DEFINE_FLAG(MF5, FASTER, AActor, flags5),
DEFINE_FLAG(MF5, FASTMELEE, AActor, flags5),
DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5), DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5),
DEFINE_FLAG(MF5, COUNTSECRET, AActor, flags5), DEFINE_FLAG(MF5, COUNTSECRET, AActor, flags5),
DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5), DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5),
@ -270,6 +268,10 @@ static FFlagDef ActorFlags[]=
DEFINE_DEPRECATED_FLAG(HEXENBOUNCE), DEFINE_DEPRECATED_FLAG(HEXENBOUNCE),
DEFINE_DEPRECATED_FLAG(DOOMBOUNCE), DEFINE_DEPRECATED_FLAG(DOOMBOUNCE),
// Deprecated flags with no more existing functionality.
DEFINE_DUMMY_FLAG(FASTER), // obsolete, replaced by 'Fast' state flag
DEFINE_DUMMY_FLAG(FASTMELEE), // obsolete, replaced by 'Fast' state flag
// Various Skulltag flags that are quite irrelevant to ZDoom // Various Skulltag flags that are quite irrelevant to ZDoom
DEFINE_DUMMY_FLAG(NONETID), // netcode-based DEFINE_DUMMY_FLAG(NONETID), // netcode-based
DEFINE_DUMMY_FLAG(ALLOWCLIENTSPAWN), // netcode-based DEFINE_DUMMY_FLAG(ALLOWCLIENTSPAWN), // netcode-based

View file

@ -247,6 +247,11 @@ do_stop:
state.Fullbright = true; state.Fullbright = true;
continue; continue;
} }
if (sc.Compare("FAST"))
{
state.Fast = true;
continue;
}
if (sc.Compare("OFFSET")) if (sc.Compare("OFFSET"))
{ {
// specify a weapon offset // specify a weapon offset
@ -274,7 +279,7 @@ do_stop:
continue; continue;
} }
// Make the action name lowercase to satisfy the gperf hashers // Make the action name lowercase
strlwr (sc.String); strlwr (sc.String);
if (DoActionSpecials(sc, state, bag)) if (DoActionSpecials(sc, state, bag))

View file

@ -14,7 +14,7 @@ ACTOR Demon 3002
Height 56 Height 56
Mass 400 Mass 400
Monster Monster
+FLOORCLIP +FASTER +FASTMELEE +FLOORCLIP
SeeSound "demon/sight" SeeSound "demon/sight"
AttackSound "demon/melee" AttackSound "demon/melee"
PainSound "demon/pain" PainSound "demon/pain"
@ -27,15 +27,15 @@ ACTOR Demon 3002
SARG AB 10 A_Look SARG AB 10 A_Look
Loop Loop
See: See:
SARG AABBCCDD 2 A_Chase SARG AABBCCDD 2 Fast A_Chase
Loop Loop
Melee: Melee:
SARG EF 8 A_FaceTarget SARG EF 8 Fast A_FaceTarget
SARG G 8 A_SargAttack SARG G 8 Fast A_SargAttack
Goto See Goto See
Pain: Pain:
SARG H 2 SARG H 2 Fast
SARG H 2 A_Pain SARG H 2 Fast A_Pain
Goto See Goto See
Death: Death:
SARG I 8 SARG I 8