Merge remote-tracking branch 'refs/remotes/origin/buuump'

This commit is contained in:
TehRealSalt 2018-01-15 16:30:31 -05:00
commit 43842468cf
7 changed files with 131 additions and 101 deletions

View File

@ -282,6 +282,7 @@ typedef enum
k_comebacktimer, // Battle mode, how long before you become a bomb after death k_comebacktimer, // Battle mode, how long before you become a bomb after death
// Each item needs its own power slot, for the HUD and held use // Each item needs its own power slot, for the HUD and held use
// *** ADDING A NEW ITEM? ADD IT TO K_DoBooSteal PLEASE!! -Salt ***
k_magnet, // 0x1 = Magnet in inventory k_magnet, // 0x1 = Magnet in inventory
k_boo, // 0x1 = Boo in inventory k_boo, // 0x1 = Boo in inventory
k_mushroom, // 0x1 = 1 Mushroom in inventory, 0x2 = 2 Mushrooms in inventory k_mushroom, // 0x1 = 1 Mushroom in inventory, 0x2 = 2 Mushrooms in inventory

View File

@ -57,7 +57,6 @@ static patch_t *ttkart; // *vroom* KART
static patch_t *ttcheckers; // *vroom* KART static patch_t *ttcheckers; // *vroom* KART
static patch_t *ttkflash; // flash screen static patch_t *ttkflash; // flash screen
static void F_SkyScroll(INT32 scrollspeed); static void F_SkyScroll(INT32 scrollspeed);
// //

View File

@ -700,8 +700,8 @@ static INT32 K_KartItemOddsDistance_Retro[NUMKARTITEMS][9] =
/*Mushroom*/ { 1, 0, 0, 3, 7, 5, 0, 0, 0 }, // Mushroom /*Mushroom*/ { 1, 0, 0, 3, 7, 5, 0, 0, 0 }, // Mushroom
/*Triple Mushroom*/ { 0, 0, 0, 0, 3,10, 6, 4, 0 }, // Triple Mushroom /*Triple Mushroom*/ { 0, 0, 0, 0, 3,10, 6, 4, 0 }, // Triple Mushroom
/*Mega Mushroom*/ { 0, 0, 0, 0, 0, 1, 1, 0, 0 }, // Mega Mushroom /*Mega Mushroom*/ { 0, 0, 0, 0, 0, 1, 1, 0, 0 }, // Mega Mushroom
/*Gold Mushroom*/ { 0, 0, 0, 0, 0, 1, 6, 8,12 }, // Gold Mushroom /*Gold Mushroom*/ { 0, 0, 0, 0, 0, 0, 4, 6, 8 }, // Gold Mushroom
/*Star*/ { 0, 0, 0, 0, 0, 0, 4, 6, 8 }, // Star /*Star*/ { 0, 0, 0, 0, 0, 1, 6, 8,12 }, // Star
/*Triple Banana*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Triple Banana /*Triple Banana*/ { 0, 0, 1, 1, 0, 0, 0, 0, 0 }, // Triple Banana
/*Fake Item*/ { 0, 4, 2, 1, 0, 0, 0, 0, 0 }, // Fake Item /*Fake Item*/ { 0, 4, 2, 1, 0, 0, 0, 0, 0 }, // Fake Item
@ -1062,7 +1062,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
if (cv_kartfrantic.value) // Frantic items if (cv_kartfrantic.value) // Frantic items
{ {
pdis = (13*pdis/12); // make the distances between everyone artifically higher... pdis = (13*pdis/12); // make the distances between everyone artifically higher...
pdis += distvar; // and set everyone back another place! //pdis += distvar; // and set everyone back another place!
} }
if (pingame == 1) useodds = 0; // Record Attack, or just alone if (pingame == 1) useodds = 0; // Record Attack, or just alone
@ -1131,7 +1131,7 @@ static void K_KartItemRouletteByDistance(player_t *player, ticcmd_t *cmd)
//{ SRB2kart p_user.c Stuff //{ SRB2kart p_user.c Stuff
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce) void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid)
{ {
mobj_t *fx; mobj_t *fx;
fixed_t momdifx, momdify; fixed_t momdifx, momdify;
@ -1176,26 +1176,31 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce)
{ {
fixed_t newz = mobj1->momz; fixed_t newz = mobj1->momz;
mobj1->momz = mobj2->momz; mobj1->momz = mobj2->momz;
mobj2->momz = newz; if (solid == false)
mobj2->momz = newz;
} }
mass1 = mass2 = 5*FRACUNIT; mass1 = mass2 = 5*FRACUNIT;
if (mobj1->player) if (mobj1->player)
mass1 = (mobj1->player->kartweight)*FRACUNIT; mass1 = (mobj1->player->kartweight)*FRACUNIT;
if (mobj2->player) if (mobj2->player)
mass2 = (mobj2->player->kartweight)*FRACUNIT; mass2 = (mobj2->player->kartweight)*FRACUNIT;
else if (solid == true)
mass2 = mass1;
momdifx = mobj1->momx - mobj2->momx; momdifx = mobj1->momx - mobj2->momx;
momdify = mobj1->momy - mobj2->momy; momdify = mobj1->momy - mobj2->momy;
// if the speed difference is less than this let's assume they're going proportionately faster from each other // if the speed difference is less than this let's assume they're going proportionately faster from each other
if (P_AproxDistance(momdifx, momdify) < 25*FRACUNIT) if (P_AproxDistance(momdifx, momdify) < (25*mapheaderinfo[gamemap-1]->mobj_scale))
{ {
fixed_t momdiflength = P_AproxDistance(momdifx, momdify); fixed_t momdiflength = P_AproxDistance(momdifx, momdify);
fixed_t normalisedx = FixedDiv(momdifx, momdiflength); fixed_t normalisedx = FixedDiv(momdifx, momdiflength);
fixed_t normalisedy = FixedDiv(momdify, momdiflength); fixed_t normalisedy = FixedDiv(momdify, momdiflength);
momdifx = FixedMul(25*FRACUNIT, normalisedx); momdifx = FixedMul((25*mapheaderinfo[gamemap-1]->mobj_scale), normalisedx);
momdify = FixedMul(25*FRACUNIT, normalisedy); momdify = FixedMul((25*mapheaderinfo[gamemap-1]->mobj_scale), normalisedy);
} }
distx = mobj1->x - mobj2->x; distx = mobj1->x - mobj2->x;
@ -1220,8 +1225,11 @@ void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce)
mobj1->momx = mobj1->momx - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), distx); mobj1->momx = mobj1->momx - FixedMul(FixedMul(FixedDiv(2*mass2, mass1 + mass2), p), distx);
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);
mobj2->momx = mobj2->momx - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -distx); if (solid == false)
mobj2->momy = mobj2->momy - FixedMul(FixedMul(FixedDiv(2*mass1, mass1 + mass2), p), -disty); {
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);
}
// Because this is done during collision now, rmomx and rmomy need to be recalculated // Because this is done during collision now, rmomx and rmomy need to be recalculated
// so that friction doesn't immediately decide to stop the player if they're at a standstill // so that friction doesn't immediately decide to stop the player if they're at a standstill
@ -2448,36 +2456,46 @@ static void K_DoBooSteal(player_t *player)
{ {
INT32 i, numplayers = 0; INT32 i, numplayers = 0;
INT32 playerswappable[MAXPLAYERS]; INT32 playerswappable[MAXPLAYERS];
INT32 stealplayer = 0; // The player that's getting stolen from INT32 stealplayer = -1; // The player that's getting stolen from
INT32 prandom = 0; INT32 prandom = 0;
if (gametype == GT_MATCH && player->kartstuff[k_balloon] <= 0)
return;
for (i = 0; i < MAXPLAYERS; i++) for (i = 0; i < MAXPLAYERS; i++)
{ {
if (playeringame[i] && players[i].mo && players[i].mo->health > 0 && players[i].playerstate == PST_LIVE if (playeringame[i] && players[i].mo && players[i].mo->health > 0 && players[i].playerstate == PST_LIVE
&& player != &players[i] && !players[i].exiting && !(players[i].spectator) && player != &players[i] && !players[i].exiting && !players[i].spectator // Player in-game
// Can steal from this player
&& ((gametype == GT_RACE && players[i].kartstuff[k_position] < player->kartstuff[k_position]) && ((gametype == GT_RACE && players[i].kartstuff[k_position] < player->kartstuff[k_position])
|| (gametype != GT_RACE && players[i].kartstuff[k_balloon] > 0)) || (gametype != GT_RACE && players[i].kartstuff[k_balloon] > 0))
&& (players[i].kartstuff[k_star] || players[i].kartstuff[k_mushroom] || players[i].kartstuff[k_goldshroom] // Has an item
|| players[i].kartstuff[k_megashroom] || players[i].kartstuff[k_lightning] || players[i].kartstuff[k_blueshell] && (players[i].kartstuff[k_magnet]
|| players[i].kartstuff[k_greenshell] & 2 || players[i].kartstuff[k_triplegreenshell] & 8 || players[i].kartstuff[k_mushroom]
|| players[i].kartstuff[k_redshell] & 2 || players[i].kartstuff[k_tripleredshell] & 8 || players[i].kartstuff[k_megashroom]
|| players[i].kartstuff[k_banana] & 2 || players[i].kartstuff[k_triplebanana] & 8 || players[i].kartstuff[k_goldshroom]
|| players[i].kartstuff[k_fakeitem] & 2 || players[i].kartstuff[k_bobomb] & 2 || players[i].kartstuff[k_star]
|| players[i].kartstuff[k_banana] & 2
|| players[i].kartstuff[k_triplebanana] & 8
|| players[i].kartstuff[k_fakeitem] & 2
|| players[i].kartstuff[k_greenshell] & 2
|| players[i].kartstuff[k_triplegreenshell] & 8
|| players[i].kartstuff[k_redshell] & 2
|| players[i].kartstuff[k_tripleredshell] & 8
|| players[i].kartstuff[k_bobomb] & 2
|| players[i].kartstuff[k_lightning]
|| players[i].kartstuff[k_blueshell]
|| players[i].kartstuff[k_fireflower]
|| players[i].kartstuff[k_feather] & 1 || players[i].kartstuff[k_feather] & 1
|| players[i].kartstuff[k_boo])) // Stealing boos with boos? sounds like fun || players[i].kartstuff[k_boo])) // Stealing boos with boos? sounds like fun
{ {
playerswappable[numplayers] = i+1; playerswappable[numplayers] = i;
numplayers++; numplayers++;
} }
} }
prandom = P_RandomFixed(); prandom = P_RandomFixed();
if (player->kartstuff[k_position] == 1 || numplayers < 1 || !multiplayer) // No-one can be stolen from? Get longer invisibility for nothing if ((gametype == GT_RACE && player->kartstuff[k_position] == 1) || numplayers == 0) // No-one can be stolen from? Get longer invisibility for nothing
{ {
player->kartstuff[k_bootimer] = bootime; player->kartstuff[k_bootimer] = bootime;
player->kartstuff[k_bootaketimer] = boostealtime; player->kartstuff[k_bootaketimer] = boostealtime;
@ -2486,17 +2504,15 @@ static void K_DoBooSteal(player_t *player)
} }
else if (numplayers == 1) // With just 2 players, we just need to set the other player to be the one to steal from else if (numplayers == 1) // With just 2 players, we just need to set the other player to be the one to steal from
{ {
stealplayer = playerswappable[numplayers - 1]; stealplayer = playerswappable[numplayers-1];
} }
else if (numplayers > 1) // We need to choose between the available candidates for the 2nd player else if (numplayers > 1) // We need to choose between the available candidates for the 2nd player
{ {
stealplayer = playerswappable[prandom%(numplayers-1)]; stealplayer = playerswappable[prandom%(numplayers-1)];
} }
if (stealplayer) // Now here's where we do the stealing, has to be done here because we still know the player we're stealing from if (stealplayer > -1) // Now here's where we do the stealing, has to be done here because we still know the player we're stealing from
{ {
stealplayer -= 1; // stealplayer is +1 so we know if it found there actually WAS a player
player->kartstuff[k_bootimer] = bootime; player->kartstuff[k_bootimer] = bootime;
player->kartstuff[k_bootaketimer] = boostealtime; player->kartstuff[k_bootaketimer] = boostealtime;
player->kartstuff[k_boo] = 0; player->kartstuff[k_boo] = 0;
@ -2572,12 +2588,22 @@ static void K_DoBooSteal(player_t *player)
player->kartstuff[k_bobomb] |= 2; player->kartstuff[k_bobomb] |= 2;
players[stealplayer].kartstuff[k_bobomb] &= ~2; players[stealplayer].kartstuff[k_bobomb] &= ~2;
} }
else if (players[stealplayer].kartstuff[k_magnet])
{
player->kartstuff[k_magnet] = players[stealplayer].kartstuff[k_magnet];
players[stealplayer].kartstuff[k_magnet] = 0;
}
else if (players[stealplayer].kartstuff[k_fireflower])
{
player->kartstuff[k_fireflower] = players[stealplayer].kartstuff[k_fireflower];
players[stealplayer].kartstuff[k_fireflower] = 0;
}
else if (players[stealplayer].kartstuff[k_feather] & 1) else if (players[stealplayer].kartstuff[k_feather] & 1)
{ {
player->kartstuff[k_feather] |= 1; player->kartstuff[k_feather] |= 1;
players[stealplayer].kartstuff[k_feather] &= ~1; players[stealplayer].kartstuff[k_feather] &= ~1;
} }
if (players[stealplayer].kartstuff[k_boo]) else if (players[stealplayer].kartstuff[k_boo])
{ {
player->kartstuff[k_boo] = players[stealplayer].kartstuff[k_boo]; player->kartstuff[k_boo] = players[stealplayer].kartstuff[k_boo];
players[stealplayer].kartstuff[k_boo] = 0; players[stealplayer].kartstuff[k_boo] = 0;
@ -2672,16 +2698,16 @@ void K_DoBouncePad(mobj_t *mo, fixed_t vertispeed)
thrust = FixedMul(thrust, 5*FRACUNIT/4); thrust = FixedMul(thrust, 5*FRACUNIT/4);
else if (mo->player->kartstuff[k_startimer]) else if (mo->player->kartstuff[k_startimer])
thrust = FixedMul(thrust, 9*FRACUNIT/8); thrust = FixedMul(thrust, 9*FRACUNIT/8);
mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), thrust); mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, mo->scale));
} }
else else
{ {
thrust = P_AproxDistance(mo->momx,mo->momy); thrust = P_AproxDistance(mo->momx,mo->momy);
if (thrust < 4<<FRACBITS) if (thrust < 8<<FRACBITS)
thrust = 4<<FRACBITS;
if (thrust > 8<<FRACBITS)
thrust = 8<<FRACBITS; thrust = 8<<FRACBITS;
mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), thrust); if (thrust > 16<<FRACBITS)
thrust = 16<<FRACBITS;
mo->momz = FixedMul(FINESINE(ANGLE_22h>>ANGLETOFINESHIFT), FixedMul(thrust, mo->scale));
} }
} }
else else
@ -2810,7 +2836,7 @@ static void K_KartDrift(player_t *player, boolean onground)
} }
// Drifting: left or right? // Drifting: left or right?
if ((player->cmd.buttons & BT_DRIFTLEFT) && player->speed > (10<<16) && player->kartstuff[k_jmp] == 1 if ((player->cmd.buttons & BT_DRIFTLEFT) && player->speed > FixedMul(10<<16, player->mo->scale) && player->kartstuff[k_jmp] == 1
&& (player->kartstuff[k_drift] == 0 || player->kartstuff[k_driftend] == 1)) // && player->kartstuff[k_drift] != 1) && (player->kartstuff[k_drift] == 0 || player->kartstuff[k_driftend] == 1)) // && player->kartstuff[k_drift] != 1)
{ {
// Starting left drift // Starting left drift
@ -2818,7 +2844,7 @@ static void K_KartDrift(player_t *player, boolean onground)
player->kartstuff[k_driftend] = 0; player->kartstuff[k_driftend] = 0;
player->kartstuff[k_driftcharge] = 0; player->kartstuff[k_driftcharge] = 0;
} }
else if ((player->cmd.buttons & BT_DRIFTRIGHT) && player->speed > (10<<16) && player->kartstuff[k_jmp] == 1 else if ((player->cmd.buttons & BT_DRIFTRIGHT) && player->speed > FixedMul(10<<16, player->mo->scale) && player->kartstuff[k_jmp] == 1
&& (player->kartstuff[k_drift] == 0 || player->kartstuff[k_driftend] == 1)) // && player->kartstuff[k_drift] != -1) && (player->kartstuff[k_drift] == 0 || player->kartstuff[k_driftend] == 1)) // && player->kartstuff[k_drift] != -1)
{ {
// Starting right drift // Starting right drift
@ -2882,7 +2908,7 @@ static void K_KartDrift(player_t *player, boolean onground)
// Stop drifting // Stop drifting
if (player->kartstuff[k_spinouttimer] > 0 // banana peel if (player->kartstuff[k_spinouttimer] > 0 // banana peel
|| player->speed < (10<<16)) // you're too slow! || player->speed < FixedMul(10<<16, player->mo->scale)) // you're too slow!
{ {
player->kartstuff[k_drift] = 0; player->kartstuff[k_drift] = 0;
player->kartstuff[k_driftcharge] = 0; player->kartstuff[k_driftcharge] = 0;
@ -4796,17 +4822,17 @@ static void K_drawKartSpeedometer(void)
if (cv_speedometer.value == 1) if (cv_speedometer.value == 1)
{ {
convSpeed = FixedMul(stplyr->speed, 142371)/FRACUNIT; // 2.172409058 convSpeed = FixedDiv(FixedMul(stplyr->speed, 142371), mapheaderinfo[gamemap-1]->mobj_scale)/FRACUNIT; // 2.172409058
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d km/h", convSpeed)); V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d km/h", convSpeed));
} }
else if (cv_speedometer.value == 2) else if (cv_speedometer.value == 2)
{ {
convSpeed = FixedMul(stplyr->speed, 88465)/FRACUNIT; // 1.349868774 convSpeed = FixedDiv(FixedMul(stplyr->speed, 88465), mapheaderinfo[gamemap-1]->mobj_scale)/FRACUNIT; // 1.349868774
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d mph", convSpeed)); V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d mph", convSpeed));
} }
else if (cv_speedometer.value == 3) else if (cv_speedometer.value == 3)
{ {
convSpeed = stplyr->speed/FRACUNIT; convSpeed = FixedDiv(stplyr->speed, mapheaderinfo[gamemap-1]->mobj_scale)/FRACUNIT;
V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/s", convSpeed)); V_DrawKartString(SPDM_X, SPDM_Y, V_HUDTRANS|splitflags, va("%3d fu/s", convSpeed));
} }
} }

View File

@ -18,7 +18,7 @@ UINT8 K_GetKartColorByName(const char *name);
void K_RegisterKartStuff(void); void K_RegisterKartStuff(void);
UINT8 K_GetKartCC(void); UINT8 K_GetKartCC(void);
void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce); void K_KartBouncing(mobj_t *mobj1, mobj_t *mobj2, boolean bounce, boolean solid);
void K_LakituChecker(player_t *player); void K_LakituChecker(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);

View File

@ -2005,12 +2005,13 @@ 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); K_KartBouncing(mobj1, mobj2, bounce, solid);
return 0; return 0;
} }

View File

@ -1232,7 +1232,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); K_KartBouncing(thing, tmthing, false, 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
@ -1679,7 +1679,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); K_KartBouncing(tmthing, thing, true, false);
if (gametype != GT_RACE && tmthing->player->kartstuff[k_feather] & 2) if (gametype != GT_RACE && tmthing->player->kartstuff[k_feather] & 2)
{ {
K_StealBalloon(tmthing->player, thing->player, false); K_StealBalloon(tmthing->player, thing->player, false);
@ -1688,7 +1688,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); K_KartBouncing(thing, tmthing, true, false);
if (gametype != GT_RACE && thing->player->kartstuff[k_feather] & 2) if (gametype != GT_RACE && thing->player->kartstuff[k_feather] & 2)
{ {
K_StealBalloon(thing->player, tmthing->player, false); K_StealBalloon(thing->player, tmthing->player, false);
@ -1696,7 +1696,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
} }
} }
else else
K_KartBouncing(tmthing, thing, false); K_KartBouncing(tmthing, thing, false, false);
if (gametype != GT_RACE) if (gametype != GT_RACE)
{ {
@ -1714,6 +1714,21 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true; return true;
} }
else if (thing->flags & MF_SOLID)
{
// see if it went over / under
if (tmthing->z > thing->z + thing->height)
return true; // overhead
if (tmthing->z + tmthing->height < thing->z)
return true; // underneath
if (P_IsObjectOnGround(thing) && tmthing->momz < 0)
K_KartBouncing(tmthing, thing, true, true);
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
&& thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z) && thing->z + thing->height + FixedMul(FRACUNIT, thing->scale) >= tmthing->z)
@ -2739,7 +2754,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
if (!(thing->flags & MF_NOCLIP)) if (!(thing->flags & MF_NOCLIP))
{ {
//All things are affected by their scale. //All things are affected by their scale.
fixed_t maxstep = MAXSTEPMOVE; //FixedMul(MAXSTEPMOVE, thing->scale); fixed_t maxstep = FixedMul(MAXSTEPMOVE, mapheaderinfo[gamemap-1]->mobj_scale);
if (thing->player) if (thing->player)
{ {
@ -3163,38 +3178,25 @@ static void P_HitSlideLine(line_t *ld)
// //
static void P_HitBounceLine(line_t *ld) static void P_HitBounceLine(line_t *ld)
{ {
angle_t lineangle, moveangle, deltaangle; INT32 side;
angle_t lineangle;
fixed_t movelen; fixed_t movelen;
if (ld->slopetype == ST_HORIZONTAL) side = P_PointOnLineSide(slidemo->x, slidemo->y, ld);
{ lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy)-ANGLE_90;
tmymove = -tmymove;
return;
}
if (ld->slopetype == ST_VERTICAL) if (side == 1)
{ lineangle += ANGLE_180;
tmxmove = -tmxmove;
return;
}
lineangle = R_PointToAngle2(0, 0, ld->dx, ld->dy);
if (lineangle >= ANGLE_180)
lineangle -= ANGLE_180;
moveangle = R_PointToAngle2(0, 0, tmxmove, tmymove);
deltaangle = moveangle + 2*(lineangle - moveangle);
lineangle >>= ANGLETOFINESHIFT; lineangle >>= ANGLETOFINESHIFT;
deltaangle >>= ANGLETOFINESHIFT;
movelen = P_AproxDistance(tmxmove, tmymove); movelen = P_AproxDistance(tmxmove, tmymove);
tmxmove = FixedMul(movelen, FINECOSINE(deltaangle)); if (slidemo->player && movelen < (15*mapheaderinfo[gamemap-1]->mobj_scale))
tmymove = FixedMul(movelen, FINESINE(deltaangle)); movelen = (15*mapheaderinfo[gamemap-1]->mobj_scale);
deltaangle = R_PointToAngle2(0, 0, tmxmove, tmymove); tmxmove += FixedMul(movelen, FINECOSINE(lineangle));
tmymove += FixedMul(movelen, FINESINE(lineangle));
} }
// //
@ -3823,16 +3825,16 @@ void P_BounceMove(mobj_t *mo)
{ {
fixed_t leadx, leady; fixed_t leadx, leady;
fixed_t trailx, traily; fixed_t trailx, traily;
fixed_t newx, newy; //fixed_t newx, newy;
INT32 hitcount; //INT32 hitcount;
fixed_t mmomx = 0, mmomy = 0; fixed_t mmomx = 0, mmomy = 0;
slidemo = mo; slidemo = mo;
hitcount = 0; //hitcount = 0;
retry: /*retry:
if (++hitcount == 3) if (++hitcount == 3)
goto bounceback; // don't loop forever goto bounceback; // don't loop forever*/
if (mo->player) if (mo->player)
{ {
@ -3881,7 +3883,7 @@ retry:
P_PathTraverse(leadx, traily, leadx + mmomx, traily + mmomy, PT_ADDLINES, PTR_SlideTraverse); P_PathTraverse(leadx, traily, leadx + mmomx, traily + mmomy, PT_ADDLINES, PTR_SlideTraverse);
// move up to the wall // move up to the wall
if (bestslidefrac == FRACUNIT + 1) /*if (bestslidefrac == FRACUNIT + 1)
{ {
// the move must have hit the middle, so bounce straight back // the move must have hit the middle, so bounce straight back
bounceback: bounceback:
@ -3903,10 +3905,10 @@ bounceback:
} }
} }
return; return;
} }*/
// fudge a bit to make sure it doesn't hit // fudge a bit to make sure it doesn't hit
bestslidefrac -= 0x800; /*bestslidefrac -= 0x800;
if (bestslidefrac > 0) if (bestslidefrac > 0)
{ {
newx = FixedMul(mmomx, bestslidefrac); newx = FixedMul(mmomx, bestslidefrac);
@ -3914,7 +3916,7 @@ bounceback:
if (!P_TryMove(mo, mo->x + newx, mo->y + newy, true)) if (!P_TryMove(mo, mo->x + newx, mo->y + newy, true))
goto bounceback; goto bounceback;
} }*/
// Now continue along the wall. // Now continue along the wall.
// First calculate remainder. // First calculate remainder.
@ -3946,6 +3948,18 @@ bounceback:
{ {
tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); tmxmove = FixedMul(mmomx, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3))); tmymove = FixedMul(mmomy, (FRACUNIT - (FRACUNIT>>2) - (FRACUNIT>>3)));
if (mo->player)
{
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;
if (cv_collidesounds.value == 1)
S_StartSound(mo, cv_collidesoundnum.value);
}
} }
P_HitBounceLine(bestslideline); // clip the moves P_HitBounceLine(bestslideline); // clip the moves
@ -3959,8 +3973,9 @@ bounceback:
mo->player->cmomy = tmymove; mo->player->cmomy = tmymove;
} }
if (!P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true)) /*if (!P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true))
goto retry; goto retry;*/
P_TryMove(mo, mo->x + tmxmove, mo->y + tmymove, true);
} }
// //

View File

@ -8351,32 +8351,32 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
camspeed = cv_cam_speed.value; camspeed = cv_cam_speed.value;
camstill = cv_cam_still.value; camstill = cv_cam_still.value;
camrotate = cv_cam_rotate.value; camrotate = cv_cam_rotate.value;
camdist = FixedMul(cv_cam_dist.value, mo->scale); camdist = FixedMul(cv_cam_dist.value, mapheaderinfo[gamemap-1]->mobj_scale);
camheight = FixedMul(cv_cam_height.value, mo->scale); camheight = FixedMul(cv_cam_height.value, mapheaderinfo[gamemap-1]->mobj_scale);
} }
else if (thiscam == &camera2) // Camera 2 else if (thiscam == &camera2) // Camera 2
{ {
camspeed = cv_cam2_speed.value; camspeed = cv_cam2_speed.value;
camstill = cv_cam2_still.value; camstill = cv_cam2_still.value;
camrotate = cv_cam2_rotate.value; camrotate = cv_cam2_rotate.value;
camdist = FixedMul(cv_cam2_dist.value, mo->scale); camdist = FixedMul(cv_cam2_dist.value, mapheaderinfo[gamemap-1]->mobj_scale);
camheight = FixedMul(cv_cam2_height.value, mo->scale); camheight = FixedMul(cv_cam2_height.value, mapheaderinfo[gamemap-1]->mobj_scale);
} }
else if (thiscam == &camera3) // Camera 3 else if (thiscam == &camera3) // Camera 3
{ {
camspeed = cv_cam3_speed.value; camspeed = cv_cam3_speed.value;
camstill = cv_cam3_still.value; camstill = cv_cam3_still.value;
camrotate = cv_cam3_rotate.value; camrotate = cv_cam3_rotate.value;
camdist = FixedMul(cv_cam3_dist.value, mo->scale); camdist = FixedMul(cv_cam3_dist.value, mapheaderinfo[gamemap-1]->mobj_scale);
camheight = FixedMul(cv_cam3_height.value, mo->scale); camheight = FixedMul(cv_cam3_height.value, mapheaderinfo[gamemap-1]->mobj_scale);
} }
else // Camera 4 else // Camera 4
{ {
camspeed = cv_cam4_speed.value; camspeed = cv_cam4_speed.value;
camstill = cv_cam4_still.value; camstill = cv_cam4_still.value;
camrotate = cv_cam4_rotate.value; camrotate = cv_cam4_rotate.value;
camdist = FixedMul(cv_cam4_dist.value, mo->scale); camdist = FixedMul(cv_cam4_dist.value, mapheaderinfo[gamemap-1]->mobj_scale);
camheight = FixedMul(cv_cam4_height.value, mo->scale); camheight = FixedMul(cv_cam4_height.value, mapheaderinfo[gamemap-1]->mobj_scale);
} }
#ifdef REDSANALOG #ifdef REDSANALOG
@ -8536,18 +8536,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
dist = FixedMul(dist, 3*FRACUNIT/2); dist = FixedMul(dist, 3*FRACUNIT/2);
height = FixedMul(height, 3*FRACUNIT/2); height = FixedMul(height, 3*FRACUNIT/2);
} }
else if (splitscreen > 1) // smallscreen splits should get 7/8 distance (shorter feels better, oddly enough)
{
dist = FixedMul(dist, 7*FRACUNIT/8);
height = FixedMul(height, 7*FRACUNIT/8);
}
// x1.2 dist for analog
/*if (P_AnalogMove(player))
{
dist = FixedMul(dist, 6*FRACUNIT/5);
height = FixedMul(height, 6*FRACUNIT/5);
}*/
if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->pflags & (PF_MACESPIN|PF_ITEMHANG|PF_ROPEHANG))) if (player->climbing || player->exiting || player->playerstate == PST_DEAD || (player->pflags & (PF_MACESPIN|PF_ITEMHANG|PF_ROPEHANG)))
dist <<= 1; dist <<= 1;