Make rainbow dash rings do something unique
Since tricking is not a thing in this game, make rainbow dashrings remove pogospring gravity for a small time frame for extra height
This commit is contained in:
parent
c57a6e74ce
commit
54aebfd8b2
11 changed files with 43 additions and 7 deletions
|
|
@ -687,6 +687,7 @@ struct player_t
|
|||
|
||||
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
|
||||
UINT8 dashRainbowPogo; // Determines when to disable pogospring extra gravity after using a rainbow dash ring
|
||||
|
||||
INT32 interpoints; // BlanKart (port from SRB2Kart CEP): override for number of points earned in intermission
|
||||
UINT32 roundscore; // battle score this round
|
||||
|
|
|
|||
13
src/k_kart.c
13
src/k_kart.c
|
|
@ -4813,6 +4813,12 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound)
|
|||
S_StartSound(mo, (sound == 1 ? sfx_kc2f : sfx_kpogos));
|
||||
}
|
||||
|
||||
void K_ResetPogoSpring(player_t *player)
|
||||
{
|
||||
player->pogospring = 0;
|
||||
player->dashRainbowPogo = 0;
|
||||
}
|
||||
|
||||
void K_DoInvincibility(player_t *player, tic_t time)
|
||||
{
|
||||
const boolean isalt = K_IsKartItemAlternate(KITEM_INVINCIBILITY);
|
||||
|
|
@ -6967,7 +6973,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (P_IsObjectOnGround(player->mo) && player->pogospring)
|
||||
{
|
||||
if (P_MobjFlip(player->mo)*player->mo->momz <= 0)
|
||||
player->pogospring = 0;
|
||||
K_ResetPogoSpring(player);
|
||||
}
|
||||
|
||||
if (player->tripwireReboundDelay)
|
||||
|
|
@ -7041,6 +7047,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
|||
if (player->walltransferboost > 0)
|
||||
player->walltransferboost--;
|
||||
|
||||
if (player->dashRainbowPogo > 0)
|
||||
player->dashRainbowPogo--;
|
||||
|
||||
if (player->invincibilitytimer)
|
||||
{
|
||||
INT16 invinfac = 1;
|
||||
|
|
@ -9020,7 +9029,7 @@ static void K_KartDrift(player_t *player, boolean onground)
|
|||
// Stop drifting
|
||||
// experiment: wall transfers should allow zero speed
|
||||
// reasoning: when driving right into a half pipe face-on, there is no h-speed for the entire launch
|
||||
if (player->walltransfered)
|
||||
if (player->walltransfered || player->dashRingPullTics || player->dashRingPushTics)
|
||||
{
|
||||
minspeed = 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -262,6 +262,7 @@ fixed_t K_InvincibilityGradient(UINT16 time);
|
|||
UINT16 K_GetInvincibilityTime(player_t *player);
|
||||
fixed_t K_GetInvincibilitySpeed(UINT16 time);
|
||||
fixed_t K_GetInvincibilityAccel(UINT16 time);
|
||||
void K_ResetPogoSpring(player_t *player);
|
||||
void K_DoInvincibility(player_t *player, tic_t time);
|
||||
void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source);
|
||||
void K_UpdateHnextList(player_t *player, boolean clean);
|
||||
|
|
|
|||
|
|
@ -680,11 +680,12 @@ void K_ProcessTerrainEffect(mobj_t *mo)
|
|||
K_MomentumAngle(player->mo), thrustAngle,
|
||||
playerSpeed, thrustSpeed
|
||||
);
|
||||
player->driftlock = TICRATE/8; // seems like a good value so its not noticable and you still get the right angle
|
||||
|
||||
P_InstaThrust(player->mo, thrustAngle, max(thrustSpeed, 2*playerSpeed));
|
||||
|
||||
player->dashpadcooldown = TICRATE/3;
|
||||
player->pogospring = 0;
|
||||
K_ResetPogoSpring(player);
|
||||
player->floorboost = 2;
|
||||
|
||||
S_StartSound(player->mo, sfx_cdfm62);
|
||||
|
|
|
|||
|
|
@ -368,6 +368,9 @@ enum player_e
|
|||
player_jawztargetdelay,
|
||||
player_confirmVictim,
|
||||
player_confirmVictimDelay,
|
||||
player_dashRingPullTics,
|
||||
player_dashRingPushTics,
|
||||
player_dashRainbowPogo,
|
||||
player_glanceDir,
|
||||
player_breathTimer,
|
||||
player_lastsafelap,
|
||||
|
|
@ -1093,6 +1096,15 @@ static int player_get(lua_State *L)
|
|||
case player_confirmVictimDelay:
|
||||
lua_pushinteger(L, plr->confirmVictimDelay);
|
||||
break;
|
||||
case player_dashRingPullTics:
|
||||
lua_pushinteger(L, plr->dashRingPullTics);
|
||||
break;
|
||||
case player_dashRingPushTics:
|
||||
lua_pushinteger(L, plr->dashRingPushTics);
|
||||
break;
|
||||
case player_dashRainbowPogo:
|
||||
lua_pushinteger(L, plr->dashRainbowPogo);
|
||||
break;
|
||||
case player_glanceDir:
|
||||
lua_pushinteger(L, plr->glanceDir);
|
||||
break;
|
||||
|
|
@ -1837,6 +1849,15 @@ static int player_set(lua_State *L)
|
|||
case player_confirmVictimDelay:
|
||||
plr->confirmVictimDelay = luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case player_dashRingPullTics:
|
||||
plr->dashRingPullTics = luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case player_dashRingPushTics:
|
||||
plr->dashRingPushTics = luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case player_dashRainbowPogo:
|
||||
plr->dashRainbowPogo = luaL_checkinteger(L, 3);
|
||||
break;
|
||||
case player_glanceDir:
|
||||
plr->glanceDir = luaL_checkinteger(L, 3);
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -32,6 +32,7 @@
|
|||
// timer values
|
||||
#define DASHRING_PULL_TICS 5
|
||||
#define DASHRING_PUSH_TICS (TICRATE/2)
|
||||
#define DASHRING_RAINBOW_POGO_TICS (TICRATE/2)
|
||||
#define DASHRING_ANTIGRAVITY_TICS 5
|
||||
|
||||
// base launch speed
|
||||
|
|
@ -219,6 +220,7 @@ static void RainbowDashRingLaunch(player_t *player, mobj_t *ring)
|
|||
{
|
||||
player->mo->eflags &= ~MFE_SPRUNG;
|
||||
player->pogospring = 1;
|
||||
player->dashRainbowPogo = DASHRING_RAINBOW_POGO_TICS;
|
||||
K_DoPogoSpring(player->mo, 0, 0);
|
||||
DashRingLaunch(player, ring);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1534,7 +1534,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget
|
|||
if (gametyperules & GTR_BUMPERS)
|
||||
K_CheckBumpers();
|
||||
|
||||
target->player->pogospring = 0;
|
||||
K_ResetPogoSpring(target->player);
|
||||
|
||||
ACS_RunPlayerDeathScript(target->player);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3532,7 +3532,7 @@ static void P_BouncePlayerMove(mobj_t *mo, TryMoveResult_t *result)
|
|||
|
||||
if (!cv_kartbumpspring.value || (modeattacking != ATTACKING_NONE && G_CompatLevel(0x000A)))
|
||||
{
|
||||
mo->player->pogospring = 0;
|
||||
K_ResetPogoSpring(mo->player);
|
||||
}
|
||||
|
||||
slidemo = mo;
|
||||
|
|
|
|||
|
|
@ -1170,7 +1170,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
|||
if (wasflip == !(mo->eflags & MFE_VERTICALFLIP)) // note!! == ! is not equivalent to != here - turns numeric into bool this way
|
||||
P_PlayerFlip(mo);
|
||||
|
||||
if (mo->player->pogospring)
|
||||
if (mo->player->pogospring && !mo->player->dashRainbowPogo)
|
||||
{
|
||||
gravityadd = (5*gravityadd)/2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -714,6 +714,7 @@ static void P_NetSyncPlayers(savebuffer_t *save)
|
|||
|
||||
SYNC(players[i].dashRingPullTics);
|
||||
SYNC(players[i].dashRingPushTics);
|
||||
SYNC(players[i].dashRainbowPogo);
|
||||
|
||||
SYNC(players[i].glanceDir);
|
||||
|
||||
|
|
|
|||
|
|
@ -5171,7 +5171,7 @@ static void P_ProcessSpeedPad(player_t *player, sector_t *sector, sector_t *rove
|
|||
player->dashpadcooldown = TICRATE/3;
|
||||
// player->drift = 0;
|
||||
// player->driftcharge = 0;
|
||||
player->pogospring = 0;
|
||||
K_ResetPogoSpring(player);
|
||||
|
||||
sfxnum = lines[lineindex].stringargs[0] ? get_number(lines[lineindex].stringargs[0]) : sfx_spdpad;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue