- 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 ---
MF5_FASTER = 0x00000001, // moves faster when DF_FAST_MONSTERS or nightmare is on.
MF5_FASTMELEE = 0x00000002, // has a faster melee attack when DF_FAST_MONSTERS or nightmare is on.
/* = 0x00000001, */
/* = 0x00000002, */
MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances.
/* = 0x00000008, */
MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret

View file

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

View file

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

View file

@ -182,8 +182,6 @@ static FFlagDef ActorFlags[]=
DEFINE_FLAG(MF4, NOSKIN, 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, COUNTSECRET, AActor, flags5),
DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5),
@ -270,7 +268,11 @@ static FFlagDef ActorFlags[]=
DEFINE_DEPRECATED_FLAG(HEXENBOUNCE),
DEFINE_DEPRECATED_FLAG(DOOMBOUNCE),
// Various Skulltag flags that are quite irrelevant to ZDoom
// 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
DEFINE_DUMMY_FLAG(NONETID), // netcode-based
DEFINE_DUMMY_FLAG(ALLOWCLIENTSPAWN), // netcode-based
DEFINE_DUMMY_FLAG(CLIENTSIDEONLY), // netcode-based

View file

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

View file

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