GTR_TEAMFLAGS
This commit is contained in:
parent
185fa2799d
commit
299f2bd8cd
|
@ -1025,7 +1025,7 @@ static void SV_SendResynch(INT32 node)
|
||||||
netbuffer->packettype = PT_RESYNCHEND;
|
netbuffer->packettype = PT_RESYNCHEND;
|
||||||
|
|
||||||
netbuffer->u.resynchend.randomseed = P_GetRandSeed();
|
netbuffer->u.resynchend.randomseed = P_GetRandSeed();
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
resynch_write_ctf(&netbuffer->u.resynchend);
|
resynch_write_ctf(&netbuffer->u.resynchend);
|
||||||
resynch_write_others(&netbuffer->u.resynchend);
|
resynch_write_others(&netbuffer->u.resynchend);
|
||||||
|
|
||||||
|
@ -2430,7 +2430,7 @@ static void CL_RemovePlayer(INT32 playernum, INT32 reason)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
P_PlayerFlagBurst(&players[playernum], false); // Don't take the flag with you!
|
P_PlayerFlagBurst(&players[playernum], false); // Don't take the flag with you!
|
||||||
|
|
||||||
// If in a special stage, redistribute the player's spheres across
|
// If in a special stage, redistribute the player's spheres across
|
||||||
|
@ -4124,7 +4124,7 @@ static void HandlePacketFromPlayer(SINT8 node)
|
||||||
|
|
||||||
P_SetRandSeed(netbuffer->u.resynchend.randomseed);
|
P_SetRandSeed(netbuffer->u.resynchend.randomseed);
|
||||||
|
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
resynch_read_ctf(&netbuffer->u.resynchend);
|
resynch_read_ctf(&netbuffer->u.resynchend);
|
||||||
resynch_read_others(&netbuffer->u.resynchend);
|
resynch_read_others(&netbuffer->u.resynchend);
|
||||||
|
|
||||||
|
|
|
@ -431,6 +431,7 @@ enum GameTypeRules
|
||||||
GTR_HIDETIMEFROZEN = 1<<10, // Hide and Seek, but not Tag
|
GTR_HIDETIMEFROZEN = 1<<10, // Hide and Seek, but not Tag
|
||||||
GTR_BLINDFOLDED = 1<<11, // Blindfolded view (Tag and Hide and Seek)
|
GTR_BLINDFOLDED = 1<<11, // Blindfolded view (Tag and Hide and Seek)
|
||||||
GTR_EMERALDS = 1<<12, // Ringslinger emeralds (Match and CTF)
|
GTR_EMERALDS = 1<<12, // Ringslinger emeralds (Match and CTF)
|
||||||
|
GTR_TEAMFLAGS = 1<<13, // Gametype has team flags (CTF)
|
||||||
};
|
};
|
||||||
|
|
||||||
// String names for gametypes
|
// String names for gametypes
|
||||||
|
|
|
@ -2564,7 +2564,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
|
||||||
|
|
||||||
// -- CTF --
|
// -- CTF --
|
||||||
// Order: CTF->DM->Coop
|
// Order: CTF->DM->Coop
|
||||||
if (gametype == GT_CTF && players[playernum].ctfteam)
|
if ((gametyperules & GTR_TEAMFLAGS) && players[playernum].ctfteam)
|
||||||
{
|
{
|
||||||
if (!(spawnpoint = G_FindCTFStart(playernum)) // find a CTF start
|
if (!(spawnpoint = G_FindCTFStart(playernum)) // find a CTF start
|
||||||
&& !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start
|
&& !(spawnpoint = G_FindMatchStart(playernum))) // find a DM start
|
||||||
|
@ -3079,7 +3079,7 @@ INT16 gametypedefaultrules[NUMGAMETYPES] =
|
||||||
GTR_RINGSLINGER|GTR_TAG|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED,
|
GTR_RINGSLINGER|GTR_TAG|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_HIDETIME|GTR_BLINDFOLDED,
|
||||||
|
|
||||||
// CTF
|
// CTF
|
||||||
GTR_RINGSLINGER|GTR_TEAMS|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_EMERALDS,
|
GTR_RINGSLINGER|GTR_TEAMS|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_EMERALDS|GTR_TEAMFLAGS,
|
||||||
};
|
};
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -2541,7 +2541,7 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
||||||
| (greycheck ? 0 : V_TRANSLUCENT)
|
| (greycheck ? 0 : V_TRANSLUCENT)
|
||||||
| V_ALLOWLOWERCASE, name);
|
| V_ALLOWLOWERCASE, name);
|
||||||
|
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
{
|
{
|
||||||
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
|
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
|
||||||
V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, rflagico, 0);
|
V_DrawFixedPatch((x-10)*FRACUNIT, (y)*FRACUNIT, FRACUNIT/4, 0, rflagico, 0);
|
||||||
|
@ -2669,7 +2669,7 @@ void HU_DrawTeamTabRankings(playersort_t *tab, INT32 whiteplayer)
|
||||||
| (greycheck ? V_TRANSLUCENT : 0)
|
| (greycheck ? V_TRANSLUCENT : 0)
|
||||||
| V_ALLOWLOWERCASE, name);
|
| V_ALLOWLOWERCASE, name);
|
||||||
|
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
{
|
{
|
||||||
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
|
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
|
||||||
V_DrawSmallScaledPatch(x-28, y-4, 0, rflagico);
|
V_DrawSmallScaledPatch(x-28, y-4, 0, rflagico);
|
||||||
|
|
|
@ -778,7 +778,7 @@ void Command_CauseCfail_f(void)
|
||||||
P_SetThingPosition(players[consoleplayer].mo);
|
P_SetThingPosition(players[consoleplayer].mo);
|
||||||
|
|
||||||
// CTF consistency test
|
// CTF consistency test
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
{
|
{
|
||||||
if (blueflag) {
|
if (blueflag) {
|
||||||
P_RemoveMobj(blueflag);
|
P_RemoveMobj(blueflag);
|
||||||
|
|
|
@ -4985,7 +4985,7 @@ void A_ThrownRing(mobj_t *actor)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Don't home in on teammates.
|
// Don't home in on teammates.
|
||||||
if (gametype == GT_CTF
|
if ((gametyperules & GTR_TEAMFLAGS)
|
||||||
&& actor->target->player->ctfteam == player->ctfteam)
|
&& actor->target->player->ctfteam == player->ctfteam)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -6591,7 +6591,7 @@ void A_OldRingExplode(mobj_t *actor) {
|
||||||
|
|
||||||
if (changecolor)
|
if (changecolor)
|
||||||
{
|
{
|
||||||
if (gametype != GT_CTF)
|
if (!(gametyperules & GTR_TEAMFLAGS))
|
||||||
mo->color = actor->target->color; //copy color
|
mo->color = actor->target->color; //copy color
|
||||||
else if (actor->target->player->ctfteam == 2)
|
else if (actor->target->player->ctfteam == 2)
|
||||||
mo->color = skincolor_bluering;
|
mo->color = skincolor_bluering;
|
||||||
|
@ -6607,7 +6607,7 @@ void A_OldRingExplode(mobj_t *actor) {
|
||||||
|
|
||||||
if (changecolor)
|
if (changecolor)
|
||||||
{
|
{
|
||||||
if (gametype != GT_CTF)
|
if (!(gametyperules & GTR_TEAMFLAGS))
|
||||||
mo->color = actor->target->color; //copy color
|
mo->color = actor->target->color; //copy color
|
||||||
else if (actor->target->player->ctfteam == 2)
|
else if (actor->target->player->ctfteam == 2)
|
||||||
mo->color = skincolor_bluering;
|
mo->color = skincolor_bluering;
|
||||||
|
@ -6622,7 +6622,7 @@ void A_OldRingExplode(mobj_t *actor) {
|
||||||
|
|
||||||
if (changecolor)
|
if (changecolor)
|
||||||
{
|
{
|
||||||
if (gametype != GT_CTF)
|
if (!(gametyperules & GTR_TEAMFLAGS))
|
||||||
mo->color = actor->target->color; //copy color
|
mo->color = actor->target->color; //copy color
|
||||||
else if (actor->target->player->ctfteam == 2)
|
else if (actor->target->player->ctfteam == 2)
|
||||||
mo->color = skincolor_bluering;
|
mo->color = skincolor_bluering;
|
||||||
|
|
|
@ -3224,7 +3224,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
|
||||||
player->mo->flags2 &= ~MF2_DONTDRAW;
|
player->mo->flags2 &= ~MF2_DONTDRAW;
|
||||||
|
|
||||||
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
P_SetPlayerMobjState(player->mo, player->mo->info->deathstate);
|
||||||
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
||||||
{
|
{
|
||||||
P_PlayerFlagBurst(player, false);
|
P_PlayerFlagBurst(player, false);
|
||||||
if (source && source->player)
|
if (source && source->player)
|
||||||
|
@ -3349,7 +3349,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
|
||||||
else
|
else
|
||||||
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
S_StartSound (player->mo, sfx_shldls); // Ba-Dum! Shield loss.
|
||||||
|
|
||||||
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
||||||
{
|
{
|
||||||
P_PlayerFlagBurst(player, false);
|
P_PlayerFlagBurst(player, false);
|
||||||
if (source && source->player)
|
if (source && source->player)
|
||||||
|
@ -3383,7 +3383,7 @@ static void P_RingDamage(player_t *player, mobj_t *inflictor, mobj_t *source, IN
|
||||||
P_AddPlayerScore(source->player, 50);
|
P_AddPlayerScore(source->player, 50);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
|
||||||
{
|
{
|
||||||
P_PlayerFlagBurst(player, false);
|
P_PlayerFlagBurst(player, false);
|
||||||
if (source && source->player)
|
if (source && source->player)
|
||||||
|
@ -3442,7 +3442,7 @@ void P_SpecialStageDamage(player_t *player, mobj_t *inflictor, mobj_t *source)
|
||||||
|
|
||||||
P_DoPlayerPain(player, inflictor, source);
|
P_DoPlayerPain(player, inflictor, source);
|
||||||
|
|
||||||
if (gametype == GT_CTF && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))
|
if ((gametyperules & GTR_TEAMFLAGS) && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))
|
||||||
P_PlayerFlagBurst(player, false);
|
P_PlayerFlagBurst(player, false);
|
||||||
|
|
||||||
if (oldnightstime > 10*TICRATE
|
if (oldnightstime > 10*TICRATE
|
||||||
|
|
|
@ -11179,7 +11179,7 @@ void P_RespawnSpecials(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
//CTF rings should continue to respawn as normal rings outside of CTF.
|
//CTF rings should continue to respawn as normal rings outside of CTF.
|
||||||
if (gametype != GT_CTF)
|
if (!(gametyperules & GTR_TEAMFLAGS))
|
||||||
{
|
{
|
||||||
if (i == MT_REDTEAMRING || i == MT_BLUETEAMRING)
|
if (i == MT_REDTEAMRING || i == MT_BLUETEAMRING)
|
||||||
i = MT_RING;
|
i = MT_RING;
|
||||||
|
@ -11750,7 +11750,7 @@ You should think about modifying the deathmatch starts to take full advantage of
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gametype != GT_CTF) // CTF specific things
|
if (!(gametyperules & GTR_TEAMFLAGS)) // CTF specific things
|
||||||
{
|
{
|
||||||
if (i == MT_RING_BLUEBOX || i == MT_RING_REDBOX)
|
if (i == MT_RING_BLUEBOX || i == MT_RING_REDBOX)
|
||||||
i = MT_RING_BOX;
|
i = MT_RING_BOX;
|
||||||
|
@ -13597,9 +13597,9 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing, boolean bonustime)
|
||||||
else if (mthing->type == mobjinfo[MT_COIN].doomednum)
|
else if (mthing->type == mobjinfo[MT_COIN].doomednum)
|
||||||
ringthing = MT_COIN;
|
ringthing = MT_COIN;
|
||||||
else if (mthing->type == mobjinfo[MT_REDTEAMRING].doomednum) // No team rings in non-CTF
|
else if (mthing->type == mobjinfo[MT_REDTEAMRING].doomednum) // No team rings in non-CTF
|
||||||
ringthing = (gametype == GT_CTF) ? MT_REDTEAMRING : MT_RING;
|
ringthing = (gametyperules & GTR_TEAMFLAGS) ? MT_REDTEAMRING : MT_RING;
|
||||||
else if (mthing->type == mobjinfo[MT_BLUETEAMRING].doomednum) // Ditto
|
else if (mthing->type == mobjinfo[MT_BLUETEAMRING].doomednum) // Ditto
|
||||||
ringthing = (gametype == GT_CTF) ? MT_BLUETEAMRING : MT_RING;
|
ringthing = (gametyperules & GTR_TEAMFLAGS) ? MT_BLUETEAMRING : MT_RING;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set proper height
|
// Set proper height
|
||||||
|
|
|
@ -4713,7 +4713,7 @@ DoneSection2:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3: // Red Team's Base
|
case 3: // Red Team's Base
|
||||||
if (gametype == GT_CTF && P_IsObjectOnGround(player->mo))
|
if ((gametyperules & GTR_TEAMFLAGS) && P_IsObjectOnGround(player->mo))
|
||||||
{
|
{
|
||||||
if (player->ctfteam == 1 && (player->gotflag & GF_BLUEFLAG))
|
if (player->ctfteam == 1 && (player->gotflag & GF_BLUEFLAG))
|
||||||
{
|
{
|
||||||
|
@ -4746,7 +4746,7 @@ DoneSection2:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 4: // Blue Team's Base
|
case 4: // Blue Team's Base
|
||||||
if (gametype == GT_CTF && P_IsObjectOnGround(player->mo))
|
if ((gametyperules & GTR_TEAMFLAGS) && P_IsObjectOnGround(player->mo))
|
||||||
{
|
{
|
||||||
if (player->ctfteam == 2 && (player->gotflag & GF_REDFLAG))
|
if (player->ctfteam == 2 && (player->gotflag & GF_REDFLAG))
|
||||||
{
|
{
|
||||||
|
@ -7231,7 +7231,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
|
||||||
// Linedef executor triggers for CTF teams.
|
// Linedef executor triggers for CTF teams.
|
||||||
case 309:
|
case 309:
|
||||||
case 311:
|
case 311:
|
||||||
if (gametype != GT_CTF)
|
if (!(gametyperules & GTR_TEAMFLAGS))
|
||||||
lines[i].special = 0;
|
lines[i].special = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -3110,7 +3110,7 @@ static void P_DoPlayerHeadSigns(player_t *player)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))) // If you have the flag (duh).
|
else if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))) // If you have the flag (duh).
|
||||||
{
|
{
|
||||||
// Spawn a got-flag message over the head of the player that
|
// 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).
|
// has it (but not on your own screen if you have the flag).
|
||||||
|
@ -5048,7 +5048,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
if (onground || player->climbing || player->powers[pw_carry])
|
if (onground || player->climbing || player->powers[pw_carry])
|
||||||
;
|
;
|
||||||
else if (gametype == GT_CTF && player->gotflag)
|
else if ((gametyperules & GTR_TEAMFLAGS) && player->gotflag)
|
||||||
;
|
;
|
||||||
else if (player->pflags & (PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player has used an ability previously
|
else if (player->pflags & (PF_GLIDING|PF_SLIDING|PF_SHIELDABILITY)) // If the player has used an ability previously
|
||||||
;
|
;
|
||||||
|
@ -5273,7 +5273,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
||||||
player->secondjump = 0;
|
player->secondjump = 0;
|
||||||
player->pflags &= ~PF_THOKKED;
|
player->pflags &= ~PF_THOKKED;
|
||||||
}
|
}
|
||||||
else if (player->pflags & PF_SLIDING || (gametype == GT_CTF && player->gotflag))
|
else if (player->pflags & PF_SLIDING || ((gametyperules & GTR_TEAMFLAGS) && player->gotflag))
|
||||||
;
|
;
|
||||||
/*else if (P_SuperReady(player))
|
/*else if (P_SuperReady(player))
|
||||||
{
|
{
|
||||||
|
@ -5560,7 +5560,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
||||||
{
|
{
|
||||||
player->pflags |= PF_JUMPDOWN;
|
player->pflags |= PF_JUMPDOWN;
|
||||||
|
|
||||||
if ((gametype != GT_CTF || !player->gotflag) && !player->exiting)
|
if ((!(gametyperules & GTR_TEAMFLAGS) || !player->gotflag) && !player->exiting)
|
||||||
{
|
{
|
||||||
if (player->secondjump == 1 && player->charability != CA_DOUBLEJUMP)
|
if (player->secondjump == 1 && player->charability != CA_DOUBLEJUMP)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2279,6 +2279,7 @@ static void ST_drawTextHUD(void)
|
||||||
{
|
{
|
||||||
if (stplyr->pflags & PF_TAGIT)
|
if (stplyr->pflags & PF_TAGIT)
|
||||||
{
|
{
|
||||||
|
if (gametyperules & GTR_BLINDFOLDED)
|
||||||
textHUDdraw(M_GetText("\x82""You are blindfolded!"))
|
textHUDdraw(M_GetText("\x82""You are blindfolded!"))
|
||||||
textHUDdraw(M_GetText("Waiting for players to hide..."))
|
textHUDdraw(M_GetText("Waiting for players to hide..."))
|
||||||
}
|
}
|
||||||
|
@ -2294,6 +2295,7 @@ static void ST_drawTextHUD(void)
|
||||||
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
|
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
|
||||||
donef12 = true;
|
donef12 = true;
|
||||||
}
|
}
|
||||||
|
if (gametyperules & GTR_HIDETIMEFROZEN)
|
||||||
textHUDdraw(M_GetText("You cannot move while hiding."))
|
textHUDdraw(M_GetText("You cannot move while hiding."))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2316,21 +2318,21 @@ static void ST_drawTeamHUD(void)
|
||||||
if (F_GetPromptHideHud(0)) // y base is 0
|
if (F_GetPromptHideHud(0)) // y base is 0
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
p = bflagico;
|
p = bflagico;
|
||||||
else
|
else
|
||||||
p = bmatcico;
|
p = bmatcico;
|
||||||
|
|
||||||
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
|
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 - SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
|
||||||
|
|
||||||
if (gametype == GT_CTF)
|
if (gametyperules & GTR_TEAMFLAGS)
|
||||||
p = rflagico;
|
p = rflagico;
|
||||||
else
|
else
|
||||||
p = rmatcico;
|
p = rmatcico;
|
||||||
|
|
||||||
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
|
V_DrawSmallScaledPatch(BASEVIDWIDTH/2 + SEP - SHORT(p->width)/4, 4, V_HUDTRANS|V_PERPLAYER|V_SNAPTOTOP, p);
|
||||||
|
|
||||||
if (gametype != GT_CTF)
|
if (!(gametyperules & GTR_TEAMFLAGS))
|
||||||
goto num;
|
goto num;
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
Loading…
Reference in New Issue