mirror of
https://git.do.srb2.org/KartKrew/Kart-Public.git
synced 2024-11-16 01:31:26 +00:00
Merge branch 'sal-misc' of https://git.magicalgirl.moe/KartKrew/Kart.git into itemdrop
This commit is contained in:
commit
6052573549
9 changed files with 161 additions and 47 deletions
|
@ -298,6 +298,7 @@ typedef enum
|
||||||
k_brakestop, // Wait until you've made a complete stop for a few tics before letting brake go in reverse.
|
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_waterskip, // Water skipping counter
|
||||||
k_dashpadcooldown, // Separate the vanilla SA-style dash pads from using pw_flashing
|
k_dashpadcooldown, // Separate the vanilla SA-style dash pads from using pw_flashing
|
||||||
|
k_boostpower, // Base boost value, for offroad
|
||||||
k_speedboost, // Boost value smoothing for max speed
|
k_speedboost, // Boost value smoothing for max speed
|
||||||
k_accelboost, // Boost value smoothing for acceleration
|
k_accelboost, // Boost value smoothing for acceleration
|
||||||
k_boostcam, // Camera push forward on boost
|
k_boostcam, // Camera push forward on boost
|
||||||
|
|
|
@ -7685,6 +7685,7 @@ static const char *const KARTSTUFF_LIST[] = {
|
||||||
"BRAKESTOP",
|
"BRAKESTOP",
|
||||||
"WATERSKIP",
|
"WATERSKIP",
|
||||||
"DASHPADCOOLDOWN",
|
"DASHPADCOOLDOWN",
|
||||||
|
"BOOSTPOWER",
|
||||||
"SPEEDBOOST",
|
"SPEEDBOOST",
|
||||||
"ACCELBOOST",
|
"ACCELBOOST",
|
||||||
"BOOSTCAM",
|
"BOOSTCAM",
|
||||||
|
|
|
@ -2797,7 +2797,7 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_THNS, 10, 2, {NULL}, 0, 0, S_THUNDERSHIELD24}, // S_THUNDERSHIELD23
|
{SPR_THNS, 10, 2, {NULL}, 0, 0, S_THUNDERSHIELD24}, // S_THUNDERSHIELD23
|
||||||
{SPR_THNS, 11, 2, {NULL}, 0, 0, S_THUNDERSHIELD1}, // S_THUNDERSHIELD24
|
{SPR_THNS, 11, 2, {NULL}, 0, 0, S_THUNDERSHIELD1}, // S_THUNDERSHIELD24
|
||||||
|
|
||||||
{SPR_SINK, 0, 4, {A_SmokeTrailer}, MT_SINKTRAIL, 0, S_SINK}, // S_SINK
|
{SPR_SINK, 0, 1, {A_SmokeTrailer}, MT_SINKTRAIL, 0, S_SINK}, // S_SINK
|
||||||
{SPR_SINK, 0|FF_TRANS80|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_SINK_SHIELD}, // S_SINK_SHIELD
|
{SPR_SINK, 0|FF_TRANS80|FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_SINK_SHIELD}, // S_SINK_SHIELD
|
||||||
{SPR_SITR, 0, 1, {NULL}, 0, 0, S_SINKTRAIL2}, // S_SINKTRAIL1
|
{SPR_SITR, 0, 1, {NULL}, 0, 0, S_SINKTRAIL2}, // S_SINKTRAIL1
|
||||||
{SPR_SITR, 1, 5, {NULL}, 0, 0, S_SINKTRAIL3}, // S_SINKTRAIL2
|
{SPR_SITR, 1, 5, {NULL}, 0, 0, S_SINKTRAIL3}, // S_SINKTRAIL2
|
||||||
|
@ -2987,7 +2987,7 @@ state_t states[NUMSTATES] =
|
||||||
{SPR_ARRO, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_BOX
|
{SPR_ARRO, FF_FULLBRIGHT|1, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_BOX
|
||||||
{SPR_ITEM, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_ITEM
|
{SPR_ITEM, FF_FULLBRIGHT, -1, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_ITEM
|
||||||
{SPR_ITMN, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_NUMBER
|
{SPR_ITMN, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_NUMBER
|
||||||
{SPR_ITMN, FF_FULLBRIGHT|10, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_X
|
{SPR_ITMN, FF_FULLBRIGHT|11, 2, {NULL}, 0, 0, S_NULL}, // S_PLAYERARROW_X
|
||||||
{SPR_WANT, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_PLAYERARROW_WANTED2}, // S_PLAYERARROW_WANTED1
|
{SPR_WANT, FF_FULLBRIGHT, 5, {NULL}, 0, 0, S_PLAYERARROW_WANTED2}, // S_PLAYERARROW_WANTED1
|
||||||
{SPR_WANT, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_PLAYERARROW_WANTED3}, // S_PLAYERARROW_WANTED2
|
{SPR_WANT, FF_FULLBRIGHT|1, 1, {NULL}, 0, 0, S_PLAYERARROW_WANTED3}, // S_PLAYERARROW_WANTED2
|
||||||
{SPR_WANT, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED4}, // S_PLAYERARROW_WANTED3
|
{SPR_WANT, FF_FULLBRIGHT|2, 3, {NULL}, 0, 0, S_PLAYERARROW_WANTED4}, // S_PLAYERARROW_WANTED3
|
||||||
|
|
138
src/k_kart.c
138
src/k_kart.c
|
@ -967,6 +967,16 @@ static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against)
|
||||||
else
|
else
|
||||||
weight = (mobj->player->kartweight)<<FRACBITS;
|
weight = (mobj->player->kartweight)<<FRACBITS;
|
||||||
break;
|
break;
|
||||||
|
case MT_FALLINGROCK:
|
||||||
|
if (against->player)
|
||||||
|
{
|
||||||
|
if (against->player->kartstuff[k_invincibilitytimer]
|
||||||
|
|| against->player->kartstuff[k_growshrinktimer] > 0)
|
||||||
|
weight = 0;
|
||||||
|
else
|
||||||
|
weight = (against->player->kartweight)<<FRACBITS;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case MT_ORBINAUT:
|
case MT_ORBINAUT:
|
||||||
case MT_ORBINAUT_SHIELD:
|
case MT_ORBINAUT_SHIELD:
|
||||||
if (against->player)
|
if (against->player)
|
||||||
|
@ -987,7 +997,7 @@ static fixed_t K_GetMobjWeight(mobj_t *mobj, mobj_t *against)
|
||||||
return weight;
|
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)
|
||||||
{
|
{
|
||||||
mobj_t *fx;
|
mobj_t *fx;
|
||||||
fixed_t momdifx, momdify;
|
fixed_t momdifx, momdify;
|
||||||
|
@ -1022,11 +1032,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||||
}
|
}
|
||||||
|
|
||||||
mass1 = K_GetMobjWeight(mobj1, mobj2);
|
mass1 = K_GetMobjWeight(mobj1, mobj2);
|
||||||
|
mass2 = K_GetMobjWeight(mobj2, mobj1);
|
||||||
if (solid == true && mass1 > 0)
|
|
||||||
mass2 = mass1;
|
|
||||||
else
|
|
||||||
mass2 = K_GetMobjWeight(mobj2, mobj1);
|
|
||||||
|
|
||||||
momdifx = mobj1->momx - mobj2->momx;
|
momdifx = mobj1->momx - mobj2->momx;
|
||||||
momdify = mobj1->momy - mobj2->momy;
|
momdify = mobj1->momy - mobj2->momy;
|
||||||
|
@ -1078,7 +1084,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||||
fixed_t newz = mobj1->momz;
|
fixed_t newz = mobj1->momz;
|
||||||
if (mass2 > 0)
|
if (mass2 > 0)
|
||||||
mobj1->momz = mobj2->momz;
|
mobj1->momz = mobj2->momz;
|
||||||
if (mass1 > 0 && solid == false)
|
if (mass1 > 0)
|
||||||
mobj2->momz = newz;
|
mobj2->momz = newz;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1088,7 +1094,7 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||||
mobj1->momy = mobj1->momy - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), disty);
|
mobj1->momy = mobj1->momy - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), disty);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mass1 > 0 && solid == false)
|
if (mass1 > 0)
|
||||||
{
|
{
|
||||||
mobj2->momx = mobj2->momx - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -distx);
|
mobj2->momx = mobj2->momx - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -distx);
|
||||||
mobj2->momy = mobj2->momy - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -disty);
|
mobj2->momy = mobj2->momy - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -disty);
|
||||||
|
@ -1132,6 +1138,83 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Alternate version for solid objects; always pushes away from the solid object, doesn't take anything else into account.
|
||||||
|
|
||||||
|
void K_KartSolidBouncing(mobj_t *solid, mobj_t *mo)
|
||||||
|
{
|
||||||
|
fixed_t mmomx = 0, mmomy = 0;
|
||||||
|
|
||||||
|
if (!solid || !mo)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Don't bump when you're being reborn
|
||||||
|
if (mo->player && mo->player->playerstate != PST_LIVE)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (mo->player && mo->player->kartstuff[k_respawn])
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (mo->eflags & MFE_JUSTBOUNCEDWALL)
|
||||||
|
{
|
||||||
|
P_SlideMove(mo, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
mmomx = mo->player->rmomx;
|
||||||
|
mmomy = mo->player->rmomy;
|
||||||
|
|
||||||
|
if (mo->player->kartstuff[k_drift] != 0) // SRB2kart
|
||||||
|
{
|
||||||
|
mo->player->kartstuff[k_drift] = 0;
|
||||||
|
mo->player->kartstuff[k_driftcharge] = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mmomx = mo->momx;
|
||||||
|
mmomy = mo->momy;
|
||||||
|
}
|
||||||
|
|
||||||
|
mmomx = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
||||||
|
mmomy = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
|
||||||
|
|
||||||
|
{
|
||||||
|
mobj_t *fx = P_SpawnMobj(mo->x, mo->y, mo->z, MT_BUMP);
|
||||||
|
if (mo->eflags & MFE_VERTICALFLIP)
|
||||||
|
fx->eflags |= MFE_VERTICALFLIP;
|
||||||
|
else
|
||||||
|
fx->eflags &= ~MFE_VERTICALFLIP;
|
||||||
|
fx->scale = mo->scale;
|
||||||
|
|
||||||
|
S_StartSound(mo, sfx_s3k49);
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
angle_t pushangle;
|
||||||
|
fixed_t movelen;
|
||||||
|
|
||||||
|
pushangle = R_PointToAngle2(solid->x, solid->y, mo->x, mo->y);
|
||||||
|
|
||||||
|
pushangle >>= ANGLETOFINESHIFT;
|
||||||
|
|
||||||
|
movelen = P_AproxDistance(mmomx, mmomy);
|
||||||
|
|
||||||
|
if (mo->player && movelen < (15*mapheaderinfo[gamemap-1]->mobj_scale))
|
||||||
|
movelen = (15*mapheaderinfo[gamemap-1]->mobj_scale);
|
||||||
|
|
||||||
|
mmomx += FixedMul(movelen, FINECOSINE(pushangle));
|
||||||
|
mmomy += FixedMul(movelen, FINESINE(pushangle));
|
||||||
|
}
|
||||||
|
|
||||||
|
mo->eflags |= MFE_JUSTBOUNCEDWALL;
|
||||||
|
|
||||||
|
mo->momx = mmomx;
|
||||||
|
mo->momy = mmomy;
|
||||||
|
mo->player->cmomx = mmomx;
|
||||||
|
mo->player->cmomy = mmomy;
|
||||||
|
|
||||||
|
P_TryMove(mo, mo->x + mmomx, mo->y + mmomy, true);
|
||||||
|
}
|
||||||
|
|
||||||
/** \brief Checks that the player is on an offroad subsector for realsies
|
/** \brief Checks that the player is on an offroad subsector for realsies
|
||||||
|
|
||||||
\param mo player mobj object
|
\param mo player mobj object
|
||||||
|
@ -1451,7 +1534,7 @@ static void K_GetKartBoostPower(player_t *player)
|
||||||
|
|
||||||
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow] == 1) // Slow down after you've been bumped
|
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow] == 1) // Slow down after you've been bumped
|
||||||
{
|
{
|
||||||
player->kartstuff[k_speedboost] = player->kartstuff[k_accelboost] = 0;
|
player->kartstuff[k_boostpower] = player->kartstuff[k_speedboost] = player->kartstuff[k_accelboost] = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1502,13 +1585,15 @@ static void K_GetKartBoostPower(player_t *player)
|
||||||
// don't average them anymore, this would make a small boost and a high boost less useful
|
// don't average them anymore, this would make a small boost and a high boost less useful
|
||||||
// just take the highest we want instead
|
// just take the highest we want instead
|
||||||
|
|
||||||
if (boostpower + speedboost > player->kartstuff[k_speedboost])
|
player->kartstuff[k_boostpower] = boostpower;
|
||||||
player->kartstuff[k_speedboost] = boostpower + speedboost; // Immediate increase if higher
|
|
||||||
else
|
|
||||||
player->kartstuff[k_speedboost] += ((boostpower + speedboost) - player->kartstuff[k_speedboost])/TICRATE; // Smoothly decrease if lower
|
|
||||||
|
|
||||||
// Accel isn't affected by boostpower, hence the FRACUNIT. Probably for making acceleration feel consistent in offroad.
|
// value smoothing
|
||||||
player->kartstuff[k_accelboost] = FRACUNIT + accelboost;
|
if (speedboost > player->kartstuff[k_speedboost])
|
||||||
|
player->kartstuff[k_speedboost] = speedboost;
|
||||||
|
else
|
||||||
|
player->kartstuff[k_speedboost] += (speedboost - player->kartstuff[k_speedboost])/(TICRATE/2);
|
||||||
|
|
||||||
|
player->kartstuff[k_accelboost] = accelboost;
|
||||||
}
|
}
|
||||||
|
|
||||||
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
|
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
|
||||||
|
@ -1543,7 +1628,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
|
||||||
finalspeed = FixedMul(FixedMul(k_speed<<14, g_cc), player->mo->scale);
|
finalspeed = FixedMul(FixedMul(k_speed<<14, g_cc), player->mo->scale);
|
||||||
|
|
||||||
if (doboostpower)
|
if (doboostpower)
|
||||||
return FixedMul(finalspeed, player->kartstuff[k_speedboost]);
|
return FixedMul(finalspeed, player->kartstuff[k_boostpower]+player->kartstuff[k_speedboost]);
|
||||||
return finalspeed;
|
return finalspeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1558,7 +1643,7 @@ fixed_t K_GetKartAccel(player_t *player)
|
||||||
//k_accel += 3 * (9 - kartspeed); // 36 - 60
|
//k_accel += 3 * (9 - kartspeed); // 36 - 60
|
||||||
k_accel += 4 * (9 - kartspeed); // 32 - 64
|
k_accel += 4 * (9 - kartspeed); // 32 - 64
|
||||||
|
|
||||||
return FixedMul(k_accel, player->kartstuff[k_accelboost]);
|
return FixedMul(k_accel, FRACUNIT+player->kartstuff[k_accelboost]);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT16 K_GetKartFlashing(player_t *player)
|
UINT16 K_GetKartFlashing(player_t *player)
|
||||||
|
@ -2702,9 +2787,8 @@ void K_DoSneaker(player_t *player, boolean doPFlag)
|
||||||
K_PlayTauntSound(player->mo);
|
K_PlayTauntSound(player->mo);
|
||||||
|
|
||||||
K_GetKartBoostPower(player);
|
K_GetKartBoostPower(player);
|
||||||
|
if (player->kartstuff[k_speedboost] > prevboost)
|
||||||
// Push the camera forward, the amount depending on how much the speed boost increases
|
player->kartstuff[k_destboostcam] = FRACUNIT;
|
||||||
player->kartstuff[k_destboostcam] = FixedMul(FRACUNIT, player->kartstuff[k_speedboost]-prevboost);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void K_DoShrink(player_t *player)
|
static void K_DoShrink(player_t *player)
|
||||||
|
@ -3286,10 +3370,6 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
|
||||||
if (player->kartstuff[k_hyudorotimer])
|
if (player->kartstuff[k_hyudorotimer])
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// Z pos too high/low
|
|
||||||
if (abs(player->mo->z - (actor->z + actor->momz)) > 48<<FRACBITS)
|
|
||||||
continue;
|
|
||||||
|
|
||||||
// Find the angle, see who's got the best.
|
// Find the angle, see who's got the best.
|
||||||
thisang = actor->angle - R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y);
|
thisang = actor->angle - R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y);
|
||||||
if (thisang > ANGLE_180)
|
if (thisang > ANGLE_180)
|
||||||
|
@ -3317,9 +3397,13 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
|
||||||
if (player->kartstuff[k_bumper] <= 0)
|
if (player->kartstuff[k_bumper] <= 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
// Z pos too high/low
|
||||||
|
if (abs(player->mo->z - (actor->z + actor->momz)) > RING_DIST/8)
|
||||||
|
continue;
|
||||||
|
|
||||||
thisdist = P_AproxDistance(player->mo->x - (actor->x + actor->momx), player->mo->y - (actor->y + actor->momy));
|
thisdist = P_AproxDistance(player->mo->x - (actor->x + actor->momx), player->mo->y - (actor->y + actor->momy));
|
||||||
|
|
||||||
if (thisdist > RING_DIST) // Don't go for people who are too far away
|
if (thisdist > 2*RING_DIST) // Don't go for people who are too far away
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
thisavg = (AngleFixed(thisang) + thisdist) / 2;
|
thisavg = (AngleFixed(thisang) + thisdist) / 2;
|
||||||
|
@ -3411,13 +3495,13 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||||
if (player->kartstuff[k_boostcam] < player->kartstuff[k_destboostcam]
|
if (player->kartstuff[k_boostcam] < player->kartstuff[k_destboostcam]
|
||||||
&& player->kartstuff[k_destboostcam] != 0)
|
&& player->kartstuff[k_destboostcam] != 0)
|
||||||
{
|
{
|
||||||
player->kartstuff[k_boostcam] += FRACUNIT/8;
|
player->kartstuff[k_boostcam] += FRACUNIT/5;
|
||||||
if (player->kartstuff[k_boostcam] >= player->kartstuff[k_destboostcam])
|
if (player->kartstuff[k_boostcam] >= player->kartstuff[k_destboostcam])
|
||||||
player->kartstuff[k_destboostcam] = 0;
|
player->kartstuff[k_destboostcam] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
player->kartstuff[k_boostcam] -= FRACUNIT/8;
|
player->kartstuff[k_boostcam] -= FRACUNIT/5;
|
||||||
if (player->kartstuff[k_boostcam] < player->kartstuff[k_destboostcam])
|
if (player->kartstuff[k_boostcam] < player->kartstuff[k_destboostcam])
|
||||||
player->kartstuff[k_boostcam] = player->kartstuff[k_destboostcam] = 0;
|
player->kartstuff[k_boostcam] = player->kartstuff[k_destboostcam] = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,7 +20,8 @@ void K_RegisterKartStuff(void);
|
||||||
|
|
||||||
boolean K_IsPlayerLosing(player_t *player);
|
boolean K_IsPlayerLosing(player_t *player);
|
||||||
boolean K_IsPlayerWanted(player_t *player);
|
boolean K_IsPlayerWanted(player_t *player);
|
||||||
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
|
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce);
|
||||||
|
void K_KartSolidBouncing(mobj_t *solid, mobj_t *mo);
|
||||||
void K_RespawnChecker(player_t *player);
|
void K_RespawnChecker(player_t *player);
|
||||||
void K_KartMoveAnimation(player_t *player);
|
void K_KartMoveAnimation(player_t *player);
|
||||||
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
void K_KartPlayerThink(player_t *player, ticcmd_t *cmd);
|
||||||
|
|
|
@ -2081,13 +2081,25 @@ static int lib_kKartBouncing(lua_State *L)
|
||||||
mobj_t *mobj1 = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *mobj1 = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
mobj_t *mobj2 = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
|
mobj_t *mobj2 = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
|
||||||
boolean bounce = luaL_checkboolean(L, 3);
|
boolean bounce = luaL_checkboolean(L, 3);
|
||||||
boolean solid = luaL_checkboolean(L, 4);
|
|
||||||
NOHUD
|
NOHUD
|
||||||
if (!mobj1)
|
if (!mobj1)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
if (!mobj2)
|
if (!mobj2)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
K_KartBouncing(mobj1, mobj2, bounce, solid);
|
K_KartBouncing(mobj1, mobj2, bounce);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int lib_kKartSolidBouncing(lua_State *L)
|
||||||
|
{
|
||||||
|
mobj_t *solid = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
|
||||||
|
NOHUD
|
||||||
|
if (!solid)
|
||||||
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
|
if (!mo)
|
||||||
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
|
K_KartSolidBouncing(solid, mo);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2242,8 +2254,8 @@ static int lib_kDoPogoSpring(lua_State *L)
|
||||||
static int lib_kKillBananaChain(lua_State *L)
|
static int lib_kKillBananaChain(lua_State *L)
|
||||||
{
|
{
|
||||||
mobj_t *banana = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *banana = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
mobj_t *inflictor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *inflictor = *((mobj_t **)luaL_checkudata(L, 2, META_MOBJ));
|
||||||
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
mobj_t *source = *((mobj_t **)luaL_checkudata(L, 3, META_MOBJ));
|
||||||
NOHUD
|
NOHUD
|
||||||
if (!banana)
|
if (!banana)
|
||||||
return LUA_ErrInvalid(L, "mobj_t");
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
|
@ -2265,6 +2277,19 @@ static int lib_kRepairOrbitChain(lua_State *L)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int lib_kFindJawzTarget(lua_State *L)
|
||||||
|
{
|
||||||
|
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
|
||||||
|
player_t *source = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
|
||||||
|
NOHUD // HUDSAFE?
|
||||||
|
if (!actor)
|
||||||
|
return LUA_ErrInvalid(L, "mobj_t");
|
||||||
|
if (!source)
|
||||||
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
|
LUA_PushUserdata(L, K_FindJawzTarget(actor, source), META_PLAYER);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int lib_kMomentumToFacing(lua_State *L)
|
static int lib_kMomentumToFacing(lua_State *L)
|
||||||
{
|
{
|
||||||
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
@ -2487,6 +2512,7 @@ static luaL_Reg lib[] = {
|
||||||
{"K_IsPlayerLosing",lib_kIsPlayerLosing},
|
{"K_IsPlayerLosing",lib_kIsPlayerLosing},
|
||||||
{"K_IsPlayerWanted",lib_kIsPlayerWanted},
|
{"K_IsPlayerWanted",lib_kIsPlayerWanted},
|
||||||
{"K_KartBouncing",lib_kKartBouncing},
|
{"K_KartBouncing",lib_kKartBouncing},
|
||||||
|
{"K_KartSolidBouncing",lib_kKartSolidBouncing},
|
||||||
{"K_DoInstashield",lib_kDoInstashield},
|
{"K_DoInstashield",lib_kDoInstashield},
|
||||||
{"K_SpinPlayer",lib_kSpinPlayer},
|
{"K_SpinPlayer",lib_kSpinPlayer},
|
||||||
{"K_SquishPlayer",lib_kSquishPlayer},
|
{"K_SquishPlayer",lib_kSquishPlayer},
|
||||||
|
@ -2501,6 +2527,7 @@ static luaL_Reg lib[] = {
|
||||||
{"K_DoPogoSpring",lib_kDoPogoSpring},
|
{"K_DoPogoSpring",lib_kDoPogoSpring},
|
||||||
{"K_KillBananaChain",lib_kKillBananaChain},
|
{"K_KillBananaChain",lib_kKillBananaChain},
|
||||||
{"K_RepairOrbitChain",lib_kRepairOrbitChain},
|
{"K_RepairOrbitChain",lib_kRepairOrbitChain},
|
||||||
|
{"K_FindJawzTarget",lib_kFindJawzTarget},
|
||||||
{"K_MomentumToFacing",lib_kMomentumToFacing},
|
{"K_MomentumToFacing",lib_kMomentumToFacing},
|
||||||
{"K_GetKartSpeed",lib_kGetKartSpeed},
|
{"K_GetKartSpeed",lib_kGetKartSpeed},
|
||||||
{"K_GetKartAccel",lib_kGetKartAccel},
|
{"K_GetKartAccel",lib_kGetKartAccel},
|
||||||
|
|
20
src/p_map.c
20
src/p_map.c
|
@ -695,7 +695,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);
|
K_KartBouncing(thing, tmthing, false);
|
||||||
|
|
||||||
if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)
|
if (tmthing->type == MT_ORBINAUT || tmthing->type == MT_JAWZ || tmthing->type == MT_JAWZ_DUD)
|
||||||
S_StartSound(thing, sfx_s3k7b);
|
S_StartSound(thing, sfx_s3k7b);
|
||||||
|
@ -978,7 +978,7 @@ 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);
|
||||||
K_KartBouncing(tmthing, thing, false, false);
|
K_KartBouncing(tmthing, thing, false);
|
||||||
|
|
||||||
if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
|
if (thing->type == MT_ORBINAUT || thing->type == MT_JAWZ || thing->type == MT_JAWZ_DUD)
|
||||||
S_StartSound(tmthing, sfx_s3k7b);
|
S_StartSound(tmthing, sfx_s3k7b);
|
||||||
|
@ -1084,7 +1084,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
return true; // overhead
|
return true; // overhead
|
||||||
if (tmthing->z + tmthing->height < thing->z)
|
if (tmthing->z + tmthing->height < thing->z)
|
||||||
return true; // underneath
|
return true; // underneath
|
||||||
K_KartBouncing(thing, tmthing, false, false);
|
K_KartBouncing(thing, tmthing, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((thing->type == MT_SPRINGSHELL || thing->type == MT_YELLOWSHELL) && thing->health > 0
|
if ((thing->type == MT_SPRINGSHELL || thing->type == MT_YELLOWSHELL) && thing->health > 0
|
||||||
|
@ -1506,7 +1506,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
|
|
||||||
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
|
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
|
||||||
{
|
{
|
||||||
K_KartBouncing(tmthing, thing, true, false);
|
K_KartBouncing(tmthing, thing, true);
|
||||||
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
|
if (G_BattleGametype() && tmthing->player->kartstuff[k_pogospring])
|
||||||
{
|
{
|
||||||
K_StealBumper(tmthing->player, thing->player, false);
|
K_StealBumper(tmthing->player, thing->player, false);
|
||||||
|
@ -1515,7 +1515,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
}
|
}
|
||||||
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
|
else if (P_IsObjectOnGround(tmthing) && thing->momz < 0)
|
||||||
{
|
{
|
||||||
K_KartBouncing(thing, tmthing, true, false);
|
K_KartBouncing(thing, tmthing, true);
|
||||||
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
|
if (G_BattleGametype() && thing->player->kartstuff[k_pogospring])
|
||||||
{
|
{
|
||||||
K_StealBumper(thing->player, tmthing->player, false);
|
K_StealBumper(thing->player, tmthing->player, false);
|
||||||
|
@ -1523,7 +1523,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
K_KartBouncing(tmthing, thing, false, false);
|
K_KartBouncing(tmthing, thing, false);
|
||||||
|
|
||||||
if (G_BattleGametype())
|
if (G_BattleGametype())
|
||||||
{
|
{
|
||||||
|
@ -1549,12 +1549,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
|
||||||
if (tmthing->z + tmthing->height < thing->z)
|
if (tmthing->z + tmthing->height < thing->z)
|
||||||
return true; // underneath
|
return true; // underneath
|
||||||
|
|
||||||
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
|
K_KartSolidBouncing(thing, tmthing);
|
||||||
K_KartBouncing(tmthing, thing, true, true);
|
return false;
|
||||||
else
|
|
||||||
K_KartBouncing(tmthing, thing, false, true);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
// Are you touching the side of the object you're interacting with?
|
// Are you touching the side of the object you're interacting with?
|
||||||
else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height
|
else if (thing->z - FixedMul(FRACUNIT, thing->scale) <= tmthing->z + tmthing->height
|
||||||
|
|
|
@ -7039,7 +7039,7 @@ void P_MobjThinker(mobj_t *mobj)
|
||||||
mobj->tracer->destscale = scale;
|
mobj->tracer->destscale = scale;
|
||||||
|
|
||||||
if (mobj->target->player->kartstuff[k_itemamount] >= numberdisplaymin
|
if (mobj->target->player->kartstuff[k_itemamount] >= numberdisplaymin
|
||||||
&& mobj->target->player->kartstuff[k_itemamount] < 10) // Meh, too difficult to support greater than this; convert this to a decent HUD object and then maybe :V
|
&& mobj->target->player->kartstuff[k_itemamount] <= 10) // Meh, too difficult to support greater than this; convert this to a decent HUD object and then maybe :V
|
||||||
{
|
{
|
||||||
mobj_t *number = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
|
mobj_t *number = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
|
||||||
mobj_t *numx = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
|
mobj_t *numx = P_SpawnMobj(mobj->x, mobj->y, mobj->z, MT_OVERLAY);
|
||||||
|
|
|
@ -8373,8 +8373,12 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
|
|
||||||
if (player->speed > K_GetKartSpeed(player, false))
|
if (player->speed > K_GetKartSpeed(player, false))
|
||||||
dist += 4*(player->speed - K_GetKartSpeed(player, false));
|
dist += 4*(player->speed - K_GetKartSpeed(player, false));
|
||||||
|
|
||||||
if (player->kartstuff[k_boostcam])
|
if (player->kartstuff[k_boostcam])
|
||||||
|
{
|
||||||
dist -= FixedMul(dist/2, player->kartstuff[k_boostcam]);
|
dist -= FixedMul(dist/2, player->kartstuff[k_boostcam]);
|
||||||
|
height -= FixedMul(height, player->kartstuff[k_boostcam]);
|
||||||
|
}
|
||||||
|
|
||||||
if (player->climbing || player->playerstate == PST_DEAD || (player->pflags & (PF_MACESPIN|PF_ITEMHANG|PF_ROPEHANG)))
|
if (player->climbing || player->playerstate == PST_DEAD || (player->pflags & (PF_MACESPIN|PF_ITEMHANG|PF_ROPEHANG)))
|
||||||
dist <<= 1;
|
dist <<= 1;
|
||||||
|
|
Loading…
Reference in a new issue