Rollout rock improvements:

- No longer struggles to start to accelerating at certain angles
- Carrying a player onto a rollout rock no longer leaves them in their ride state
- Changed dispoffset might alleviate some sorting issues
- Changes the player's camera angle when sprung horizontally
- Works better in reverse gravity
This commit is contained in:
lachwright 2021-02-15 01:11:03 +11:00
parent 41fe113af4
commit cf389179e8
4 changed files with 24 additions and 8 deletions

View file

@ -13481,7 +13481,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
32*FRACUNIT, // speed
30*FRACUNIT, // radius
60*FRACUNIT, // height
0, // display offset
-1, // display offset
100, // mass
0, // damage
sfx_None, // activesound

View file

@ -14319,6 +14319,14 @@ void A_RolloutRock(mobj_t *actor)
if (LUA_CallAction(A_ROLLOUTROCK, actor))
return;
if (!actor->tracer || P_MobjWasRemoved(actor->tracer) || !actor->tracer->health)
actor->flags |= MF_PUSHABLE;
else
{
actor->flags2 = (actor->flags2 & ~MF2_OBJECTFLIP) | (actor->tracer->flags2 & MF2_OBJECTFLIP);
actor->eflags = (actor->eflags & ~MFE_VERTICALFLIP) | (actor->tracer->eflags & MFE_VERTICALFLIP);
}
actor->friction = FRACUNIT; // turns out riding on solids sucks, so let's just make it easier on ourselves
if (actor->eflags & MFE_JUSTHITFLOOR)
@ -14357,7 +14365,8 @@ void A_RolloutRock(mobj_t *actor)
speed = P_AproxDistance(actor->momx, actor->momy); // recalculate speed for visual rolling
if (speed < actor->scale >> 1) // stop moving if speed is insignificant
if (((actor->flags & MF_PUSHABLE) || !(actor->flags2 & MF2_STRONGBOX))
&& speed < actor->scale) // stop moving if speed is insignificant
{
actor->momx = 0;
actor->momy = 0;
@ -14377,9 +14386,6 @@ void A_RolloutRock(mobj_t *actor)
actor->frame = actor->reactiontime % maxframes; // set frame
if (!actor->tracer || P_MobjWasRemoved(actor->tracer) || !actor->tracer->health)
actor->flags |= MF_PUSHABLE;
if (!(actor->flags & MF_PUSHABLE) || (actor->movecount != 1)) // if being ridden or haven't moved, don't disappear
actor->fuse = actor->info->painchance;
else if (actor->fuse < 2*TICRATE)

View file

@ -429,6 +429,13 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
else
P_SetPlayerMobjState(object, S_PLAY_FALL);
}
else if (horizspeed
&& object->tracer
&& object->tracer->player
&& object->tracer->player->powers[pw_carry] != CR_NONE
&& object->tracer->tracer == object
&& (!demoplayback || P_ControlStyle(object->tracer->player) == CS_LMAOGALOG))
P_SetPlayerAngle(object->tracer->player, spring->angle);
object->standingslope = NULL; // And again.

View file

@ -12608,14 +12608,14 @@ void P_PlayerAfterThink(player_t *player)
if (P_AproxDistance(player->mo->x - tails->x, player->mo->y - tails->y) > player->mo->radius)
player->powers[pw_carry] = CR_NONE;
if (player->powers[pw_carry] != CR_NONE)
if (player->powers[pw_carry] == CR_PLAYER)
{
if (player->mo->state-states != S_PLAY_RIDE)
P_SetPlayerMobjState(player->mo, S_PLAY_RIDE);
if (tails->player && (tails->skin && ((skin_t *)(tails->skin))->sprites[SPR2_SWIM].numframes) && (tails->eflags & MFE_UNDERWATER))
tails->player->powers[pw_tailsfly] = 0;
}
else
else if (player->powers[pw_carry] == CR_NONE)
P_SetTarget(&player->mo->tracer, NULL);
if (player-players == consoleplayer && botingame)
@ -12718,9 +12718,12 @@ void P_PlayerAfterThink(player_t *player)
if (player->cmd.forwardmove || player->cmd.sidemove)
{
rock->flags2 |= MF2_STRONGBOX; // signifies the rock should not slow to a halt
rock->movedir = (player->cmd.angleturn << FRACBITS) + R_PointToAngle2(0, 0, player->cmd.forwardmove << FRACBITS, -player->cmd.sidemove << FRACBITS);
P_Thrust(rock, rock->movedir, rock->scale >> 1);
}
else
rock->flags2 &= ~MF2_STRONGBOX;
mo->momx = rock->momx;
mo->momy = rock->momy;
@ -12736,7 +12739,7 @@ void P_PlayerAfterThink(player_t *player)
mo->tics = walktics;
}
P_TeleportMove(player->mo, rock->x, rock->y, rock->z + rock->height);
P_TeleportMove(player->mo, rock->x, rock->y, rock->z + ((mo->eflags & MFE_VERTICALFLIP) ? -mo->height : rock->height));
break;
}
case CR_PTERABYTE: // being carried by a Pterabyte