huge cleanup gametypes
removed half the game lol
This commit is contained in:
1 parent
2d43624a87
commit
32a1a7ee3f
18 files changed
+131
-1630
No files matched your search
+3
-21
@@ -1061,8 +1061,6 @@ static void SV_SendResynch(INT32 node)
|
||||
netbuffer->packettype = PT_RESYNCHEND;
|
||||
|
||||
netbuffer->u.resynchend.randomseed = P_GetRandSeed();
|
||||
if (gametype == GT_CTF)
|
||||
resynch_write_ctf(&netbuffer->u.resynchend);
|
||||
resynch_write_others(&netbuffer->u.resynchend);
|
||||
|
||||
HSendPacket(node, true, 0, (sizeof(resynchend_pak)));
|
||||
@@ -1669,20 +1667,10 @@ static void SV_SendPlayerInfo(INT32 node)
|
||||
//No, don't do that, you fuckface.
|
||||
memset(netbuffer->u.playerinfo[i].address, 0, 4);
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (!players[i].ctfteam)
|
||||
netbuffer->u.playerinfo[i].team = 255;
|
||||
else
|
||||
netbuffer->u.playerinfo[i].team = (UINT8)players[i].ctfteam;
|
||||
}
|
||||
if (players[i].spectator)
|
||||
netbuffer->u.playerinfo[i].team = 255;
|
||||
else
|
||||
{
|
||||
if (players[i].spectator)
|
||||
netbuffer->u.playerinfo[i].team = 255;
|
||||
else
|
||||
netbuffer->u.playerinfo[i].team = 0;
|
||||
}
|
||||
netbuffer->u.playerinfo[i].team = 0;
|
||||
|
||||
netbuffer->u.playerinfo[i].score = LONG(players[i].score);
|
||||
netbuffer->u.playerinfo[i].timeinserver = SHORT((UINT16)(players[i].jointime / TICRATE));
|
||||
@@ -3244,9 +3232,6 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
||||
if (K_IsPlayerWanted(&players[playernum]))
|
||||
K_CalculateBattleWanted();
|
||||
|
||||
if (gametype == GT_CTF)
|
||||
P_PlayerFlagBurst(&players[playernum], false); // Don't take the flag with you!
|
||||
|
||||
// If in a special stage, redistribute the player's rings across
|
||||
// the remaining players.
|
||||
if (G_IsSpecialStage(gamemap))
|
||||
@@ -5623,9 +5608,6 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||
resynch_local_inprogress = false;
|
||||
|
||||
P_SetRandSeed(netbuffer->u.resynchend.randomseed);
|
||||
|
||||
if (gametype == GT_CTF)
|
||||
resynch_read_ctf(&netbuffer->u.resynchend);
|
||||
resynch_read_others(&netbuffer->u.resynchend);
|
||||
|
||||
break;
|
||||
|
||||
+43
-600
@@ -1526,24 +1526,10 @@ UINT8 CanChangeSkin(INT32 playernum)
|
||||
// Server has skin change restrictions.
|
||||
if (cv_restrictskinchange.value)
|
||||
{
|
||||
if (gametype == GT_COOP)
|
||||
return true;
|
||||
|
||||
// Can change skin during initial countdown.
|
||||
if (leveltime < starttime)
|
||||
return true;
|
||||
|
||||
if (G_TagGametype())
|
||||
{
|
||||
// Can change skin during hidetime.
|
||||
if (leveltime < hidetime * TICRATE)
|
||||
return true;
|
||||
|
||||
// IT players can always change skins to persue players hiding in character only locations.
|
||||
if (players[playernum].pflags & PF_TAGIT)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (players[playernum].spectator || players[playernum].playerstate == PST_DEAD || players[playernum].playerstate == PST_REBORN)
|
||||
return true;
|
||||
|
||||
@@ -1589,15 +1575,6 @@ static void SendNameAndColor(void)
|
||||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[consoleplayer].ctfteam == 1 && cv_playercolor.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor, skincolor_redteam);
|
||||
else if (players[consoleplayer].ctfteam == 2 && cv_playercolor.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor.value)
|
||||
{
|
||||
@@ -1638,25 +1615,9 @@ static void SendNameAndColor(void)
|
||||
}
|
||||
else if ((foundskin = R_SkinAvailable(cv_skin.string)) != -1)
|
||||
{
|
||||
//boolean notsame;
|
||||
|
||||
cv_skin.value = foundskin;
|
||||
|
||||
//notsame = (cv_skin.value != players[consoleplayer].skin);
|
||||
|
||||
SetPlayerSkin(consoleplayer, cv_skin.string);
|
||||
CV_StealthSet(&cv_skin, skins[cv_skin.value].name);
|
||||
|
||||
// SRB2Kart
|
||||
/*if (notsame)
|
||||
{
|
||||
CV_StealthSetValue(&cv_playercolor, skins[cv_skin.value].prefcolor);
|
||||
|
||||
players[consoleplayer].skincolor = (cv_playercolor.value&0x3F) % MAXSKINCOLORS;
|
||||
|
||||
if (players[consoleplayer].mo)
|
||||
players[consoleplayer].mo->color = (UINT8)players[consoleplayer].skincolor;
|
||||
}*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1722,15 +1683,6 @@ static void SendNameAndColor2(void)
|
||||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[secondplaya].ctfteam == 1 && cv_playercolor2.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor2, skincolor_redteam);
|
||||
else if (players[secondplaya].ctfteam == 2 && cv_playercolor2.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor2, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor2.value)
|
||||
{
|
||||
@@ -1850,15 +1802,6 @@ static void SendNameAndColor3(void)
|
||||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[thirdplaya].ctfteam == 1 && cv_playercolor3.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor3, skincolor_redteam);
|
||||
else if (players[thirdplaya].ctfteam == 2 && cv_playercolor3.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor3, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor3.value)
|
||||
{
|
||||
@@ -1970,15 +1913,6 @@ static void SendNameAndColor4(void)
|
||||
|
||||
p = buf;
|
||||
|
||||
// normal player colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (players[fourthplaya].ctfteam == 1 && cv_playercolor4.value != skincolor_redteam)
|
||||
CV_StealthSetValue(&cv_playercolor4, skincolor_redteam);
|
||||
else if (players[fourthplaya].ctfteam == 2 && cv_playercolor4.value != skincolor_blueteam)
|
||||
CV_StealthSetValue(&cv_playercolor4, skincolor_blueteam);
|
||||
}
|
||||
|
||||
// never allow the color "none"
|
||||
if (!cv_playercolor4.value)
|
||||
{
|
||||
@@ -2127,15 +2061,6 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
||||
{
|
||||
boolean kick = false;
|
||||
|
||||
// team colors
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (p->ctfteam == 1 && p->skincolor != skincolor_redteam)
|
||||
kick = true;
|
||||
else if (p->ctfteam == 2 && p->skincolor != skincolor_blueteam)
|
||||
kick = true;
|
||||
}
|
||||
|
||||
// don't allow color "none"
|
||||
if (!p->skincolor)
|
||||
kick = true;
|
||||
@@ -3345,27 +3270,14 @@ static void Command_Teamchange_f(void)
|
||||
|
||||
if (COM_Argc() <= 1)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
else
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "red") || !strcasecmp(COM_Argv(1), "1"))
|
||||
NetPacket.packet.newteam = 1;
|
||||
else if (!strcasecmp(COM_Argv(1), "blue") || !strcasecmp(COM_Argv(1), "2"))
|
||||
NetPacket.packet.newteam = 2;
|
||||
else if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
else
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
@@ -3382,17 +3294,13 @@ static void Command_Teamchange_f(void)
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
return;
|
||||
}
|
||||
|
||||
if (players[consoleplayer].spectator)
|
||||
error = !(NetPacket.packet.newteam || (players[consoleplayer].pflags & PF_WANTSTOJOIN)); // :lancer:
|
||||
else if (G_GametypeHasTeams())
|
||||
error = (NetPacket.packet.newteam == (unsigned)players[consoleplayer].ctfteam);
|
||||
else if (G_GametypeHasSpectators() && !players[consoleplayer].spectator)
|
||||
error = (NetPacket.packet.newteam == 3);
|
||||
#ifdef PARANOIA
|
||||
@@ -3412,13 +3320,6 @@ static void Command_Teamchange_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
//additional check for hide and seek. Don't allow change of status after hidetime ends.
|
||||
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
|
||||
SendNetXCmd(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
|
||||
}
|
||||
@@ -3435,27 +3336,14 @@ static void Command_Teamchange2_f(void)
|
||||
|
||||
if (COM_Argc() <= 1)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam2 <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam2 <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
else
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "red") || !strcasecmp(COM_Argv(1), "1"))
|
||||
NetPacket.packet.newteam = 1;
|
||||
else if (!strcasecmp(COM_Argv(1), "blue") || !strcasecmp(COM_Argv(1), "2"))
|
||||
NetPacket.packet.newteam = 2;
|
||||
else if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
else
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
@@ -3473,17 +3361,13 @@ static void Command_Teamchange2_f(void)
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam2 <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam2 <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
return;
|
||||
}
|
||||
|
||||
if (players[displayplayers[1]].spectator)
|
||||
error = !(NetPacket.packet.newteam || (players[displayplayers[1]].pflags & PF_WANTSTOJOIN));
|
||||
else if (G_GametypeHasTeams())
|
||||
error = (NetPacket.packet.newteam == (unsigned)players[displayplayers[1]].ctfteam);
|
||||
else if (G_GametypeHasSpectators() && !players[displayplayers[1]].spectator)
|
||||
error = (NetPacket.packet.newteam == 3);
|
||||
#ifdef PARANOIA
|
||||
@@ -3503,13 +3387,6 @@ static void Command_Teamchange2_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
//additional check for hide and seek. Don't allow change of status after hidetime ends.
|
||||
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
|
||||
SendNetXCmd2(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
|
||||
}
|
||||
@@ -3526,27 +3403,14 @@ static void Command_Teamchange3_f(void)
|
||||
|
||||
if (COM_Argc() <= 1)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam3 <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam3 <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
else
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "red") || !strcasecmp(COM_Argv(1), "1"))
|
||||
NetPacket.packet.newteam = 1;
|
||||
else if (!strcasecmp(COM_Argv(1), "blue") || !strcasecmp(COM_Argv(1), "2"))
|
||||
NetPacket.packet.newteam = 2;
|
||||
else if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
else
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
@@ -3564,17 +3428,13 @@ static void Command_Teamchange3_f(void)
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam3 <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam3 <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
return;
|
||||
}
|
||||
|
||||
if (players[displayplayers[2]].spectator)
|
||||
error = !(NetPacket.packet.newteam || (players[displayplayers[2]].pflags & PF_WANTSTOJOIN));
|
||||
else if (G_GametypeHasTeams())
|
||||
error = (NetPacket.packet.newteam == (unsigned)players[displayplayers[2]].ctfteam);
|
||||
else if (G_GametypeHasSpectators() && !players[displayplayers[2]].spectator)
|
||||
error = (NetPacket.packet.newteam == 3);
|
||||
#ifdef PARANOIA
|
||||
@@ -3594,13 +3454,6 @@ static void Command_Teamchange3_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
//additional check for hide and seek. Don't allow change of status after hidetime ends.
|
||||
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
|
||||
SendNetXCmd3(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
|
||||
}
|
||||
@@ -3617,27 +3470,14 @@ static void Command_Teamchange4_f(void)
|
||||
|
||||
if (COM_Argc() <= 1)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam4 <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam4 <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
else
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "red") || !strcasecmp(COM_Argv(1), "1"))
|
||||
NetPacket.packet.newteam = 1;
|
||||
else if (!strcasecmp(COM_Argv(1), "blue") || !strcasecmp(COM_Argv(1), "2"))
|
||||
NetPacket.packet.newteam = 2;
|
||||
else if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
else
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(1), "spectator") || !strcasecmp(COM_Argv(1), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
@@ -3655,17 +3495,13 @@ static void Command_Teamchange4_f(void)
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("changeteam4 <team>: switch to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("changeteam4 <team>: switch to a new team (%s)\n"), "spectator or playing");
|
||||
return;
|
||||
}
|
||||
|
||||
if (players[displayplayers[3]].spectator)
|
||||
error = !(NetPacket.packet.newteam || (players[displayplayers[3]].pflags & PF_WANTSTOJOIN));
|
||||
else if (G_GametypeHasTeams())
|
||||
error = (NetPacket.packet.newteam == (unsigned)players[displayplayers[3]].ctfteam);
|
||||
else if (G_GametypeHasSpectators() && !players[displayplayers[3]].spectator)
|
||||
error = (NetPacket.packet.newteam == 3);
|
||||
#ifdef PARANOIA
|
||||
@@ -3685,13 +3521,6 @@ static void Command_Teamchange4_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
//additional check for hide and seek. Don't allow change of status after hidetime ends.
|
||||
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
|
||||
SendNetXCmd4(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
|
||||
}
|
||||
@@ -3714,42 +3543,14 @@ static void Command_ServerTeamChange_f(void)
|
||||
|
||||
if (COM_Argc() < 3)
|
||||
{
|
||||
if (G_TagGametype())
|
||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "it, notit, playing, or spectator");
|
||||
else if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "spectator or playing");
|
||||
else
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_TagGametype())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(2), "it") || !strcasecmp(COM_Argv(2), "1"))
|
||||
NetPacket.packet.newteam = 1;
|
||||
else if (!strcasecmp(COM_Argv(2), "notit") || !strcasecmp(COM_Argv(2), "2"))
|
||||
NetPacket.packet.newteam = 2;
|
||||
else if (!strcasecmp(COM_Argv(2), "playing") || !strcasecmp(COM_Argv(2), "3"))
|
||||
NetPacket.packet.newteam = 3;
|
||||
else if (!strcasecmp(COM_Argv(2), "spectator") || !strcasecmp(COM_Argv(2), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
else
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasTeams())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(2), "red") || !strcasecmp(COM_Argv(2), "1"))
|
||||
NetPacket.packet.newteam = 1;
|
||||
else if (!strcasecmp(COM_Argv(2), "blue") || !strcasecmp(COM_Argv(2), "2"))
|
||||
NetPacket.packet.newteam = 2;
|
||||
else if (!strcasecmp(COM_Argv(2), "spectator") || !strcasecmp(COM_Argv(2), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
else
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!strcasecmp(COM_Argv(2), "spectator") || !strcasecmp(COM_Argv(2), "0"))
|
||||
NetPacket.packet.newteam = 0;
|
||||
@@ -3766,11 +3567,7 @@ static void Command_ServerTeamChange_f(void)
|
||||
|
||||
if (error)
|
||||
{
|
||||
if (G_TagGametype())
|
||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "it, notit, playing, or spectator");
|
||||
else if (G_GametypeHasTeams())
|
||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "red, blue or spectator");
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
CONS_Printf(M_GetText("serverchangeteam <playernum> <team>: switch player to a new team (%s)\n"), "spectator or playing");
|
||||
return;
|
||||
}
|
||||
@@ -3783,21 +3580,7 @@ static void Command_ServerTeamChange_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_TagGametype())
|
||||
{
|
||||
if (( (players[NetPacket.packet.playernum].pflags & PF_TAGIT) && NetPacket.packet.newteam == 1) ||
|
||||
(!(players[NetPacket.packet.playernum].pflags & PF_TAGIT) && NetPacket.packet.newteam == 2) ||
|
||||
( players[NetPacket.packet.playernum].spectator && !NetPacket.packet.newteam) ||
|
||||
(!players[NetPacket.packet.playernum].spectator && NetPacket.packet.newteam == 3))
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasTeams())
|
||||
{
|
||||
if (NetPacket.packet.newteam == (unsigned)players[NetPacket.packet.playernum].ctfteam ||
|
||||
(players[NetPacket.packet.playernum].spectator && !NetPacket.packet.newteam))
|
||||
error = true;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if ((players[NetPacket.packet.playernum].spectator && !NetPacket.packet.newteam) ||
|
||||
(!players[NetPacket.packet.playernum].spectator && NetPacket.packet.newteam == 3))
|
||||
@@ -3814,13 +3597,6 @@ static void Command_ServerTeamChange_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
//additional check for hide and seek. Don't allow change of status after hidetime ends.
|
||||
if (gametype == GT_HIDEANDSEEK && leveltime >= (hidetime * TICRATE))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("Hiding time expired; no Hide and Seek status changes allowed!\n"));
|
||||
return;
|
||||
}
|
||||
|
||||
NetPacket.packet.verification = true; // This signals that it's a server change
|
||||
|
||||
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
|
||||
@@ -3834,7 +3610,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
boolean error = false, wasspectator = false;
|
||||
NetPacket.value.l = NetPacket.value.b = READINT16(*cp);
|
||||
|
||||
if (!G_GametypeHasTeams() && !G_GametypeHasSpectators()) //Make sure you're in the right gametype.
|
||||
if (!G_GametypeHasSpectators()) //Make sure you're in the right gametype.
|
||||
{
|
||||
// this should never happen unless the client is hacked/buggy
|
||||
CONS_Alert(CONS_WARNING, M_GetText("Illegal team change received from player %s\n"), player_names[playernum]);
|
||||
@@ -3869,18 +3645,6 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
// Prevent multiple changes in one go.
|
||||
if (players[playernum].spectator && !(players[playernum].pflags & PF_WANTSTOJOIN) && !NetPacket.packet.newteam)
|
||||
return;
|
||||
else if (G_TagGametype())
|
||||
{
|
||||
if (((players[playernum].pflags & PF_TAGIT) && NetPacket.packet.newteam == 1) ||
|
||||
(!(players[playernum].pflags & PF_TAGIT) && NetPacket.packet.newteam == 2) ||
|
||||
(!players[playernum].spectator && NetPacket.packet.newteam == 3))
|
||||
return;
|
||||
}
|
||||
else if (G_GametypeHasTeams())
|
||||
{
|
||||
if (NetPacket.packet.newteam && (NetPacket.packet.newteam == (unsigned)players[playernum].ctfteam))
|
||||
return;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!players[playernum].spectator && NetPacket.packet.newteam == 3)
|
||||
@@ -3903,45 +3667,16 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
return;
|
||||
}
|
||||
|
||||
//Make sure that the right team number is sent. Keep in mind that normal clients cannot change to certain teams in certain gametypes.
|
||||
switch (gametype)
|
||||
{
|
||||
case GT_HIDEANDSEEK:
|
||||
//no status changes after hidetime
|
||||
if (leveltime >= (hidetime * TICRATE))
|
||||
{
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
/* FALLTHRU */
|
||||
case GT_TAG:
|
||||
switch (NetPacket.packet.newteam)
|
||||
{
|
||||
case 0:
|
||||
break;
|
||||
case 1: case 2:
|
||||
if (!NetPacket.packet.verification)
|
||||
error = true; //Only admin can change player's IT status' in tag.
|
||||
break;
|
||||
case 3: //Join game via console.
|
||||
if (!NetPacket.packet.verification && !cv_allowteamchange.value)
|
||||
error = true;
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
default:
|
||||
#ifdef PARANOIA
|
||||
if (!G_GametypeHasTeams() && !G_GametypeHasSpectators())
|
||||
I_Error("Invalid gametype after initial checks!");
|
||||
if (!G_GametypeHasSpectators())
|
||||
I_Error("Invalid gametype after initial checks!");
|
||||
#endif
|
||||
|
||||
if (!cv_allowteamchange.value)
|
||||
{
|
||||
if (!NetPacket.packet.verification && NetPacket.packet.newteam)
|
||||
error = true; //Only admin can change status, unless changing to spectator.
|
||||
}
|
||||
break; //Otherwise, you don't need special permissions.
|
||||
//Make sure that the right team number is sent. Keep in mind that normal clients cannot change to certain teams in certain gametypes.
|
||||
if (!cv_allowteamchange.value)
|
||||
{
|
||||
if (!NetPacket.packet.verification && NetPacket.packet.newteam)
|
||||
error = true; //Only admin can change status, unless changing to spectator.
|
||||
}
|
||||
|
||||
if (server && ((NetPacket.packet.newteam < 0 || NetPacket.packet.newteam > 3) || error))
|
||||
@@ -3959,19 +3694,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
if (!players[playernum].spectator)
|
||||
{
|
||||
if (players[playernum].mo)
|
||||
{
|
||||
//if (!players[playernum].spectator)
|
||||
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
|
||||
/*else
|
||||
{
|
||||
if (players[playernum].mo)
|
||||
{
|
||||
P_RemoveMobj(players[playernum].mo);
|
||||
players[playernum].mo = NULL;
|
||||
}
|
||||
players[playernum].playerstate = PST_REBORN;
|
||||
}*/
|
||||
}
|
||||
P_DamageMobj(players[playernum].mo, NULL, NULL, 10000);
|
||||
else
|
||||
players[playernum].playerstate = PST_REBORN;
|
||||
}
|
||||
@@ -3982,50 +3705,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
|
||||
//Now that we've done our error checking and killed the player
|
||||
//if necessary, put the player on the correct team/status.
|
||||
if (G_TagGametype())
|
||||
{
|
||||
if (!NetPacket.packet.newteam)
|
||||
{
|
||||
players[playernum].spectator = true;
|
||||
players[playernum].pflags &= ~PF_TAGIT;
|
||||
players[playernum].pflags &= ~PF_TAGGED;
|
||||
}
|
||||
else if (NetPacket.packet.newteam != 3) // .newteam == 1 or 2.
|
||||
{
|
||||
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
|
||||
players[playernum].pflags &= ~PF_TAGGED;//Just in case.
|
||||
|
||||
if (NetPacket.packet.newteam == 1) //Make the player IT.
|
||||
players[playernum].pflags |= PF_TAGIT;
|
||||
else
|
||||
players[playernum].pflags &= ~PF_TAGIT;
|
||||
}
|
||||
else // Just join the game.
|
||||
{
|
||||
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
|
||||
|
||||
//If joining after hidetime in normal tag, default to being IT.
|
||||
if (gametype == GT_TAG && (leveltime > (hidetime * TICRATE)))
|
||||
{
|
||||
NetPacket.packet.newteam = 1; //minor hack, causes the "is it" message to be printed later.
|
||||
players[playernum].pflags |= PF_TAGIT; //make the player IT.
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (G_GametypeHasTeams())
|
||||
{
|
||||
if (!NetPacket.packet.newteam)
|
||||
{
|
||||
players[playernum].ctfteam = 0;
|
||||
players[playernum].spectator = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
players[playernum].ctfteam = NetPacket.packet.newteam;
|
||||
players[playernum].pflags |= PF_WANTSTOJOIN; //players[playernum].spectator = false;
|
||||
}
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!NetPacket.packet.newteam)
|
||||
players[playernum].spectator = true;
|
||||
@@ -4049,17 +3729,11 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
}
|
||||
else if (NetPacket.packet.newteam == 1)
|
||||
{
|
||||
if (G_TagGametype())
|
||||
CONS_Printf(M_GetText("%s is now IT!\n"), player_names[playernum]);
|
||||
else
|
||||
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x85', M_GetText("Red Team"), '\x80');
|
||||
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[playernum], '\x85', M_GetText("Red Team"), '\x80');
|
||||
}
|
||||
else if (NetPacket.packet.newteam == 2)
|
||||
{
|
||||
if (G_TagGametype())
|
||||
CONS_Printf(M_GetText("%s is no longer IT!\n"), player_names[playernum]);
|
||||
else
|
||||
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 == 0 && !wasspectator)
|
||||
HU_AddChatText(va("\x82*%s became a spectator.", player_names[playernum]), false); // "entered the game" text was moved to P_SpectatorJoinGame
|
||||
@@ -4068,21 +3742,6 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
if (playernum == consoleplayer || displayplayers[0] == playernum)
|
||||
displayplayers[0] = consoleplayer;
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (NetPacket.packet.newteam)
|
||||
{
|
||||
if (playernum == consoleplayer) //CTF and Team Match colors.
|
||||
CV_SetValue(&cv_playercolor, NetPacket.packet.newteam + 5);
|
||||
else if (playernum == displayplayers[1])
|
||||
CV_SetValue(&cv_playercolor2, NetPacket.packet.newteam + 5);
|
||||
else if (playernum == displayplayers[2])
|
||||
CV_SetValue(&cv_playercolor3, NetPacket.packet.newteam + 5);
|
||||
else if (playernum == displayplayers[3])
|
||||
CV_SetValue(&cv_playercolor4, NetPacket.packet.newteam + 5);
|
||||
}
|
||||
}
|
||||
|
||||
if (gamestate != GS_LEVEL)
|
||||
return;
|
||||
|
||||
@@ -4105,10 +3764,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
|
||||
players[playernum].mo->health = 1;
|
||||
}
|
||||
|
||||
// In tag, check to see if you still have a game.
|
||||
/*if (G_TagGametype())
|
||||
P_CheckSurvivors();
|
||||
else*/ if (G_BattleGametype())
|
||||
if (G_BattleGametype())
|
||||
K_CheckBumpers(); // SRB2Kart
|
||||
else if (G_RaceGametype())
|
||||
P_CheckRacers(); // also SRB2Kart
|
||||
@@ -5109,7 +4765,7 @@ static void PointLimit_OnChange(void)
|
||||
if (cv_pointlimit.value)
|
||||
{
|
||||
CONS_Printf(M_GetText("Levels will end after %s scores %d point%s.\n"),
|
||||
G_GametypeHasTeams() ? M_GetText("a team") : M_GetText("someone"),
|
||||
M_GetText("someone"),
|
||||
cv_pointlimit.value,
|
||||
cv_pointlimit.value > 1 ? "s" : "");
|
||||
}
|
||||
@@ -5164,11 +4820,7 @@ static void TimeLimit_OnChange(void)
|
||||
if (cv_timelimit.value != 0)
|
||||
{
|
||||
CONS_Printf(M_GetText("Levels will end after %d minute%s.\n"),cv_timelimit.value,cv_timelimit.value == 1 ? "" : "s"); // Graue 11-17-2003
|
||||
timelimitintics = cv_timelimit.value * 60 * TICRATE;
|
||||
|
||||
//add hidetime for tag too!
|
||||
if (G_TagGametype())
|
||||
timelimitintics += hidetime * TICRATE;
|
||||
timelimitintics = cv_timelimit.value * 60 * TICRATE;;
|
||||
|
||||
// Note the deliberate absence of any code preventing
|
||||
// pointlimit and timelimit from being set simultaneously.
|
||||
@@ -5207,54 +4859,24 @@ void D_GameTypeChanged(INT32 lastgametype)
|
||||
// There will always be a server, and this only needs to be done once.
|
||||
if (server && (multiplayer || netgame))
|
||||
{
|
||||
if (gametype == GT_COMPETITION || gametype == GT_COOP)
|
||||
CV_SetValue(&cv_itemrespawn, 0);
|
||||
else if (!cv_itemrespawn.changed)
|
||||
if (!cv_itemrespawn.changed)
|
||||
CV_SetValue(&cv_itemrespawn, 1);
|
||||
|
||||
switch (gametype)
|
||||
if (gametype == GT_MATCH)
|
||||
{
|
||||
case GT_MATCH:
|
||||
case GT_TEAMMATCH:
|
||||
if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits
|
||||
{
|
||||
// default settings for match: no timelimit, no pointlimit
|
||||
CV_SetValue(&cv_pointlimit, 0);
|
||||
CV_SetValue(&cv_timelimit, 0);
|
||||
}
|
||||
if (!cv_itemrespawntime.changed)
|
||||
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
|
||||
break;
|
||||
case GT_TAG:
|
||||
case GT_HIDEANDSEEK:
|
||||
if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits
|
||||
{
|
||||
// default settings for tag: 5 mins, no pointlimit
|
||||
// Note that tag mode also uses an alternate timing mechanism in tandem with timelimit.
|
||||
CV_SetValue(&cv_timelimit, 5);
|
||||
CV_SetValue(&cv_pointlimit, 0);
|
||||
}
|
||||
if (!cv_itemrespawntime.changed)
|
||||
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
|
||||
break;
|
||||
case GT_CTF:
|
||||
if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits
|
||||
{
|
||||
// default settings for CTF: no timelimit, pointlimit 5
|
||||
CV_SetValue(&cv_timelimit, 0);
|
||||
CV_SetValue(&cv_pointlimit, 5);
|
||||
}
|
||||
if (!cv_itemrespawntime.changed)
|
||||
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
|
||||
break;
|
||||
if (!cv_timelimit.changed && !cv_pointlimit.changed) // user hasn't changed limits
|
||||
{
|
||||
// default settings for match: no timelimit, no pointlimit
|
||||
CV_SetValue(&cv_pointlimit, 0);
|
||||
CV_SetValue(&cv_timelimit, 0);
|
||||
}
|
||||
if (!cv_itemrespawntime.changed)
|
||||
CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue); // respawn normally
|
||||
}
|
||||
}
|
||||
else if (!multiplayer && !netgame)
|
||||
{
|
||||
gametype = GT_RACE; // SRB2kart
|
||||
// These shouldn't matter anymore
|
||||
//CV_Set(&cv_itemrespawntime, cv_itemrespawntime.defaultvalue);
|
||||
//CV_SetValue(&cv_itemrespawn, 0);
|
||||
}
|
||||
|
||||
// reset timelimit and pointlimit in race/coop, prevent stupid cheats
|
||||
@@ -5267,42 +4889,6 @@ void D_GameTypeChanged(INT32 lastgametype)
|
||||
if (cv_pointlimit.value)
|
||||
CV_SetValue(&cv_pointlimit, 0);
|
||||
}
|
||||
else if ((cv_pointlimit.changed || cv_timelimit.changed) && cv_pointlimit.value)
|
||||
{
|
||||
if (lastgametype != GT_CTF && gametype == GT_CTF)
|
||||
CV_SetValue(&cv_pointlimit, cv_pointlimit.value / 500);
|
||||
else if (lastgametype == GT_CTF && gametype != GT_CTF)
|
||||
CV_SetValue(&cv_pointlimit, cv_pointlimit.value * 500);
|
||||
}
|
||||
}
|
||||
|
||||
// When swapping to a gametype that supports spectators,
|
||||
// make everyone a spectator initially.
|
||||
/*if (G_GametypeHasSpectators())
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
{
|
||||
players[i].ctfteam = 0;
|
||||
players[i].spectator = true;
|
||||
}
|
||||
}*/
|
||||
|
||||
// don't retain teams in other modes or between changes from ctf to team match.
|
||||
// also, stop any and all forms of team scrambling that might otherwise take place.
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
INT32 i;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i])
|
||||
players[i].ctfteam = 0;
|
||||
|
||||
if (server || (IsPlayerAdmin(consoleplayer)))
|
||||
{
|
||||
CV_StealthSetValue(&cv_teamscramble, 0);
|
||||
teamscramble = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5366,14 +4952,6 @@ static void AutoBalance_OnChange(void)
|
||||
|
||||
static void TeamScramble_OnChange(void)
|
||||
{
|
||||
INT16 i = 0, j = 0, playercount = 0;
|
||||
boolean repick = true;
|
||||
INT32 blue = 0, red = 0;
|
||||
INT32 maxcomposition = 0;
|
||||
INT16 newteam = 0;
|
||||
INT32 retries = 0;
|
||||
boolean success = false;
|
||||
|
||||
// Don't trigger outside level or intermission!
|
||||
if (!(gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING))
|
||||
return;
|
||||
@@ -5381,152 +4959,17 @@ static void TeamScramble_OnChange(void)
|
||||
if (!cv_teamscramble.value)
|
||||
teamscramble = 0;
|
||||
|
||||
if (!G_GametypeHasTeams() && (server || IsPlayerAdmin(consoleplayer)))
|
||||
if (server || IsPlayerAdmin(consoleplayer))
|
||||
{
|
||||
CONS_Alert(CONS_NOTICE, M_GetText("This command cannot be used in this gametype.\n"));
|
||||
CV_StealthSetValue(&cv_teamscramble, 0);
|
||||
return;
|
||||
}
|
||||
|
||||
// If a team scramble is already in progress, do not allow another one to be started!
|
||||
if (teamscramble)
|
||||
return;
|
||||
|
||||
retryscramble:
|
||||
|
||||
// Clear related global variables. These will get used again in p_tick.c/y_inter.c as the teams are scrambled.
|
||||
memset(&scrambleplayers, 0, sizeof(scrambleplayers));
|
||||
memset(&scrambleteams, 0, sizeof(scrambleplayers));
|
||||
scrambletotal = scramblecount = 0;
|
||||
blue = red = maxcomposition = newteam = playercount = 0;
|
||||
repick = true;
|
||||
|
||||
// Put each player's node in the array.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && !players[i].spectator)
|
||||
{
|
||||
scrambleplayers[playercount] = i;
|
||||
playercount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (playercount < 2)
|
||||
{
|
||||
CV_StealthSetValue(&cv_teamscramble, 0);
|
||||
return; // Don't scramble one or zero players.
|
||||
}
|
||||
|
||||
// Randomly place players on teams.
|
||||
if (cv_teamscramble.value == 1)
|
||||
{
|
||||
maxcomposition = playercount / 2;
|
||||
|
||||
// Now randomly assign players to teams.
|
||||
// If the teams get out of hand, assign the rest to the other team.
|
||||
for (i = 0; i < playercount; i++)
|
||||
{
|
||||
if (repick)
|
||||
newteam = (INT16)((M_RandomByte() % 2) + 1);
|
||||
|
||||
// One team has the most players they can get, assign the rest to the other team.
|
||||
if (red == maxcomposition || blue == maxcomposition)
|
||||
{
|
||||
if (red == maxcomposition)
|
||||
newteam = 2;
|
||||
else if (blue == maxcomposition)
|
||||
newteam = 1;
|
||||
|
||||
repick = false;
|
||||
}
|
||||
|
||||
scrambleteams[i] = newteam;
|
||||
|
||||
if (newteam == 1)
|
||||
red++;
|
||||
else
|
||||
blue++;
|
||||
}
|
||||
}
|
||||
else if (cv_teamscramble.value == 2) // Same as before, except split teams based on current score.
|
||||
{
|
||||
// Now, sort the array based on points scored.
|
||||
for (i = 1; i < playercount; i++)
|
||||
{
|
||||
for (j = i; j < playercount; j++)
|
||||
{
|
||||
INT16 tempplayer = 0;
|
||||
|
||||
if ((players[scrambleplayers[i-1]].score > players[scrambleplayers[j]].score))
|
||||
{
|
||||
tempplayer = scrambleplayers[i-1];
|
||||
scrambleplayers[i-1] = scrambleplayers[j];
|
||||
scrambleplayers[j] = tempplayer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Now assign players to teams based on score. Scramble in pairs.
|
||||
// If there is an odd number, one team will end up with the unlucky slob who has no points. =(
|
||||
for (i = 0; i < playercount; i++)
|
||||
{
|
||||
if (repick)
|
||||
{
|
||||
newteam = (INT16)((M_RandomByte() % 2) + 1);
|
||||
repick = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
// We will only randomly pick the team for the first guy.
|
||||
// Otherwise, just alternate back and forth, distributing players.
|
||||
if (newteam == 1)
|
||||
newteam = 2;
|
||||
else
|
||||
newteam = 1;
|
||||
}
|
||||
|
||||
scrambleteams[i] = newteam;
|
||||
}
|
||||
}
|
||||
|
||||
// Check to see if our random selection actually
|
||||
// changed anybody. If not, we run through and try again.
|
||||
for (i = 0; i < playercount; i++)
|
||||
{
|
||||
if (players[scrambleplayers[i]].ctfteam != scrambleteams[i])
|
||||
success = true;
|
||||
}
|
||||
|
||||
if (!success && retries < 5)
|
||||
{
|
||||
retries++;
|
||||
goto retryscramble; //try again
|
||||
}
|
||||
|
||||
// Display a witty message, but only during scrambles specifically triggered by an admin.
|
||||
if (cv_teamscramble.value)
|
||||
{
|
||||
scrambletotal = playercount;
|
||||
teamscramble = (INT16)cv_teamscramble.value;
|
||||
|
||||
if (!(gamestate == GS_INTERMISSION && cv_scrambleonchange.value))
|
||||
CONS_Printf(M_GetText("Teams will be scrambled next round.\n"));
|
||||
}
|
||||
}
|
||||
|
||||
static void Hidetime_OnChange(void)
|
||||
{
|
||||
if (Playing() && G_TagGametype() && leveltime >= (hidetime * TICRATE))
|
||||
{
|
||||
// Don't allow hidetime changes after it expires.
|
||||
CV_StealthSetValue(&cv_hidetime, hidetime);
|
||||
return;
|
||||
}
|
||||
hidetime = cv_hidetime.value;
|
||||
|
||||
//uh oh, gotta change timelimitintics now too
|
||||
if (G_TagGametype())
|
||||
timelimitintics = (cv_timelimit.value * 60 * TICRATE) + (hidetime * TICRATE);
|
||||
}
|
||||
|
||||
static void Command_Showmap_f(void)
|
||||
@@ -5568,7 +5011,7 @@ static void Command_Mapmd5_f(void)
|
||||
|
||||
static void Command_ExitLevel_f(void)
|
||||
{
|
||||
if (!(netgame || (multiplayer && gametype != GT_COOP)) && !cv_debug)
|
||||
if (!(netgame || multiplayer) && !cv_debug)
|
||||
CONS_Printf(M_GetText("This only works in a netgame.\n"));
|
||||
else if (!(server || (IsPlayerAdmin(consoleplayer))))
|
||||
CONS_Printf(M_GetText("Only the server or a remote admin can use this.\n"));
|
||||
|
||||
@@ -324,15 +324,6 @@ enum GameType // SRB2Kart
|
||||
GT_RACE = 0, // also used in record attack
|
||||
GT_MATCH, // battle, but renaming would be silly
|
||||
NUMGAMETYPES,
|
||||
|
||||
// TODO: This is *horrid*. Remove this hack ASAP.
|
||||
// the following have been left in on account of just not wanting to deal with removing all the checks for them
|
||||
GT_COOP,
|
||||
GT_COMPETITION,
|
||||
GT_TEAMMATCH,
|
||||
GT_TAG,
|
||||
GT_HIDEANDSEEK,
|
||||
GT_CTF
|
||||
};
|
||||
// If you alter this list, update dehacked.c, and Gametype_Names in g_game.c
|
||||
|
||||
|
||||
+5
-127
@@ -2152,7 +2152,6 @@ void G_ResetView(UINT8 viewnum, INT32 playernum, boolean onlyactive)
|
||||
|
||||
P_ResetCamera(&players[(*displayplayerp)], camerap);
|
||||
|
||||
|
||||
// Make sure the viewport doesn't interpolate at all into
|
||||
// its new position -- just snap instantly into place.
|
||||
R_ResetViewInterpolation(viewd);
|
||||
@@ -2237,13 +2236,6 @@ void G_Ticker(boolean run)
|
||||
if (!(netgame || multiplayer) && G_GetRetryFlag())
|
||||
{
|
||||
G_ClearRetryFlag();
|
||||
|
||||
// Costs a life to retry ... unless the player in question is dead already.
|
||||
/*if (G_GametypeUsesLives() && players[consoleplayer].playerstate == PST_LIVE)
|
||||
players[consoleplayer].lives -= 1;
|
||||
|
||||
G_DoReborn(consoleplayer);*/
|
||||
|
||||
D_MapChange(gamemap, gametype, cv_kartencore.value, true, 1, false, false);
|
||||
}
|
||||
|
||||
@@ -2745,9 +2737,6 @@ void G_PlayerReborn(INT32 player)
|
||||
if (leveltime > (starttime + (TICRATE/2)) && !p->spectator)
|
||||
p->kartstuff[k_respawn] = 48; // Respawn effect
|
||||
|
||||
if (gametype == GT_COOP)
|
||||
P_FindEmerald(); // scan for emeralds to hunt for
|
||||
|
||||
// Reset Nights score and max link to 0 on death
|
||||
p->maxlink = 0;
|
||||
|
||||
@@ -2818,19 +2807,9 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
||||
return;
|
||||
}
|
||||
|
||||
// -- CTF --
|
||||
// Order: CTF->DM->Coop
|
||||
if (gametype == GT_CTF && players[playernum].ctfteam)
|
||||
{
|
||||
if (!(spawnpoint = G_FindCTFStart(playernum)) // find a CTF start
|
||||
&& !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start
|
||||
spawnpoint = G_FindRaceStart(playernum); // fallback
|
||||
}
|
||||
|
||||
// -- DM/Tag/CTF-spectator/etc --
|
||||
// Order: DM->CTF->Coop
|
||||
else if (gametype == GT_MATCH || gametype == GT_TEAMMATCH || gametype == GT_CTF
|
||||
|| ((gametype == GT_TAG || gametype == GT_HIDEANDSEEK) && !(players[playernum].pflags & PF_TAGIT)))
|
||||
if (gametype == GT_MATCH && !(players[playernum].pflags & PF_TAGIT))
|
||||
{
|
||||
if (!(spawnpoint = G_FindMatchStart(playernum)) // find a DM start
|
||||
&& !(spawnpoint = G_FindCTFStart(playernum))) // find a CTF start
|
||||
@@ -3142,14 +3121,6 @@ void G_ExitLevel(void)
|
||||
gameaction = ga_completed;
|
||||
lastdraw = true;
|
||||
|
||||
// If you want your teams scrambled on map change, start the process now.
|
||||
// The teams will scramble at the start of the next round.
|
||||
if (cv_scrambleonchange.value && G_GametypeHasTeams())
|
||||
{
|
||||
if (server)
|
||||
CV_SetValue(&cv_teamscramble, cv_scrambleonchange.value);
|
||||
}
|
||||
|
||||
if (netgame || multiplayer)
|
||||
CON_LogMessage(M_GetText("The round has ended.\n"));
|
||||
|
||||
@@ -3165,13 +3136,6 @@ const char *Gametype_Names[NUMGAMETYPES] =
|
||||
{
|
||||
"Race", // GT_RACE
|
||||
"Battle" // GT_MATCH
|
||||
|
||||
/*"Co-op", // GT_COOP
|
||||
"Competition", // GT_COMPETITION
|
||||
"Team Match", // GT_TEAMMATCH
|
||||
"Tag", // GT_TAG
|
||||
"Hide and Seek", // GT_HIDEANDSEEK
|
||||
"CTF" // GT_CTF*/
|
||||
};
|
||||
|
||||
//
|
||||
@@ -3202,29 +3166,6 @@ boolean G_IsSpecialStage(INT32 mapnum)
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// G_GametypeUsesLives
|
||||
//
|
||||
// Returns true if the current gametype uses
|
||||
// the lives system. False otherwise.
|
||||
//
|
||||
boolean G_GametypeUsesLives(void)
|
||||
{
|
||||
// SRB2kart NEEDS no lives
|
||||
return false;
|
||||
}
|
||||
|
||||
//
|
||||
// G_GametypeHasTeams
|
||||
//
|
||||
// Returns true if the current gametype uses
|
||||
// Red/Blue teams. False otherwise.
|
||||
//
|
||||
boolean G_GametypeHasTeams(void)
|
||||
{
|
||||
return (gametype == GT_TEAMMATCH || gametype == GT_CTF);
|
||||
}
|
||||
|
||||
//
|
||||
// G_GametypeHasSpectators
|
||||
//
|
||||
@@ -3233,12 +3174,7 @@ boolean G_GametypeHasTeams(void)
|
||||
//
|
||||
boolean G_GametypeHasSpectators(void)
|
||||
{
|
||||
// SRB2Kart: We don't have any exceptions to not being able to spectate yet. Maybe when SP & bots roll around.
|
||||
#if 0
|
||||
return (gametype != GT_COOP && gametype != GT_COMPETITION && gametype != GT_RACE);
|
||||
#else
|
||||
return (netgame || (multiplayer && demo.playback)); //true
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
@@ -3347,16 +3283,6 @@ boolean G_RaceGametype(void)
|
||||
return (gametype == GT_RACE);
|
||||
}
|
||||
|
||||
//
|
||||
// G_TagGametype
|
||||
//
|
||||
// For Jazz's Tag/HnS modes that have a lot of special cases...
|
||||
// SRB2Kart: do we actually want to add Kart tag later? :V
|
||||
//
|
||||
boolean G_TagGametype(void)
|
||||
{
|
||||
return (gametype == GT_TAG || gametype == GT_HIDEANDSEEK);
|
||||
}
|
||||
|
||||
/** Get the typeoflevel flag needed to indicate support of a gametype.
|
||||
* In single-player, this always returns TOL_SP.
|
||||
@@ -3367,14 +3293,8 @@ boolean G_TagGametype(void)
|
||||
INT16 G_TOLFlag(INT32 pgametype)
|
||||
{
|
||||
if (!multiplayer) return TOL_SP;
|
||||
if (pgametype == GT_COOP) return TOL_RACE; // SRB2kart
|
||||
if (pgametype == GT_COMPETITION) return TOL_COMPETITION;
|
||||
if (pgametype == GT_RACE) return TOL_RACE;
|
||||
if (pgametype == GT_MATCH) return TOL_MATCH;
|
||||
if (pgametype == GT_TEAMMATCH) return TOL_MATCH;
|
||||
if (pgametype == GT_TAG) return TOL_TAG;
|
||||
if (pgametype == GT_HIDEANDSEEK) return TOL_TAG;
|
||||
if (pgametype == GT_CTF) return TOL_CTF;
|
||||
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Unknown gametype! %d\n"), pgametype);
|
||||
return INT16_MAX;
|
||||
@@ -3653,42 +3573,15 @@ static void G_DoCompleted(void)
|
||||
if (nextmap >= 1100-1 && nextmap <= 1102-1 && G_RaceGametype())
|
||||
nextmap = (INT16)(spstage_start-1);
|
||||
|
||||
if (gametype == GT_COOP && token)
|
||||
{
|
||||
token--;
|
||||
gottoken = true;
|
||||
|
||||
if (!(emeralds & EMERALD1))
|
||||
nextmap = (INT16)(sstage_start - 1); // Special Stage 1
|
||||
else if (!(emeralds & EMERALD2))
|
||||
nextmap = (INT16)(sstage_start); // Special Stage 2
|
||||
else if (!(emeralds & EMERALD3))
|
||||
nextmap = (INT16)(sstage_start + 1); // Special Stage 3
|
||||
else if (!(emeralds & EMERALD4))
|
||||
nextmap = (INT16)(sstage_start + 2); // Special Stage 4
|
||||
else if (!(emeralds & EMERALD5))
|
||||
nextmap = (INT16)(sstage_start + 3); // Special Stage 5
|
||||
else if (!(emeralds & EMERALD6))
|
||||
nextmap = (INT16)(sstage_start + 4); // Special Stage 6
|
||||
else if (!(emeralds & EMERALD7))
|
||||
nextmap = (INT16)(sstage_start + 5); // Special Stage 7
|
||||
else
|
||||
gottoken = false;
|
||||
}
|
||||
|
||||
if (G_IsSpecialStage(gamemap) && !gottoken)
|
||||
nextmap = lastmap; // Exiting from a special stage? Go back to the game. Tails 08-11-2001
|
||||
|
||||
automapactive = false;
|
||||
|
||||
if (gametype != GT_COOP)
|
||||
{
|
||||
if (cv_advancemap.value == 0) // Stay on same map.
|
||||
nextmap = prevmap;
|
||||
else if (cv_advancemap.value == 2) // Go to random map.
|
||||
nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, 0, false, NULL);
|
||||
}
|
||||
|
||||
if (cv_advancemap.value == 0) // Stay on same map.
|
||||
nextmap = prevmap;
|
||||
else if (cv_advancemap.value == 2) // Go to random map.
|
||||
nextmap = G_RandMap(G_TOLFlag(gametype), prevmap, false, 0, false, NULL);
|
||||
|
||||
// We are committed to this map now.
|
||||
// We may as well allocate its header if it doesn't exist
|
||||
@@ -3873,21 +3766,6 @@ void G_EndGame(void)
|
||||
if (demo.recording && (modeattacking || demo.savemode != DSM_NOTSAVING))
|
||||
G_SaveDemo();
|
||||
|
||||
// Only do evaluation and credits in coop games.
|
||||
if (gametype == GT_COOP)
|
||||
{
|
||||
if (nextmap == 1102-1) // end game with credits
|
||||
{
|
||||
F_StartCredits();
|
||||
return;
|
||||
}
|
||||
if (nextmap == 1101-1) // end game with evaluation
|
||||
{
|
||||
F_StartGameEvaluation();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 1100 or competitive multiplayer, so go back to title screen.
|
||||
D_StartTitle();
|
||||
}
|
||||
|
||||
@@ -367,14 +367,11 @@ boolean G_DemoTitleResponder(event_t *ev);
|
||||
|
||||
INT32 G_GetGametypeByName(const char *gametypestr);
|
||||
boolean G_IsSpecialStage(INT32 mapnum);
|
||||
boolean G_GametypeUsesLives(void);
|
||||
boolean G_GametypeHasTeams(void);
|
||||
boolean G_GametypeHasSpectators(void);
|
||||
boolean G_BattleGametype(void);
|
||||
UINT8 G_SometimesGetDifferentGametype(UINT8 prefgametype);
|
||||
UINT8 G_GetGametypeColor(INT16 gt);
|
||||
boolean G_RaceGametype(void);
|
||||
boolean G_TagGametype(void);
|
||||
void G_ExitLevel(void);
|
||||
void G_NextLevel(void);
|
||||
void G_Continue(void);
|
||||
|
||||
+2
-42
@@ -773,10 +773,7 @@ static void Command_Sayteam_f(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype.
|
||||
DoSayCommand(-1, 1, 0);
|
||||
else
|
||||
DoSayCommand(0, 1, 0);
|
||||
DoSayCommand(0, 1, 0);
|
||||
}
|
||||
|
||||
/** Send a message to everyone, to be displayed by CECHO. Only
|
||||
@@ -1474,7 +1471,7 @@ boolean HU_Responder(event_t *ev)
|
||||
{
|
||||
chat_on = true;
|
||||
w_chat[0] = 0;
|
||||
teamtalk = G_GametypeHasTeams(); // Don't teamtalk if we don't have teams.
|
||||
teamtalk = false;
|
||||
chat_scrollmedown = true;
|
||||
typelines = 1;
|
||||
return true;
|
||||
@@ -2726,7 +2723,6 @@ static inline void HU_DrawSpectatorTicker(void)
|
||||
//
|
||||
static void HU_DrawRankings(void)
|
||||
{
|
||||
patch_t *p;
|
||||
playersort_t tab[MAXPLAYERS];
|
||||
INT32 i, j, scorelines, hilicol, numplayersingame = 0;
|
||||
boolean completed[MAXPLAYERS];
|
||||
@@ -2753,25 +2749,6 @@ static void HU_DrawRankings(void)
|
||||
else
|
||||
V_DrawString(4, 188, hilicol|V_SNAPTOBOTTOM|V_SNAPTOLEFT, G_BuildMapTitle(gamemap));
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (gametype == GT_CTF)
|
||||
p = bflagico;
|
||||
else
|
||||
p = bmatcico;
|
||||
|
||||
V_DrawSmallScaledPatch(128 - SHORT(p->width)/4, 4, 0, p);
|
||||
V_DrawCenteredString(128, 16, 0, va("%u", bluescore));
|
||||
|
||||
if (gametype == GT_CTF)
|
||||
p = rflagico;
|
||||
else
|
||||
p = rmatcico;
|
||||
|
||||
V_DrawSmallScaledPatch(192 - SHORT(p->width)/4, 4, 0, p);
|
||||
V_DrawCenteredString(192, 16, 0, va("%u", redscore));
|
||||
}
|
||||
|
||||
if (!G_RaceGametype())
|
||||
{
|
||||
if (cv_timelimit.value && timelimitintics > 0)
|
||||
@@ -2801,18 +2778,6 @@ static void HU_DrawRankings(void)
|
||||
V_DrawCenteredString(256, 16, hilicol, va("%d", cv_pointlimit.value));
|
||||
}
|
||||
}
|
||||
/*else if (gametype == GT_COOP)
|
||||
{
|
||||
INT32 totalscore = 0;
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i])
|
||||
totalscore += players[i].score;
|
||||
}
|
||||
|
||||
V_DrawCenteredString(256, 8, 0, "TOTAL SCORE");
|
||||
V_DrawCenteredString(256, 16, 0, va("%u", totalscore));
|
||||
}*/
|
||||
else
|
||||
{
|
||||
if (circuitmap)
|
||||
@@ -2885,12 +2850,7 @@ static void HU_DrawRankings(void)
|
||||
#endif
|
||||
}
|
||||
|
||||
/*if (G_GametypeHasTeams())
|
||||
HU_DrawTeamTabRankings(tab, whiteplayer); //separate function for Spazzo's silly request -- gotta fix this up later
|
||||
else if (scorelines > 10)*/
|
||||
HU_DrawTabRankings(((scorelines > 8) ? 32 : 40), 33, tab, scorelines, whiteplayer, hilicol);
|
||||
/*else
|
||||
HU_DrawDualTabRankings(32, 32, tab, scorelines, whiteplayer);*/
|
||||
|
||||
// draw spectators in a ticker across the bottom
|
||||
if (netgame && G_GametypeHasSpectators())
|
||||
|
||||
@@ -4876,10 +4876,6 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
|
||||
if (player == source)
|
||||
continue;
|
||||
|
||||
// Don't home in on teammates.
|
||||
if (G_GametypeHasTeams() && source->ctfteam == player->ctfteam)
|
||||
continue;
|
||||
|
||||
// Invisible, don't bother
|
||||
if (player->kartstuff[k_hyudorotimer])
|
||||
continue;
|
||||
|
||||
+7
-20
@@ -473,14 +473,7 @@ static int lib_pSpawnAlteredDirectionMissile(lua_State *L)
|
||||
|
||||
static int lib_pColorTeamMissile(lua_State *L)
|
||||
{
|
||||
mobj_t *missile = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||
player_t *source = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
|
||||
NOHUD
|
||||
if (!missile)
|
||||
return LUA_ErrInvalid(L, "mobj_t");
|
||||
if (!source)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
P_ColorTeamMissile(missile, source);
|
||||
(void)L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1264,12 +1257,7 @@ static int lib_pPlayerEmeraldBurst(lua_State *L)
|
||||
|
||||
static int lib_pPlayerFlagBurst(lua_State *L)
|
||||
{
|
||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||
boolean toss = lua_optboolean(L, 2);
|
||||
NOHUD
|
||||
if (!player)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
P_PlayerFlagBurst(player, toss);
|
||||
(void)L;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1837,7 +1825,7 @@ static int lib_sStartSoundAtVolume(lua_State *L)
|
||||
return LUA_ErrInvalid(L, "player_t");
|
||||
}
|
||||
if (!player || P_IsLocalPlayer(player))
|
||||
S_StartSoundAtVolume(origin, sound_id, volume);
|
||||
S_StartSoundAtVolume(origin, sound_id, volume);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1939,7 +1927,7 @@ static int lib_sChangeMusic(lua_State *L)
|
||||
music_flags = (UINT16)((music_num & 0x7FFF0000) >> 16);
|
||||
else
|
||||
#endif
|
||||
music_flags = (UINT16)luaL_optinteger(L, 4, 0);
|
||||
music_flags = (UINT16)luaL_optinteger(L, 4, 0);
|
||||
|
||||
position = (UINT32)luaL_optinteger(L, 5, 0);
|
||||
prefadems = (UINT32)luaL_optinteger(L, 6, 0);
|
||||
@@ -2466,14 +2454,14 @@ static int lib_gIsSpecialStage(lua_State *L)
|
||||
static int lib_gGametypeUsesLives(lua_State *L)
|
||||
{
|
||||
//HUDSAFE
|
||||
lua_pushboolean(L, G_GametypeUsesLives());
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int lib_gGametypeHasTeams(lua_State *L)
|
||||
{
|
||||
//HUDSAFE
|
||||
lua_pushboolean(L, G_GametypeHasTeams());
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -2501,7 +2489,7 @@ static int lib_gRaceGametype(lua_State *L)
|
||||
static int lib_gTagGametype(lua_State *L)
|
||||
{
|
||||
//HUDSAFE
|
||||
lua_pushboolean(L, G_TagGametype());
|
||||
lua_pushboolean(L, false);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -3176,7 +3164,6 @@ static luaL_Reg lib[] = {
|
||||
{"P_LookForEnemies",lib_pLookForEnemies},
|
||||
{"P_NukeEnemies",lib_pNukeEnemies},
|
||||
{"P_HomingAttack",lib_pHomingAttack},
|
||||
//{"P_SuperReady",lib_pSuperReady},
|
||||
{"P_Telekinesis",lib_pTelekinesis},
|
||||
|
||||
// p_map
|
||||
|
||||
+6
-68
@@ -3286,37 +3286,20 @@ static void Newgametype_OnChange(void)
|
||||
P_AllocMapHeader((INT16)(cv_nextmap.value-1));
|
||||
|
||||
if ((cv_newgametype.value == GT_RACE && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_RACE)) || // SRB2kart
|
||||
((cv_newgametype.value == GT_MATCH || cv_newgametype.value == GT_TEAMMATCH) && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_MATCH)))
|
||||
(cv_newgametype.value == GT_MATCH && !(mapheaderinfo[cv_nextmap.value-1]->typeoflevel & TOL_MATCH)))
|
||||
{
|
||||
INT32 value = 0;
|
||||
|
||||
switch (cv_newgametype.value)
|
||||
{
|
||||
case GT_COOP:
|
||||
value = TOL_RACE; // SRB2kart
|
||||
break;
|
||||
case GT_COMPETITION:
|
||||
value = TOL_COMPETITION;
|
||||
break;
|
||||
case GT_RACE:
|
||||
value = TOL_RACE;
|
||||
break;
|
||||
case GT_MATCH:
|
||||
case GT_TEAMMATCH:
|
||||
value = TOL_MATCH;
|
||||
break;
|
||||
case GT_TAG:
|
||||
case GT_HIDEANDSEEK:
|
||||
value = TOL_TAG;
|
||||
break;
|
||||
case GT_CTF:
|
||||
value = TOL_CTF;
|
||||
break;
|
||||
}
|
||||
|
||||
CV_SetValue(&cv_nextmap, M_FindFirstMap(value));
|
||||
//CV_AddValue(&cv_nextmap, -1);
|
||||
//CV_AddValue(&cv_nextmap, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4423,9 +4406,6 @@ void M_StartControlPanel(void)
|
||||
{
|
||||
MPauseMenu[mpause_switchmap].status = IT_STRING | IT_CALL;
|
||||
MPauseMenu[mpause_addons].status = IT_STRING | IT_CALL;
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
MPauseMenu[mpause_scramble].status = IT_STRING | IT_SUBMENU;
|
||||
}
|
||||
|
||||
if (server || (!cv_showlocalskinmenus.value))
|
||||
@@ -4446,16 +4426,7 @@ void M_StartControlPanel(void)
|
||||
|
||||
if (netgame)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU;
|
||||
MPauseMenu[mpause_switchteam].alphaKey += ((splitscreen+1) * 8);
|
||||
MPauseMenu[mpause_localskin].alphaKey += 8;
|
||||
MPauseMenu[mpause_options].alphaKey += 8;
|
||||
MPauseMenu[mpause_title].alphaKey += 8;
|
||||
MPauseMenu[mpause_quit].alphaKey += 8;
|
||||
}
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
MPauseMenu[mpause_switchspectate].status = IT_STRING | IT_SUBMENU;
|
||||
MPauseMenu[mpause_switchspectate].alphaKey += ((splitscreen+1) * 8);
|
||||
@@ -4489,9 +4460,7 @@ void M_StartControlPanel(void)
|
||||
{
|
||||
MPauseMenu[mpause_psetup].status = IT_STRING | IT_CALL;
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU;
|
||||
else if (G_GametypeHasSpectators())
|
||||
if (G_GametypeHasSpectators())
|
||||
{
|
||||
if (!players[consoleplayer].spectator)
|
||||
MPauseMenu[mpause_spectate].status = IT_STRING | IT_CALL;
|
||||
@@ -5875,29 +5844,15 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
||||
switch (levellistmode)
|
||||
{
|
||||
case LLM_CREATESERVER:
|
||||
// Should the map be hidden?
|
||||
//if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap)
|
||||
//return false;
|
||||
|
||||
// Should the map be hidden? <-- well imma wanna toggle it, its just annoying being unable to select hell maps in mapselect
|
||||
if ((mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU && mapnum+1 != gamemap) && (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))) // map hell
|
||||
{
|
||||
if (cv_showallmaps.value)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return cv_showallmaps.value;
|
||||
|
||||
// same goes here, just show every map if i want to
|
||||
if (M_MapLocked(mapnum+1)) // not unlocked
|
||||
{
|
||||
if (cv_showallmaps.value)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
return cv_showallmaps.value;
|
||||
|
||||
if ((gt == GT_MATCH || gt == GT_TEAMMATCH) && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH))
|
||||
if (gt == GT_MATCH && (mapheaderinfo[mapnum]->typeoflevel & TOL_MATCH))
|
||||
return true;
|
||||
|
||||
if (gt == GT_RACE && (mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))
|
||||
@@ -5905,18 +5860,7 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
||||
|
||||
return false;
|
||||
|
||||
/*case LLM_LEVELSELECT:
|
||||
if (mapheaderinfo[mapnum]->levelselect != maplistoption)
|
||||
return false;
|
||||
|
||||
if (M_MapLocked(mapnum+1))
|
||||
return false; // not unlocked
|
||||
|
||||
return true;*/
|
||||
case LLM_RECORDATTACK:
|
||||
/*if (!(mapheaderinfo[mapnum]->menuflags & LF2_RECORDATTACK))
|
||||
return false;*/
|
||||
|
||||
if (!(mapheaderinfo[mapnum]->typeoflevel & TOL_RACE))
|
||||
return false;
|
||||
|
||||
@@ -5929,12 +5873,6 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt)
|
||||
if (mapheaderinfo[mapnum]->menuflags & LF2_HIDEINMENU)
|
||||
return false; // map hell
|
||||
|
||||
/*if (mapheaderinfo[mapnum]->menuflags & LF2_NOVISITNEEDED)
|
||||
return true;
|
||||
|
||||
if (!mapvisited[mapnum])
|
||||
return false;*/
|
||||
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
||||
+7
-25
@@ -3055,11 +3055,7 @@ void A_ExtraLife(mobj_t *actor)
|
||||
return;
|
||||
}
|
||||
|
||||
// In shooter gametypes, give the player 100 rings instead of an extra life.
|
||||
if (gametype != GT_COOP && gametype != GT_COMPETITION)
|
||||
P_GivePlayerRings(player, 100);
|
||||
else
|
||||
P_GivePlayerLives(player, 1);
|
||||
P_GivePlayerRings(player, 100);
|
||||
P_PlayLivesJingle(player);
|
||||
}
|
||||
|
||||
@@ -3741,11 +3737,6 @@ void A_ThrownRing(mobj_t *actor)
|
||||
if (player->mo == actor->target)
|
||||
continue;
|
||||
|
||||
// Don't home in on teammates.
|
||||
if (gametype == GT_CTF
|
||||
&& actor->target->player->ctfteam == player->ctfteam)
|
||||
continue;
|
||||
|
||||
if (actor->target->player->kartstuff[k_position] < player->kartstuff[k_position]) // SRB2kart - Jawz only go after people ahead of you
|
||||
continue;
|
||||
|
||||
@@ -3806,11 +3797,6 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing)
|
||||
|| (G_BattleGametype() && thing->player && thing->player->kartstuff[k_bumper] <= 0 && thing->player->kartstuff[k_comebacktimer])))
|
||||
return true;
|
||||
|
||||
if ((gametype == GT_CTF || gametype == GT_TEAMMATCH)
|
||||
&& !cv_friendlyfire.value && grenade->target->player && thing->player
|
||||
&& grenade->target->player->ctfteam == thing->player->ctfteam) // Don't blow up at your teammates, unless friendlyfire is on
|
||||
return true;
|
||||
|
||||
// see if it went over / under
|
||||
if (grenade->z - explodedist > thing->z + thing->height)
|
||||
return true; // overhead
|
||||
@@ -5358,10 +5344,10 @@ void A_OldRingExplode(mobj_t *actor) {
|
||||
|
||||
if (changecolor)
|
||||
{
|
||||
if (gametype != GT_CTF)
|
||||
mo->color = actor->target->color; //copy color
|
||||
else if (actor->target->player->ctfteam == 2)
|
||||
if (actor->target->player->ctfteam == 2)
|
||||
mo->color = skincolor_bluering;
|
||||
else
|
||||
mo->color = actor->target->color; //copy color
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5374,9 +5360,7 @@ void A_OldRingExplode(mobj_t *actor) {
|
||||
|
||||
if (changecolor)
|
||||
{
|
||||
if (gametype != GT_CTF)
|
||||
mo->color = actor->target->color; //copy color
|
||||
else if (actor->target->player->ctfteam == 2)
|
||||
if (actor->target->player->ctfteam == 2)
|
||||
mo->color = skincolor_bluering;
|
||||
}
|
||||
|
||||
@@ -5389,9 +5373,7 @@ void A_OldRingExplode(mobj_t *actor) {
|
||||
|
||||
if (changecolor)
|
||||
{
|
||||
if (gametype != GT_CTF)
|
||||
mo->color = actor->target->color; //copy color
|
||||
else if (actor->target->player->ctfteam == 2)
|
||||
if (actor->target->player->ctfteam == 2)
|
||||
mo->color = skincolor_bluering;
|
||||
}
|
||||
}
|
||||
@@ -5416,7 +5398,7 @@ void A_MixUp(mobj_t *actor)
|
||||
|
||||
// No mix-up monitors in hide and seek or time only race.
|
||||
// The random factor is okay for other game modes, but in these, it is cripplingly unfair.
|
||||
if (gametype == GT_HIDEANDSEEK || gametype == GT_RACE)
|
||||
if (gametype == GT_RACE)
|
||||
return;
|
||||
|
||||
numplayers = 0;
|
||||
|
||||
+26
-224
@@ -1434,46 +1434,36 @@ void P_CheckTimeLimit(void)
|
||||
if (gamestate == GS_LEVEL && (leveltime == (timelimitintics + TICRATE)))
|
||||
S_StartSound(NULL, sfx_strpst);
|
||||
|
||||
// Normal Match
|
||||
if (!G_GametypeHasTeams())
|
||||
//Store the nodes of participating players in an array.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
//Store the nodes of participating players in an array.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && !players[i].spectator)
|
||||
{
|
||||
if (playeringame[i] && !players[i].spectator)
|
||||
playerarray[playercount] = i;
|
||||
playercount++;
|
||||
}
|
||||
}
|
||||
|
||||
if (playercount > MAXPLAYERS)
|
||||
playercount = MAXPLAYERS;
|
||||
|
||||
//Sort 'em.
|
||||
for (i = 1; i < playercount; i++)
|
||||
{
|
||||
for (k = i; k < playercount; k++)
|
||||
{
|
||||
if (players[playerarray[i-1]].marescore < players[playerarray[k]].marescore)
|
||||
{
|
||||
playerarray[playercount] = i;
|
||||
playercount++;
|
||||
tempplayer = playerarray[i-1];
|
||||
playerarray[i-1] = playerarray[k];
|
||||
playerarray[k] = tempplayer;
|
||||
}
|
||||
}
|
||||
|
||||
if (playercount > MAXPLAYERS)
|
||||
playercount = MAXPLAYERS;
|
||||
|
||||
//Sort 'em.
|
||||
for (i = 1; i < playercount; i++)
|
||||
{
|
||||
for (k = i; k < playercount; k++)
|
||||
{
|
||||
if (players[playerarray[i-1]].marescore < players[playerarray[k]].marescore)
|
||||
{
|
||||
tempplayer = playerarray[i-1];
|
||||
playerarray[i-1] = playerarray[k];
|
||||
playerarray[k] = tempplayer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//End the round if the top players aren't tied.
|
||||
if (players[playerarray[0]].marescore == players[playerarray[1]].marescore)
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
//In team match and CTF, determining a tie is much simpler. =P
|
||||
if (redscore == bluescore)
|
||||
return;
|
||||
}
|
||||
|
||||
//End the round if the top players aren't tied.
|
||||
if (players[playerarray[0]].marescore == players[playerarray[1]].marescore)
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1720,21 +1710,6 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||
P_UnsetThingPosition(target);
|
||||
target->flags |= MF_NOBLOCKMAP|MF_NOCLIPHEIGHT;
|
||||
P_SetThingPosition(target);
|
||||
|
||||
if (!target->player->bot && !G_IsSpecialStage(gamemap)
|
||||
&& G_GametypeUsesLives())
|
||||
{
|
||||
target->player->lives -= 1; // Lose a life Tails 03-11-2000
|
||||
|
||||
if (target->player->lives <= 0) // Tails 03-14-2000
|
||||
{
|
||||
if (P_IsLocalPlayer(target->player)/* && target->player == &players[consoleplayer] */)
|
||||
{
|
||||
S_StopMusic(); // Stop the Music! Tails 03-14-2000
|
||||
S_ChangeMusicInternal("gmover", false); // Yousa dead now, Okieday? Tails 03-14-2000
|
||||
}
|
||||
}
|
||||
}
|
||||
target->player->playerstate = PST_DEAD;
|
||||
|
||||
if (cv_birdmusic.value && cv_fading.value && P_IsLocalPlayer(target->player))
|
||||
@@ -2160,90 +2135,9 @@ static inline void P_NiGHTSDamage(mobj_t *target, mobj_t *source)
|
||||
}
|
||||
}
|
||||
|
||||
static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
||||
static inline boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *source)
|
||||
{
|
||||
player_t *player = target->player;
|
||||
(void)damage; //unused parm
|
||||
|
||||
// If flashing or invulnerable, ignore the tag,
|
||||
if (player->powers[pw_flashing] || player->powers[pw_invulnerability])
|
||||
return false;
|
||||
|
||||
// Ignore IT players shooting each other, unless friendlyfire is on.
|
||||
if ((player->pflags & PF_TAGIT && !(cv_friendlyfire.value &&
|
||||
source && source->player && source->player->pflags & PF_TAGIT)))
|
||||
return false;
|
||||
|
||||
// Don't allow any damage before the round starts.
|
||||
if (leveltime <= hidetime * TICRATE)
|
||||
return false;
|
||||
|
||||
// Don't allow players on the same team to hurt one another,
|
||||
// unless cv_friendlyfire is on.
|
||||
if (!cv_friendlyfire.value && (player->pflags & PF_TAGIT) == (source->player->pflags & PF_TAGIT))
|
||||
{
|
||||
if (!(inflictor->flags & MF_FIRE))
|
||||
P_GivePlayerRings(player, 1);
|
||||
if (inflictor->flags2 & MF2_BOUNCERING)
|
||||
inflictor->fuse = 0; // bounce ring disappears at -1 not 0
|
||||
return false;
|
||||
}
|
||||
|
||||
P_DoPlayerPain(player, source, inflictor);
|
||||
|
||||
// Check for a shield
|
||||
if (player->powers[pw_shield])
|
||||
{
|
||||
P_RemoveShield(player);
|
||||
S_StartSound(target, sfx_shldls);
|
||||
return true;
|
||||
}
|
||||
|
||||
if (target->health <= 1) // Death
|
||||
{
|
||||
P_PlayDeathSound(target);
|
||||
P_PlayVictorySound(source); // Killer laughs at you! LAUGHS! BWAHAHAHHAHAA!!
|
||||
}
|
||||
else if (target->health > 1) // Ring loss
|
||||
{
|
||||
P_PlayRinglossSound(target, source);
|
||||
P_PlayerRingBurst(player, player->mo->health - 1);
|
||||
}
|
||||
|
||||
if (inflictor && ((inflictor->flags & MF_MISSILE) || inflictor->player) && player->powers[pw_super] && ALL7EMERALDS(player->powers[pw_emeralds]))
|
||||
{
|
||||
player->health -= 10;
|
||||
if (player->health < 2)
|
||||
player->health = 2;
|
||||
target->health = player->health;
|
||||
}
|
||||
else
|
||||
player->health = target->health = 1;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 damage)
|
||||
{
|
||||
player_t *player = target->player;
|
||||
|
||||
// Tag handling
|
||||
if (G_TagGametype())
|
||||
return P_TagDamage(target, inflictor, source, damage);
|
||||
else if (G_GametypeHasTeams()) // CTF + Team Match
|
||||
{
|
||||
// Don't allow players on the same team to hurt one another,
|
||||
// unless cv_friendlyfire is on.
|
||||
if (!cv_friendlyfire.value && target->player->ctfteam == source->player->ctfteam)
|
||||
{
|
||||
if (!(inflictor->flags & MF_FIRE))
|
||||
P_GivePlayerRings(target->player, 1);
|
||||
if (inflictor->flags2 & MF2_BOUNCERING)
|
||||
inflictor->fuse = 0; // bounce ring disappears at -1 not 0
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
// Add pity.
|
||||
if (!player->powers[pw_flashing] && !player->powers[pw_invulnerability] && !player->powers[pw_super]
|
||||
@@ -2497,10 +2391,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
{
|
||||
if (source == target)
|
||||
return false; // Don't hit yourself with your own paraloop, baka
|
||||
if (source && source->player && !cv_friendlyfire.value
|
||||
&& (gametype == GT_COOP
|
||||
|| (G_GametypeHasTeams() && target->player->ctfteam == source->player->ctfteam)))
|
||||
return false; // Don't run eachother over in special stages and team games and such
|
||||
}
|
||||
|
||||
if (LUAh_MobjDamage(target, inflictor, source, damage))
|
||||
@@ -2533,7 +2423,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
// Player hits another player
|
||||
if (!force && source && source->player)
|
||||
{
|
||||
if (!P_PlayerHitsPlayer(target, inflictor, source, damage))
|
||||
if (!P_PlayerHitsPlayer(target, source))
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2588,9 +2478,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||
if (player->health < 2)
|
||||
player->health = 2;
|
||||
}
|
||||
|
||||
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
||||
P_PlayerFlagBurst(player, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -3102,88 +2989,3 @@ void P_PlayerEmeraldBurst(player_t *player, boolean toss)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Makes an injured or dead player lose possession of the flag.
|
||||
*
|
||||
* \param player The player with the flag, about to lose it.
|
||||
* \sa P_PlayerRingBurst
|
||||
*/
|
||||
void P_PlayerFlagBurst(player_t *player, boolean toss)
|
||||
{
|
||||
mobj_t *flag;
|
||||
mobjtype_t type;
|
||||
|
||||
if (!(player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
||||
return;
|
||||
|
||||
if (player->gotflag & GF_REDFLAG)
|
||||
type = MT_REDFLAG;
|
||||
else
|
||||
type = MT_BLUEFLAG;
|
||||
|
||||
flag = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, type);
|
||||
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
flag->z += player->mo->height - flag->height;
|
||||
|
||||
if (toss)
|
||||
P_InstaThrust(flag, player->mo->angle, FixedMul(6*FRACUNIT, player->mo->scale));
|
||||
else
|
||||
{
|
||||
angle_t fa = P_RandomByte()*FINEANGLES/256;
|
||||
flag->momx = FixedMul(FINECOSINE(fa), FixedMul(6*FRACUNIT, player->mo->scale));
|
||||
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
|
||||
flag->momy = FixedMul(FINESINE(fa), FixedMul(6*FRACUNIT, player->mo->scale));
|
||||
}
|
||||
|
||||
flag->momz = FixedMul(8*FRACUNIT, player->mo->scale);
|
||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||
flag->momz = -flag->momz;
|
||||
|
||||
if (type == MT_REDFLAG)
|
||||
flag->spawnpoint = rflagpoint;
|
||||
else
|
||||
flag->spawnpoint = bflagpoint;
|
||||
|
||||
flag->fuse = cv_flagtime.value * TICRATE;
|
||||
P_SetTarget(&flag->target, player->mo);
|
||||
|
||||
// Flag text
|
||||
char plname[MAXPLAYERNAME+4];
|
||||
const char *flagtext;
|
||||
char flagcolor;
|
||||
|
||||
snprintf(plname, sizeof(plname), "%s%s%s",
|
||||
CTFTEAMCODE(player),
|
||||
player_names[player - players],
|
||||
CTFTEAMENDCODE(player));
|
||||
|
||||
if (type == MT_REDFLAG)
|
||||
{
|
||||
flagtext = M_GetText("Red flag");
|
||||
flagcolor = '\x85';
|
||||
}
|
||||
else
|
||||
{
|
||||
flagtext = M_GetText("Blue flag");
|
||||
flagcolor = '\x84';
|
||||
}
|
||||
|
||||
if (toss)
|
||||
CONS_Printf(M_GetText("%s tossed the %c%s%c.\n"), plname, flagcolor, flagtext, 0x80);
|
||||
else
|
||||
CONS_Printf(M_GetText("%s dropped the %c%s%c.\n"), plname, flagcolor, flagtext, 0x80);
|
||||
|
||||
player->gotflag = 0;
|
||||
|
||||
// Pointers set for displaying time value and for consistency restoration.
|
||||
if (type == MT_REDFLAG)
|
||||
redflag = flag;
|
||||
else
|
||||
blueflag = flag;
|
||||
|
||||
if (toss)
|
||||
player->tossdelay = 2*TICRATE;
|
||||
|
||||
return;
|
||||
}
|
||||
@@ -290,7 +290,6 @@ mobj_t *P_SPMAngle(mobj_t *source, mobjtype_t type, angle_t angle, UINT8 aimtype
|
||||
#ifdef SEENAMES
|
||||
#define P_SpawnNameFinder(s,t) P_SPMAngle(s,t,s->angle,true,0)
|
||||
#endif
|
||||
void P_ColorTeamMissile(mobj_t *missile, player_t *source);
|
||||
SINT8 P_MobjFlip(const mobj_t *mobj);
|
||||
fixed_t P_GetMobjGravity(mobj_t *mo);
|
||||
FUNCMATH boolean P_WeaponOrPanel(mobjtype_t type);
|
||||
@@ -419,10 +418,8 @@ void P_PlayerWeaponAmmoBurst(player_t *player);
|
||||
void P_PlayerEmeraldBurst(player_t *player, boolean toss);
|
||||
|
||||
void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck);
|
||||
void P_PlayerFlagBurst(player_t *player, boolean toss);
|
||||
void P_CheckTimeLimit(void);
|
||||
void P_CheckPointLimit(void);
|
||||
//void P_CheckSurvivors(void);
|
||||
boolean P_CheckRacers(void);
|
||||
|
||||
boolean P_CanPickupItem(player_t *player, UINT8 weapon);
|
||||
|
||||
+22
-135
@@ -10518,11 +10518,8 @@ void P_RespawnSpecials(void)
|
||||
}
|
||||
|
||||
//CTF rings should continue to respawn as normal rings outside of CTF.
|
||||
if (gametype != GT_CTF)
|
||||
{
|
||||
if (i == MT_REDTEAMRING || i == MT_BLUETEAMRING)
|
||||
i = MT_RING;
|
||||
}
|
||||
if (i == MT_REDTEAMRING || i == MT_BLUETEAMRING)
|
||||
i = MT_RING;
|
||||
|
||||
if (mthing->options & MTF_OBJECTFLIP)
|
||||
{
|
||||
@@ -10594,48 +10591,7 @@ void P_SpawnPlayer(INT32 playernum)
|
||||
}
|
||||
else if (multiplayer && !netgame)
|
||||
{
|
||||
// If you're in a team game and you don't have a team assigned yet...
|
||||
if (G_GametypeHasTeams() && p->ctfteam == 0)
|
||||
{
|
||||
changeteam_union NetPacket;
|
||||
UINT16 usvalue;
|
||||
NetPacket.value.l = NetPacket.value.b = 0;
|
||||
|
||||
// Spawn as a spectator,
|
||||
// yes even in splitscreen mode
|
||||
p->spectator = true;
|
||||
p->spectatorreentry = 0; //(cv_spectatorreentry.value * TICRATE);
|
||||
|
||||
if (playernum&1) p->skincolor = skincolor_redteam;
|
||||
else p->skincolor = skincolor_blueteam;
|
||||
|
||||
// but immediately send a team change packet.
|
||||
NetPacket.packet.playernum = playernum;
|
||||
NetPacket.packet.verification = true;
|
||||
NetPacket.packet.newteam = !(playernum&1) + 1;
|
||||
|
||||
usvalue = SHORT(NetPacket.value.l|NetPacket.value.b);
|
||||
SendNetXCmd(XD_TEAMCHANGE, &usvalue, sizeof(usvalue));
|
||||
}
|
||||
else // Otherwise, never spectator.
|
||||
p->spectator = false;
|
||||
}
|
||||
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
// Fix stupid non spectator spectators.
|
||||
if (!p->spectator && !p->ctfteam)
|
||||
{
|
||||
p->spectator = true;
|
||||
p->spectatorreentry = 0; //(cv_spectatorreentry.value * TICRATE);
|
||||
}
|
||||
|
||||
// Fix team colors.
|
||||
// This code isn't being done right somewhere else. Oh well.
|
||||
if (p->ctfteam == 1)
|
||||
p->skincolor = skincolor_redteam;
|
||||
else if (p->ctfteam == 2)
|
||||
p->skincolor = skincolor_blueteam;
|
||||
p->spectator = false;
|
||||
}
|
||||
|
||||
mobj = P_SpawnMobj(0, 0, 0, MT_PLAYER);
|
||||
@@ -11041,36 +10997,14 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
return;
|
||||
|
||||
if (i >= MT_EMERALD1 && i <= MT_EMERALD7) // Pickupable Emeralds
|
||||
{
|
||||
if (gametype != GT_COOP) // Don't place emeralds in non-coop modes
|
||||
return;
|
||||
|
||||
if (metalrecording)
|
||||
return; // Metal Sonic isn't for collecting emeralds.
|
||||
|
||||
if (emeralds & mobjinfo[i].speed) // You already have this emerald!
|
||||
return;
|
||||
}
|
||||
return;
|
||||
|
||||
if (!G_BattleGametype() || !cv_specialrings.value)
|
||||
if (P_WeaponOrPanel(i))
|
||||
return; // Don't place weapons/panels in non-ringslinger modes
|
||||
|
||||
if (i == MT_EMERHUNT)
|
||||
{
|
||||
// Emerald Hunt is Coop only.
|
||||
if (gametype != GT_COOP)
|
||||
return;
|
||||
|
||||
ss = R_PointInSubsector(mthing->x << FRACBITS, mthing->y << FRACBITS);
|
||||
mthing->z = (INT16)(((
|
||||
ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, mthing->x << FRACBITS, mthing->y << FRACBITS) :
|
||||
ss->sector->floorheight)>>FRACBITS) + (mthing->options >> ZSHIFT));
|
||||
|
||||
if (numhuntemeralds < MAXHUNTEMERALDS)
|
||||
huntemeralds[numhuntemeralds++] = mthing;
|
||||
return;
|
||||
}
|
||||
|
||||
if (i == MT_EMERALDSPAWN)
|
||||
{
|
||||
@@ -11087,57 +11021,29 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
if ((mobjinfo[i].flags & MF_ENEMY) || (mobjinfo[i].flags & MF_BOSS))
|
||||
return;
|
||||
|
||||
// Set powerup boxes to user settings for competition.
|
||||
if (gametype == GT_COMPETITION)
|
||||
{
|
||||
if ((mobjinfo[i].flags & MF_MONITOR) && cv_competitionboxes.value) // not Normal
|
||||
{
|
||||
if (cv_competitionboxes.value == 1) // Random
|
||||
i = MT_QUESTIONBOX;
|
||||
else if (cv_competitionboxes.value == 2) // Teleports
|
||||
i = MT_MIXUPBOX;
|
||||
else if (cv_competitionboxes.value == 3) // None
|
||||
return; // Don't spawn!
|
||||
}
|
||||
}
|
||||
|
||||
// Set powerup boxes to user settings for other netplay modes
|
||||
else if (gametype != GT_COOP)
|
||||
if ((mobjinfo[i].flags & MF_MONITOR) && cv_matchboxes.value) // not Normal
|
||||
{
|
||||
if ((mobjinfo[i].flags & MF_MONITOR) && cv_matchboxes.value) // not Normal
|
||||
{
|
||||
if (cv_matchboxes.value == 1) // Random
|
||||
i = MT_QUESTIONBOX;
|
||||
else if (cv_matchboxes.value == 3) // Don't spawn
|
||||
return;
|
||||
else // cv_matchboxes.value == 2, Non-Random
|
||||
{
|
||||
if (i == MT_QUESTIONBOX)
|
||||
return; // don't spawn in Non-Random
|
||||
|
||||
mthing->options &= ~(MTF_AMBUSH|MTF_OBJECTSPECIAL); // no random respawning!
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (gametype != GT_CTF) // CTF specific things
|
||||
{
|
||||
if (i == MT_BLUETEAMRING || i == MT_REDTEAMRING)
|
||||
i = MT_RING;
|
||||
else if (i == MT_BLUERINGBOX || i == MT_REDRINGBOX)
|
||||
i = MT_SUPERRINGBOX;
|
||||
else if (i == MT_BLUEFLAG || i == MT_REDFLAG)
|
||||
return; // No flags in non-CTF modes!
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((i == MT_BLUEFLAG && blueflag) || (i == MT_REDFLAG && redflag))
|
||||
{
|
||||
CONS_Alert(CONS_ERROR, M_GetText("Only one flag per team allowed in CTF!\n"));
|
||||
if (cv_matchboxes.value == 1) // Random
|
||||
i = MT_QUESTIONBOX;
|
||||
else if (cv_matchboxes.value == 3) // Don't spawn
|
||||
return;
|
||||
else // cv_matchboxes.value == 2, Non-Random
|
||||
{
|
||||
if (i == MT_QUESTIONBOX)
|
||||
return; // don't spawn in Non-Random
|
||||
|
||||
mthing->options &= ~(MTF_AMBUSH|MTF_OBJECTSPECIAL); // no random respawning!
|
||||
}
|
||||
}
|
||||
|
||||
if (i == MT_BLUETEAMRING || i == MT_REDTEAMRING)
|
||||
i = MT_RING;
|
||||
else if (i == MT_BLUERINGBOX || i == MT_REDRINGBOX)
|
||||
i = MT_SUPERRINGBOX;
|
||||
else if (i == MT_BLUEFLAG || i == MT_REDFLAG)
|
||||
return; // No flags in non-CTF modes!
|
||||
|
||||
if (!G_RaceGametype() && (i == MT_SIGN || i == MT_STARPOST))
|
||||
return; // Don't spawn exit signs or starposts in wrong game modes
|
||||
|
||||
@@ -11167,7 +11073,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
|
||||
return; // No rings in Ultimate mode (except special stages)
|
||||
}
|
||||
|
||||
if (i == MT_EMMY && (gametype != GT_COOP || ultimatemode || tokenbits == 30 || tokenlist & (1 << tokenbits++)))
|
||||
if (i == MT_EMMY && (ultimatemode || tokenbits == 30 || tokenlist & (1 << tokenbits++)))
|
||||
return; // you already got this token, or there are too many, or the gametype's not right
|
||||
|
||||
// Objectplace landing point
|
||||
@@ -12350,25 +12256,6 @@ mobj_t *P_SpawnMissile(mobj_t *source, mobj_t *dest, mobjtype_t type)
|
||||
return dist ? th : NULL;
|
||||
}
|
||||
|
||||
//
|
||||
// P_ColorTeamMissile
|
||||
// Colors a player's ring based on their team
|
||||
//
|
||||
void P_ColorTeamMissile(mobj_t *missile, player_t *source)
|
||||
{
|
||||
if (G_GametypeHasTeams())
|
||||
{
|
||||
if (source->ctfteam == 2)
|
||||
missile->color = skincolor_bluering;
|
||||
else if (source->ctfteam == 1)
|
||||
missile->color = skincolor_redring;
|
||||
}
|
||||
/*
|
||||
else
|
||||
missile->color = player->mo->color; //copy color
|
||||
*/
|
||||
}
|
||||
|
||||
//
|
||||
// P_SPMAngle
|
||||
// Fires missile at angle from what is presumably a player
|
||||
|
||||
+2
-40
@@ -2471,7 +2471,6 @@ static void P_SetupCamera(UINT8 pnum, camera_t *cam)
|
||||
switch (gametype)
|
||||
{
|
||||
case GT_MATCH:
|
||||
case GT_TAG:
|
||||
thing = deathmatchstarts[0];
|
||||
break;
|
||||
|
||||
@@ -2818,7 +2817,7 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate)
|
||||
players[i].mo = NULL;
|
||||
G_DoReborn(i);
|
||||
}
|
||||
else // gametype is GT_COOP or GT_RACE
|
||||
else // gametype is GT_RACE
|
||||
{
|
||||
players[i].mo = NULL;
|
||||
|
||||
@@ -2834,44 +2833,7 @@ boolean P_SetupLevel(boolean skipprecip, boolean reloadinggamestate)
|
||||
if (modeattacking == ATTACKING_RECORD && !demo.playback)
|
||||
P_LoadRecordGhosts();
|
||||
|
||||
if (G_TagGametype())
|
||||
{
|
||||
INT32 realnumplayers = 0;
|
||||
INT32 playersactive[MAXPLAYERS];
|
||||
|
||||
//I just realized how problematic this code can be.
|
||||
//D_NumPlayers() will not always cover the scope of the netgame.
|
||||
//What if one player is node 0 and the other node 31?
|
||||
//The solution? Make a temp array of all players that are currently playing and pick from them.
|
||||
//Future todo? When a player leaves, shift all nodes down so D_NumPlayers() can be used as intended?
|
||||
//Also, you'd never have to loop through all 32 players slots to find anything ever again.
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
if (playeringame[i] && !players[i].spectator)
|
||||
{
|
||||
playersactive[realnumplayers] = i; //stores the player's node in the array.
|
||||
realnumplayers++;
|
||||
}
|
||||
}
|
||||
|
||||
if (realnumplayers) //this should also fix the dedicated crash bug. You only pick a player if one exists to be picked.
|
||||
{
|
||||
i = P_RandomKey(realnumplayers);
|
||||
players[playersactive[i]].pflags |= PF_TAGIT; //choose our initial tagger before map starts.
|
||||
|
||||
// Taken and modified from G_DoReborn()
|
||||
// Remove the player so he can respawn elsewhere.
|
||||
// first dissasociate the corpse
|
||||
if (players[playersactive[i]].mo)
|
||||
P_RemoveMobj(players[playersactive[i]].mo);
|
||||
|
||||
G_SpawnPlayer(playersactive[i], false); //respawn the lucky player in his dedicated spawn location.
|
||||
}
|
||||
else
|
||||
CONS_Printf(M_GetText("No player currently available to become IT. Awaiting available players.\n"));
|
||||
|
||||
}
|
||||
else if (G_RaceGametype() && server)
|
||||
if (G_RaceGametype() && server)
|
||||
CV_StealthSetValue(&cv_numlaps,
|
||||
((netgame || multiplayer) && cv_basenumlaps.value
|
||||
&& (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE)
|
||||
|
||||
+4
-91
@@ -3374,9 +3374,6 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||
}
|
||||
|
||||
P_DoPlayerPain(player, NULL, NULL); // this does basically everything that was here before
|
||||
|
||||
if (gametype == GT_CTF && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))
|
||||
P_PlayerFlagBurst(player, false);
|
||||
break;
|
||||
case 12: // Wall Sector (Don't step-up/down)
|
||||
case 13: // Ramp Sector (Increase step-up/down)
|
||||
@@ -3396,7 +3393,7 @@ void P_ProcessSpecialSector(player_t *player, sector_t *sector, sector_t *rovers
|
||||
case 3: // Linedef executor requires all players present // Trigger Linedef Exec (Floor Touch, All Players)
|
||||
/// \todo check continues for proper splitscreen support?
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
if (playeringame[i] && !players[i].bot && players[i].mo && (gametype != GT_COOP || players[i].lives > 0))
|
||||
if (playeringame[i] && !players[i].bot && players[i].mo && players[i].lives > 0)
|
||||
{
|
||||
if (roversector)
|
||||
{
|
||||
@@ -3666,95 +3663,12 @@ DoneSection2:
|
||||
sstimer = 6; // Just let P_Ticker take care of the rest.
|
||||
|
||||
// Exit (for FOF exits; others are handled in P_PlayerThink in p_user.c)
|
||||
{
|
||||
INT32 lineindex;
|
||||
|
||||
P_DoPlayerExit(player);
|
||||
|
||||
P_SetupSignExit(player);
|
||||
// important: use sector->tag on next line instead of player->mo->subsector->tag
|
||||
// this part is different from in P_PlayerThink, this is what was causing
|
||||
// FOF custom exits not to work.
|
||||
lineindex = P_FindSpecialLineFromTag(2, sector->tag, -1);
|
||||
|
||||
if (gametype == GT_COOP && lineindex != -1) // Custom exit!
|
||||
{
|
||||
// Special goodies with the block monsters flag depending on emeralds collected
|
||||
if ((lines[lineindex].flags & ML_BLOCKMONSTERS) && ALL7EMERALDS(emeralds))
|
||||
nextmapoverride = (INT16)(lines[lineindex].frontsector->ceilingheight>>FRACBITS);
|
||||
else
|
||||
nextmapoverride = (INT16)(lines[lineindex].frontsector->floorheight>>FRACBITS);
|
||||
|
||||
if (lines[lineindex].flags & ML_NOCLIMB)
|
||||
skipstats = true;
|
||||
}
|
||||
}
|
||||
P_DoPlayerExit(player);
|
||||
P_SetupSignExit(player);
|
||||
break;
|
||||
|
||||
case 3: // Red Team's Base
|
||||
if (gametype == GT_CTF && P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
if (player->ctfteam == 1 && (player->gotflag & GF_BLUEFLAG))
|
||||
{
|
||||
mobj_t *mo;
|
||||
|
||||
// Make sure the red team still has their own
|
||||
// flag at their base so they can score.
|
||||
if (!P_IsFlagAtBase(MT_REDFLAG))
|
||||
break;
|
||||
|
||||
HU_SetCEchoFlags(0);
|
||||
HU_SetCEchoDuration(5);
|
||||
HU_DoCEcho(va(M_GetText("%s\\captured the blue flag.\\\\\\\\"), player_names[player-players]));
|
||||
|
||||
if (splitscreen || players[consoleplayer].ctfteam == 1)
|
||||
S_StartSound(NULL, sfx_flgcap);
|
||||
else if (players[consoleplayer].ctfteam == 2)
|
||||
S_StartSound(NULL, sfx_lose);
|
||||
|
||||
mo = P_SpawnMobj(player->mo->x,player->mo->y,player->mo->z,MT_BLUEFLAG);
|
||||
player->gotflag &= ~GF_BLUEFLAG;
|
||||
mo->flags &= ~MF_SPECIAL;
|
||||
mo->fuse = TICRATE;
|
||||
mo->spawnpoint = bflagpoint;
|
||||
mo->flags2 |= MF2_JUSTATTACKED;
|
||||
redscore += 1;
|
||||
P_AddPlayerScore(player, 5);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // Blue Team's Base
|
||||
if (gametype == GT_CTF && P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
if (player->ctfteam == 2 && (player->gotflag & GF_REDFLAG))
|
||||
{
|
||||
mobj_t *mo;
|
||||
|
||||
// Make sure the blue team still has their own
|
||||
// flag at their base so they can score.
|
||||
if (!P_IsFlagAtBase(MT_BLUEFLAG))
|
||||
break;
|
||||
|
||||
HU_SetCEchoFlags(0);
|
||||
HU_SetCEchoDuration(5);
|
||||
HU_DoCEcho(va(M_GetText("%s\\captured the red flag.\\\\\\\\"), player_names[player-players]));
|
||||
|
||||
if (splitscreen || players[consoleplayer].ctfteam == 2)
|
||||
S_StartSound(NULL, sfx_flgcap);
|
||||
else if (players[consoleplayer].ctfteam == 1)
|
||||
S_StartSound(NULL, sfx_lose);
|
||||
|
||||
mo = P_SpawnMobj(player->mo->x,player->mo->y,player->mo->z,MT_REDFLAG);
|
||||
player->gotflag &= ~GF_REDFLAG;
|
||||
mo->flags &= ~MF_SPECIAL;
|
||||
mo->fuse = TICRATE;
|
||||
mo->spawnpoint = rflagpoint;
|
||||
mo->flags2 |= MF2_JUSTATTACKED;
|
||||
bluescore += 1;
|
||||
P_AddPlayerScore(player, 5);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case 5: // Fan sector
|
||||
@@ -6052,8 +5966,7 @@ void P_SpawnSpecials(INT32 fromnetsave, boolean reloadinggamestate)
|
||||
// Linedef executor triggers for CTF teams.
|
||||
case 309:
|
||||
case 311:
|
||||
if (gametype != GT_CTF)
|
||||
lines[i].special = 0;
|
||||
lines[i].special = 0;
|
||||
break;
|
||||
|
||||
// Each time executors
|
||||
|
||||
+1
-180
@@ -457,24 +457,6 @@ void P_GivePlayerRings(player_t *player, INT32 num_rings)
|
||||
player->health = 1;
|
||||
}
|
||||
//}
|
||||
|
||||
// Now extra life bonuses are handled here instead of in P_MovePlayer, since why not?
|
||||
if (!ultimatemode && !modeattacking && !G_IsSpecialStage(gamemap) && G_GametypeUsesLives())
|
||||
{
|
||||
INT32 gainlives = 0;
|
||||
|
||||
while (player->xtralife < maxXtraLife && player->health > 100 * (player->xtralife+1))
|
||||
{
|
||||
++gainlives;
|
||||
++player->xtralife;
|
||||
}
|
||||
|
||||
if (gainlives)
|
||||
{
|
||||
P_GivePlayerLives(player, gainlives);
|
||||
P_PlayLivesJingle(player);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -508,8 +490,6 @@ void P_DoSuperTransformation(player_t *player, boolean giverings)
|
||||
// Adds to the player's score
|
||||
void P_AddPlayerScore(player_t *player, UINT32 amount)
|
||||
{
|
||||
//UINT32 oldscore;
|
||||
|
||||
if (!(G_BattleGametype()))
|
||||
return;
|
||||
|
||||
@@ -519,22 +499,11 @@ void P_AddPlayerScore(player_t *player, UINT32 amount)
|
||||
if (player->exiting) // srb2kart
|
||||
return;
|
||||
|
||||
//oldscore = player->score;
|
||||
|
||||
// Don't go above MAXSCORE.
|
||||
if (player->marescore + amount < MAXSCORE)
|
||||
player->marescore += amount;
|
||||
else
|
||||
player->marescore = MAXSCORE;
|
||||
|
||||
// In team match, all awarded points are incremented to the team's running score.
|
||||
if (gametype == GT_TEAMMATCH)
|
||||
{
|
||||
if (player->ctfteam == 1)
|
||||
redscore += amount;
|
||||
else if (player->ctfteam == 2)
|
||||
bluescore += amount;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
@@ -1759,58 +1728,6 @@ static void P_DoBubbleBreath(player_t *player)
|
||||
return;
|
||||
}
|
||||
|
||||
//
|
||||
// P_DoPlayerHeadSigns
|
||||
//
|
||||
// Spawns "IT" and "GOT FLAG" signs for Tag and CTF respectively
|
||||
//
|
||||
static void P_DoPlayerHeadSigns(player_t *player)
|
||||
{
|
||||
if (G_TagGametype())
|
||||
{
|
||||
// If you're "IT", show a big "IT" over your head for others to see.
|
||||
if (player->pflags & PF_TAGIT)
|
||||
{
|
||||
if (!P_IsDisplayPlayer(player)) // Don't display it on your own view.
|
||||
{
|
||||
if (!(player->mo->eflags & MFE_VERTICALFLIP))
|
||||
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z + player->mo->height, MT_TAG);
|
||||
else
|
||||
P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z - mobjinfo[MT_TAG].height, MT_TAG)->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (gametype == GT_CTF)
|
||||
{
|
||||
if (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)) // If you have the flag (duh).
|
||||
{
|
||||
// Spawn a got-flag message over the head of the player that
|
||||
// has it (but not on your own screen if you have the flag).
|
||||
if (splitscreen || player != &players[consoleplayer])
|
||||
{
|
||||
if (player->gotflag & GF_REDFLAG)
|
||||
{
|
||||
if (!(player->mo->eflags & MFE_VERTICALFLIP))
|
||||
P_SpawnMobj(player->mo->x+player->mo->momx, player->mo->y+player->mo->momy,
|
||||
player->mo->z+P_GetPlayerHeight(player)+FixedMul(16*FRACUNIT, player->mo->scale)+player->mo->momz, MT_GOTFLAG);
|
||||
else
|
||||
P_SpawnMobj(player->mo->x+player->mo->momx, player->mo->y+player->mo->momy,
|
||||
player->mo->z+player->mo->height-P_GetPlayerHeight(player)-mobjinfo[MT_GOTFLAG].height-FixedMul(16*FRACUNIT, player->mo->scale)+player->mo->momz, MT_GOTFLAG)->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
if (player->gotflag & GF_BLUEFLAG)
|
||||
{
|
||||
if (!(player->mo->eflags & MFE_VERTICALFLIP))
|
||||
P_SpawnMobj(player->mo->x+player->mo->momx, player->mo->y+player->mo->momy,
|
||||
player->mo->z+P_GetPlayerHeight(player)+FixedMul(16*FRACUNIT, player->mo->scale)+player->mo->momz, MT_GOTFLAG2);
|
||||
else
|
||||
P_SpawnMobj(player->mo->x+player->mo->momx, player->mo->y+player->mo->momy,
|
||||
player->mo->z+player->mo->height-P_GetPlayerHeight(player)-mobjinfo[MT_GOTFLAG2].height-FixedMul(16*FRACUNIT, player->mo->scale)+player->mo->momz, MT_GOTFLAG2)->eflags |= MFE_VERTICALFLIP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// P_DoJumpShield
|
||||
//
|
||||
@@ -2245,38 +2162,6 @@ static void P_MovePlayer(player_t *player)
|
||||
}
|
||||
// note: don't unset stasis here
|
||||
|
||||
if (!player->spectator && G_TagGametype())
|
||||
{
|
||||
// If we have stasis already here, it's because it's forced on us
|
||||
// by a linedef executor or what have you
|
||||
boolean forcestasis = false;
|
||||
|
||||
//During hide time, taggers cannot move.
|
||||
if (leveltime < hidetime * TICRATE)
|
||||
{
|
||||
if (player->pflags & PF_TAGIT)
|
||||
forcestasis = true;
|
||||
}
|
||||
else if (gametype == GT_HIDEANDSEEK)
|
||||
{
|
||||
if (!(player->pflags & PF_TAGIT))
|
||||
{
|
||||
forcestasis = true;
|
||||
if (player->pflags & PF_TAGGED) // Already hit.
|
||||
player->powers[pw_flashing] = 5;
|
||||
}
|
||||
}
|
||||
|
||||
if (forcestasis)
|
||||
{
|
||||
player->pflags |= PF_FULLSTASIS;
|
||||
// If you're in stasis in tag, you don't drown.
|
||||
/*if (player->powers[pw_underwater] <= 12*TICRATE + 1)
|
||||
P_RestoreMusic(player);*/
|
||||
player->powers[pw_underwater] = player->powers[pw_spacetime] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (player->spectator)
|
||||
{
|
||||
P_SpectatorMovement(player);
|
||||
@@ -4027,61 +3912,6 @@ boolean P_SpectatorJoinGame(player_t *player)
|
||||
CONS_Printf(M_GetText("Server does not allow team change.\n"));
|
||||
//player->powers[pw_flashing] = TICRATE + 1; //to prevent message spam.
|
||||
}
|
||||
// Team changing in Team Match and CTF
|
||||
// Pressing fire assigns you to a team that needs players if allowed.
|
||||
// Partial code reproduction from p_tick.c autobalance code.
|
||||
else if (G_GametypeHasTeams())
|
||||
{
|
||||
INT32 changeto = 0;
|
||||
INT32 z, numplayersred = 0, numplayersblue = 0;
|
||||
|
||||
//find a team by num players, score, or random if all else fails.
|
||||
for (z = 0; z < MAXPLAYERS; ++z)
|
||||
if (playeringame[z])
|
||||
{
|
||||
if (players[z].ctfteam == 1)
|
||||
++numplayersred;
|
||||
else if (players[z].ctfteam == 2)
|
||||
++numplayersblue;
|
||||
}
|
||||
// for z
|
||||
|
||||
if (numplayersblue > numplayersred)
|
||||
changeto = 1;
|
||||
else if (numplayersred > numplayersblue)
|
||||
changeto = 2;
|
||||
else if (bluescore > redscore)
|
||||
changeto = 1;
|
||||
else if (redscore > bluescore)
|
||||
changeto = 2;
|
||||
else
|
||||
changeto = (P_RandomFixed() & 1) + 1;
|
||||
|
||||
if (player->mo)
|
||||
{
|
||||
P_RemoveMobj(player->mo);
|
||||
player->mo = NULL;
|
||||
}
|
||||
player->spectator = false;
|
||||
player->pflags &= ~PF_WANTSTOJOIN;
|
||||
player->kartstuff[k_spectatewait] = 0;
|
||||
player->ctfteam = changeto;
|
||||
player->playerstate = PST_REBORN;
|
||||
|
||||
//center camera
|
||||
P_ResetLocalCamAiming(player);
|
||||
|
||||
//Reset away view
|
||||
if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer)
|
||||
displayplayers[0] = consoleplayer;
|
||||
|
||||
if (changeto == 1)
|
||||
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[player-players], '\x85', M_GetText("Red team"), '\x80');
|
||||
else if (changeto == 2)
|
||||
CONS_Printf(M_GetText("%s switched to the %c%s%c.\n"), player_names[player-players], '\x84', M_GetText("Blue team"), '\x80');
|
||||
|
||||
return true; // no more player->mo, cannot continue.
|
||||
}
|
||||
// Joining in game from firing.
|
||||
else
|
||||
{
|
||||
@@ -4383,8 +4213,7 @@ void P_PlayerThink(player_t *player)
|
||||
{
|
||||
seenplayer = NULL;
|
||||
|
||||
if (cv_seenames.value && cv_allowseenames.value &&
|
||||
!(G_TagGametype() && (player->pflags & PF_TAGIT)))
|
||||
if (cv_seenames.value && cv_allowseenames.value)
|
||||
{
|
||||
mobj_t *mo = P_SpawnNameFinder(player->mo, MT_NAMECHECK);
|
||||
|
||||
@@ -4659,8 +4488,6 @@ void P_PlayerThink(player_t *player)
|
||||
{
|
||||
player->pflags ^= PF_WANTSTOJOIN;
|
||||
player->powers[pw_flashing] = TICRATE/2 + 1;
|
||||
/*if (P_SpectatorJoinGame(player))
|
||||
return; // player->mo was removed.*/
|
||||
}
|
||||
|
||||
// Even if not NiGHTS, pull in nearby objects when walking around as John Q. Elliot.
|
||||
@@ -4730,14 +4557,9 @@ void P_PlayerThink(player_t *player)
|
||||
if (player->onconveyor == 1)
|
||||
player->cmomy = player->cmomx = 0;
|
||||
|
||||
//P_DoSuperStuff(player);
|
||||
//P_CheckSneakerAndLivesTimer(player);
|
||||
P_DoBubbleBreath(player); // Spawn Sonic's bubbles
|
||||
//P_CheckUnderwaterAndSpaceTimer(player); // Display the countdown drown numbers!
|
||||
P_CheckInvincibilityTimer(player); // Spawn Invincibility Sparkles
|
||||
P_DoPlayerHeadSigns(player); // Spawn Tag/CTF signs over player's head
|
||||
|
||||
#if 1
|
||||
// "Blur" a bit when you have speed shoes and are going fast enough
|
||||
if ((player->powers[pw_super] || player->powers[pw_sneakers]
|
||||
|| player->kartstuff[k_driftboost] || player->kartstuff[k_sneakertimer] || player->kartstuff[k_startboost]) && !player->kartstuff[k_invincibilitytimer] // SRB2kart
|
||||
@@ -4765,7 +4587,6 @@ void P_PlayerThink(player_t *player)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// check for use
|
||||
if (!(player->pflags & PF_NIGHTSMODE))
|
||||
|
||||
+2
-15
@@ -214,13 +214,6 @@ boolean ST_SameTeam(player_t *a, player_t *b)
|
||||
if (a->spectator && b->spectator)
|
||||
return true;
|
||||
|
||||
// Team chat.
|
||||
if (G_GametypeHasTeams())
|
||||
return a->ctfteam == b->ctfteam;
|
||||
|
||||
if (G_TagGametype())
|
||||
return ((a->pflags & PF_TAGIT) == (b->pflags & PF_TAGIT));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -731,8 +724,6 @@ static void ST_overlayDrawer(void)
|
||||
itemtxt = M_GetText("Item - . . .");
|
||||
else if (stplyr->pflags & PF_WANTSTOJOIN)
|
||||
itemtxt = M_GetText("Item - Cancel Join");
|
||||
else if (G_GametypeHasTeams())
|
||||
itemtxt = M_GetText("Item - Join Team");
|
||||
|
||||
if (cv_ingamecap.value)
|
||||
{
|
||||
@@ -862,18 +853,14 @@ void ST_Drawer(void)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF, player_names[seenplayer-players]);
|
||||
else if (cv_seenames.value == 2)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF,
|
||||
va("%s%s", G_GametypeHasTeams() ? ((seenplayer->ctfteam == 1) ? "\x85" : "\x84") : "", player_names[seenplayer-players]));
|
||||
va("%s%s", "", player_names[seenplayer-players]));
|
||||
else //if (cv_seenames.value == 3)
|
||||
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF,
|
||||
va("%s%s", !G_BattleGametype() || (G_GametypeHasTeams() && players[consoleplayer].ctfteam == seenplayer->ctfteam)
|
||||
va("%s%s", !G_BattleGametype()
|
||||
? "\x83" : "\x85", player_names[seenplayer-players]));
|
||||
}
|
||||
#endif
|
||||
|
||||
// Doom's status bar only updated if necessary.
|
||||
// However, ours updates every frame regardless, so the "refresh" param was removed
|
||||
//(void)refresh;
|
||||
|
||||
// force a set of the palette by using doPaletteStuff()
|
||||
if (vid.recalc)
|
||||
st_palette = -1;
|
||||
|
||||
+1
-23
@@ -56,26 +56,6 @@ typedef struct
|
||||
|
||||
typedef union
|
||||
{
|
||||
/*struct
|
||||
{
|
||||
char passed1[21]; // KNUCKLES GOT / CRAWLA HONCHO
|
||||
char passed2[16]; // THROUGH THE ACT / PASSED THE ACT
|
||||
INT32 passedx1;
|
||||
INT32 passedx2;
|
||||
|
||||
y_bonus_t bonuses[4];
|
||||
patch_t *bonuspatches[4];
|
||||
|
||||
SINT8 gotperfbonus; // Used for visitation flags.
|
||||
|
||||
UINT32 score, total; // fake score, total
|
||||
UINT32 tics; // time
|
||||
|
||||
patch_t *ttlnum; // act number being displayed
|
||||
patch_t *ptotal; // TOTAL
|
||||
UINT8 gotlife; // Number of extra lives obtained
|
||||
} coop;*/
|
||||
|
||||
struct
|
||||
{
|
||||
UINT8 *color[MAXPLAYERS]; // Winner's color #
|
||||
@@ -884,9 +864,7 @@ void Y_StartIntermission(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (cv_inttime.value == 0 && gametype == GT_COOP)
|
||||
timer = 0;
|
||||
else if (demo.playback) // Override inttime (which is pulled from the replay anyway
|
||||
if (demo.playback) // Override inttime (which is pulled from the replay anyway
|
||||
timer = 10*TICRATE;
|
||||
else
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user