mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-07 08:52:01 +00:00
Fix default NiGHTS skin brightness for non-super characters
This commit is contained in:
parent
a8e16638ee
commit
cea3f64c88
4 changed files with 28 additions and 14 deletions
|
@ -1113,6 +1113,16 @@ static int lib_pPlayerCanDamage(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_pPlayerFullbright(lua_State *L)
|
||||||
|
{
|
||||||
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
INLEVEL
|
||||||
|
if (!player)
|
||||||
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
|
lua_pushboolean(L, P_PlayerFullbright(player));
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static int lib_pIsObjectInGoop(lua_State *L)
|
static int lib_pIsObjectInGoop(lua_State *L)
|
||||||
{
|
{
|
||||||
|
@ -3386,6 +3396,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_DoPlayerPain",lib_pDoPlayerPain},
|
{"P_DoPlayerPain",lib_pDoPlayerPain},
|
||||||
{"P_ResetPlayer",lib_pResetPlayer},
|
{"P_ResetPlayer",lib_pResetPlayer},
|
||||||
{"P_PlayerCanDamage",lib_pPlayerCanDamage},
|
{"P_PlayerCanDamage",lib_pPlayerCanDamage},
|
||||||
|
{"P_PlayerFullbright",lib_pPlayerFullbright},
|
||||||
{"P_IsObjectInGoop",lib_pIsObjectInGoop},
|
{"P_IsObjectInGoop",lib_pIsObjectInGoop},
|
||||||
{"P_IsObjectOnGround",lib_pIsObjectOnGround},
|
{"P_IsObjectOnGround",lib_pIsObjectOnGround},
|
||||||
{"P_InSpaceSector",lib_pInSpaceSector},
|
{"P_InSpaceSector",lib_pInSpaceSector},
|
||||||
|
|
|
@ -142,6 +142,7 @@ void P_SetPlayerAngle(player_t *player, angle_t angle);
|
||||||
angle_t P_GetLocalAngle(player_t *player);
|
angle_t P_GetLocalAngle(player_t *player);
|
||||||
void P_SetLocalAngle(player_t *player, angle_t angle);
|
void P_SetLocalAngle(player_t *player, angle_t angle);
|
||||||
void P_ForceLocalAngle(player_t *player, angle_t angle);
|
void P_ForceLocalAngle(player_t *player, angle_t angle);
|
||||||
|
boolean P_PlayerFullbright(player_t *player);
|
||||||
|
|
||||||
boolean P_IsObjectInGoop(mobj_t *mo);
|
boolean P_IsObjectInGoop(mobj_t *mo);
|
||||||
boolean P_IsObjectOnGround(mobj_t *mo);
|
boolean P_IsObjectOnGround(mobj_t *mo);
|
||||||
|
|
|
@ -442,7 +442,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 (player->powers[pw_super] || (player->powers[pw_carry] == CR_NIGHTSMODE && (player->charflags & (SF_SUPER|SF_NONIGHTSSUPER)) == SF_SUPER)) // Super colours? Super bright!
|
if (P_PlayerFullbright(player))
|
||||||
mobj->frame |= FF_FULLBRIGHT;
|
mobj->frame |= FF_FULLBRIGHT;
|
||||||
}
|
}
|
||||||
// Regular sprites
|
// Regular sprites
|
||||||
|
|
28
src/p_user.c
28
src/p_user.c
|
@ -7975,20 +7975,13 @@ void P_MovePlayer(player_t *player)
|
||||||
// Locate the capsule for this mare.
|
// Locate the capsule for this mare.
|
||||||
else if (maptol & TOL_NIGHTS)
|
else if (maptol & TOL_NIGHTS)
|
||||||
{
|
{
|
||||||
if ((player->powers[pw_carry] == CR_NIGHTSMODE)
|
if (P_PlayerFullbright(player))
|
||||||
&& (player->exiting
|
|
||||||
|| !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1]
|
|
||||||
&& player->mo->state < &states[S_PLAY_NIGHTS_TRANS6]))) // Note the < instead of <=
|
|
||||||
{
|
{
|
||||||
skin_t *skin = ((skin_t *)(player->mo->skin));
|
player->mo->color = ((skin_t *)player->mo->skin)->supercolor
|
||||||
if (( skin->flags & (SF_SUPER|SF_NONIGHTSSUPER) ) == SF_SUPER)
|
+ ((player->nightstime == player->startedtime)
|
||||||
{
|
? 4
|
||||||
player->mo->color = skin->supercolor
|
: abs((((signed)leveltime >> 1) % 9) - 4)); // This is where super flashing is handled.
|
||||||
+ ((player->nightstime == player->startedtime)
|
G_GhostAddColor(GHC_SUPER);
|
||||||
? 4
|
|
||||||
: abs((((signed)leveltime >> 1) % 9) - 4)); // This is where super flashing is handled.
|
|
||||||
G_GhostAddColor(GHC_SUPER);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!player->capsule && !player->bonustime)
|
if (!player->capsule && !player->bonustime)
|
||||||
|
@ -12895,3 +12888,12 @@ void P_ForceLocalAngle(player_t *player, angle_t angle)
|
||||||
else if (player == &players[secondarydisplayplayer])
|
else if (player == &players[secondarydisplayplayer])
|
||||||
localangle2 = angle;
|
localangle2 = angle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean P_PlayerFullbright(player_t *player)
|
||||||
|
{
|
||||||
|
return (player->powers[pw_super]
|
||||||
|
|| ((player->powers[pw_carry] == CR_NIGHTSMODE && (((skin_t *)player->mo->skin)->flags & (SF_SUPER|SF_NONIGHTSSUPER)) == SF_SUPER) // Super colours? Super bright!
|
||||||
|
&& (player->exiting
|
||||||
|
|| !(player->mo->state >= &states[S_PLAY_NIGHTS_TRANS1]
|
||||||
|
&& player->mo->state < &states[S_PLAY_NIGHTS_TRANS6])))); // Note the < instead of <=
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue