Merge branch 'battle-tweak' into 'master'

Battle tweaks

See merge request KartKrew/Kart!517
This commit is contained in:
James R 2022-01-06 06:35:28 +00:00
commit 37b2d81788
4 changed files with 32 additions and 10 deletions

View file

@ -261,7 +261,7 @@ INT32 stealtime = TICRATE/2;
INT32 sneakertime = TICRATE + (TICRATE/3);
INT32 itemtime = 8*TICRATE;
INT32 bubbletime = TICRATE/2;
INT32 comebacktime = 10*TICRATE;
INT32 comebacktime = 3*TICRATE;
INT32 bumptime = 6;
INT32 greasetics = 3*TICRATE;
INT32 wipeoutslowtime = 20;

View file

@ -469,16 +469,15 @@ void K_RunPaperItemSpawners(void)
firstUnspawnedEmerald
);
}
else if (P_RandomChance(FRACUNIT/3))
else
{
drop = K_SpawnSphereBox(
spotList[r]->x, spotList[r]->y, spotList[r]->z + (128 * mapobjectscale * flip),
FixedAngle(P_RandomRange(0, 359) * FRACUNIT), flip,
10
);
}
else
{
K_FlipFromObject(drop, spotList[r]);
drop = K_CreatePaperItem(
spotList[r]->x, spotList[r]->y, spotList[r]->z + (128 * mapobjectscale * flip),
FixedAngle(P_RandomRange(0, 359) * FRACUNIT), flip,

View file

@ -1721,6 +1721,7 @@ static void K_UpdateDraft(player_t *player)
{
fixed_t topspd = K_GetKartSpeed(player, false);
fixed_t draftdistance;
fixed_t minDist;
UINT8 leniency;
UINT8 i;
@ -1740,6 +1741,13 @@ static void K_UpdateDraft(player_t *player)
draftdistance = FixedMul(draftdistance, K_GetKartGameSpeedScalar(gamespeed));
}
minDist = 640 * player->mo->scale;
if (gametype == GT_BATTLE)
{
// TODO: gametyperules
minDist /= 4;
}
// On the contrary, the leniency period biases toward high weight.
// (See also: the leniency variable in K_SpawnDraftDust)
leniency = (3*TICRATE)/4 + ((player->kartweight-1) * (TICRATE/4));
@ -1798,7 +1806,7 @@ static void K_UpdateDraft(player_t *player)
#ifndef EASYDRAFTTEST
// TOO close to draft.
if (dist < FixedMul(RING_DIST>>1, player->mo->scale))
if (dist < minDist)
continue;
// Not close enough to draft.
@ -2866,6 +2874,13 @@ static void K_GetKartBoostPower(player_t *player)
{
// 30% - 44%, each point of speed adds 1.75%
fixed_t draftspeed = ((3*FRACUNIT)/10) + ((player->kartspeed-1) * ((7*FRACUNIT)/400));
if (gametype == GT_BATTLE)
{
// TODO: gametyperules
draftspeed *= 2;
}
speedboost += FixedMul(draftspeed, player->draftpower); // (Drafting suffers no boost stack penalty.)
numboosts++;
}
@ -2962,11 +2977,18 @@ UINT16 K_GetKartFlashing(player_t *player)
{
UINT16 tics = flashingtics;
if (!player)
if (gametype == GT_BATTLE)
{
// TODO: gametyperules
return 1;
}
if (player == NULL)
{
return tics;
}
tics += (tics/8) * (player->kartspeed);
return tics;
}
@ -3459,13 +3481,14 @@ void K_HandleBumperChanges(player_t *player, UINT8 prevBumpers)
karmahitbox->destscale = player->mo->destscale;
P_SetScale(karmahitbox, player->mo->scale);
player->karmadelay = comebacktime;
if (netgame)
{
CONS_Printf(M_GetText("%s lost all of their bumpers!\n"), player_names[player-players]);
}
}
player->karmadelay = comebacktime;
K_CalculateBattleWanted();
K_CheckBumpers();
}

View file

@ -4553,7 +4553,7 @@ void P_PlayerThink(player_t *player)
|| (player->pflags & PF_NOCONTEST) // NO CONTEST explosion
|| ((gametyperules & GTR_BUMPERS) && player->bumpers <= 0 && player->karmadelay)))
{
if (player->flashing > 0 && player->flashing < K_GetKartFlashing(player)
if (player->flashing > 1 && player->flashing < K_GetKartFlashing(player)
&& (leveltime & 1))
player->mo->renderflags |= RF_DONTDRAW;
else