Dashmode tweaks:

- Remove the ability for non-SF_MACHINE players in dashmode to break spikes and monitors
- Replace instances of dashmode magic numbers with dashmode constants
- Add dashmode constants to dehacked.c
This commit is contained in:
lachwright 2020-01-07 15:38:48 +08:00
parent b95d1cef01
commit 01b8bd21cc
3 changed files with 7 additions and 3 deletions

View File

@ -9461,6 +9461,10 @@ struct {
{"SF_MULTIABILITY",SF_MULTIABILITY},
{"SF_NONIGHTSROTATION",SF_NONIGHTSROTATION},
// Dashmode constants
{"DASHMODE_THRESHOLD",DASHMODE_THRESHOLD},
{"DASHMODE_MAX",DASHMODE_MAX},
// Character abilities!
// Primary
{"CA_NONE",CA_NONE}, // now slot 0!

View File

@ -426,7 +426,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
object->player->pflags |= pflags;
object->player->secondjump = secondjump;
}
else if (object->player->dashmode >= 3*TICRATE)
else if (object->player->dashmode >= DASHMODE_THRESHOLD)
P_SetPlayerMobjState(object, S_PLAY_DASH);
else if (P_IsObjectOnGround(object) && horizspeed >= FixedMul(object->player->runspeed, object->scale))
P_SetPlayerMobjState(object, S_PLAY_RUN);
@ -806,7 +806,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
// SF_DASHMODE users destroy spikes and monitors, CA_TWINSPIN users and CA2_MELEE users destroy spikes.
if ((tmthing->player)
&& (((tmthing->player->charflags & SF_DASHMODE) && (tmthing->player->dashmode >= 3*TICRATE)
&& ((((tmthing->player->charflags & (SF_DASHMODE|SF_MACHINE)) == (SF_DASHMODE|SF_MACHINE)) && (tmthing->player->dashmode >= DASHMODE_THRESHOLD)
&& (thing->flags & (MF_MONITOR)
|| (thing->type == MT_SPIKE
|| thing->type == MT_WALLSPIKE)))

View File

@ -3298,7 +3298,7 @@ boolean P_CanRunOnWater(player_t *player, ffloor_t *rover)
*rover->topheight;
if (!player->powers[pw_carry] && !player->homing
&& ((player->powers[pw_super] || player->charflags & SF_RUNONWATER || player->dashmode >= 3*TICRATE) && player->mo->ceilingz-topheight >= player->mo->height)
&& ((player->powers[pw_super] || player->charflags & SF_RUNONWATER || player->dashmode >= DASHMODE_THRESHOLD) && player->mo->ceilingz-topheight >= player->mo->height)
&& (rover->flags & FF_SWIMMABLE) && !(player->pflags & PF_SPINNING) && player->speed > FixedMul(player->runspeed, player->mo->scale)
&& !(player->pflags & PF_SLIDING)
&& abs(player->mo->z - topheight) < FixedMul(30*FRACUNIT, player->mo->scale))