mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-29 11:12:30 +00:00
WIP: Nerf bumper car bots
This commit is contained in:
parent
5dda483460
commit
3076e73c59
6 changed files with 27 additions and 0 deletions
|
|
@ -844,6 +844,8 @@ struct player_t
|
|||
UINT8 trickboost; // Trick boost. This one is weird and has variable speed. Dear god.
|
||||
UINT8 tricklock; // Input safety for 2.2 lenient tricks.
|
||||
|
||||
UINT8 bumpslow;
|
||||
|
||||
UINT8 dashRingPullTics; // Timer during which the player is pulled towards a dash ring
|
||||
UINT8 dashRingPushTics; // Timer during which the player displays effects and has no gravity after being thrust by a dash ring
|
||||
|
||||
|
|
|
|||
|
|
@ -806,6 +806,9 @@ fixed_t K_UpdateRubberband(player_t *player)
|
|||
// Ease into the new value.
|
||||
ret += (dest - player->botvars.rubberband) / 8;
|
||||
|
||||
if (player->bumpslow)
|
||||
ret = FRACUNIT/2; // Magic number!
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
|||
11
src/k_kart.c
11
src/k_kart.c
|
|
@ -9438,6 +9438,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->trickboost)
|
||||
player->trickboost--;
|
||||
|
||||
if (player->bumpslow)
|
||||
player->bumpslow--;
|
||||
|
||||
if (player->flamedash)
|
||||
{
|
||||
player->flamedash--;
|
||||
|
|
@ -10224,6 +10227,14 @@ void K_KartResetPlayerColor(player_t *player)
|
|||
goto base;
|
||||
}
|
||||
|
||||
if (player->bumpslow)
|
||||
{
|
||||
player->mo->colorized = true;
|
||||
player->mo->color = SKINCOLOR_RED;
|
||||
fullbright = true;
|
||||
goto finalise;
|
||||
}
|
||||
|
||||
if (player->eggmanexplode) // You're gonna diiiiie
|
||||
{
|
||||
const INT32 flashtime = 4<<(player->eggmanexplode/TICRATE);
|
||||
|
|
|
|||
|
|
@ -526,6 +526,8 @@ static int player_get(lua_State *L)
|
|||
lua_pushinteger(L, plr->trickboost);
|
||||
else if (fastcmp(field,"tricklock"))
|
||||
lua_pushinteger(L, plr->tricklock);
|
||||
else if (fastcmp(field,"bumpslow"))
|
||||
lua_pushinteger(L, plr->bumpslow);
|
||||
else if (fastcmp(field,"dashringpulltics"))
|
||||
lua_pushinteger(L, plr->dashRingPullTics);
|
||||
else if (fastcmp(field,"dashringpushtics"))
|
||||
|
|
@ -1136,6 +1138,8 @@ static int player_set(lua_State *L)
|
|||
plr->trickboost = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"tricklock"))
|
||||
plr->tricklock = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"bumpslow"))
|
||||
plr->bumpslow = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"dashringpulltics"))
|
||||
plr->dashRingPullTics = luaL_checkinteger(L, 3);
|
||||
else if (fastcmp(field,"dashringpushtics"))
|
||||
|
|
|
|||
|
|
@ -4117,6 +4117,9 @@ static void P_BouncePlayerMove(mobj_t *mo, TryMoveResult_t *result)
|
|||
if (mo->player)
|
||||
mo->player->bumpUnstuck += 5;
|
||||
|
||||
if (K_PlayerUsesBotMovement(mo->player))
|
||||
mo->player->bumpslow = TICRATE*2;
|
||||
|
||||
// Combo avoidance!
|
||||
if (mo->player && P_PlayerInPain(mo->player) && gametyperules & GTR_BUMPERS && mo->health == 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -569,6 +569,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT8(save->p, players[i].trickboost);
|
||||
WRITEUINT8(save->p, players[i].tricklock);
|
||||
|
||||
WRITEUINT8(save->p, players[i].bumpslow);
|
||||
|
||||
WRITEUINT8(save->p, players[i].dashRingPullTics);
|
||||
WRITEUINT8(save->p, players[i].dashRingPushTics);
|
||||
|
||||
|
|
@ -1206,6 +1208,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].trickboost = READUINT8(save->p);
|
||||
players[i].tricklock = READUINT8(save->p);
|
||||
|
||||
players[i].bumpslow = READUINT8(save->p);
|
||||
|
||||
players[i].dashRingPullTics = READUINT8(save->p);
|
||||
players[i].dashRingPushTics = READUINT8(save->p);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue