mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
Ringbox proto functionality
This commit is contained in:
parent
7842032eee
commit
f371a21258
6 changed files with 35 additions and 9 deletions
|
|
@ -764,6 +764,9 @@ struct player_t
|
||||||
|
|
||||||
boolean markedfordeath;
|
boolean markedfordeath;
|
||||||
|
|
||||||
|
UINT8 ringboxdelay; // Delay until Ring Box auto-activates
|
||||||
|
UINT8 ringboxaward; // Where did we stop?
|
||||||
|
|
||||||
uint8_t public_key[PUBKEYLENGTH];
|
uint8_t public_key[PUBKEYLENGTH];
|
||||||
|
|
||||||
#ifdef HWRENDER
|
#ifdef HWRENDER
|
||||||
|
|
|
||||||
11
src/k_hud.c
11
src/k_hud.c
|
|
@ -1250,12 +1250,6 @@ static void K_drawKartItem(void)
|
||||||
vector2_t rouletteCrop = {7, 7};
|
vector2_t rouletteCrop = {7, 7};
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
if (stplyr->itemRoulette.ringbox)
|
|
||||||
{
|
|
||||||
// Todo: owl
|
|
||||||
localbg = offset ? kp_ringbg[1] : kp_ringbg[0];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (stplyr->itemRoulette.itemListLen > 0)
|
if (stplyr->itemRoulette.itemListLen > 0)
|
||||||
{
|
{
|
||||||
// Init with item roulette stuff.
|
// Init with item roulette stuff.
|
||||||
|
|
@ -1617,6 +1611,11 @@ static void K_drawKartSlotMachine(void)
|
||||||
{
|
{
|
||||||
rouletteOffset = K_GetRouletteOffset(&stplyr->itemRoulette, rendertimefrac);
|
rouletteOffset = K_GetRouletteOffset(&stplyr->itemRoulette, rendertimefrac);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (!stplyr->ringboxdelay)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// pain and suffering defined below
|
// pain and suffering defined below
|
||||||
if (offset)
|
if (offset)
|
||||||
|
|
|
||||||
11
src/k_kart.c
11
src/k_kart.c
|
|
@ -10732,6 +10732,17 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||||
player->pflags &= ~PF_USERINGS;
|
player->pflags &= ~PF_USERINGS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->ringboxdelay)
|
||||||
|
{
|
||||||
|
player->ringboxdelay--;
|
||||||
|
if (player->ringboxdelay == 0)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
K_AwardPlayerRings(player, 10 * player->ringboxaward, true);
|
||||||
|
player->ringboxaward = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (player && player->mo && player->mo->health > 0 && !player->spectator && !P_PlayerInPain(player) && !mapreset && leveltime > introtime)
|
if (player && player->mo && player->mo->health > 0 && !player->spectator && !P_PlayerInPain(player) && !mapreset && leveltime > introtime)
|
||||||
{
|
{
|
||||||
// First, the really specific, finicky items that function without the item being directly in your item slot.
|
// First, the really specific, finicky items that function without the item being directly in your item slot.
|
||||||
|
|
|
||||||
|
|
@ -1603,9 +1603,8 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
|
||||||
|
|
||||||
if (roulette->ringbox == true)
|
if (roulette->ringbox == true)
|
||||||
{
|
{
|
||||||
// TODO: add logic to make it give you the rings
|
player->ringboxdelay = TICRATE;
|
||||||
//player->slotMachineType = finalItem;
|
player->ringboxaward = finalItem;
|
||||||
//player->slotMachineDelay = TICRATE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -251,6 +251,10 @@ static int player_get(lua_State *L)
|
||||||
lua_pushboolean(L, plr->flipDI);
|
lua_pushboolean(L, plr->flipDI);
|
||||||
else if (fastcmp(field,"markedfordeath"))
|
else if (fastcmp(field,"markedfordeath"))
|
||||||
lua_pushboolean(L, plr->markedfordeath);
|
lua_pushboolean(L, plr->markedfordeath);
|
||||||
|
else if (fastcmp(field,"ringboxdelay"))
|
||||||
|
lua_pushinteger(L, plr->ringboxdelay);
|
||||||
|
else if (fastcmp(field,"ringboxaward"))
|
||||||
|
lua_pushinteger(L, plr->ringboxaward);
|
||||||
else if (fastcmp(field,"drift"))
|
else if (fastcmp(field,"drift"))
|
||||||
lua_pushinteger(L, plr->drift);
|
lua_pushinteger(L, plr->drift);
|
||||||
else if (fastcmp(field,"driftcharge"))
|
else if (fastcmp(field,"driftcharge"))
|
||||||
|
|
@ -651,6 +655,10 @@ static int player_set(lua_State *L)
|
||||||
plr->flipDI = luaL_checkboolean(L, 3);
|
plr->flipDI = luaL_checkboolean(L, 3);
|
||||||
else if (fastcmp(field,"markedfordeath"))
|
else if (fastcmp(field,"markedfordeath"))
|
||||||
plr->markedfordeath = luaL_checkboolean(L, 3);
|
plr->markedfordeath = luaL_checkboolean(L, 3);
|
||||||
|
else if (fastcmp(field,"ringboxdelay"))
|
||||||
|
plr->ringboxdelay = luaL_checkinteger(L, 3);
|
||||||
|
else if (fastcmp(field,"ringboxaward"))
|
||||||
|
plr->ringboxaward = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"drift"))
|
else if (fastcmp(field,"drift"))
|
||||||
plr->drift = luaL_checkinteger(L, 3);
|
plr->drift = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"driftcharge"))
|
else if (fastcmp(field,"driftcharge"))
|
||||||
|
|
|
||||||
|
|
@ -433,6 +433,9 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
||||||
|
|
||||||
WRITEUINT8(save->p, players[i].markedfordeath);
|
WRITEUINT8(save->p, players[i].markedfordeath);
|
||||||
|
|
||||||
|
WRITEUINT8(save->p, players[i].ringboxdelay);
|
||||||
|
WRITEUINT8(save->p, players[i].ringboxaward);
|
||||||
|
|
||||||
// respawnvars_t
|
// respawnvars_t
|
||||||
WRITEUINT8(save->p, players[i].respawn.state);
|
WRITEUINT8(save->p, players[i].respawn.state);
|
||||||
WRITEUINT32(save->p, K_GetWaypointHeapIndex(players[i].respawn.wp));
|
WRITEUINT32(save->p, K_GetWaypointHeapIndex(players[i].respawn.wp));
|
||||||
|
|
@ -828,6 +831,9 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
||||||
|
|
||||||
players[i].markedfordeath = READUINT8(save->p);
|
players[i].markedfordeath = READUINT8(save->p);
|
||||||
|
|
||||||
|
players[i].ringboxdelay = READUINT8(save->p);
|
||||||
|
players[i].ringboxaward = READUINT8(save->p);
|
||||||
|
|
||||||
// respawnvars_t
|
// respawnvars_t
|
||||||
players[i].respawn.state = READUINT8(save->p);
|
players[i].respawn.state = READUINT8(save->p);
|
||||||
players[i].respawn.wp = (waypoint_t *)(size_t)READUINT32(save->p);
|
players[i].respawn.wp = (waypoint_t *)(size_t)READUINT32(save->p);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue