Minor adjustments in hopes that I fixed the resynch bomb on gametype switch?

This commit is contained in:
TehRealSalt 2018-02-08 17:13:06 -05:00
parent 56f1263f34
commit 85a81ed087
16 changed files with 79 additions and 77 deletions

View File

@ -4328,7 +4328,7 @@ static INT16 Consistancy(void)
}
// I give up
// Coop desynching enemies is painful
if (!G_PlatformGametype())
if (!G_RaceGametype())
ret += P_GetRandSeed();
#ifdef MOBJCONSISTANCY

View File

@ -2325,7 +2325,7 @@ static void Command_Suicide(void)
return;
}
/*if (!G_PlatformGametype()) // srb2kart: not necessary, suiciding makes you lose a balloon in battle, so it's not desirable to use as a way to escape a hit
/*if (!G_RaceGametype()) // srb2kart: not necessary, suiciding makes you lose a balloon in battle, so it's not desirable to use as a way to escape a hit
{
CONS_Printf(M_GetText("You may only use this in co-op, race, and competition!\n"));
return;
@ -2346,7 +2346,7 @@ static void Got_Suicide(UINT8 **cp, INT32 playernum)
INT32 suicideplayer = READINT32(*cp);
// You can't suicide someone else. Nice try, there.
if (suicideplayer != playernum) // srb2kart: "|| (!G_PlatformGametype())"
if (suicideplayer != playernum) // srb2kart: "|| (!G_RaceGametype())"
{
CONS_Alert(CONS_WARNING, M_GetText("Illegal suicide command received from %s\n"), player_names[playernum]);
if (server)
@ -4078,7 +4078,7 @@ void ItemFinder_OnChange(void)
static void PointLimit_OnChange(void)
{
// Don't allow pointlimit in Single Player/Co-Op/Race!
if (server && Playing() && G_PlatformGametype())
if (server && Playing() && G_RaceGametype())
{
if (cv_pointlimit.value)
CV_StealthSetValue(&cv_pointlimit, 0);
@ -4126,7 +4126,7 @@ UINT32 timelimitintics = 0;
static void TimeLimit_OnChange(void)
{
// Don't allow timelimit in Single Player/Co-Op/Race!
if (server && Playing() && cv_timelimit.value != 0 && G_PlatformGametype())
if (server && Playing() && cv_timelimit.value != 0 && G_RaceGametype())
{
CV_SetValue(&cv_timelimit, 0);
return;
@ -4229,7 +4229,7 @@ void D_GameTypeChanged(INT32 lastgametype)
// reset timelimit and pointlimit in race/coop, prevent stupid cheats
if (server)
{
if (G_PlatformGametype())
if (G_RaceGametype())
{
if (cv_timelimit.value)
CV_SetValue(&cv_timelimit, 0);

View File

@ -313,7 +313,6 @@ typedef enum
k_balloon, // Number of balloons left
k_comebackpoints, // Number of times you've bombed or gave an item to someone; once it's 3 it gets set back to 0 and you're given a balloon
k_comebackmode, // 0 = bomb, 1 = item
k_comebackshowninfo,// Have you already seen the info screen before?
NUMKARTSTUFF
} kartstufftype_t;

View File

@ -7425,8 +7425,7 @@ static const char *const KARTSTUFF_LIST[] = {
"BALLOON",
"COMEBACKPOINTS",
"COMEBACKMODE",
"COMEBACKSHOWNINFO"
"COMEBACKMODE"
};
static const char *const HUDITEMS_LIST[] = {

View File

@ -445,8 +445,9 @@ extern boolean franticitems;
extern boolean mirrormode;
extern boolean comeback;
extern tic_t curlap, bestlap;
extern boolean legitimateexit;
extern boolean comebackshowninfo;
extern tic_t curlap, bestlap;
extern INT16 votelevels[4];
extern INT8 votes[MAXPLAYERS];

View File

@ -241,22 +241,24 @@ INT16 scramblecount; //for CTF team scramble
INT32 cheats; //for multiplayer cheat commands
// SRB2Kart
// Cvars that we don't want changed mid-game
UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0-2 for relaxed, standard, & turbo
boolean mirrormode; // Mirror Mode currently enabled?
boolean franticitems; // Frantic items currently enabled?
boolean comeback; // Battle Mode's karma comeback is on/off
boolean legitimateexit; // Did this client actually finish the match? Calculated locally
tic_t curlap; // Current lap time, calculated locally
tic_t bestlap; // Best lap time, locally
INT16 randmapbuffer[NUMMAPS-4]; // Buffer for maps RandMap is allowed to roll
// Voting system
INT16 votelevels[4]; // Levels that were rolled by the host
INT8 votes[MAXPLAYERS]; // Each player's vote
INT8 pickedvote; // What vote the host rolls
// Client-sided variables (NEVER use in anything that needs to be synced with other players)
boolean legitimateexit; // Did this client actually finish the match?
boolean comebackshowninfo; // Have you already seen the "ATTACK OR PROTECT" message?
tic_t curlap; // Current lap time
tic_t bestlap; // Best lap time
static INT16 randmapbuffer[NUMMAPS-4]; // Buffer for maps RandMap is allowed to roll
tic_t hidetime;
// Grading
@ -1867,7 +1869,7 @@ boolean G_Responder(event_t *ev)
&& (players[consoleplayer].pflags & PF_TAGIT) != (players[displayplayer].pflags & PF_TAGIT))
continue;
}
else if (G_GametypeHasSpectators() && G_RingSlingerGametype())
else if (G_GametypeHasSpectators() && G_BattleGametype())
{
if (!players[consoleplayer].spectator)
continue;
@ -2358,7 +2360,6 @@ void G_PlayerReborn(INT32 player)
INT32 offroad;
INT32 balloon;
INT32 comebackpoints;
INT32 comebackshowninfo;
score = players[player].score;
lives = players[player].lives;
@ -2416,7 +2417,6 @@ void G_PlayerReborn(INT32 player)
offroad = players[player].kartstuff[k_offroad];
balloon = players[player].kartstuff[k_balloon];
comebackpoints = players[player].kartstuff[k_comebackpoints];
comebackshowninfo = players[player].kartstuff[k_comebackshowninfo];
p = &players[player];
memset(p, 0, sizeof (*p));
@ -2476,7 +2476,6 @@ void G_PlayerReborn(INT32 player)
p->kartstuff[k_balloon] = balloon;
p->kartstuff[k_comebackpoints] = comebackpoints;
p->kartstuff[k_comebackshowninfo] = comebackshowninfo;
p->kartstuff[k_comebacktimer] = comebacktime;
// Don't do anything immediately
@ -2988,9 +2987,10 @@ void G_ExitLevel(void)
//
boolean G_IsSpecialStage(INT32 mapnum)
{
#if 0
if (gametype == GT_COOP && modeattacking != ATTACKING_RECORD && mapnum >= sstage_start && mapnum <= sstage_end)
return true;
#endif
return false;
}
@ -3002,13 +3002,18 @@ boolean G_IsSpecialStage(INT32 mapnum)
//
boolean G_GametypeUsesLives(void)
{
// Coop, Competitive
// SRB2kart NEEDS no lives
#if 0
// Coop, Competitive
if ((gametype == GT_COOP || gametype == GT_COMPETITION)
&& !modeattacking // No lives in Time Attack
//&& !G_IsSpecialStage(gamemap)
&& !(maptol & TOL_NIGHTS)) // No lives in NiGHTS
return true;
return false;
#else
return false;
#endif
}
//
@ -3039,30 +3044,30 @@ boolean G_GametypeHasSpectators(void)
}
//
// G_RingSlingerGametype
// G_BattleGametype
//
// Returns true if the current gametype supports firing rings.
// ANY gametype can be a ringslinger gametype, just flick a switch.
// Returns true in Battle gamemodes, previously was G_RingSlingerGametype.
//
boolean G_RingSlingerGametype(void)
boolean G_BattleGametype(void)
{
return ((gametype != GT_COOP && gametype != GT_COMPETITION && gametype != GT_RACE) || (cv_ringslinger.value));
return (gametype == GT_MATCH);
}
//
// G_PlatformGametype
// G_RaceGametype
//
// Returns true if a gametype is a more traditional platforming-type.
// Returns true in racing gamemodes, previously was G_PlatformGametype.
//
boolean G_PlatformGametype(void)
boolean G_RaceGametype(void)
{
return (gametype == GT_COOP || gametype == GT_RACE || gametype == GT_COMPETITION);
return (gametype == GT_RACE); //(gametype == GT_COOP || gametype == GT_RACE || gametype == GT_COMPETITION);
}
//
// G_TagGametype
//
// For Jazz's Tag/HnS modes that have a lot of special cases..
// 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)
{
@ -3328,7 +3333,7 @@ static void G_DoCompleted(void)
void G_AfterIntermission(void)
{
HU_ClearCEcho();
G_NextLevel();
//G_NextLevel();
if (mapheaderinfo[gamemap-1]->cutscenenum && !modeattacking) // Start a custom cutscene.
F_StartCustomCutscene(mapheaderinfo[gamemap-1]->cutscenenum-1, false, false);
@ -3371,6 +3376,16 @@ static void G_DoWorldDone(void)
gameaction = ga_nothing;
}
//
// G_DoStartVote
//
static void G_DoStartVote(void)
{
if (server)
D_SetupVote();
gameaction = ga_nothing;
}
//
// G_UseContinue
//
@ -3427,16 +3442,6 @@ static void G_DoContinued(void)
gameaction = ga_nothing;
}
//
// G_DoStartVote
//
static void G_DoStartVote(void)
{
if (server)
D_SetupVote();
gameaction = ga_nothing;
}
//
// G_LoadGameSettings
//
@ -3995,6 +4000,7 @@ void G_InitNew(UINT8 pultmode, const char *mapname, boolean resetplayer, boolean
ultimatemode = false;
legitimateexit = false; // SRB2Kart
comebackshowninfo = false;
if (!demoplayback && !netgame) // Netgame sets random seed elsewhere, demo playback sets seed just before us!
P_SetRandSeed(M_RandomizedSeed()); // Use a more "Random" random seed

View File

@ -166,8 +166,8 @@ boolean G_IsSpecialStage(INT32 mapnum);
boolean G_GametypeUsesLives(void);
boolean G_GametypeHasTeams(void);
boolean G_GametypeHasSpectators(void);
boolean G_RingSlingerGametype(void);
boolean G_PlatformGametype(void);
boolean G_BattleGametype(void);
boolean G_RaceGametype(void);
boolean G_TagGametype(void);
void G_ExitLevel(void);
void G_NextLevel(void);

View File

@ -1486,8 +1486,8 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
else if (player->kartstuff[k_comebacktimer])
{
player->kartstuff[k_comebacktimer]--;
if (player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer] <= 0)
player->kartstuff[k_comebackshowninfo] = 1;
if (player == &players[consoleplayer] && player->kartstuff[k_balloon] <= 0 && player->kartstuff[k_comebacktimer] <= 0)
comebackshowninfo = true; // client has already seen the message
}
if (player->kartstuff[k_spinout] == 0 && player->kartstuff[k_spinouttimer] == 0 && player->powers[pw_flashing] == K_GetKartFlashing())
@ -5300,7 +5300,7 @@ static void K_drawBattleFullscreen(void)
ty += (BASEVIDHEIGHT/2);
}
if (!stplyr->kartstuff[k_comebackshowninfo])
if (!comebackshowninfo)
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, 0, kp_battleinfo, NULL);
else
V_DrawFixedPatch(x<<FRACBITS, y<<FRACBITS, scale, 0, kp_battlewait, NULL);

View File

@ -1920,17 +1920,17 @@ static int lib_gGametypeHasSpectators(lua_State *L)
return 1;
}
static int lib_gRingSlingerGametype(lua_State *L)
static int lib_gBattleGametype(lua_State *L)
{
//HUDSAFE
lua_pushboolean(L, G_RingSlingerGametype());
lua_pushboolean(L, G_BattleGametype());
return 1;
}
static int lib_gPlatformGametype(lua_State *L)
static int lib_gRaceGametype(lua_State *L)
{
//HUDSAFE
lua_pushboolean(L, G_PlatformGametype());
lua_pushboolean(L, G_RaceGametype());
return 1;
}
@ -2318,8 +2318,8 @@ static luaL_Reg lib[] = {
{"G_GametypeUsesLives",lib_gGametypeUsesLives},
{"G_GametypeHasTeams",lib_gGametypeHasTeams},
{"G_GametypeHasSpectators",lib_gGametypeHasSpectators},
{"G_RingSlingerGametype",lib_gRingSlingerGametype},
{"G_PlatformGametype",lib_gPlatformGametype},
{"G_BattleGametype",lib_gBattleGametype},
{"G_RaceGametype",lib_gRaceGametype},
{"G_TagGametype",lib_gTagGametype},
{"G_TicsToHours",lib_gTicsToHours},
{"G_TicsToMinutes",lib_gTicsToMinutes},

View File

@ -760,7 +760,7 @@ static int P_RecycleCompare(const void *p1, const void *p2)
player_t *player2 = &players[*(const UINT8 *)p2];
// Non-shooting gametypes
if (!G_PlatformGametype())
if (!G_RaceGametype())
{
// Invincibility.
if (player1->powers[pw_invulnerability] > player2->powers[pw_invulnerability]) return -1;

View File

@ -1574,7 +1574,7 @@ static void P_HitDeathMessages(player_t *player, mobj_t *inflictor, mobj_t *sour
char targetname[MAXPLAYERNAME+4];
char sourcename[MAXPLAYERNAME+4];
if (G_PlatformGametype())
if (G_RaceGametype())
return; // Not in coop, etc.
if (!player)
@ -1769,7 +1769,7 @@ void P_CheckTimeLimit(void)
if (!(multiplayer || netgame))
return;
if (G_PlatformGametype())
if (G_RaceGametype())
return;
if (leveltime < timelimitintics)
@ -1882,7 +1882,7 @@ void P_CheckPointLimit(void)
if (!(multiplayer || netgame))
return;
if (G_PlatformGametype())
if (G_RaceGametype())
return;
// pointlimit is nonzero, check if it's been reached by this player
@ -2716,7 +2716,7 @@ static inline boolean P_PlayerHitsPlayer(mobj_t *target, mobj_t *inflictor, mobj
// In COOP/RACE/CHAOS, you can't hurt other players unless cv_friendlyfire is on
// ...But in SRB2kart, you can!
//if (!cv_friendlyfire.value && (G_PlatformGametype()))
//if (!cv_friendlyfire.value && (G_RaceGametype()))
// return false;
// Tag handling
@ -3141,7 +3141,7 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
return false; // Invincible to fire objects
if (G_PlatformGametype() && source && source->player)
if (G_RaceGametype() && source && source->player)
return false; // Don't get hurt by fire generated from friends.
}

View File

@ -1560,7 +1560,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
else if (thing->player->kartstuff[k_startimer] && !tmthing->player->kartstuff[k_startimer])
P_DamageMobj(tmthing, thing, thing, 1);
if (G_RingSlingerGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
if (G_BattleGametype() && (!G_GametypeHasTeams() || tmthing->player->ctfteam != thing->player->ctfteam))
{
if ((tmthing->player->powers[pw_invulnerability] || tmthing->player->powers[pw_super])
&& !thing->player->powers[pw_super])

View File

@ -9510,10 +9510,7 @@ void P_SpawnPlayer(INT32 playernum)
p->spectator = false;
}
else if (netgame && p->jointime < 1)
{
//p->spectator = true;
p->kartstuff[k_comebackshowninfo] = 0;
}
/*p->spectator = true*/;
else if (multiplayer && !netgame)
{
// If you're in a team game and you don't have a team assigned yet...
@ -9968,7 +9965,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
return;
}
if (!G_RingSlingerGametype() || !cv_specialrings.value)
if (!G_BattleGametype() || !cv_specialrings.value)
if (P_WeaponOrPanel(i))
return; // Don't place weapons/panels in non-ringslinger modes
@ -10001,7 +9998,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
runemeraldmanager = true;
}
if (!G_PlatformGametype()) // No enemies in match or CTF modes
if (!G_RaceGametype()) // No enemies in match or CTF modes
if ((mobjinfo[i].flags & MF_ENEMY) || (mobjinfo[i].flags & MF_BOSS))
return;
@ -10056,7 +10053,7 @@ void P_SpawnMapThing(mapthing_t *mthing)
}
}
if (!G_PlatformGametype() && (i == MT_SIGN || i == MT_STARPOST))
if (!G_RaceGametype() && (i == MT_SIGN || i == MT_STARPOST))
return; // Don't spawn exit signs or starposts in wrong game modes
if (modeattacking) // Record Attack special stuff

View File

@ -2810,7 +2810,7 @@ boolean P_SetupLevel(boolean skipprecip)
// Start players with pity shields if possible
players[i].pity = -1;
if (!G_PlatformGametype())
if (!G_RaceGametype())
{
players[i].mo = NULL;
G_DoReborn(i);

View File

@ -3311,7 +3311,7 @@ static void P_DoFiring(player_t *player, ticcmd_t *cmd) // SRB2kart - unused.
P_SpawnPlayerMissile(player->mo, MT_FIREBALL, 0);
S_StartSound(player->mo, sfx_mario7);
}
else if (G_RingSlingerGametype() && (!G_TagGametype() || player->pflags & PF_TAGIT)
else if (G_BattleGametype() && (!G_TagGametype() || player->pflags & PF_TAGIT)
&& !player->weapondelay && !player->climbing
&& !(player->pflags & PF_ATTACKDOWN))
{
@ -7786,7 +7786,7 @@ void P_NukeEnemies(mobj_t *inflictor, mobj_t *source, fixed_t radius)
if (mo->flags & MF_MONITOR)
continue; // Monitors cannot be 'nuked'.
//if (!G_RingSlingerGametype() && mo->type == MT_PLAYER)
//if (!G_BattleGametype() && mo->type == MT_PLAYER)
// continue; // Don't hurt players in Co-Op!
if (abs(inflictor->x - mo->x) > radius || abs(inflictor->y - mo->y) > radius || abs(inflictor->z - mo->z) > radius)
@ -8016,7 +8016,7 @@ static void P_DeathThink(player_t *player)
}
// Force respawn if idle for more than 30 seconds in shooter modes.
if (player->deadtimer > 30*TICRATE && !G_PlatformGametype())
if (player->deadtimer > 30*TICRATE && !G_RaceGametype())
player->playerstate = PST_REBORN;
else if (player->lives > 0 && !G_IsSpecialStage(gamemap) && leveltime >= 140) // Don't allow "click to respawn" in special stages!
{

View File

@ -177,7 +177,7 @@ hudinfo_t hudinfo[NUMHUDITEMS] =
boolean ST_SameTeam(player_t *a, player_t *b)
{
// Just pipe team messages to everyone in co-op or race.
if (!G_RingSlingerGametype())
if (!G_BattleGametype())
return true;
// Spectator chat.
@ -1412,7 +1412,7 @@ static void ST_drawMatchHUD(void) // SRB2kart - unused.
{
INT32 offset = (BASEVIDWIDTH / 2) - (NUM_WEAPONS * 10);
if (!G_RingSlingerGametype())
if (!G_BattleGametype())
return;
if (G_TagGametype() && !(stplyr->pflags & PF_TAGIT))
@ -1850,7 +1850,7 @@ static void ST_overlayDrawer(void)
/* SRB2kart doesn't need this stuff, I think
// If you are in overtime, put a big honkin' flashin' message on the screen.
if (G_RingSlingerGametype() && cv_overtime.value
if (G_BattleGametype() && cv_overtime.value
&& (leveltime > (timelimitintics + TICRATE/2)) && cv_timelimit.value && (leveltime/TICRATE % 2 == 0))
{
if (splitscreen)
@ -1937,7 +1937,7 @@ static void ST_overlayDrawer(void)
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(116), 0, M_GetText("You cannot move while hiding."));
V_DrawCenteredString(BASEVIDWIDTH/2, STRINGY(132), 0, M_GetText("Press F12 to watch another player."));
}
/*else if (!G_PlatformGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
/*else if (!G_RaceGametype() && stplyr->playerstate == PST_DEAD && stplyr->lives) //Death overrides spectator text.
{
INT32 respawntime = cv_respawntime.value - stplyr->deadtimer/TICRATE;
if (respawntime > 0 && !stplyr->spectator)
@ -1980,7 +1980,7 @@ void ST_Drawer(void)
va("%s%s", G_GametypeHasTeams() ? ((seenplayer->ctfteam == 1) ? "\x85" : "\x84") : "", player_names[seenplayer-players]));
else //if (cv_seenames.value == 3)
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT/2 + 15, V_HUDTRANSHALF,
va("%s%s", !G_RingSlingerGametype() || (G_GametypeHasTeams() && players[consoleplayer].ctfteam == seenplayer->ctfteam)
va("%s%s", !G_BattleGametype() || (G_GametypeHasTeams() && players[consoleplayer].ctfteam == seenplayer->ctfteam)
? "\x83" : "\x85", player_names[seenplayer-players]));
}
#endif