mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 12:01:47 +00:00
bailquake
This commit is contained in:
parent
ff9644c278
commit
b131b44353
5 changed files with 21 additions and 3 deletions
|
|
@ -1083,6 +1083,7 @@ struct player_t
|
||||||
|
|
||||||
UINT32 bailcharge;
|
UINT32 bailcharge;
|
||||||
UINT32 baildrop;
|
UINT32 baildrop;
|
||||||
|
UINT8 bailquake;
|
||||||
|
|
||||||
boolean analoginput; // Has an input been recorded that requires analog usage? For input display.
|
boolean analoginput; // Has an input been recorded that requires analog usage? For input display.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10051,6 +10051,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
player->ringboost /= 3;
|
player->ringboost /= 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->bailquake)
|
||||||
|
player->bailquake--;
|
||||||
|
|
||||||
// The precise ordering of start-of-level made me want to cut my head off,
|
// The precise ordering of start-of-level made me want to cut my head off,
|
||||||
// so let's try this instead. Whatever!
|
// so let's try this instead. Whatever!
|
||||||
if (leveltime <= starttime || player->gradingpointnum == 0)
|
if (leveltime <= starttime || player->gradingpointnum == 0)
|
||||||
|
|
@ -14033,6 +14036,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||||
player->baildrop = baildrop * BAIL_DROPFREQUENCY + 1;
|
player->baildrop = baildrop * BAIL_DROPFREQUENCY + 1;
|
||||||
|
|
||||||
K_AddHitLag(player->mo, TICRATE/4, false);
|
K_AddHitLag(player->mo, TICRATE/4, false);
|
||||||
|
player->bailquake = player->mo->hitlag + TICRATE; // the quake effect that uses this will ignore it during hitlag and trigger after, so it needs to be longer than the hitlag
|
||||||
|
|
||||||
if (P_PlayerInPain(player))
|
if (P_PlayerInPain(player))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -285,9 +285,11 @@ static int player_get(lua_State *L)
|
||||||
else if (fastcmp(field,"ringvisualwarning"))
|
else if (fastcmp(field,"ringvisualwarning"))
|
||||||
lua_pushboolean(L, plr->ringvisualwarning);
|
lua_pushboolean(L, plr->ringvisualwarning);
|
||||||
else if (fastcmp(field,"bailcharge"))
|
else if (fastcmp(field,"bailcharge"))
|
||||||
lua_pushboolean(L, plr->bailcharge);
|
lua_pushinteger(L, plr->bailcharge);
|
||||||
else if (fastcmp(field,"baildrop"))
|
else if (fastcmp(field,"baildrop"))
|
||||||
lua_pushboolean(L, plr->baildrop);
|
lua_pushinteger(L, plr->baildrop);
|
||||||
|
else if (fastcmp(field,"bailquake"))
|
||||||
|
lua_pushinteger(L, plr->bailquake);
|
||||||
else if (fastcmp(field,"dotrickfx"))
|
else if (fastcmp(field,"dotrickfx"))
|
||||||
lua_pushboolean(L, plr->dotrickfx);
|
lua_pushboolean(L, plr->dotrickfx);
|
||||||
else if (fastcmp(field,"stingfx"))
|
else if (fastcmp(field,"stingfx"))
|
||||||
|
|
@ -918,6 +920,8 @@ static int player_set(lua_State *L)
|
||||||
plr->bailcharge = luaL_checkinteger(L, 3);
|
plr->bailcharge = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"baildrop"))
|
else if (fastcmp(field,"baildrop"))
|
||||||
plr->baildrop = luaL_checkinteger(L, 3);
|
plr->baildrop = luaL_checkinteger(L, 3);
|
||||||
|
else if (fastcmp(field,"bailquake"))
|
||||||
|
plr->bailquake = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp(field,"analoginput"))
|
else if (fastcmp(field,"analoginput"))
|
||||||
plr->analoginput = luaL_checkboolean(L, 3);
|
plr->analoginput = luaL_checkboolean(L, 3);
|
||||||
else if (fastcmp(field,"transfer"))
|
else if (fastcmp(field,"transfer"))
|
||||||
|
|
|
||||||
|
|
@ -669,6 +669,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
||||||
|
|
||||||
WRITEUINT32(save->p, players[i].bailcharge);
|
WRITEUINT32(save->p, players[i].bailcharge);
|
||||||
WRITEUINT32(save->p, players[i].baildrop);
|
WRITEUINT32(save->p, players[i].baildrop);
|
||||||
|
WRITEUINT8(save->p, players[i].bailquake);
|
||||||
|
|
||||||
WRITEUINT8(save->p, players[i].analoginput);
|
WRITEUINT8(save->p, players[i].analoginput);
|
||||||
|
|
||||||
|
|
@ -1327,6 +1328,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
||||||
|
|
||||||
players[i].bailcharge = READUINT32(save->p);
|
players[i].bailcharge = READUINT32(save->p);
|
||||||
players[i].baildrop = READUINT32(save->p);
|
players[i].baildrop = READUINT32(save->p);
|
||||||
|
players[i].bailquake = READUINT8(save->p);
|
||||||
|
|
||||||
players[i].analoginput = READUINT8(save->p);
|
players[i].analoginput = READUINT8(save->p);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9635,7 +9635,7 @@ void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset)
|
||||||
quake = quake->next;
|
quake = quake->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add level-based effects.
|
// Add level-based effects, and local bailquake
|
||||||
if (P_MobjWasRemoved(viewer->mo) == false
|
if (P_MobjWasRemoved(viewer->mo) == false
|
||||||
&& viewer->speed > viewer->mo->scale
|
&& viewer->speed > viewer->mo->scale
|
||||||
&& P_IsObjectOnGround(viewer->mo) == true)
|
&& P_IsObjectOnGround(viewer->mo) == true)
|
||||||
|
|
@ -9653,6 +9653,13 @@ void P_DoQuakeOffset(UINT8 view, mappoint_t *viewPos, mappoint_t *offset)
|
||||||
ir = FixedMul((viewer->stairjank * FRACUNIT * 5) / 17, mapobjectscale);
|
ir = FixedMul((viewer->stairjank * FRACUNIT * 5) / 17, mapobjectscale);
|
||||||
addZ += ir;
|
addZ += ir;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// add bail effect
|
||||||
|
if (viewer->bailquake > 0 && !viewer->mo->hitlag) // only start after hitlag ends
|
||||||
|
{
|
||||||
|
ir = FixedMul((viewer->bailquake * FRACUNIT * 5) / 17, mapobjectscale);
|
||||||
|
addZ += ir;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_t maxShake = FixedMul(cv_cam_height[view].value, mapobjectscale) * 3 / 4;
|
fixed_t maxShake = FixedMul(cv_cam_height[view].value, mapobjectscale) * 3 / 4;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue