Water skipping

No way to disable it yet, let's see if we even need it
This commit is contained in:
TehRealSalt 2018-07-16 22:51:31 -04:00
parent f6e5571948
commit e2a6d5ceb3
4 changed files with 24 additions and 6 deletions

View File

@ -294,6 +294,7 @@ typedef enum
k_offroad, // In Super Mario Kart, going offroad has lee-way of about 1 second before you start losing speed
k_pogospring, // Pogo spring bounce effect
k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse.
k_waterskip, // Water skipping counter
k_itemroulette, // Used for the roulette when deciding what item to give you (was "pw_kartitem")
k_roulettetype, // Used for the roulette, for deciding type (currently only used for Battle, to give you better items from Karma items)

View File

@ -7604,6 +7604,7 @@ static const char *const KARTSTUFF_LIST[] = {
"OFFROAD",
"POGOSPRING",
"BRAKESTOP",
"WATERSKIP",
"ITEMROULETTE",
"ROULETTETYPE",

View File

@ -2887,6 +2887,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
if (G_BattleGametype() && player->kartstuff[k_bumper] > 0)
player->kartstuff[k_wanted]++;
if (P_IsObjectOnGround(player->mo))
player->kartstuff[k_waterskip] = 0;
// ???
/*
if (player->kartstuff[k_jmp] > 1 && onground)

View File

@ -3375,17 +3375,30 @@ void P_MobjCheckWater(mobj_t *mobj)
}
// skipping stone!
if (p && (p->charability2 == CA2_SPINDASH) && p->speed/2 > abs(mobj->momz)
&& ((p->pflags & (PF_SPINNING|PF_JUMPED)) == PF_SPINNING)
if (p && p->kartstuff[k_waterskip] < 2
&& ((p->speed/2 > abs(mobj->momz)) // Going more forward than horizontal, so you can skip across the water.
|| (p->speed > K_GetKartSpeed(p,false)/4 && p->kartstuff[k_waterskip])) // Already skipped once, so you can skip once more!
&& ((!(mobj->eflags & MFE_VERTICALFLIP) && thingtop - mobj->momz > mobj->watertop)
|| ((mobj->eflags & MFE_VERTICALFLIP) && mobj->z - mobj->momz < mobj->waterbottom)))
{
const fixed_t min = 6<<FRACBITS;
//const fixed_t max = 8<<FRACBITS;
mobj->momx = mobj->momx/2;
mobj->momy = mobj->momy/2;
mobj->momz = -mobj->momz/2;
if (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->momz > FixedMul(6*FRACUNIT, mobj->scale))
mobj->momz = FixedMul(6*FRACUNIT, mobj->scale);
else if (mobj->eflags & MFE_VERTICALFLIP && mobj->momz < FixedMul(-6*FRACUNIT, mobj->scale))
mobj->momz = FixedMul(-6*FRACUNIT, mobj->scale);
if (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->momz < FixedMul(min, mobj->scale))
mobj->momz = FixedMul(min, mobj->scale);
else if (mobj->eflags & MFE_VERTICALFLIP && mobj->momz > FixedMul(-min, mobj->scale))
mobj->momz = FixedMul(-min, mobj->scale);
/*if (!(mobj->eflags & MFE_VERTICALFLIP) && mobj->momz > FixedMul(max, mobj->scale))
mobj->momz = FixedMul(max, mobj->scale);
else if (mobj->eflags & MFE_VERTICALFLIP && mobj->momz < FixedMul(-max, mobj->scale))
mobj->momz = FixedMul(-max, mobj->scale);*/
p->kartstuff[k_waterskip]++;
}
}