Scale Prison bonus time to remaining time and difficulty

This commit is contained in:
AJ Martinez 2023-11-26 15:34:11 -07:00
parent 6666f6d024
commit 119f309cb8
2 changed files with 25 additions and 5 deletions

View file

@ -13042,9 +13042,7 @@ tic_t K_TimeLimitForGametype(void)
{
if (grandprixinfo.gp)
{
if (grandprixinfo.masterbots)
return 15*TICRATE;
else if (grandprixinfo.gamespeed == KARTSPEED_EASY)
if (grandprixinfo.gamespeed == KARTSPEED_EASY)
return 30*TICRATE;
}
return 20*TICRATE;

View file

@ -44,6 +44,8 @@
#include "acs/interface.h"
#include "k_powerup.h"
#include "k_collide.h"
#include "m_easing.h"
// CTF player names
#define CTFTEAMCODE(pl) pl->ctfteam ? (pl->ctfteam == 1 ? "\x85" : "\x84") : ""
@ -1123,15 +1125,35 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
if (timelimitintics)
{
UINT16 bonustime = 10*TICRATE;
INT16 clamptime = 0; // Don't allow reserve time past this value (by much)...
INT16 mintime = 2*TICRATE; // But give SOME reward for every hit.
if (grandprixinfo.gp)
{
if (grandprixinfo.masterbots)
bonustime = 8*TICRATE;
{
clamptime = 8*TICRATE;
mintime = 1*TICRATE;
}
else if (grandprixinfo.gamespeed == KARTSPEED_HARD)
{
clamptime = 12*TICRATE;
}
else if (grandprixinfo.gamespeed == KARTSPEED_NORMAL)
{
clamptime = 15*TICRATE;
}
else if (grandprixinfo.gamespeed == KARTSPEED_EASY)
bonustime = 15*TICRATE;
{
// "I think Easy Mode should be about Trying Not To Kill Your Self" -VelocitOni
clamptime = 45*TICRATE;
mintime = 20*TICRATE;
}
}
if (clamptime) // Lower bonus if you have more reserve, keep it tense.
bonustime = Easing_InOutSine(min(FRACUNIT, (timelimitintics - leveltime + starttime) * FRACUNIT / clamptime), clamptime, mintime);
extratimeintics += bonustime;
secretextratime = TICRATE/2;
}