mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-01 06:00:45 +00:00
brak missile fix, pw_ignorelatch, small Recycler fix
This commit is contained in:
parent
8063814f1c
commit
682791a024
7 changed files with 80 additions and 42 deletions
|
@ -285,6 +285,8 @@ typedef enum
|
||||||
|
|
||||||
pw_justlaunched, // Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch)
|
pw_justlaunched, // Launched off a slope this tic (0=none, 1=standard launch, 2=half-pipe launch)
|
||||||
|
|
||||||
|
pw_ignorelatch, // Don't grab onto CR_GENERIC, add 32768 (powers[pw_ignorelatch] & 1<<15) to avoid ALL not-NiGHTS CR_ types
|
||||||
|
|
||||||
NUMPOWERS
|
NUMPOWERS
|
||||||
} powertype_t;
|
} powertype_t;
|
||||||
|
|
||||||
|
|
|
@ -9312,7 +9312,9 @@ static const char *const POWERS_LIST[] = {
|
||||||
//for dyes
|
//for dyes
|
||||||
"DYE",
|
"DYE",
|
||||||
|
|
||||||
"JUSTLAUNCHED"
|
"JUSTLAUNCHED",
|
||||||
|
|
||||||
|
"IGNORELATCH"
|
||||||
};
|
};
|
||||||
|
|
||||||
static const char *const HUDITEMS_LIST[] = {
|
static const char *const HUDITEMS_LIST[] = {
|
||||||
|
|
|
@ -6946,7 +6946,9 @@ void A_RecyclePowers(mobj_t *actor)
|
||||||
for (j = 0; j < NUMPOWERS; j++)
|
for (j = 0; j < NUMPOWERS; j++)
|
||||||
{
|
{
|
||||||
if (j == pw_flashing || j == pw_underwater || j == pw_spacetime || j == pw_carry
|
if (j == pw_flashing || j == pw_underwater || j == pw_spacetime || j == pw_carry
|
||||||
|| j == pw_tailsfly || j == pw_extralife || j == pw_nocontrol || j == pw_super)
|
|| j == pw_tailsfly || j == pw_extralife || j == pw_nocontrol || j == pw_super
|
||||||
|
|| j == pw_pushing || j == pw_justsprung || j == pw_noautobrake || j == pw_justlaunched
|
||||||
|
|| j == pw_ignorelatch)
|
||||||
continue;
|
continue;
|
||||||
players[recv_pl].powers[j] = powers[send_pl][j];
|
players[recv_pl].powers[j] = powers[send_pl][j];
|
||||||
}
|
}
|
||||||
|
@ -13340,6 +13342,9 @@ static boolean PIT_DustDevilLaunch(mobj_t *thing)
|
||||||
if (!player)
|
if (!player)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
if (player->powers[pw_carry] != CR_DUSTDEVIL && (player->powers[pw_ignorelatch] & (1<<15)))
|
||||||
|
return true;
|
||||||
|
|
||||||
if (abs(thing->x - dustdevil->x) > dustdevil->radius || abs(thing->y - dustdevil->y) > dustdevil->radius)
|
if (abs(thing->x - dustdevil->x) > dustdevil->radius || abs(thing->y - dustdevil->y) > dustdevil->radius)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
@ -1468,7 +1468,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MT_BLACKEGGMAN_GOOPFIRE:
|
case MT_BLACKEGGMAN_GOOPFIRE:
|
||||||
if (!player->powers[pw_flashing])
|
if (!player->powers[pw_flashing] && !(player->powers[pw_ignorelatch] & (1<<15)))
|
||||||
{
|
{
|
||||||
toucher->momx = 0;
|
toucher->momx = 0;
|
||||||
toucher->momy = 0;
|
toucher->momy = 0;
|
||||||
|
@ -1584,6 +1584,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
case MT_SMALLGRABCHAIN:
|
case MT_SMALLGRABCHAIN:
|
||||||
case MT_BIGGRABCHAIN:
|
case MT_BIGGRABCHAIN:
|
||||||
|
{
|
||||||
|
boolean macespin = false;
|
||||||
if (P_MobjFlip(toucher)*toucher->momz > 0
|
if (P_MobjFlip(toucher)*toucher->momz > 0
|
||||||
|| (player->powers[pw_carry]))
|
|| (player->powers[pw_carry]))
|
||||||
return;
|
return;
|
||||||
|
@ -1597,6 +1599,12 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
if (player->powers[pw_flashing])
|
if (player->powers[pw_flashing])
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (special->tracer && !(special->tracer->flags2 & MF2_STRONGBOX))
|
||||||
|
macespin = true;
|
||||||
|
|
||||||
|
if (macespin ? (player->powers[pw_ignorelatch] & (1<<15)) : (player->powers[pw_ignorelatch]))
|
||||||
|
return;
|
||||||
|
|
||||||
if (special->movefactor && special->tracer && special->tracer->angle != ANGLE_90 && special->tracer->angle != ANGLE_270)
|
if (special->movefactor && special->tracer && special->tracer->angle != ANGLE_90 && special->tracer->angle != ANGLE_270)
|
||||||
{ // I don't expect you to understand this, Mr Bond...
|
{ // I don't expect you to understand this, Mr Bond...
|
||||||
angle_t ang = R_PointToAngle2(special->x, special->y, toucher->x, toucher->y) - special->tracer->angle;
|
angle_t ang = R_PointToAngle2(special->x, special->y, toucher->x, toucher->y) - special->tracer->angle;
|
||||||
|
@ -1609,7 +1617,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
P_ResetPlayer(player);
|
P_ResetPlayer(player);
|
||||||
P_SetTarget(&toucher->tracer, special);
|
P_SetTarget(&toucher->tracer, special);
|
||||||
|
|
||||||
if (special->tracer && !(special->tracer->flags2 & MF2_STRONGBOX))
|
if (macespin)
|
||||||
{
|
{
|
||||||
player->powers[pw_carry] = CR_MACESPIN;
|
player->powers[pw_carry] = CR_MACESPIN;
|
||||||
S_StartSound(toucher, sfx_spin);
|
S_StartSound(toucher, sfx_spin);
|
||||||
|
@ -1622,6 +1630,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
player->pflags |= PF_JUMPSTASIS;
|
player->pflags |= PF_JUMPSTASIS;
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
case MT_EGGMOBILE2_POGO:
|
case MT_EGGMOBILE2_POGO:
|
||||||
// sanity checks
|
// sanity checks
|
||||||
if (!special->target || !special->target->health)
|
if (!special->target || !special->target->health)
|
||||||
|
@ -1711,7 +1720,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case MT_MINECARTSPAWNER:
|
case MT_MINECARTSPAWNER:
|
||||||
if (!player->bot && special->fuse <= TICRATE && player->powers[pw_carry] != CR_MINECART)
|
if (!player->bot && special->fuse <= TICRATE && player->powers[pw_carry] != CR_MINECART && !(player->powers[pw_ignorelatch] & (1<<15)))
|
||||||
{
|
{
|
||||||
mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART);
|
mobj_t *mcart = P_SpawnMobj(special->x, special->y, special->z, MT_MINECART);
|
||||||
P_SetTarget(&mcart->target, toucher);
|
P_SetTarget(&mcart->target, toucher);
|
||||||
|
|
|
@ -527,6 +527,8 @@ static void P_DoPterabyteCarry(player_t *player, mobj_t *ptera)
|
||||||
{
|
{
|
||||||
if (player->powers[pw_carry] && player->powers[pw_carry] != CR_ROLLOUT)
|
if (player->powers[pw_carry] && player->powers[pw_carry] != CR_ROLLOUT)
|
||||||
return;
|
return;
|
||||||
|
if (player->powers[pw_ignorelatch] & (1<<15))
|
||||||
|
return;
|
||||||
if (ptera->extravalue1 != 1)
|
if (ptera->extravalue1 != 1)
|
||||||
return; // Not swooping
|
return; // Not swooping
|
||||||
if (ptera->target != player->mo)
|
if (ptera->target != player->mo)
|
||||||
|
@ -611,7 +613,8 @@ static void P_DoTailsCarry(player_t *sonic, player_t *tails)
|
||||||
|
|
||||||
if (zdist <= sonic->mo->height + sonic->mo->scale // FixedMul(FRACUNIT, sonic->mo->scale), but scale == FRACUNIT by default
|
if (zdist <= sonic->mo->height + sonic->mo->scale // FixedMul(FRACUNIT, sonic->mo->scale), but scale == FRACUNIT by default
|
||||||
&& zdist > sonic->mo->height*2/3
|
&& zdist > sonic->mo->height*2/3
|
||||||
&& P_MobjFlip(tails->mo)*sonic->mo->momz <= 0)
|
&& P_MobjFlip(tails->mo)*sonic->mo->momz <= 0
|
||||||
|
&& !(sonic->powers[pw_ignorelatch] & (1<<15)))
|
||||||
{
|
{
|
||||||
if (sonic-players == consoleplayer && botingame)
|
if (sonic-players == consoleplayer && botingame)
|
||||||
CV_SetValue(&cv_analog[1], false);
|
CV_SetValue(&cv_analog[1], false);
|
||||||
|
@ -1002,6 +1005,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
}
|
}
|
||||||
if ((thing->flags & MF_PUSHABLE) // not carrying a player
|
if ((thing->flags & MF_PUSHABLE) // not carrying a player
|
||||||
&& (tmthing->player->powers[pw_carry] == CR_NONE) // player is not already riding something
|
&& (tmthing->player->powers[pw_carry] == CR_NONE) // player is not already riding something
|
||||||
|
&& !(tmthing->player->powers[pw_ignorelatch] & (1<<15))
|
||||||
&& ((tmthing->eflags & MFE_VERTICALFLIP) == (thing->eflags & MFE_VERTICALFLIP))
|
&& ((tmthing->eflags & MFE_VERTICALFLIP) == (thing->eflags & MFE_VERTICALFLIP))
|
||||||
&& (P_MobjFlip(tmthing)*tmthing->momz <= 0)
|
&& (P_MobjFlip(tmthing)*tmthing->momz <= 0)
|
||||||
&& ((!(tmthing->eflags & MFE_VERTICALFLIP) && abs(thing->z + thing->height - tmthing->z) < (thing->height>>2))
|
&& ((!(tmthing->eflags & MFE_VERTICALFLIP) && abs(thing->z + thing->height - tmthing->z) < (thing->height>>2))
|
||||||
|
@ -1291,6 +1295,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player
|
else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player
|
||||||
&& (thing->player->pflags & PF_JUMPED)
|
&& (thing->player->pflags & PF_JUMPED)
|
||||||
&& !thing->player->powers[pw_flashing]
|
&& !thing->player->powers[pw_flashing]
|
||||||
|
&& !thing->player->powers[pw_ignorelatch]
|
||||||
&& thing->tracer != tmthing
|
&& thing->tracer != tmthing
|
||||||
&& tmthing->target != thing)
|
&& tmthing->target != thing)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4811,6 +4811,9 @@ DoneSection2:
|
||||||
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ZOOMTUBE)
|
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ZOOMTUBE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (player->powers[pw_ignorelatch] & (1<<15))
|
||||||
|
break;
|
||||||
|
|
||||||
// Find line #3 tagged to this sector
|
// Find line #3 tagged to this sector
|
||||||
lineindex = P_FindSpecialLineFromTag(3, sector->tag, -1);
|
lineindex = P_FindSpecialLineFromTag(3, sector->tag, -1);
|
||||||
|
|
||||||
|
@ -4873,6 +4876,9 @@ DoneSection2:
|
||||||
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ZOOMTUBE)
|
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ZOOMTUBE)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (player->powers[pw_ignorelatch] & (1<<15))
|
||||||
|
break;
|
||||||
|
|
||||||
// Find line #3 tagged to this sector
|
// Find line #3 tagged to this sector
|
||||||
lineindex = P_FindSpecialLineFromTag(3, sector->tag, -1);
|
lineindex = P_FindSpecialLineFromTag(3, sector->tag, -1);
|
||||||
|
|
||||||
|
@ -4983,6 +4989,9 @@ DoneSection2:
|
||||||
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ROPEHANG)
|
if (player->mo->tracer && player->mo->tracer->type == MT_TUBEWAYPOINT && player->powers[pw_carry] == CR_ROPEHANG)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
if (player->powers[pw_ignorelatch] & (1<<15))
|
||||||
|
break;
|
||||||
|
|
||||||
if (player->mo->momz > 0)
|
if (player->mo->momz > 0)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -4406,6 +4406,7 @@ void P_DoJump(player_t *player, boolean soundandstate)
|
||||||
{
|
{
|
||||||
player->mo->momz = 9*FRACUNIT;
|
player->mo->momz = 9*FRACUNIT;
|
||||||
player->powers[pw_carry] = CR_NONE;
|
player->powers[pw_carry] = CR_NONE;
|
||||||
|
if (!(player->mo->tracer->flags & MF_MISSILE)) // Missiles remember their owner!
|
||||||
P_SetTarget(&player->mo->tracer->target, NULL);
|
P_SetTarget(&player->mo->tracer->target, NULL);
|
||||||
P_SetTarget(&player->mo->tracer, NULL);
|
P_SetTarget(&player->mo->tracer, NULL);
|
||||||
}
|
}
|
||||||
|
@ -12089,6 +12090,11 @@ void P_PlayerThink(player_t *player)
|
||||||
else
|
else
|
||||||
player->powers[pw_nocontrol] = 0;
|
player->powers[pw_nocontrol] = 0;
|
||||||
|
|
||||||
|
if (player->powers[pw_ignorelatch] & ((1<<15)-1) && player->powers[pw_ignorelatch] < UINT16_MAX)
|
||||||
|
player->powers[pw_ignorelatch]--;
|
||||||
|
else
|
||||||
|
player->powers[pw_ignorelatch] = 0;
|
||||||
|
|
||||||
//pw_super acts as a timer now
|
//pw_super acts as a timer now
|
||||||
if (player->powers[pw_super]
|
if (player->powers[pw_super]
|
||||||
&& (player->mo->state < &states[S_PLAY_SUPER_TRANS1]
|
&& (player->mo->state < &states[S_PLAY_SUPER_TRANS1]
|
||||||
|
|
Loading…
Reference in a new issue