Vanilla Doom:
Code: Select all
for (i=S_SARG_RUN1 ; i<=S_SARG_PAIN2 ; i++)
states[i].tics >>= 1;
Code: Select all
{SPR_SARG,0,2,{A_Chase},S_SARG_RUN2,0,0}, // S_SARG_RUN1
{SPR_SARG,0,2,{A_Chase},S_SARG_RUN3,0,0}, // S_SARG_RUN2
{SPR_SARG,1,2,{A_Chase},S_SARG_RUN4,0,0}, // S_SARG_RUN3
{SPR_SARG,1,2,{A_Chase},S_SARG_RUN5,0,0}, // S_SARG_RUN4
{SPR_SARG,2,2,{A_Chase},S_SARG_RUN6,0,0}, // S_SARG_RUN5
{SPR_SARG,2,2,{A_Chase},S_SARG_RUN7,0,0}, // S_SARG_RUN6
{SPR_SARG,3,2,{A_Chase},S_SARG_RUN8,0,0}, // S_SARG_RUN7
{SPR_SARG,3,2,{A_Chase},S_SARG_RUN1,0,0}, // S_SARG_RUN8
{SPR_SARG,4,8,{A_FaceTarget},S_SARG_ATK2,0,0}, // S_SARG_ATK1
{SPR_SARG,5,8,{A_FaceTarget},S_SARG_ATK3,0,0}, // S_SARG_ATK2
{SPR_SARG,6,8,{A_SargAttack},S_SARG_RUN1,0,0}, // S_SARG_ATK3
{SPR_SARG,7,2,{NULL},S_SARG_PAIN2,0,0}, // S_SARG_PAIN
{SPR_SARG,7,2,{A_Pain},S_SARG_RUN1,0,0}, // S_SARG_PAIN2
Code: Select all
int AActor::GetTics(FState * newstate)
{
int tics = newstate->GetTics();
if (isFast())
{
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;
}
There needs to be an MF6_FASTPAIN flag too, I guess.
It might be complicated by the existence of custom pain types, but vanilla accuracy only requires to handle the generic Pain state with no need to handle more complex things. (Especially given how the FASTER and FASTMELEE flags are a bit useless with the complicated actor scripting that goes on nowaday with A_JumpIfs everywhere and dozens of labels.)
Alternatively, it could be a boolean flag on the state themselves. Kinda like the Bright keyword, there'd be a Fast keyword? The demon's code could look like this:
Code: Select all
States
{
Spawn:
SARG AB 10 A_Look
Loop
See:
SARG AABBCCDD 2 Fast A_Chase
Loop
Melee:
SARG EF 8 Fast A_FaceTarget
SARG G 8 Fast A_SargAttack
Goto See
Pain:
SARG H Fast 2
SARG H Fast 2 A_Pain
Goto See
Death:
SARG I 8
SARG J 8 A_Scream
SARG K 4
SARG L 4 A_NoBlocking
SARG M 4
SARG N -1
Stop
Raise:
SARG N 5
SARG MLKJI 5
Goto See
}