mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
Separate water skipping condition into K_WaterSkip
This commit is contained in:
parent
7b301452cc
commit
77bc259986
3 changed files with 13 additions and 4 deletions
11
src/k_kart.c
11
src/k_kart.c
|
|
@ -3277,6 +3277,17 @@ boolean K_WaterRun(player_t *player)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
boolean K_WaterSkip(player_t *player)
|
||||||
|
{
|
||||||
|
if (player->speed/3 > abs(player->mo->momz)) // Going more forward than horizontal, so you can skip across the water.
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (player->speed > 20*mapobjectscale && player->waterskip) // Already skipped once, so you can skip once more!
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
static fixed_t K_FlameShieldDashVar(INT32 val)
|
static fixed_t K_FlameShieldDashVar(INT32 val)
|
||||||
{
|
{
|
||||||
// 1 second = 75% + 50% top speed
|
// 1 second = 75% + 50% top speed
|
||||||
|
|
|
||||||
|
|
@ -143,6 +143,7 @@ boolean K_SlopeResistance(player_t *player);
|
||||||
tripwirepass_t K_TripwirePassConditions(player_t *player);
|
tripwirepass_t K_TripwirePassConditions(player_t *player);
|
||||||
boolean K_TripwirePass(player_t *player);
|
boolean K_TripwirePass(player_t *player);
|
||||||
boolean K_WaterRun(player_t *player);
|
boolean K_WaterRun(player_t *player);
|
||||||
|
boolean K_WaterSkip(player_t *player);
|
||||||
void K_ApplyTripWire(player_t *player, tripwirestate_t state);
|
void K_ApplyTripWire(player_t *player, tripwirestate_t state);
|
||||||
INT16 K_GetSpindashChargeTime(player_t *player);
|
INT16 K_GetSpindashChargeTime(player_t *player);
|
||||||
fixed_t K_GetSpindashChargeSpeed(player_t *player);
|
fixed_t K_GetSpindashChargeSpeed(player_t *player);
|
||||||
|
|
|
||||||
|
|
@ -3317,10 +3317,7 @@ void P_MobjCheckWater(mobj_t *mobj)
|
||||||
}
|
}
|
||||||
|
|
||||||
// skipping stone!
|
// skipping stone!
|
||||||
if (p && p->waterskip < 2
|
if (p && p->waterskip < 2 && K_WaterSkip(p) && (splashValid == true))
|
||||||
&& ((p->speed/3 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water.
|
|
||||||
|| (p->speed > 20*mapobjectscale && p->waterskip)) // Already skipped once, so you can skip once more!
|
|
||||||
&& (splashValid == true))
|
|
||||||
{
|
{
|
||||||
const fixed_t hop = 5 * mobj->scale;
|
const fixed_t hop = 5 * mobj->scale;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue