diff --git a/src/deh_soc.c b/src/deh_soc.c index 0d21c7a76..49a8607c8 100644 --- a/src/deh_soc.c +++ b/src/deh_soc.c @@ -2577,8 +2577,8 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) else if (fastcmp(params[0], "PLAYTIME")) { PARAMCHECK(1); - ty = UC_PLAYTIME + offset; - re = atoi(params[1]); + ty = UC_PLAYTIME; + re = get_number(params[1]); } else if (fastcmp(params[0], "ROUNDSPLAYED")) { @@ -2624,6 +2624,12 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) return; } } + else if (fastcmp(params[0], "TOTALTUMBLETIME")) + { + PARAMCHECK(1); + ty = UC_TOTALTUMBLETIME; + re = get_number(params[1]); + } else if (fastcmp(params[0], "GAMECLEAR")) { ty = UC_GAMECLEAR; @@ -2633,7 +2639,7 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) { PARAMCHECK(1); ty = UC_OVERALLTIME; - re = atoi(params[1]); + re = get_number(params[1]); } else if ((offset=0) || fastcmp(params[0], "MAPVISITED") || (++offset && fastcmp(params[0], "MAPBEATEN")) @@ -2655,7 +2661,7 @@ static void readcondition(UINT16 set, UINT32 id, char *word2) { PARAMCHECK(2); ty = UC_MAPTIME; - re = atoi(params[2]); + re = get_number(params[2]); x1 = G_MapNumber(params[1]); if (x1 >= nummapheaders) diff --git a/src/k_kart.c b/src/k_kart.c index 688f96471..182e0a7cb 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7658,6 +7658,14 @@ void K_KartPlayerHUDUpdate(player_t *player) } else player->karthud[khud_finish] = 0; + + if (demo.playback == false && P_IsLocalPlayer(player) == true) + { + if (player->tumbleBounces != 0 && gamedata->totaltumbletime != UINT32_MAX) + { + gamedata->totaltumbletime++; + } + } } #undef RINGANIM_DELAYMAX diff --git a/src/m_cond.c b/src/m_cond.c index 095b44598..c69e1a460 100644 --- a/src/m_cond.c +++ b/src/m_cond.c @@ -649,6 +649,7 @@ void M_ClearStats(void) UINT8 i; gamedata->totalplaytime = 0; gamedata->totalrings = 0; + gamedata->totaltumbletime = 0; for (i = 0; i < GDGT_MAX; ++i) gamedata->roundsplayed[i] = 0; gamedata->timesBeaten = 0; @@ -1286,6 +1287,8 @@ boolean M_CheckCondition(condition_t *cn, player_t *player) } case UC_TOTALRINGS: // Requires grabbing >= x rings return (gamedata->totalrings >= (unsigned)cn->requirement); + case UC_TOTALTUMBLETIME: // Requires total tumbling time >= x + return (gamedata->totaltumbletime >= (unsigned)cn->requirement); case UC_GAMECLEAR: // Requires game beaten >= x times return (gamedata->timesBeaten >= (unsigned)cn->requirement); case UC_OVERALLTIME: // Requires overall time <= x @@ -1918,14 +1921,12 @@ static const char *M_GetConditionString(condition_t *cn) switch (cn->type) { case UC_PLAYTIME: // Requires total playing time >= x - return va("play for %i:%02i:%02i", G_TicsToHours(cn->requirement), G_TicsToMinutes(cn->requirement, false), G_TicsToSeconds(cn->requirement)); case UC_ROUNDSPLAYED: // Requires any level completed >= x times - if (cn->extrainfo1 == GDGT_MAX) work = ""; else if (cn->extrainfo1 != GDGT_RACE && cn->extrainfo1 != GDGT_BATTLE // Base gametypes @@ -1963,6 +1964,11 @@ static const char *M_GetConditionString(condition_t *cn) return va("collect %u,%03u Rings", (cn->requirement/1000), (cn->requirement%1000)); return va("collect %u Rings", cn->requirement); + case UC_TOTALTUMBLETIME: + return va("tumble through the air for %i:%02i", + G_TicsToMinutes(cn->requirement, true), + G_TicsToSeconds(cn->requirement)); + case UC_GAMECLEAR: // Requires game beaten >= x times if (cn->requirement > 1) return va("beat game %d times", cn->requirement); diff --git a/src/m_cond.h b/src/m_cond.h index 7b9a9e3ec..1f747f263 100644 --- a/src/m_cond.h +++ b/src/m_cond.h @@ -33,6 +33,7 @@ typedef enum UC_PLAYTIME, // PLAYTIME [tics] UC_ROUNDSPLAYED, // ROUNDSPLAYED [x played] UC_TOTALRINGS, // TOTALRINGS [x collected] + UC_TOTALTUMBLETIME, // TOTALTUMBLETIME [tics] UC_GAMECLEAR, // GAMECLEAR UC_OVERALLTIME, // OVERALLTIME [time to beat, tics] @@ -344,6 +345,7 @@ struct gamedata_t UINT32 totalplaytime; UINT32 roundsplayed[GDGT_MAX]; UINT32 totalrings; + UINT32 totaltumbletime; // Chao Key condition bypass UINT32 pendingkeyrounds;