mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Prison bonus time: fix a shitton of bad math
This commit is contained in:
parent
119f309cb8
commit
bcf59845e3
1 changed files with 15 additions and 5 deletions
|
|
@ -1126,22 +1126,24 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||||
{
|
{
|
||||||
UINT16 bonustime = 10*TICRATE;
|
UINT16 bonustime = 10*TICRATE;
|
||||||
INT16 clamptime = 0; // Don't allow reserve time past this value (by much)...
|
INT16 clamptime = 0; // Don't allow reserve time past this value (by much)...
|
||||||
INT16 mintime = 2*TICRATE; // But give SOME reward for every hit.
|
INT16 mintime = 5*TICRATE; // But give SOME reward for every hit. (This value used for Normal)
|
||||||
|
|
||||||
if (grandprixinfo.gp)
|
if (grandprixinfo.gp)
|
||||||
{
|
{
|
||||||
if (grandprixinfo.masterbots)
|
if (grandprixinfo.masterbots)
|
||||||
{
|
{
|
||||||
clamptime = 8*TICRATE;
|
clamptime = 10*TICRATE;
|
||||||
mintime = 1*TICRATE;
|
mintime = 1*TICRATE;
|
||||||
}
|
}
|
||||||
else if (grandprixinfo.gamespeed == KARTSPEED_HARD)
|
else if (grandprixinfo.gamespeed == KARTSPEED_HARD)
|
||||||
{
|
{
|
||||||
clamptime = 12*TICRATE;
|
clamptime = 15*TICRATE;
|
||||||
|
mintime = 2*TICRATE;
|
||||||
}
|
}
|
||||||
else if (grandprixinfo.gamespeed == KARTSPEED_NORMAL)
|
else if (grandprixinfo.gamespeed == KARTSPEED_NORMAL)
|
||||||
{
|
{
|
||||||
clamptime = 15*TICRATE;
|
clamptime = 20*TICRATE;
|
||||||
|
mintime = 5*TICRATE;
|
||||||
}
|
}
|
||||||
else if (grandprixinfo.gamespeed == KARTSPEED_EASY)
|
else if (grandprixinfo.gamespeed == KARTSPEED_EASY)
|
||||||
{
|
{
|
||||||
|
|
@ -1151,8 +1153,16 @@ static void P_AddBrokenPrison(mobj_t *target, mobj_t *inflictor, mobj_t *source)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
UINT16 effectivetime = timelimitintics + extratimeintics - leveltime + starttime;
|
||||||
|
|
||||||
if (clamptime) // Lower bonus if you have more reserve, keep it tense.
|
if (clamptime) // Lower bonus if you have more reserve, keep it tense.
|
||||||
bonustime = Easing_InOutSine(min(FRACUNIT, (timelimitintics - leveltime + starttime) * FRACUNIT / clamptime), clamptime, mintime);
|
{
|
||||||
|
bonustime = Easing_InOutSine(min(FRACUNIT, (effectivetime) * FRACUNIT / clamptime), bonustime, mintime);
|
||||||
|
|
||||||
|
// Quicker rolloff if you're stacking time substantially past clamptime
|
||||||
|
if ((effectivetime + bonustime) > clamptime)
|
||||||
|
bonustime = Easing_InSine(min(FRACUNIT, (effectivetime + bonustime - clamptime) * FRACUNIT / clamptime), bonustime, 1);
|
||||||
|
}
|
||||||
|
|
||||||
extratimeintics += bonustime;
|
extratimeintics += bonustime;
|
||||||
secretextratime = TICRATE/2;
|
secretextratime = TICRATE/2;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue