Merge branch 'sonicitems' into bumpstuff
This commit is contained in:
commit
a63b172351
|
@ -3117,12 +3117,12 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
{
|
{
|
||||||
if (!players[playernum].spectator)
|
if (!players[playernum].spectator)
|
||||||
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
|
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
|
||||||
else
|
/*else
|
||||||
{
|
{
|
||||||
P_RemoveMobj(players[playernum].mo);
|
P_RemoveMobj(players[playernum].mo);
|
||||||
players[playernum].mo = NULL;
|
players[playernum].mo = NULL;
|
||||||
players[playernum].playerstate = PST_REBORN;
|
players[playernum].playerstate = PST_REBORN;
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
players[playernum].playerstate = PST_REBORN;
|
players[playernum].playerstate = PST_REBORN;
|
||||||
|
@ -3139,7 +3139,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
}
|
}
|
||||||
else if (NetPacket.packet.newteam != 3) // .newteam == 1 or 2.
|
else if (NetPacket.packet.newteam != 3) // .newteam == 1 or 2.
|
||||||
{
|
{
|
||||||
players[playernum].spectator = false;
|
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
|
||||||
players[playernum].pflags &= ~PF_TAGGED;//Just in case.
|
players[playernum].pflags &= ~PF_TAGGED;//Just in case.
|
||||||
|
|
||||||
if (NetPacket.packet.newteam == 1) //Make the player IT.
|
if (NetPacket.packet.newteam == 1) //Make the player IT.
|
||||||
|
@ -3149,7 +3149,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
}
|
}
|
||||||
else // Just join the game.
|
else // Just join the game.
|
||||||
{
|
{
|
||||||
players[playernum].spectator = false;
|
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
|
||||||
|
|
||||||
//If joining after hidetime in normal tag, default to being IT.
|
//If joining after hidetime in normal tag, default to being IT.
|
||||||
if (gametype == GT_TAG && (leveltime > (hidetime * TICRATE)))
|
if (gametype == GT_TAG && (leveltime > (hidetime * TICRATE)))
|
||||||
|
@ -3169,7 +3169,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
players[playernum].ctfteam = NetPacket.packet.newteam;
|
players[playernum].ctfteam = NetPacket.packet.newteam;
|
||||||
players[playernum].spectator = false;
|
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (G_GametypeHasSpectators())
|
else if (G_GametypeHasSpectators())
|
||||||
|
@ -3177,7 +3177,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
if (!NetPacket.packet.newteam)
|
if (!NetPacket.packet.newteam)
|
||||||
players[playernum].spectator = true;
|
players[playernum].spectator = true;
|
||||||
else
|
else
|
||||||
players[playernum].spectator = false;
|
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (NetPacket.packet.autobalance)
|
if (NetPacket.packet.autobalance)
|
||||||
|
@ -3209,7 +3209,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||||
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x84', M_GetText("Blue Team"), '\x80');
|
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x84', M_GetText("Blue Team"), '\x80');
|
||||||
}
|
}
|
||||||
else if (NetPacket.packet.newteam == 3)
|
else if (NetPacket.packet.newteam == 3)
|
||||||
CONS_Printf(M_GetText("%s entered the game.\n"), player_names[playernum]);
|
/*CONS_Printf(M_GetText("%s entered the game.\n"), player_names[playernum])*/;
|
||||||
else
|
else
|
||||||
CONS_Printf(M_GetText("%s became a spectator.\n"), player_names[playernum]);
|
CONS_Printf(M_GetText("%s became a spectator.\n"), player_names[playernum]);
|
||||||
|
|
||||||
|
|
|
@ -108,8 +108,8 @@ typedef enum
|
||||||
// Did you get a time-over?
|
// Did you get a time-over?
|
||||||
PF_TIMEOVER = 1<<10,
|
PF_TIMEOVER = 1<<10,
|
||||||
|
|
||||||
// Ready for Super?
|
// SRB2Kart: Spectator that wants to join
|
||||||
PF_SUPERREADY = 1<<11,
|
PF_WANTSTOJOIN = 1<<11,
|
||||||
|
|
||||||
// Character action status
|
// Character action status
|
||||||
PF_JUMPED = 1<<12,
|
PF_JUMPED = 1<<12,
|
||||||
|
|
|
@ -7391,8 +7391,8 @@ static const char *const PLAYERFLAG_LIST[] = {
|
||||||
// Did you get a time-over?
|
// Did you get a time-over?
|
||||||
"TIMEOVER",
|
"TIMEOVER",
|
||||||
|
|
||||||
// Ready for Super?
|
// SRB2Kart: spectator that wants to join
|
||||||
"SUPERREADY",
|
"WANTSTOJOIN",
|
||||||
|
|
||||||
// Character action status
|
// Character action status
|
||||||
"JUMPED",
|
"JUMPED",
|
||||||
|
|
26
src/g_game.c
26
src/g_game.c
|
@ -2175,6 +2175,9 @@ void G_Ticker(boolean run)
|
||||||
|
|
||||||
if (run)
|
if (run)
|
||||||
{
|
{
|
||||||
|
if (G_GametypeHasSpectators() && (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING))
|
||||||
|
K_CheckSpectateStatus();
|
||||||
|
|
||||||
if (pausedelay)
|
if (pausedelay)
|
||||||
pausedelay--;
|
pausedelay--;
|
||||||
|
|
||||||
|
@ -2227,14 +2230,6 @@ static inline void G_PlayerFinishLevel(INT32 player)
|
||||||
p->starpostnum = 0;
|
p->starpostnum = 0;
|
||||||
p->starpostcount = 0;
|
p->starpostcount = 0;
|
||||||
|
|
||||||
// SRB2Kart: exitlevel shouldn't get you the points
|
|
||||||
if (!p->exiting && !(p->pflags & PF_TIMEOVER))
|
|
||||||
{
|
|
||||||
p->pflags |= PF_TIMEOVER;
|
|
||||||
if (G_RaceGametype())
|
|
||||||
S_ChangeMusicInternal("racent", true);
|
|
||||||
}
|
|
||||||
|
|
||||||
// SRB2kart: Increment the "matches played" counter.
|
// SRB2kart: Increment the "matches played" counter.
|
||||||
if (player == consoleplayer)
|
if (player == consoleplayer)
|
||||||
{
|
{
|
||||||
|
@ -3232,7 +3227,7 @@ INT16 G_RandMap(INT16 tolflags, INT16 pprevmap, boolean dontadd, boolean ignoreb
|
||||||
//
|
//
|
||||||
static void G_DoCompleted(void)
|
static void G_DoCompleted(void)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i, j = 0;
|
||||||
boolean gottoken = false;
|
boolean gottoken = false;
|
||||||
|
|
||||||
tokenlist = 0; // Reset the list
|
tokenlist = 0; // Reset the list
|
||||||
|
@ -3246,7 +3241,20 @@ static void G_DoCompleted(void)
|
||||||
|
|
||||||
for (i = 0; i < MAXPLAYERS; i++)
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
if (playeringame[i])
|
if (playeringame[i])
|
||||||
|
{
|
||||||
|
// SRB2Kart: exitlevel shouldn't get you the points
|
||||||
|
if (!players[i].exiting && !(players[i].pflags & PF_TIMEOVER))
|
||||||
|
{
|
||||||
|
players[i].pflags |= PF_TIMEOVER;
|
||||||
|
if (P_IsLocalPlayer(&players[i]))
|
||||||
|
j++;
|
||||||
|
}
|
||||||
G_PlayerFinishLevel(i); // take away cards and stuff
|
G_PlayerFinishLevel(i); // take away cards and stuff
|
||||||
|
}
|
||||||
|
|
||||||
|
// play some generic music if there's no win/cool/lose music going on (for exitlevel commands)
|
||||||
|
if (G_RaceGametype() && j == splitscreen+1)
|
||||||
|
S_ChangeMusicInternal("racent", true);
|
||||||
|
|
||||||
if (automapactive)
|
if (automapactive)
|
||||||
AM_Stop();
|
AM_Stop();
|
||||||
|
|
12
src/info.c
12
src/info.c
|
@ -2565,12 +2565,12 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_RPOP, FF_FULLBRIGHT|2, 5, {NULL}, 0, 0, S_RANDOMITEMPOP4}, // S_RANDOMITEMPOP3
|
{SPR_RPOP, FF_FULLBRIGHT|2, 5, {NULL}, 0, 0, S_RANDOMITEMPOP4}, // S_RANDOMITEMPOP3
|
||||||
{SPR_RPOP, FF_FULLBRIGHT|3, 5, {NULL}, 0, 0, S_NULL}, // S_RANDOMITEMPOP4
|
{SPR_RPOP, FF_FULLBRIGHT|3, 5, {NULL}, 0, 0, S_NULL}, // S_RANDOMITEMPOP4
|
||||||
|
|
||||||
{SPR_DRIF, 0, 2, {NULL}, 0, 0, S_DRIFTSPARK2}, // S_DRIFTSPARK1
|
{SPR_DRIF, 0|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK2}, // S_DRIFTSPARK1
|
||||||
{SPR_DRIF, 1, 2, {NULL}, 0, 0, S_DRIFTSPARK3}, // S_DRIFTSPARK2
|
{SPR_DRIF, 1|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK3}, // S_DRIFTSPARK2
|
||||||
{SPR_DRIF, 2, 2, {NULL}, 0, 0, S_DRIFTSPARK1}, // S_DRIFTSPARK3
|
{SPR_DRIF, 2|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK1}, // S_DRIFTSPARK3
|
||||||
{SPR_DRIF, 3, 2, {NULL}, 0, 0, S_DRIFTSPARK5}, // S_DRIFTSPARK4
|
{SPR_DRIF, 3|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK5}, // S_DRIFTSPARK4
|
||||||
{SPR_DRIF, 4, 2, {NULL}, 0, 0, S_DRIFTSPARK6}, // S_DRIFTSPARK5
|
{SPR_DRIF, 4|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK6}, // S_DRIFTSPARK5
|
||||||
{SPR_DRIF, 5, 2, {NULL}, 0, 0, S_DRIFTSPARK4}, // S_DRIFTSPARK6
|
{SPR_DRIF, 5|FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_DRIFTSPARK4}, // S_DRIFTSPARK6
|
||||||
|
|
||||||
{SPR_DUST, 0, 3, {NULL}, 0, 0, S_DRIFTDUST2}, // S_DRIFTDUST1
|
{SPR_DUST, 0, 3, {NULL}, 0, 0, S_DRIFTDUST2}, // S_DRIFTDUST1
|
||||||
{SPR_DUST, 1, 3, {NULL}, 0, 0, S_DRIFTDUST3}, // S_DRIFTDUST2
|
{SPR_DUST, 1, 3, {NULL}, 0, 0, S_DRIFTDUST3}, // S_DRIFTDUST2
|
||||||
|
|
62
src/k_kart.c
62
src/k_kart.c
|
@ -3444,10 +3444,6 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||||
if (player->kartstuff[k_positiondelay])
|
if (player->kartstuff[k_positiondelay])
|
||||||
player->kartstuff[k_positiondelay]--;
|
player->kartstuff[k_positiondelay]--;
|
||||||
|
|
||||||
// Race force spectate
|
|
||||||
if (player->spectator && netgame && G_RaceGametype() && P_FindHighestLap() > 0)
|
|
||||||
player->powers[pw_flashing] = 5;
|
|
||||||
|
|
||||||
if ((player->pflags & PF_ATTACKDOWN) && !(cmd->buttons & BT_ATTACK))
|
if ((player->pflags & PF_ATTACKDOWN) && !(cmd->buttons & BT_ATTACK))
|
||||||
player->pflags &= ~PF_ATTACKDOWN;
|
player->pflags &= ~PF_ATTACKDOWN;
|
||||||
else if (cmd->buttons & BT_ATTACK)
|
else if (cmd->buttons & BT_ATTACK)
|
||||||
|
@ -4157,6 +4153,49 @@ void K_CheckBumpers(void)
|
||||||
P_DoPlayerExit(&players[i]);
|
P_DoPlayerExit(&players[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void K_CheckSpectateStatus(void)
|
||||||
|
{
|
||||||
|
UINT8 respawnlist[MAXPLAYERS];
|
||||||
|
UINT8 i, no = 0;
|
||||||
|
UINT8 numingame = 0, numjoiners = 0;
|
||||||
|
|
||||||
|
for (i = 0; i < MAXPLAYERS; i++)
|
||||||
|
{
|
||||||
|
if (!playeringame[i])
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (!players[i].spectator)
|
||||||
|
{
|
||||||
|
numingame++;
|
||||||
|
if (gamestate != GS_LEVEL)
|
||||||
|
continue;
|
||||||
|
if (G_RaceGametype() && players[i].laps > 0)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cv_allowteamchange.value && !(players[i].pflags & PF_WANTSTOJOIN))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
respawnlist[no++] = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
numjoiners = no; // Move the map change stuff up here when it gets a delay, and remove this redundant numjoiners var
|
||||||
|
|
||||||
|
while (no)
|
||||||
|
P_SpectatorJoinGame(&players[respawnlist[--no]]);
|
||||||
|
|
||||||
|
if (!server)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Reset the match if you're in an empty server, TODO: put it on a short 5-10 second timer, so you have a chance to roam.
|
||||||
|
if (gamestate == GS_LEVEL && (numingame < 2 && numingame+numjoiners >= 2))
|
||||||
|
{
|
||||||
|
CONS_Printf("Here comes a new challenger! Resetting map...\n");
|
||||||
|
D_MapChange(gamemap, gametype, ultimatemode, true, 0, false, false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//}
|
//}
|
||||||
|
|
||||||
//{ SRB2kart HUD Code
|
//{ SRB2kart HUD Code
|
||||||
|
@ -5464,19 +5503,24 @@ static void K_drawKartFinish(void)
|
||||||
if ((stplyr->kartstuff[k_cardanimation] % (2*5)) / 5) // blink
|
if ((stplyr->kartstuff[k_cardanimation] % (2*5)) / 5) // blink
|
||||||
pnum = 1;
|
pnum = 1;
|
||||||
|
|
||||||
if (splitscreen)
|
if (splitscreen > 1)
|
||||||
{
|
{
|
||||||
V_DrawTinyScaledPatch(STCD_X - (SHORT(kp_racefinish[pnum]->width)/8), STCD_Y - (SHORT(kp_racefinish[pnum]->height)/8), splitflags, kp_racefinish[pnum]);
|
V_DrawTinyScaledPatch(STCD_X - (SHORT(kp_racefinish[pnum]->width)/8), STCD_Y - (SHORT(kp_racefinish[pnum]->height)/8), splitflags, kp_racefinish[pnum]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
INT32 x = ((vid.width<<FRACBITS)/vid.dupx), xval = (SHORT(kp_racefinish[pnum]->width)<<(FRACBITS));
|
INT32 scaleshift = (FRACBITS - splitscreen); // FRACUNIT or FRACUNIT/2
|
||||||
|
INT32 x = ((vid.width<<FRACBITS)/vid.dupx), xval = (SHORT(kp_racefinish[pnum]->width)<<scaleshift);
|
||||||
x = ((TICRATE - stplyr->kartstuff[k_cardanimation])*(xval > x ? xval : x))/TICRATE;
|
x = ((TICRATE - stplyr->kartstuff[k_cardanimation])*(xval > x ? xval : x))/TICRATE;
|
||||||
|
|
||||||
V_DrawFixedPatch(x + ((STCD_X - (SHORT(kp_racefinish[pnum]->width)/2))<<FRACBITS),
|
if (splitscreen && stplyr == &players[secondarydisplayplayer])
|
||||||
(STCD_Y - (SHORT(kp_racefinish[pnum]->height)/2))<<FRACBITS,
|
x = -x;
|
||||||
FRACUNIT, splitflags, kp_racefinish[pnum], NULL);
|
|
||||||
|
V_DrawFixedPatch(x + (STCD_X<<FRACBITS) - (SHORT(kp_racefinish[pnum]->width)<<(scaleshift-1)),
|
||||||
|
(STCD_Y<<FRACBITS) - (SHORT(kp_racefinish[pnum]->height)<<(scaleshift-1)),
|
||||||
|
(1<<scaleshift),
|
||||||
|
splitflags, kp_racefinish[pnum], NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,6 +51,7 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove
|
||||||
void K_MoveKartPlayer(player_t *player, boolean onground);
|
void K_MoveKartPlayer(player_t *player, boolean onground);
|
||||||
void K_CalculateBattleWanted(void);
|
void K_CalculateBattleWanted(void);
|
||||||
void K_CheckBumpers(void);
|
void K_CheckBumpers(void);
|
||||||
|
void K_CheckSpectateStatus(void);
|
||||||
|
|
||||||
INT32 K_calcSplitFlags(INT32 snapflags);
|
INT32 K_calcSplitFlags(INT32 snapflags);
|
||||||
void K_LoadKartHUDGraphics(void);
|
void K_LoadKartHUDGraphics(void);
|
||||||
|
|
|
@ -897,7 +897,7 @@ static int lib_pHomingAttack(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_pSuperReady(lua_State *L)
|
/*static int lib_pSuperReady(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
//HUDSAFE
|
//HUDSAFE
|
||||||
|
@ -905,7 +905,7 @@ static int lib_pSuperReady(lua_State *L)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
lua_pushboolean(L, P_SuperReady(player));
|
lua_pushboolean(L, P_SuperReady(player));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
static int lib_pDoJump(lua_State *L)
|
static int lib_pDoJump(lua_State *L)
|
||||||
{
|
{
|
||||||
|
@ -2323,7 +2323,7 @@ static luaL_Reg lib[] = {
|
||||||
{"P_LookForEnemies",lib_pLookForEnemies},
|
{"P_LookForEnemies",lib_pLookForEnemies},
|
||||||
{"P_NukeEnemies",lib_pNukeEnemies},
|
{"P_NukeEnemies",lib_pNukeEnemies},
|
||||||
{"P_HomingAttack",lib_pHomingAttack},
|
{"P_HomingAttack",lib_pHomingAttack},
|
||||||
{"P_SuperReady",lib_pSuperReady},
|
//{"P_SuperReady",lib_pSuperReady},
|
||||||
{"P_DoJump",lib_pDoJump},
|
{"P_DoJump",lib_pDoJump},
|
||||||
{"P_SpawnThokMobj",lib_pSpawnThokMobj},
|
{"P_SpawnThokMobj",lib_pSpawnThokMobj},
|
||||||
{"P_SpawnSpinMobj",lib_pSpawnSpinMobj},
|
{"P_SpawnSpinMobj",lib_pSpawnSpinMobj},
|
||||||
|
|
|
@ -179,7 +179,7 @@ void P_InstaThrustEvenIn2D(mobj_t *mo, angle_t angle, fixed_t move);
|
||||||
boolean P_LookForEnemies(player_t *player);
|
boolean P_LookForEnemies(player_t *player);
|
||||||
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius);
|
||||||
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in p_user
|
||||||
boolean P_SuperReady(player_t *player);
|
//boolean P_SuperReady(player_t *player);
|
||||||
void P_DoJump(player_t *player, boolean soundandstate);
|
void P_DoJump(player_t *player, boolean soundandstate);
|
||||||
boolean P_AnalogMove(player_t *player);
|
boolean P_AnalogMove(player_t *player);
|
||||||
boolean P_TransferToNextMare(player_t *player);
|
boolean P_TransferToNextMare(player_t *player);
|
||||||
|
|
74
src/p_user.c
74
src/p_user.c
|
@ -3561,10 +3561,10 @@ static void P_DoSuperStuff(player_t *player)
|
||||||
return; // NiGHTS Super doesn't mix with normal super
|
return; // NiGHTS Super doesn't mix with normal super
|
||||||
|
|
||||||
// Does player have all emeralds? If so, flag the "Ready For Super!"
|
// Does player have all emeralds? If so, flag the "Ready For Super!"
|
||||||
if ((ALL7EMERALDS(emeralds) || ALL7EMERALDS(player->powers[pw_emeralds])) && player->health > 50)
|
/*if ((ALL7EMERALDS(emeralds) || ALL7EMERALDS(player->powers[pw_emeralds])) && player->health > 50)
|
||||||
player->pflags |= PF_SUPERREADY;
|
player->pflags |= PF_SUPERREADY;
|
||||||
else
|
else
|
||||||
player->pflags &= ~PF_SUPERREADY;
|
player->pflags &= ~PF_SUPERREADY;*/
|
||||||
|
|
||||||
if (player->powers[pw_super])
|
if (player->powers[pw_super])
|
||||||
{
|
{
|
||||||
|
@ -3690,7 +3690,7 @@ static void P_DoSuperStuff(player_t *player)
|
||||||
//
|
//
|
||||||
// Returns true if player is ready to turn super, duh
|
// Returns true if player is ready to turn super, duh
|
||||||
//
|
//
|
||||||
boolean P_SuperReady(player_t *player)
|
/*boolean P_SuperReady(player_t *player)
|
||||||
{
|
{
|
||||||
if ((player->pflags & PF_SUPERREADY) && !player->powers[pw_super] && !player->powers[pw_tailsfly]
|
if ((player->pflags & PF_SUPERREADY) && !player->powers[pw_super] && !player->powers[pw_tailsfly]
|
||||||
&& !(player->powers[pw_shield] & SH_NOSTACK)
|
&& !(player->powers[pw_shield] & SH_NOSTACK)
|
||||||
|
@ -3701,7 +3701,7 @@ boolean P_SuperReady(player_t *player)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
//
|
//
|
||||||
// P_DoJump
|
// P_DoJump
|
||||||
|
@ -8814,20 +8814,13 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
|
|
||||||
boolean P_SpectatorJoinGame(player_t *player)
|
boolean P_SpectatorJoinGame(player_t *player)
|
||||||
{
|
{
|
||||||
if (!G_GametypeHasSpectators() && G_IsSpecialStage(gamemap) && useNightsSS) // Special Stage spectators should NEVER be allowed to rejoin the game
|
// Team changing isn't allowed.
|
||||||
{
|
if (!cv_allowteamchange.value)
|
||||||
if (P_IsLocalPlayer(player))
|
|
||||||
CONS_Printf(M_GetText("You cannot enter the game while a special stage is in progress.\n"));
|
|
||||||
player->powers[pw_flashing] += 2*TICRATE; //to prevent message spam.
|
|
||||||
}
|
|
||||||
|
|
||||||
else if (!cv_allowteamchange.value)
|
|
||||||
{
|
{
|
||||||
if (P_IsLocalPlayer(player))
|
if (P_IsLocalPlayer(player))
|
||||||
CONS_Printf(M_GetText("Server does not allow team change.\n"));
|
CONS_Printf(M_GetText("Server does not allow team change.\n"));
|
||||||
player->powers[pw_flashing] += 2*TICRATE; //to prevent message spam.
|
player->powers[pw_flashing] += 2*TICRATE; //to prevent message spam.
|
||||||
}
|
}
|
||||||
|
|
||||||
// Team changing in Team Match and CTF
|
// Team changing in Team Match and CTF
|
||||||
// Pressing fire assigns you to a team that needs players if allowed.
|
// Pressing fire assigns you to a team that needs players if allowed.
|
||||||
// Partial code reproduction from p_tick.c autobalance code.
|
// Partial code reproduction from p_tick.c autobalance code.
|
||||||
|
@ -8864,6 +8857,7 @@ boolean P_SpectatorJoinGame(player_t *player)
|
||||||
player->mo = NULL;
|
player->mo = NULL;
|
||||||
}
|
}
|
||||||
player->spectator = false;
|
player->spectator = false;
|
||||||
|
player->pflags &= ~PF_WANTSTOJOIN;
|
||||||
player->ctfteam = changeto;
|
player->ctfteam = changeto;
|
||||||
player->playerstate = PST_REBORN;
|
player->playerstate = PST_REBORN;
|
||||||
|
|
||||||
|
@ -8881,43 +8875,21 @@ boolean P_SpectatorJoinGame(player_t *player)
|
||||||
// Joining in game from firing.
|
// Joining in game from firing.
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Exception for hide and seek. Don't join a game when you simply
|
if (player->mo)
|
||||||
// respawn in place and sit there for the rest of the round.
|
|
||||||
if (!(gametype == GT_HIDEANDSEEK && leveltime > (hidetime * TICRATE)))
|
|
||||||
{
|
{
|
||||||
if (player->mo)
|
P_RemoveMobj(player->mo);
|
||||||
{
|
player->mo = NULL;
|
||||||
P_RemoveMobj(player->mo);
|
|
||||||
player->mo = NULL;
|
|
||||||
}
|
|
||||||
player->spectator = false;
|
|
||||||
player->playerstate = PST_REBORN;
|
|
||||||
|
|
||||||
if (gametype == GT_TAG)
|
|
||||||
{
|
|
||||||
//Make joining players "it" after hidetime.
|
|
||||||
if (leveltime > (hidetime * TICRATE))
|
|
||||||
{
|
|
||||||
CONS_Printf(M_GetText("%s is now IT!\n"), player_names[player-players]); // Tell everyone who is it!
|
|
||||||
player->pflags |= PF_TAGIT;
|
|
||||||
}
|
|
||||||
|
|
||||||
P_CheckSurvivors();
|
|
||||||
}
|
|
||||||
|
|
||||||
//Reset away view
|
|
||||||
if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
|
|
||||||
displayplayer = consoleplayer;
|
|
||||||
|
|
||||||
CONS_Printf(M_GetText("%s entered the game.\n"), player_names[player-players]);
|
|
||||||
return true; // no more player->mo, cannot continue.
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (P_IsLocalPlayer(player))
|
|
||||||
CONS_Printf(M_GetText("You must wait until next round to enter the game.\n"));
|
|
||||||
player->powers[pw_flashing] += 2*TICRATE; //to prevent message spam.
|
|
||||||
}
|
}
|
||||||
|
player->spectator = false;
|
||||||
|
player->pflags &= ~PF_WANTSTOJOIN;
|
||||||
|
player->playerstate = PST_REBORN;
|
||||||
|
|
||||||
|
//Reset away view
|
||||||
|
if (P_IsLocalPlayer(player) && displayplayer != consoleplayer)
|
||||||
|
displayplayer = consoleplayer;
|
||||||
|
|
||||||
|
CONS_Printf(M_GetText("%s entered the game.\n"), player_names[player-players]);
|
||||||
|
return true; // no more player->mo, cannot continue.
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -9335,8 +9307,10 @@ void P_PlayerThink(player_t *player)
|
||||||
|
|
||||||
if ((netgame || splitscreen) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing])
|
if ((netgame || splitscreen) && player->spectator && cmd->buttons & BT_ATTACK && !player->powers[pw_flashing])
|
||||||
{
|
{
|
||||||
if (P_SpectatorJoinGame(player))
|
player->pflags ^= PF_WANTSTOJOIN;
|
||||||
return; // player->mo was removed.
|
player->powers[pw_flashing] += 2*TICRATE;
|
||||||
|
/*if (P_SpectatorJoinGame(player))
|
||||||
|
return; // player->mo was removed.*/
|
||||||
}
|
}
|
||||||
|
|
||||||
// Even if not NiGHTS, pull in nearby objects when walking around as John Q. Elliot.
|
// Even if not NiGHTS, pull in nearby objects when walking around as John Q. Elliot.
|
||||||
|
|
|
@ -1952,12 +1952,12 @@ static void ST_overlayDrawer(void)
|
||||||
{
|
{
|
||||||
// SRB2kart: changed positions & text
|
// SRB2kart: changed positions & text
|
||||||
V_DrawString(2, BASEVIDHEIGHT-50, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -"));
|
V_DrawString(2, BASEVIDHEIGHT-50, V_HUDTRANSHALF|V_YELLOWMAP, M_GetText("- SPECTATING -"));
|
||||||
/*if (G_GametypeHasTeams())
|
if (stplyr->pflags & PF_WANTSTOJOIN)
|
||||||
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Team"));
|
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Cancel Join"));
|
||||||
else if (G_IsSpecialStage(gamemap) && useNightsSS)
|
/*else if (G_GametypeHasTeams())
|
||||||
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF|V_REDMAP, M_GetText("- CANNOT JOIN -"));
|
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Team"));*/
|
||||||
else*/
|
else
|
||||||
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Enter Game"));
|
V_DrawString(2, BASEVIDHEIGHT-40, V_HUDTRANSHALF, M_GetText("Item - Join Game"));
|
||||||
V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("F12 - Change View"));
|
V_DrawString(2, BASEVIDHEIGHT-30, V_HUDTRANSHALF, M_GetText("F12 - Change View"));
|
||||||
V_DrawString(2, BASEVIDHEIGHT-20, V_HUDTRANSHALF, M_GetText("Accelerate - Float"));
|
V_DrawString(2, BASEVIDHEIGHT-20, V_HUDTRANSHALF, M_GetText("Accelerate - Float"));
|
||||||
V_DrawString(2, BASEVIDHEIGHT-10, V_HUDTRANSHALF, M_GetText("Brake - Sink"));
|
V_DrawString(2, BASEVIDHEIGHT-10, V_HUDTRANSHALF, M_GetText("Brake - Sink"));
|
||||||
|
|
Loading…
Reference in New Issue