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)
This commit is contained in:
TehRealSalt 2018-02-13 18:13:27 -05:00
parent 1a424ba756
commit 9c5a09d770
5 changed files with 40 additions and 19 deletions

View file

@ -2279,7 +2279,7 @@ static inline void G_PlayerFinishLevel(INT32 player)
// SRB2kart: Increment the "matches played" counter. // SRB2kart: Increment the "matches played" counter.
if (player == consoleplayer) 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++; matchesplayed++;
if (M_UpdateUnlockablesAndExtraEmblems()) if (M_UpdateUnlockablesAndExtraEmblems())

View file

@ -1470,9 +1470,9 @@ state_t states[NUMSTATES] =
{SPR_NULL, 0, 2*TICRATE, {NULL}, 0, 0, S_FLAMEJETSTART}, // S_FLAMEJETSTND {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, 3*TICRATE, {A_ToggleFlameJet}, 0, 0, S_FLAMEJETSTOP}, // S_FLAMEJETSTART
{SPR_NULL, 0, 1, {A_ToggleFlameJet}, 0, 0, S_FLAMEJETSTND}, // S_FLAMEJETSTOP {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_FULLBRIGHT|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_FULLBRIGHT|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_TRANS70|2, 11, {NULL}, 0, 0, S_NULL}, // S_FLAMEJETFLAME3
// Spinning flame jets // Spinning flame jets
// A: Counter-clockwise // A: Counter-clockwise

View file

@ -1452,13 +1452,14 @@ static menuitem_t OP_ServerOptionsMenu[] =
#endif #endif
{IT_STRING | IT_CVAR, NULL, "Intermission Timer", &cv_inttime, 80}, {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 #ifndef NONET
{IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 110}, {IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 120},
{IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 120}, {IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 130},
{IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 130}, {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 140},
{IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 140}, {IT_STRING | IT_CVAR, NULL, "Attempts to Resynch", &cv_resynchattempts, 150},
#endif #endif
}; };

View file

@ -546,7 +546,7 @@ void M_SaveConfig(const char *filename)
#if NUMSCREENS > 2 #if NUMSCREENS > 2
static const char *Newsnapshotfile(const char *pathname, const char *ext) 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 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 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 int result; // -1 = guess too high, 0 = correct, 1 = guess too low
@ -1390,7 +1390,7 @@ void M_ScreenShot(void)
} }
/** Takes a screenshot. /** 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 * rendermode) where xxxx is the lowest four-digit number for which a file
* does not already exist. * does not already exist.
* *

View file

@ -182,6 +182,8 @@ typedef struct
UINT8 ranim; UINT8 ranim;
UINT8 rtics; UINT8 rtics;
UINT8 roffset; UINT8 roffset;
UINT8 rsynctime;
UINT8 rendoff;
} y_voteclient; } y_voteclient;
static y_votelvlinfo levelinfo[4]; static y_votelvlinfo levelinfo[4];
@ -2272,7 +2274,7 @@ void Y_VoteTicker(void)
D_PickVote(); D_PickVote();
if (!votetic) if (!votetic)
S_ChangeMusicInternal("racent", true); S_ChangeMusicInternal("vote", true);
if (timer) if (timer)
timer--; timer--;
@ -2283,6 +2285,7 @@ void Y_VoteTicker(void)
if (pickedvote != -1) if (pickedvote != -1)
{ {
timer = 0; timer = 0;
voteclient.rsynctime++;
if (voteendtic == -1) if (voteendtic == -1)
{ {
@ -2302,16 +2305,29 @@ void Y_VoteTicker(void)
if (voteclient.rtics <= 0) if (voteclient.rtics <= 0)
{ {
voteclient.roffset++; voteclient.roffset++;
voteclient.rtics = min(TICRATE/2, (voteclient.roffset/3)+1); voteclient.rtics = min(TICRATE/2, (voteclient.roffset/2)+5);
S_StartSound(NULL, sfx_s3k5b); 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); if (voteclient.rendoff == 0)
S_StartSound(NULL, sfx_s3k63); {
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 else
@ -2349,7 +2365,7 @@ void Y_VoteTicker(void)
if (pressed) if (pressed)
{ {
S_StartSound(NULL, sfx_s3k5b); S_StartSound(NULL, sfx_kc4a);
voteclient.delay = NEWTICRATE/7; voteclient.delay = NEWTICRATE/7;
} }
@ -2413,6 +2429,8 @@ void Y_StartVote(void)
voteclient.ranim = 0; voteclient.ranim = 0;
voteclient.rtics = 1; voteclient.rtics = 1;
voteclient.roffset = 0; voteclient.roffset = 0;
voteclient.rsynctime = 0;
voteclient.rendoff = 0;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
votes[i] = -1; votes[i] = -1;
@ -2495,4 +2513,6 @@ void Y_SetupVoteFinish(INT8 pick, INT8 level)
pickedvote = pick; pickedvote = pick;
nextmap = votelevels[level]; nextmap = votelevels[level];
timer = 0; timer = 0;
S_ChangeMusicInternal("voteea", true);
// TODO: Just end the vote here if there's only 1 player
} }