mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2025-01-31 05:20:51 +00:00
More tweaking
- Getting wipeout bumped into offroad slows you down - Orbinaut & Jawz are relative to your weight (Jawz is heavier), via new function K_GetMobjWeight - Reorangized where K_KartBouncing is called so that wipeout changes don't affect Eggman Items
This commit is contained in:
parent
b891ebe614
commit
584082882c
5 changed files with 71 additions and 31 deletions
67
src/k_kart.c
67
src/k_kart.c
|
@ -925,6 +925,42 @@ static void K_KartItemRoulette(player_t *player, ticcmd_t *cmd)
|
||||||
|
|
||||||
//{ SRB2kart p_user.c Stuff
|
//{ SRB2kart p_user.c Stuff
|
||||||
|
|
||||||
|
static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against)
|
||||||
|
{
|
||||||
|
fixed_t weight = 5<<FRACBITS;
|
||||||
|
|
||||||
|
switch (mobj->type)
|
||||||
|
{
|
||||||
|
case MT_PLAYER:
|
||||||
|
if (!mobj->player)
|
||||||
|
break;
|
||||||
|
if (against->player && !against->player->kartstuff[k_spinouttimer] && mobj->player->kartstuff[k_spinouttimer])
|
||||||
|
weight = 0; // Do not bump
|
||||||
|
else
|
||||||
|
weight = (mobj->player->kartweight)<<FRACBITS;
|
||||||
|
break;
|
||||||
|
case MT_GREENITEM:
|
||||||
|
case MT_GREENSHIELD:
|
||||||
|
if (against->player)
|
||||||
|
weight = (against->player->kartweight)<<FRACBITS;
|
||||||
|
else
|
||||||
|
weight = 8<<FRACBITS;
|
||||||
|
break;
|
||||||
|
case MT_JAWZ:
|
||||||
|
case MT_JAWZ_DUD:
|
||||||
|
case MT_JAWZ_SHIELD:
|
||||||
|
if (against->player)
|
||||||
|
weight = (against->player->kartweight+3)<<FRACBITS;
|
||||||
|
else
|
||||||
|
weight = 11<<FRACBITS;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return weight;
|
||||||
|
}
|
||||||
|
|
||||||
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||||
{
|
{
|
||||||
mobj_t *fx;
|
mobj_t *fx;
|
||||||
|
@ -959,25 +995,12 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mass1 = mass2 = 5*FRACUNIT;
|
mass1 = K_GetMobjWeight(mobj1, mobj2);
|
||||||
|
|
||||||
if (mobj1->player)
|
if (solid == true && mass1 > 0)
|
||||||
{
|
mass2 = mass1;
|
||||||
if (mobj2->player && !mobj2->player->kartstuff[k_spinouttimer] && mobj1->player->kartstuff[k_spinouttimer])
|
|
||||||
mass1 = 0; // Do not bump
|
|
||||||
else
|
else
|
||||||
mass1 = (mobj1->player->kartweight)*FRACUNIT;
|
mass2 = K_GetMobjWeight(mobj2, mobj1);
|
||||||
}
|
|
||||||
|
|
||||||
if (mobj2->player)
|
|
||||||
{
|
|
||||||
if (mobj1->player && !mobj1->player->kartstuff[k_spinouttimer] && mobj2->player->kartstuff[k_spinouttimer])
|
|
||||||
mass2 = 0; // Do not bump
|
|
||||||
else
|
|
||||||
mass2 = (mobj2->player->kartweight)*FRACUNIT;
|
|
||||||
}
|
|
||||||
else if (solid == true && mobj1->player)
|
|
||||||
mass2 = (mobj1->player->kartweight)*FRACUNIT;
|
|
||||||
|
|
||||||
momdifx = mobj1->momx - mobj2->momx;
|
momdifx = mobj1->momx - mobj2->momx;
|
||||||
momdify = mobj1->momy - mobj2->momy;
|
momdify = mobj1->momy - mobj2->momy;
|
||||||
|
@ -1589,7 +1612,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, boolean trapitem
|
||||||
S_StartSound(player->mo, sfx_slip);
|
S_StartSound(player->mo, sfx_slip);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
player->kartstuff[k_spinouttimer] = (1*TICRATE)+20; // Wipeout
|
player->kartstuff[k_spinouttimer] = TICRATE+20; // Wipeout
|
||||||
|
|
||||||
player->powers[pw_flashing] = K_GetKartFlashing();
|
player->powers[pw_flashing] = K_GetKartFlashing();
|
||||||
|
|
||||||
|
@ -3868,8 +3891,16 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||||
if (player->mo->movefactor < 32)
|
if (player->mo->movefactor < 32)
|
||||||
player->mo->movefactor = 32;
|
player->mo->movefactor = 32;
|
||||||
}
|
}
|
||||||
|
if (player->kartstuff[k_spinouttimer])
|
||||||
|
{
|
||||||
|
player->mo->friction = FRACUNIT;
|
||||||
|
if (player->kartstuff[k_wipeoutslow])
|
||||||
|
{
|
||||||
|
player->mo->friction -= FixedMul(1228, player->kartstuff[k_offroad]);
|
||||||
if (player->kartstuff[k_wipeoutslow] == 1)
|
if (player->kartstuff[k_wipeoutslow] == 1)
|
||||||
player->mo->friction -= 4912;
|
player->mo->friction -= 4912;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
K_KartDrift(player, onground);
|
K_KartDrift(player, onground);
|
||||||
|
|
||||||
|
|
|
@ -3325,7 +3325,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
|
||||||
damage = player->mo->health - 1;
|
damage = player->mo->health - 1;
|
||||||
P_RingDamage(player, inflictor, source, damage);
|
P_RingDamage(player, inflictor, source, damage);
|
||||||
P_PlayerRingBurst(player, 5);
|
P_PlayerRingBurst(player, 5);
|
||||||
K_KartBouncing(player->mo, inflictor, false, false);
|
if (inflictor->type == MT_FAKEITEM || inflictor->type == MT_FAKESHIELD)
|
||||||
|
player->mo->momx = player->mo->momy = 0;
|
||||||
if (P_IsLocalPlayer(player))
|
if (P_IsLocalPlayer(player))
|
||||||
{
|
{
|
||||||
quake.intensity = 32*FRACUNIT;
|
quake.intensity = 32*FRACUNIT;
|
||||||
|
|
|
@ -694,6 +694,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
{
|
{
|
||||||
// Player Damage
|
// Player Damage
|
||||||
P_DamageMobj(thing, tmthing, tmthing->target, 1);
|
P_DamageMobj(thing, tmthing, tmthing->target, 1);
|
||||||
|
K_KartBouncing(thing, tmthing, false, false);
|
||||||
|
|
||||||
if (tmthing->type == MT_GREENITEM || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)
|
if (tmthing->type == MT_GREENITEM || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)
|
||||||
S_StartSound(thing, sfx_shelit);
|
S_StartSound(thing, sfx_shelit);
|
||||||
|
@ -1126,6 +1127,9 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
// Player Damage
|
// Player Damage
|
||||||
P_DamageMobj(tmthing, thing, thing->target, 1);
|
P_DamageMobj(tmthing, thing, thing->target, 1);
|
||||||
|
|
||||||
|
if (thing->type != MT_FAKESHIELD && thing->type != MT_FAKEITEM)
|
||||||
|
K_KartBouncing(tmthing, thing, false, false);
|
||||||
|
|
||||||
if (thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
|
if (thing->type == MT_GREENITEM || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
|
||||||
S_StartSound(tmthing, sfx_shelit);
|
S_StartSound(tmthing, sfx_shelit);
|
||||||
|
|
||||||
|
|
|
@ -2003,7 +2003,7 @@ void P_XYMovement(mobj_t *mo)
|
||||||
if (mo->type == MT_GREENITEM || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer))
|
if (mo->type == MT_GREENITEM || mo->type == MT_JAWZ_DUD || mo->type == MT_JAWZ || mo->type == MT_BALLHOG) //(mo->type == MT_JAWZ && !mo->tracer))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && mo->player->kartstuff[k_wipeoutslow] != 1) && mo->player->speed <= mo->player->normalspeed/2)
|
if (mo->player && (mo->player->kartstuff[k_spinouttimer] && !mo->player->kartstuff[k_wipeoutslow]) && mo->player->speed <= mo->player->normalspeed/2)
|
||||||
return;
|
return;
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
|
|
@ -852,6 +852,9 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
|
||||||
angle_t ang;
|
angle_t ang;
|
||||||
fixed_t fallbackspeed;
|
fixed_t fallbackspeed;
|
||||||
|
|
||||||
|
if (inflictor && (inflictor->type != MT_PLAYER && inflictor->type != MT_GREENITEM && inflictor->type != MT_GREENSHIELD
|
||||||
|
&& inflictor->type != MT_JAWZ && inflictor->type != MT_JAWZ_DUD && inflictor->type != MT_JAWZ_SHIELD))
|
||||||
|
{
|
||||||
if (player->mo->eflags & MFE_VERTICALFLIP)
|
if (player->mo->eflags & MFE_VERTICALFLIP)
|
||||||
player->mo->z--;
|
player->mo->z--;
|
||||||
else
|
else
|
||||||
|
@ -861,6 +864,7 @@ void P_DoPlayerPain(player_t *player, mobj_t *source, mobj_t *inflictor)
|
||||||
P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false);
|
P_SetObjectMomZ(player->mo, FixedDiv(10511*FRACUNIT,2600*FRACUNIT), false);
|
||||||
else
|
else
|
||||||
P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false);
|
P_SetObjectMomZ(player->mo, FixedDiv(69*FRACUNIT,10*FRACUNIT), false);
|
||||||
|
}
|
||||||
|
|
||||||
if (inflictor)
|
if (inflictor)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue