GTR_TEAMFLAGS

This commit is contained in:
Jaime Passos 2019-12-18 11:43:50 -03:00
parent 185fa2799d
commit 299f2bd8cd
11 changed files with 35 additions and 32 deletions

View File

@ -1025,7 +1025,7 @@ static void SV_SendResynch(INT32 node)
netbuffer->packettype = PT_RESYNCHEND;
netbuffer->u.resynchend.randomseed = P_GetRandSeed();
if (gametype == GT_CTF)
if (gametyperules & GTR_TEAMFLAGS)
resynch_write_ctf(&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!
// 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);
if (gametype == GT_CTF)
if (gametyperules & GTR_TEAMFLAGS)
resynch_read_ctf(&netbuffer->u.resynchend);
resynch_read_others(&netbuffer->u.resynchend);

View File

@ -431,6 +431,7 @@ enum GameTypeRules
GTR_HIDETIMEFROZEN = 1<<10, // Hide and Seek, but not Tag
GTR_BLINDFOLDED = 1<<11, // Blindfolded view (Tag and Hide and Seek)
GTR_EMERALDS = 1<<12, // Ringslinger emeralds (Match and CTF)
GTR_TEAMFLAGS = 1<<13, // Gametype has team flags (CTF)
};
// String names for gametypes

View File

@ -2564,7 +2564,7 @@ void G_SpawnPlayer(INT32 playernum, boolean starpost)
// -- CTF --
// 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
&& !(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,
// CTF
GTR_RINGSLINGER|GTR_TEAMS|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_EMERALDS,
GTR_RINGSLINGER|GTR_TEAMS|GTR_SPECTATORS|GTR_TIMELIMIT|GTR_EMERALDS|GTR_TEAMFLAGS,
};
//

View File

@ -2541,7 +2541,7 @@ static void HU_Draw32TeamTabRankings(playersort_t *tab, INT32 whiteplayer)
| (greycheck ? 0 : V_TRANSLUCENT)
| V_ALLOWLOWERCASE, name);
if (gametype == GT_CTF)
if (gametyperules & GTR_TEAMFLAGS)
{
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
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)
| V_ALLOWLOWERCASE, name);
if (gametype == GT_CTF)
if (gametyperules & GTR_TEAMFLAGS)
{
if (players[tab[i].num].gotflag & GF_REDFLAG) // Red
V_DrawSmallScaledPatch(x-28, y-4, 0, rflagico);

View File

@ -778,7 +778,7 @@ void Command_CauseCfail_f(void)
P_SetThingPosition(players[consoleplayer].mo);
// CTF consistency test
if (gametype == GT_CTF)
if (gametyperules & GTR_TEAMFLAGS)
{
if (blueflag) {
P_RemoveMobj(blueflag);

View File

@ -4985,7 +4985,7 @@ void A_ThrownRing(mobj_t *actor)
continue;
// Don't home in on teammates.
if (gametype == GT_CTF
if ((gametyperules & GTR_TEAMFLAGS)
&& actor->target->player->ctfteam == player->ctfteam)
continue;
}
@ -6591,7 +6591,7 @@ void A_OldRingExplode(mobj_t *actor) {
if (changecolor)
{
if (gametype != GT_CTF)
if (!(gametyperules & GTR_TEAMFLAGS))
mo->color = actor->target->color; //copy color
else if (actor->target->player->ctfteam == 2)
mo->color = skincolor_bluering;
@ -6607,7 +6607,7 @@ void A_OldRingExplode(mobj_t *actor) {
if (changecolor)
{
if (gametype != GT_CTF)
if (!(gametyperules & GTR_TEAMFLAGS))
mo->color = actor->target->color; //copy color
else if (actor->target->player->ctfteam == 2)
mo->color = skincolor_bluering;
@ -6622,7 +6622,7 @@ void A_OldRingExplode(mobj_t *actor) {
if (changecolor)
{
if (gametype != GT_CTF)
if (!(gametyperules & GTR_TEAMFLAGS))
mo->color = actor->target->color; //copy color
else if (actor->target->player->ctfteam == 2)
mo->color = skincolor_bluering;

View File

@ -3224,7 +3224,7 @@ static void P_KillPlayer(player_t *player, mobj_t *source, INT32 damage)
player->mo->flags2 &= ~MF2_DONTDRAW;
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);
if (source && source->player)
@ -3349,7 +3349,7 @@ static void P_ShieldDamage(player_t *player, mobj_t *inflictor, mobj_t *source,
else
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);
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);
}
if (gametype == GT_CTF && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
if ((gametyperules & GTR_TEAMFLAGS) && (player->gotflag & (GF_REDFLAG|GF_BLUEFLAG)))
{
P_PlayerFlagBurst(player, false);
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);
if (gametype == GT_CTF && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))
if ((gametyperules & GTR_TEAMFLAGS) && player->gotflag & (GF_REDFLAG|GF_BLUEFLAG))
P_PlayerFlagBurst(player, false);
if (oldnightstime > 10*TICRATE

View File

@ -11179,7 +11179,7 @@ void P_RespawnSpecials(void)
}
//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)
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)
i = MT_RING_BOX;
@ -13597,9 +13597,9 @@ void P_SpawnHoopsAndRings(mapthing_t *mthing, boolean bonustime)
else if (mthing->type == mobjinfo[MT_COIN].doomednum)
ringthing = MT_COIN;
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
ringthing = (gametype == GT_CTF) ? MT_BLUETEAMRING : MT_RING;
ringthing = (gametyperules & GTR_TEAMFLAGS) ? MT_BLUETEAMRING : MT_RING;
}
// Set proper height

View File

@ -4713,7 +4713,7 @@ DoneSection2:
break;
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))
{
@ -4746,7 +4746,7 @@ DoneSection2:
break;
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))
{
@ -7231,7 +7231,7 @@ void P_SpawnSpecials(INT32 fromnetsave)
// Linedef executor triggers for CTF teams.
case 309:
case 311:
if (gametype != GT_CTF)
if (!(gametyperules & GTR_TEAMFLAGS))
lines[i].special = 0;
break;

View File

@ -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
// 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])
;
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
;
@ -5273,7 +5273,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
player->secondjump = 0;
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))
{
@ -5560,7 +5560,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
{
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)
{

View File

@ -2279,7 +2279,8 @@ static void ST_drawTextHUD(void)
{
if (stplyr->pflags & PF_TAGIT)
{
textHUDdraw(M_GetText("\x82""You are blindfolded!"))
if (gametyperules & GTR_BLINDFOLDED)
textHUDdraw(M_GetText("\x82""You are blindfolded!"))
textHUDdraw(M_GetText("Waiting for players to hide..."))
}
else if (gametype == GT_HIDEANDSEEK)
@ -2294,7 +2295,8 @@ static void ST_drawTextHUD(void)
textHUDdraw(M_GetText("\x82""VIEWPOINT:""\x80 Switch view"))
donef12 = true;
}
textHUDdraw(M_GetText("You cannot move while hiding."))
if (gametyperules & GTR_HIDETIMEFROZEN)
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
return;
if (gametype == GT_CTF)
if (gametyperules & GTR_TEAMFLAGS)
p = bflagico;
else
p = bmatcico;
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;
else
p = rmatcico;
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;
{
INT32 i;