From 581e231a3edc3935ed1cce8053fd52177e755024 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Tue, 13 Feb 2018 18:13:27 -0500 Subject: [PATCH] sonicitems porting, Part 2 BUT with more tweaks on top of that: - matchesplayed can go up & unlock stuff regardless of modifiedgame - votetime added to menu - flame jets are fullbright (been meaning to do this for a while) - screenshots are prefixed with kart instead of srb2 (ditto) --- src/g_game.c | 2 +- src/info.c | 6 +++--- src/m_menu.c | 11 ++++++----- src/m_misc.c | 4 ++-- src/y_inter.c | 36 ++++++++++++++++++++++++++++-------- 5 files changed, 40 insertions(+), 19 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index feeacb96..7582006b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2279,7 +2279,7 @@ static inline void G_PlayerFinishLevel(INT32 player) // SRB2kart: Increment the "matches played" counter. if (player == consoleplayer) { - if (legitimateexit && ((!modifiedgame || savemoddata) && !demoplayback)) + if (legitimateexit && !demoplayback) // (yes you're allowed to unlock stuff this way when the game is modified) { matchesplayed++; if (M_UpdateUnlockablesAndExtraEmblems()) diff --git a/src/info.c b/src/info.c index 2b38bada..7d1a9bb0 100644 --- a/src/info.c +++ b/src/info.c @@ -1470,9 +1470,9 @@ state_t states[NUMSTATES] = {SPR_NULL, 0, 2*TICRATE, {NULL}, 0, 0, S_FLAMEJETSTART}, // S_FLAMEJETSTND {SPR_NULL, 0, 3*TICRATE, {A_ToggleFlameJet}, 0, 0, S_FLAMEJETSTOP}, // S_FLAMEJETSTART {SPR_NULL, 0, 1, {A_ToggleFlameJet}, 0, 0, S_FLAMEJETSTND}, // S_FLAMEJETSTOP - {SPR_FLME, FF_TRANS50 , 4, {NULL}, 0, 0, S_FLAMEJETFLAME2}, // S_FLAMEJETFLAME1 - {SPR_FLME, FF_TRANS60|1, 5, {NULL}, 0, 0, S_FLAMEJETFLAME3}, // S_FLAMEJETFLAME2 - {SPR_FLME, FF_TRANS70|2, 11, {NULL}, 0, 0, S_NULL}, // S_FLAMEJETFLAME3 + {SPR_FLME, FF_FULLBRIGHT|FF_TRANS50 , 4, {NULL}, 0, 0, S_FLAMEJETFLAME2}, // S_FLAMEJETFLAME1 + {SPR_FLME, FF_FULLBRIGHT|FF_TRANS60|1, 5, {NULL}, 0, 0, S_FLAMEJETFLAME3}, // S_FLAMEJETFLAME2 + {SPR_FLME, FF_FULLBRIGHT|FF_TRANS70|2, 11, {NULL}, 0, 0, S_NULL}, // S_FLAMEJETFLAME3 // Spinning flame jets // A: Counter-clockwise diff --git a/src/m_menu.c b/src/m_menu.c index ad7c371c..95086d4d 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1452,13 +1452,14 @@ static menuitem_t OP_ServerOptionsMenu[] = #endif {IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 80}, - {IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 90}, + {IT_STRING | IT_CVAR, NULL, "Voting Timer", &cv_votetime, 90}, + {IT_STRING | IT_CVAR, NULL, "Advance to next map", &cv_advancemap, 100}, #ifndef NONET - {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 110}, - {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 120}, - {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 130}, - {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 140}, + {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 120}, + {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 130}, + {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 140}, + {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 150}, #endif }; diff --git a/src/m_misc.c b/src/m_misc.c index 74ba8b31..0d0be0f6 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -546,7 +546,7 @@ void M_SaveConfig(const char *filename) #if NUMSCREENS > 2 static const char *Newsnapshotfile(const char *pathname, const char *ext) { - static char freename[13] = "srb2XXXX.ext"; + static char freename[13] = "kartXXXX.ext"; int i = 5000; // start in the middle: num screenshots divided by 2 int add = i; // how much to add or subtract if wrong; gets divided by 2 each time int result; // -1 = guess too high, 0 = correct, 1 = guess too low @@ -1390,7 +1390,7 @@ void M_ScreenShot(void) } /** Takes a screenshot. - * The screenshot is saved as "srb2xxxx.pcx" (or "srb2xxxx.tga" in hardware + * The screenshot is saved as "kartxxxx.pcx" (or "kartxxxx.tga" in hardware * rendermode) where xxxx is the lowest four-digit number for which a file * does not already exist. * diff --git a/src/y_inter.c b/src/y_inter.c index 4c75dfc2..e443e91f 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -182,6 +182,8 @@ typedef struct UINT8 ranim; UINT8 rtics; UINT8 roffset; + UINT8 rsynctime; + UINT8 rendoff; } y_voteclient; static y_votelvlinfo levelinfo[4]; @@ -2272,7 +2274,7 @@ void Y_VoteTicker(void) D_PickVote(); if (!votetic) - S_ChangeMusicInternal("racent", true); + S_ChangeMusicInternal("vote", true); if (timer) timer--; @@ -2283,6 +2285,7 @@ void Y_VoteTicker(void) if (pickedvote != -1) { timer = 0; + voteclient.rsynctime++; if (voteendtic == -1) { @@ -2302,16 +2305,29 @@ void Y_VoteTicker(void) if (voteclient.rtics <= 0) { voteclient.roffset++; - voteclient.rtics = min(TICRATE/2, (voteclient.roffset/3)+1); - S_StartSound(NULL, sfx_s3k5b); + voteclient.rtics = min(TICRATE/2, (voteclient.roffset/2)+5); + S_StartSound(NULL, sfx_kc39); } - voteclient.ranim = tempvotes[((pickedvote + voteclient.roffset) % numvotes)]; + if (voteclient.rendoff == 0 || voteclient.roffset < voteclient.rendoff) + voteclient.ranim = tempvotes[((pickedvote + voteclient.roffset) % numvotes)]; - if (voteclient.ranim == pickedvote && voteclient.roffset >= 30) + if (voteclient.roffset >= 24) { - voteendtic = votetic + (4*TICRATE); - S_StartSound(NULL, sfx_s3k63); + if (voteclient.rendoff == 0) + { + if (tempvotes[((pickedvote + voteclient.roffset + 4) % numvotes)] == pickedvote + && voteclient.rsynctime % (29*TICRATE/20) == 0) // Song is 1.45 seconds long (sorry @ whoever wants to replace it in a music wad :V) + { + voteclient.rendoff = voteclient.roffset+4; + S_ChangeMusicInternal("voteeb", false); + } + } + else if (voteclient.roffset >= voteclient.rendoff) + { + voteendtic = votetic + (3*TICRATE); + S_StartSound(NULL, sfx_kc48); + } } } else @@ -2349,7 +2365,7 @@ void Y_VoteTicker(void) if (pressed) { - S_StartSound(NULL, sfx_s3k5b); + S_StartSound(NULL, sfx_kc4a); voteclient.delay = NEWTICRATE/7; } @@ -2413,6 +2429,8 @@ void Y_StartVote(void) voteclient.ranim = 0; voteclient.rtics = 1; voteclient.roffset = 0; + voteclient.rsynctime = 0; + voteclient.rendoff = 0; for (i = 0; i < MAXPLAYERS; i++) votes[i] = -1; @@ -2495,4 +2513,6 @@ void Y_SetupVoteFinish(INT8 pick, INT8 level) pickedvote = pick; nextmap = votelevels[level]; timer = 0; + S_ChangeMusicInternal("voteea", true); + // TODO: Just end the vote here if there's only 1 player } \ No newline at end of file