mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Reduce multihit/staggered Amp gains
This commit is contained in:
parent
751934250c
commit
7b99637d9f
4 changed files with 27 additions and 0 deletions
|
|
@ -1131,6 +1131,7 @@ struct player_t
|
|||
UINT32 lastringboost; // What was our accumulated boost when locking the award?
|
||||
|
||||
UINT8 amps;
|
||||
UINT8 recentamps;
|
||||
UINT8 amppickup;
|
||||
UINT8 ampspending;
|
||||
|
||||
|
|
|
|||
20
src/k_kart.c
20
src/k_kart.c
|
|
@ -4430,6 +4430,22 @@ void K_SpawnAmps(player_t *player, UINT8 amps, mobj_t *impact)
|
|||
// FixedMul(scaledamps<<FRACBITS, itemdistmult)>>FRACBITS);
|
||||
scaledamps = FixedMul(scaledamps<<FRACBITS, itemdistmult)>>FRACBITS;
|
||||
|
||||
//CONS_Printf("SA=%d ", scaledamps);
|
||||
|
||||
// Arbitrary tuning constants.
|
||||
// Reduce amp payouts by 1/40th for each 2 amps obtained recently
|
||||
UINT8 num = 40;
|
||||
UINT8 div = 40;
|
||||
UINT8 reduction = min(30, player->recentamps);
|
||||
|
||||
num -= reduction;
|
||||
|
||||
//CONS_Printf("N=%d D=%d RA=%d ", num, div, player->recentamps);
|
||||
|
||||
scaledamps = num * scaledamps / div;
|
||||
|
||||
//CONS_Printf("SA2=%d\n", scaledamps);
|
||||
|
||||
/*
|
||||
if (player->position <= 1)
|
||||
scaledamps /= 2;
|
||||
|
|
@ -4446,6 +4462,7 @@ void K_SpawnAmps(player_t *player, UINT8 amps, mobj_t *impact)
|
|||
pickup->color = player->skincolor;
|
||||
P_SetTarget(&pickup->target, player->mo);
|
||||
player->ampspending++;
|
||||
player->recentamps++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -10608,6 +10625,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
}
|
||||
}
|
||||
|
||||
if (player->recentamps && (leveltime%TICRATE == 0))
|
||||
player->recentamps--;
|
||||
|
||||
if (player->invincibilitytimer && (player->ignoreAirtimeLeniency > 0 || onground == true || K_PowerUpRemaining(player, POWERUP_SMONITOR)))
|
||||
{
|
||||
player->invincibilitytimer--;
|
||||
|
|
|
|||
|
|
@ -295,6 +295,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->lastringboost);
|
||||
else if (fastcmp(field,"amps"))
|
||||
lua_pushinteger(L, plr->amps);
|
||||
else if (fastcmp(field,"recentamps"))
|
||||
lua_pushinteger(L, plr->recentamps);
|
||||
else if (fastcmp(field,"amppickup"))
|
||||
lua_pushinteger(L, plr->amppickup);
|
||||
else if (fastcmp(field,"ampspending"))
|
||||
|
|
@ -958,6 +960,8 @@ static int player_set(lua_State *L)
|
|||
plr->lastringboost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"amps"))
|
||||
plr->amps = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"recentamps"))
|
||||
plr->recentamps = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"amppickup"))
|
||||
plr->amppickup = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"ampspending"))
|
||||
|
|
|
|||
|
|
@ -708,6 +708,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT32(save->p, players[i].lastringboost);
|
||||
|
||||
WRITEUINT8(save->p, players[i].amps);
|
||||
WRITEUINT8(save->p, players[i].recentamps);
|
||||
WRITEUINT8(save->p, players[i].amppickup);
|
||||
WRITEUINT8(save->p, players[i].ampspending);
|
||||
|
||||
|
|
@ -1383,6 +1384,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].lastringboost = READUINT32(save->p);
|
||||
|
||||
players[i].amps =READUINT8(save->p);
|
||||
players[i].recentamps =READUINT8(save->p);
|
||||
players[i].amppickup =READUINT8(save->p);
|
||||
players[i].ampspending =READUINT8(save->p);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue