mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-17 23:21:22 +00:00
Now that it's not 3am, here's some fixes to what I pushed last night.
* That hacky anti-NiGHTS-deaxisment code I commented out because I thought it was visual only? Reimplemented in a way that is both more and less hacky. It's identical in result to the original code, but takes a roundabout method to get there. * Sprite references for SUPE, SUPZ and NDRL are removed because they are now unused. * Helper's flashing conditional is restructured to do less flag swapping. * The check for super setting FF_FULLBRIGHT is limited to MAXTRANSLATIONS now, and also correctly takes into account MAXSKINCOLORS == SKINCOLOR_SUPERSILVER1. * NiGHTS collision bounds aren't hardcoded anymore. * NiGHTS link will never display when leaving stage. * Slightly tweaked rules for the supercolor setting when doing a NiGHTS transformation, but only meaningful for setting FF_FULLBRIGHT.
This commit is contained in:
parent
0c3256fa14
commit
9c02c81095
6 changed files with 79 additions and 72 deletions
|
@ -438,16 +438,12 @@ light_t *t_lspr[NUMSPRITES] =
|
||||||
|
|
||||||
// NiGHTS Stuff
|
// NiGHTS Stuff
|
||||||
&lspr[SUPERSONIC_L], // SPR_NDRN // NiGHTS drone
|
&lspr[SUPERSONIC_L], // SPR_NDRN // NiGHTS drone
|
||||||
&lspr[SUPERSONIC_L], // SPR_SUPE // NiGHTS character flying
|
|
||||||
&lspr[SUPERSONIC_L], // SPR_SUPZ // NiGHTS hurt
|
|
||||||
&lspr[SUPERSONIC_L], // SPR_NDRL // NiGHTS character drilling
|
|
||||||
&lspr[NOLIGHT], // SPR_NSPK
|
&lspr[NOLIGHT], // SPR_NSPK
|
||||||
&lspr[NOLIGHT], // SPR_NBMP
|
&lspr[NOLIGHT], // SPR_NBMP
|
||||||
&lspr[NOLIGHT], // SPR_HOOP
|
&lspr[NOLIGHT], // SPR_HOOP
|
||||||
&lspr[NOLIGHT], // SPR_HSCR
|
&lspr[NOLIGHT], // SPR_HSCR
|
||||||
&lspr[NOLIGHT], // SPR_NPRU
|
&lspr[NOLIGHT], // SPR_NPRU
|
||||||
&lspr[NOLIGHT], // SPR_CAPS
|
&lspr[NOLIGHT], // SPR_CAPS
|
||||||
&lspr[SUPERSONIC_L], // SPR_SUPT
|
|
||||||
|
|
||||||
// Debris
|
// Debris
|
||||||
&lspr[RINGSPARK_L], // SPR_SPRK
|
&lspr[RINGSPARK_L], // SPR_SPRK
|
||||||
|
|
22
src/info.c
22
src/info.c
|
@ -49,11 +49,11 @@ char sprnames[NUMSPRITES + 1][5] =
|
||||||
"RNGR","RNGI","RNGA","RNGE","RNGS","RNGG","PIKB","PIKR","PIKA","PIKE",
|
"RNGR","RNGI","RNGA","RNGE","RNGS","RNGG","PIKB","PIKR","PIKA","PIKE",
|
||||||
"PIKS","PIKG","TAUT","TGRE","TSCR","COIN","CPRK","GOOM","BGOM","FFWR",
|
"PIKS","PIKG","TAUT","TGRE","TSCR","COIN","CPRK","GOOM","BGOM","FFWR",
|
||||||
"FBLL","SHLL","PUMA","HAMM","KOOP","BFLM","MAXE","MUS1","MUS2","TOAD",
|
"FBLL","SHLL","PUMA","HAMM","KOOP","BFLM","MAXE","MUS1","MUS2","TOAD",
|
||||||
"NDRN","SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP","NSCR","NPRU","CAPS",
|
"NDRN","NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SPRK","BOM1","BOM2",
|
||||||
"SUPT","SPRK","BOM1","BOM2","BOM3","BOM4","ROIA","ROIB","ROIC","ROID",
|
"BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH",
|
||||||
"ROIE","ROIF","ROIG","ROIH","ROII","ROIJ","ROIK","ROIL","ROIM","ROIN",
|
"ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG",
|
||||||
"ROIO","ROIP","BBAL","GWLG","GWLR","SRBA","SRBB","SRBC","SRBD","SRBE",
|
"GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI",
|
||||||
"SRBF","SRBG","SRBH","SRBI","SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO",
|
"SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO",
|
||||||
};
|
};
|
||||||
|
|
||||||
char spr2names[NUMPLAYERSPRITES][5] =
|
char spr2names[NUMPLAYERSPRITES][5] =
|
||||||
|
@ -250,12 +250,12 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_PLAY, SPR2_NTRN, 4, {A_Scream}, 0, 0, S_PLAY_NIGHTS_TRANS2}, // S_PLAY_NIGHTS_TRANS
|
{SPR_PLAY, SPR2_NTRN, 4, {A_Scream}, 0, 0, S_PLAY_NIGHTS_TRANS2}, // S_PLAY_NIGHTS_TRANS
|
||||||
{SPR_PLAY, SPR2_NTRN, 4, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS3}, // S_PLAY_NIGHTS_TRANS2
|
{SPR_PLAY, SPR2_NTRN, 4, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS3}, // S_PLAY_NIGHTS_TRANS2
|
||||||
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 4, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS4}, // S_PLAY_NIGHTS_TRANS3
|
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 4, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS4}, // S_PLAY_NIGHTS_TRANS3
|
||||||
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS5}, // S_PLAY_NIGHTS_TRANS4
|
{SPR_PLAY, SPR2_NTRN, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS5}, // S_PLAY_NIGHTS_TRANS4
|
||||||
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS6}, // S_PLAY_NIGHTS_TRANS5
|
{SPR_PLAY, SPR2_NTRN, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS6}, // S_PLAY_NIGHTS_TRANS5
|
||||||
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS7}, // S_PLAY_NIGHTS_TRANS6
|
{SPR_PLAY, SPR2_NTRN, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS7}, // S_PLAY_NIGHTS_TRANS6
|
||||||
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS8}, // S_PLAY_NIGHTS_TRANS7
|
{SPR_PLAY, SPR2_NTRN, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS8}, // S_PLAY_NIGHTS_TRANS7
|
||||||
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS9}, // S_PLAY_NIGHTS_TRANS8
|
{SPR_PLAY, SPR2_NTRN, 3, {NULL}, 0, 0, S_PLAY_NIGHTS_TRANS9}, // S_PLAY_NIGHTS_TRANS8
|
||||||
{SPR_PLAY, SPR2_NTRN|FF_FULLBRIGHT, 16, {NULL}, 0, 0, S_PLAY_NIGHTS_FLOAT}, // S_PLAY_NIGHTS_TRANS9
|
{SPR_PLAY, SPR2_NTRN, 16, {NULL}, 0, 0, S_PLAY_NIGHTS_FLOAT}, // S_PLAY_NIGHTS_TRANS9
|
||||||
|
|
||||||
// NiGHTS Player, Stand, Floating, Pain, Pull and Attack
|
// NiGHTS Player, Stand, Floating, Pain, Pull and Attack
|
||||||
{SPR_PLAY, SPR2_NSTD, 7, {NULL}, 0, 0, S_PLAY_NIGHTS_STAND}, // S_PLAY_NIGHTS_STAND
|
{SPR_PLAY, SPR2_NSTD, 7, {NULL}, 0, 0, S_PLAY_NIGHTS_STAND}, // S_PLAY_NIGHTS_STAND
|
||||||
|
|
|
@ -514,16 +514,12 @@ typedef enum sprite
|
||||||
|
|
||||||
// NiGHTS Stuff
|
// NiGHTS Stuff
|
||||||
SPR_NDRN, // NiGHTS drone
|
SPR_NDRN, // NiGHTS drone
|
||||||
SPR_SUPE, // NiGHTS character flying
|
|
||||||
SPR_SUPZ, // NiGHTS hurt
|
|
||||||
SPR_NDRL, // NiGHTS character drilling
|
|
||||||
SPR_NSPK, // NiGHTS sparkle
|
SPR_NSPK, // NiGHTS sparkle
|
||||||
SPR_NBMP, // NiGHTS Bumper
|
SPR_NBMP, // NiGHTS Bumper
|
||||||
SPR_HOOP, // NiGHTS hoop sprite
|
SPR_HOOP, // NiGHTS hoop sprite
|
||||||
SPR_NSCR, // NiGHTS score sprite
|
SPR_NSCR, // NiGHTS score sprite
|
||||||
SPR_NPRU, // Nights Powerups
|
SPR_NPRU, // Nights Powerups
|
||||||
SPR_CAPS, // Capsule thingy for NiGHTS
|
SPR_CAPS, // Capsule thingy for NiGHTS
|
||||||
SPR_SUPT, // Super Sonic Transformation (NiGHTS)
|
|
||||||
|
|
||||||
// Debris
|
// Debris
|
||||||
SPR_SPRK, // spark
|
SPR_SPRK, // spark
|
||||||
|
|
|
@ -8067,12 +8067,14 @@ void A_OrbitNights(mobj_t* actor)
|
||||||
}
|
}
|
||||||
P_SetThingPosition(actor);
|
P_SetThingPosition(actor);
|
||||||
|
|
||||||
if (ishelper // Flash a helper that's about to be removed.
|
if (ishelper) // Flash a helper that's about to be removed.
|
||||||
&& (actor->target->player->powers[pw_nights_helper] < TICRATE)
|
{
|
||||||
&& (actor->target->player->powers[pw_nights_helper] & 1))
|
if ((actor->target->player->powers[pw_nights_helper] < TICRATE)
|
||||||
actor->flags2 |= MF2_DONTDRAW;
|
&& (actor->target->player->powers[pw_nights_helper] & 1))
|
||||||
else
|
actor->flags2 |= MF2_DONTDRAW;
|
||||||
actor->flags2 &= ~MF2_DONTDRAW;
|
else
|
||||||
|
actor->flags2 &= ~MF2_DONTDRAW;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -597,7 +597,7 @@ boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state)
|
||||||
|
|
||||||
mobj->sprite2 = spr2;
|
mobj->sprite2 = spr2;
|
||||||
mobj->frame = frame|(st->frame&~FF_FRAMEMASK);
|
mobj->frame = frame|(st->frame&~FF_FRAMEMASK);
|
||||||
if (mobj->color > MAXSKINCOLORS) // Super colours? Super bright!
|
if (mobj->color >= MAXSKINCOLORS && mobj->color < MAXTRANSLATIONS) // Super colours? Super bright!
|
||||||
mobj->frame |= FF_FULLBRIGHT;
|
mobj->frame |= FF_FULLBRIGHT;
|
||||||
}
|
}
|
||||||
// Regular sprites
|
// Regular sprites
|
||||||
|
|
105
src/p_user.c
105
src/p_user.c
|
@ -56,6 +56,39 @@
|
||||||
static void P_NukeAllPlayers(player_t *player);
|
static void P_NukeAllPlayers(player_t *player);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
//
|
||||||
|
// P_GetPlayerRadius
|
||||||
|
//
|
||||||
|
// Returns the radius
|
||||||
|
// of the player.
|
||||||
|
//
|
||||||
|
fixed_t P_GetPlayerRadius(player_t *player)
|
||||||
|
{
|
||||||
|
return FixedMul(skins[player->skin].radius, player->mo->scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// P_GetPlayerHeight
|
||||||
|
//
|
||||||
|
// Returns the height
|
||||||
|
// of the player.
|
||||||
|
//
|
||||||
|
fixed_t P_GetPlayerHeight(player_t *player)
|
||||||
|
{
|
||||||
|
return FixedMul(skins[player->skin].height, player->mo->scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// P_GetPlayerSpinHeight
|
||||||
|
//
|
||||||
|
// Returns the 'spin height'
|
||||||
|
// of the player.
|
||||||
|
//
|
||||||
|
fixed_t P_GetPlayerSpinHeight(player_t *player)
|
||||||
|
{
|
||||||
|
return FixedMul(skins[player->skin].spinheight, player->mo->scale);
|
||||||
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Movement.
|
// Movement.
|
||||||
//
|
//
|
||||||
|
@ -650,10 +683,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (!(player->pflags & PF_NIGHTSMODE))
|
if (!(player->pflags & PF_NIGHTSMODE))
|
||||||
{
|
player->mo->height = P_GetPlayerHeight(player); // Just to make sure jumping into the drone doesn't result in a squashed hitbox.
|
||||||
player->mo->radius = 16*FRACUNIT;
|
|
||||||
player->mo->height = 48*FRACUNIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING);
|
player->pflags &= ~(PF_USEDOWN|PF_JUMPDOWN|PF_ATTACKDOWN|PF_STARTDASH|PF_GLIDING|PF_JUMPED|PF_THOKKED|PF_SPINNING|PF_DRILLING);
|
||||||
player->homing = 0;
|
player->homing = 0;
|
||||||
|
@ -1298,39 +1328,6 @@ void P_SetObjectMomZ(mobj_t *mo, fixed_t value, boolean relative)
|
||||||
mo->momz = value;
|
mo->momz = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
|
||||||
// P_GetPlayerRadius
|
|
||||||
//
|
|
||||||
// Returns the radius
|
|
||||||
// of the player.
|
|
||||||
//
|
|
||||||
fixed_t P_GetPlayerRadius(player_t *player)
|
|
||||||
{
|
|
||||||
return FixedMul(skins[player->skin].radius, player->mo->scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// P_GetPlayerHeight
|
|
||||||
//
|
|
||||||
// Returns the height
|
|
||||||
// of the player.
|
|
||||||
//
|
|
||||||
fixed_t P_GetPlayerHeight(player_t *player)
|
|
||||||
{
|
|
||||||
return FixedMul(skins[player->skin].height, player->mo->scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// P_GetPlayerSpinHeight
|
|
||||||
//
|
|
||||||
// Returns the 'spin height'
|
|
||||||
// of the player.
|
|
||||||
//
|
|
||||||
fixed_t P_GetPlayerSpinHeight(player_t *player)
|
|
||||||
{
|
|
||||||
return FixedMul(skins[player->skin].spinheight, player->mo->scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_IsLocalPlayer
|
// P_IsLocalPlayer
|
||||||
//
|
//
|
||||||
|
@ -5000,14 +4997,30 @@ static void P_NightsTransferPoints(player_t *player, fixed_t xspeed, fixed_t rad
|
||||||
if (player->exiting)
|
if (player->exiting)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// You're welcome, Rob. (Now with slightly less horrendous hacking -Red
|
/*
|
||||||
/*player->mo->tracer->flags &= ~MF_NOCLIP;
|
In some ways worse, in some ways better.
|
||||||
player->mo->tracer->z = player->mo->z;
|
I did the following this way because the player object has to deal with touchspecials too, not just solids.
|
||||||
if (!P_TryMove(player->mo->tracer, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, true)) {
|
There were all sorts of fun bugs when the player got to touch the goal a frame earlier than it should've.
|
||||||
player->mo->tracer->flags |= MF_NOCLIP;
|
We could've applied MF_NOCLIPTHING, but then we'd lose out on clipping against MF_SOLIDs. Which is bad.
|
||||||
return;
|
Instead, the object TEMPORARILY LOSES ITS PLAYER STATUS. Is that nuts? It's probably a little nuts. I know
|
||||||
|
we probably could've kept around MT_NIGHTSCHAR in some fashion, having an invisible hitbox following the
|
||||||
|
player around... but I'd already removed all its references, restructured the way the chaos emerald follows
|
||||||
|
the player around to fill the player->mo->tracer gap left behind, and NiGHTS is a lag magnet (lagnet?)
|
||||||
|
enough as it is... so whatever. You're welcome to tell me I'm terrible, but at least it works.
|
||||||
|
~toast
|
||||||
|
*/
|
||||||
|
{
|
||||||
|
fixed_t prevx = player->mo->x;
|
||||||
|
fixed_t prevy = player->mo->y;
|
||||||
|
boolean notallowed;
|
||||||
|
player->mo->player = NULL; // YIKES
|
||||||
|
notallowed = (!(P_TryMove(player->mo, player->mo->x+player->mo->momx, player->mo->y+player->mo->momy, true)));
|
||||||
|
P_TeleportMove(player->mo, prevx, prevy, player->mo->z);
|
||||||
|
player->mo->player = player; // unyikes
|
||||||
|
if (notallowed)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
player->mo->tracer->flags |= MF_NOCLIP;*/
|
|
||||||
{
|
{
|
||||||
const INT32 sequence = player->mo->target->threshold;
|
const INT32 sequence = player->mo->target->threshold;
|
||||||
mobj_t *transfer1 = NULL;
|
mobj_t *transfer1 = NULL;
|
||||||
|
@ -5768,7 +5781,7 @@ static void P_NiGHTSMovement(player_t *player)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player->exiting > 0 && player->exiting < 2*TICRATE)
|
if (player->exiting > 0) //&& player->exiting < 2*TICRATE)
|
||||||
{
|
{
|
||||||
player->mo->momx = player->mo->momy = 0;
|
player->mo->momx = player->mo->momy = 0;
|
||||||
|
|
||||||
|
@ -6409,7 +6422,7 @@ static void P_MovePlayer(player_t *player)
|
||||||
{
|
{
|
||||||
if ((player->pflags & PF_NIGHTSMODE)
|
if ((player->pflags & PF_NIGHTSMODE)
|
||||||
&& !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS]
|
&& !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS]
|
||||||
&& player->mo->state <= &states[S_PLAY_NIGHTS_TRANS9]
|
&& player->mo->state <= &states[S_PLAY_NIGHTS_TRANS6] // NOT 9 - it's 6 when the player turns their supercolor.
|
||||||
&& !(player->exiting)))
|
&& !(player->exiting)))
|
||||||
{
|
{
|
||||||
skin_t *skin = ((skin_t *)(player->mo->skin));
|
skin_t *skin = ((skin_t *)(player->mo->skin));
|
||||||
|
|
Loading…
Reference in a new issue