Merge branch 'prison-difficulty' into 'master'

Prison difficulty modes

See merge request KartKrew/Kart!1583
This commit is contained in:
Oni 2023-10-29 06:07:42 +00:00
commit 8557a7250f
4 changed files with 36 additions and 3 deletions

View file

@ -802,7 +802,7 @@ consvar_t cv_kartdebugwaypoints = OnlineCheat("debugwaypoints", "Off").values({{
extern CV_PossibleValue_t numlaps_cons_t[]; extern CV_PossibleValue_t numlaps_cons_t[];
void NumLaps_OnChange(void); void NumLaps_OnChange(void);
consvar_t cv_numlaps = OnlineCheat("numlaps", "Map default").values(numlaps_cons_t).onchange(NumLaps_OnChange).save().description("Race maps always have the same number of laps"); consvar_t cv_numlaps = OnlineCheat("numlaps", "Map default").values(numlaps_cons_t).onchange(NumLaps_OnChange).description("Race maps always have the same number of laps");
consvar_t cv_restrictskinchange = OnlineCheat("restrictskinchange", "Yes").yes_no().description("Don't let players change their skin in the middle of gameplay"); consvar_t cv_restrictskinchange = OnlineCheat("restrictskinchange", "Yes").yes_no().description("Don't let players change their skin in the middle of gameplay");
consvar_t cv_spbtest = OnlineCheat("spbtest", "Off").on_off().description("SPB can never target a player"); consvar_t cv_spbtest = OnlineCheat("spbtest", "Off").on_off().description("SPB can never target a player");

View file

@ -40,7 +40,23 @@ UINT8 numtargets = 0; // Capsules busted
INT32 K_StartingBumperCount(void) INT32 K_StartingBumperCount(void)
{ {
if (battleprisons) if (battleprisons)
return 0; // always 1 hit in Prison Break {
if (grandprixinfo.gp)
{
switch (grandprixinfo.gamespeed)
{
case KARTSPEED_HARD:
return (grandprixinfo.masterbots == true) ? 0 : 1;
case KARTSPEED_NORMAL:
return 2;
case KARTSPEED_EASY:
return 3;
}
}
return 2; // Normal
}
return cv_kartbumpers.value; return cv_kartbumpers.value;
} }

View file

@ -12445,6 +12445,13 @@ tic_t K_TimeLimitForGametype(void)
{ {
if (battleprisons) if (battleprisons)
{ {
if (grandprixinfo.gp)
{
if (grandprixinfo.masterbots)
return 15*TICRATE;
else if (grandprixinfo.gamespeed == KARTSPEED_EASY)
return 30*TICRATE;
}
return 20*TICRATE; return 20*TICRATE;
} }

View file

@ -1082,7 +1082,17 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
S_StartSound(NULL, sfx_s221); S_StartSound(NULL, sfx_s221);
if (timelimitintics) if (timelimitintics)
{ {
extratimeintics += 10*TICRATE; UINT16 bonustime = 10*TICRATE;
if (grandprixinfo.gp)
{
if (grandprixinfo.masterbots)
bonustime = 8*TICRATE;
else if (grandprixinfo.gamespeed == KARTSPEED_EASY)
bonustime = 15*TICRATE;
}
extratimeintics += bonustime;
secretextratime = TICRATE/2; secretextratime = TICRATE/2;
} }