Merge branch 'fancarry' into 'next'

Add carry type to fans (with fixed merge conflicts)

See merge request STJr/SRB2!1809
This commit is contained in:
sphere 2022-09-30 13:07:19 +00:00
commit 70161ff52e
5 changed files with 40 additions and 10 deletions

View file

@ -245,7 +245,8 @@ typedef enum
CR_MINECART, CR_MINECART,
CR_ROLLOUT, CR_ROLLOUT,
CR_PTERABYTE, CR_PTERABYTE,
CR_DUSTDEVIL CR_DUSTDEVIL,
CR_FAN
} carrytype_t; // pw_carry } carrytype_t; // pw_carry
// Player powers. (don't edit this comment) // Player powers. (don't edit this comment)

View file

@ -5119,6 +5119,7 @@ struct int_const_s const INT_CONST[] = {
{"CR_ROLLOUT",CR_ROLLOUT}, {"CR_ROLLOUT",CR_ROLLOUT},
{"CR_PTERABYTE",CR_PTERABYTE}, {"CR_PTERABYTE",CR_PTERABYTE},
{"CR_DUSTDEVIL",CR_DUSTDEVIL}, {"CR_DUSTDEVIL",CR_DUSTDEVIL},
{"CR_FAN",CR_FAN},
// Ring weapons (ringweapons_t) // Ring weapons (ringweapons_t)
// Useful for A_GiveWeapon // Useful for A_GiveWeapon

View file

@ -505,11 +505,12 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object)
if (flipval*object->momz > FixedMul(speed, spring->scale)) if (flipval*object->momz > FixedMul(speed, spring->scale))
object->momz = flipval*FixedMul(speed, spring->scale); object->momz = flipval*FixedMul(speed, spring->scale);
if (p && !p->powers[pw_tailsfly]) // doesn't reset anim for Tails' flight if (p && !p->powers[pw_tailsfly] && !p->powers[pw_carry]) // doesn't reset anim for Tails' flight
{ {
P_ResetPlayer(p); P_ResetPlayer(p);
if (p->panim != PA_FALL) P_SetPlayerMobjState(object, S_PLAY_FALL);
P_SetPlayerMobjState(object, S_PLAY_FALL); P_SetTarget(&object->tracer, spring);
p->powers[pw_carry] = CR_FAN;
} }
break; break;
case MT_STEAM: // Steam case MT_STEAM: // Steam

View file

@ -4965,9 +4965,13 @@ static void P_EvaluateSpecialFlags(player_t *player, sector_t *sector, sector_t
if (player->mo->momz > mobjinfo[MT_FAN].mass) if (player->mo->momz > mobjinfo[MT_FAN].mass)
player->mo->momz = mobjinfo[MT_FAN].mass; player->mo->momz = mobjinfo[MT_FAN].mass;
P_ResetPlayer(player); if (!player->powers[pw_carry])
if (player->panim != PA_FALL) {
P_ResetPlayer(player);
P_SetPlayerMobjState(player->mo, S_PLAY_FALL); P_SetPlayerMobjState(player->mo, S_PLAY_FALL);
P_SetTarget(&player->mo->tracer, player->mo);
player->powers[pw_carry] = CR_FAN;
}
} }
if (sector->specialflags & SSF_SUPERTRANSFORM) if (sector->specialflags & SSF_SUPERTRANSFORM)
{ {

View file

@ -12589,6 +12589,29 @@ void P_PlayerAfterThink(player_t *player)
break; break;
} }
case CR_FAN:
{
fixed_t zdist;
mobj_t *mo = player->mo, *fan = player->mo->tracer;
if (!(player->pflags & PF_JUMPSTASIS))
player->pflags |= PF_JUMPSTASIS;
if (fan->eflags & MFE_VERTICALFLIP)
zdist = (mo->z + mo->height) - (fan->z + fan->height);
else
zdist = mo->z - fan->z;
if ((fan->type != MT_FAN && !P_PlayerTouchingSectorSpecialFlag(player, SSF_FAN))
|| (fan->type == MT_FAN && (abs(mo->x - fan->x) > fan->radius || abs(mo->y - fan->y) > fan->radius || zdist > (fan->health << FRACBITS))))
{
P_SetTarget(&player->mo->tracer, NULL);
player->pflags &= ~PF_JUMPSTASIS;
player->powers[pw_carry] = CR_NONE;
break;
}
break;
}
case CR_ROLLOUT: case CR_ROLLOUT:
{ {
mobj_t *mo = player->mo, *rock = player->mo->tracer; mobj_t *mo = player->mo, *rock = player->mo->tracer;