mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 12:31:54 +00:00
Merge branch 'master' into new-cars-movie
This commit is contained in:
commit
4555b20e6c
7 changed files with 61 additions and 11 deletions
|
|
@ -1164,6 +1164,8 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
||||||
}*/
|
}*/
|
||||||
else if (fastcmp(word, "MOBJSCALE"))
|
else if (fastcmp(word, "MOBJSCALE"))
|
||||||
mapheaderinfo[num-1]->mobj_scale = get_number(word2);
|
mapheaderinfo[num-1]->mobj_scale = get_number(word2);
|
||||||
|
else if (fastcmp(word, "DEFAULTWAYPOINTRADIUS"))
|
||||||
|
mapheaderinfo[num-1]->default_waypoint_radius = get_number(word2);
|
||||||
|
|
||||||
// Individual triggers for level flags, for ease of use (and 2.0 compatibility)
|
// Individual triggers for level flags, for ease of use (and 2.0 compatibility)
|
||||||
else if (fastcmp(word, "SCRIPTISFILE"))
|
else if (fastcmp(word, "SCRIPTISFILE"))
|
||||||
|
|
|
||||||
|
|
@ -290,6 +290,7 @@ typedef struct
|
||||||
// SRB2kart
|
// SRB2kart
|
||||||
//boolean automap; ///< Displays a level's white map outline in modified games
|
//boolean automap; ///< Displays a level's white map outline in modified games
|
||||||
fixed_t mobj_scale; ///< Replacement for TOL_ERZ3
|
fixed_t mobj_scale; ///< Replacement for TOL_ERZ3
|
||||||
|
fixed_t default_waypoint_radius; ///< 0 is a special value for DEFAULT_WAYPOINT_RADIUS, but scaled with mobjscale
|
||||||
|
|
||||||
// Music stuff.
|
// Music stuff.
|
||||||
UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds
|
UINT32 musinterfadeout; ///< Fade out level music on intermission screen in milliseconds
|
||||||
|
|
|
||||||
13
src/k_kart.c
13
src/k_kart.c
|
|
@ -6879,6 +6879,11 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
|
||||||
basedrift += (basedrift / greasetics) * player->kartstuff[k_tiregrease];
|
basedrift += (basedrift / greasetics) * player->kartstuff[k_tiregrease];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||||
|
{
|
||||||
|
countersteer = 3*countersteer/2;
|
||||||
|
}
|
||||||
|
|
||||||
return basedrift + (FixedMul(driftadjust * FRACUNIT, countersteer) / FRACUNIT);
|
return basedrift + (FixedMul(driftadjust * FRACUNIT, countersteer) / FRACUNIT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -6914,6 +6919,11 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
|
||||||
turnvalue = 5*turnvalue/4;
|
turnvalue = 5*turnvalue/4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||||
|
{
|
||||||
|
turnvalue = 3*turnvalue/2;
|
||||||
|
}
|
||||||
|
|
||||||
turnvalue = FixedMul(turnvalue * FRACUNIT, weightadjust) / FRACUNIT; // Weight has a small effect on turning
|
turnvalue = FixedMul(turnvalue * FRACUNIT, weightadjust) / FRACUNIT; // Weight has a small effect on turning
|
||||||
|
|
||||||
return turnvalue;
|
return turnvalue;
|
||||||
|
|
@ -8034,6 +8044,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||||
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
|
if (G_BattleGametype() && player->kartstuff[k_bumper] <= 0)
|
||||||
player->mo->friction += 1228;
|
player->mo->friction += 1228;
|
||||||
|
|
||||||
|
if (player->mo->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||||
|
player->mo->friction += 614;
|
||||||
|
|
||||||
// Wipeout slowdown
|
// Wipeout slowdown
|
||||||
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
|
if (player->kartstuff[k_spinouttimer] && player->kartstuff[k_wipeoutslow])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1937,8 +1937,7 @@ void K_AdjustWaypointsParameters (void)
|
||||||
waypointmobj;
|
waypointmobj;
|
||||||
waypointmobj = waypointmobj->tracer
|
waypointmobj = waypointmobj->tracer
|
||||||
){
|
){
|
||||||
if (K_AnchorWaypointRadius(waypointmobj, anchor))
|
K_AnchorWaypointRadius(waypointmobj, anchor);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,8 @@
|
||||||
#include "p_mobj.h"
|
#include "p_mobj.h"
|
||||||
#include "k_pathfind.h"
|
#include "k_pathfind.h"
|
||||||
|
|
||||||
|
#define DEFAULT_WAYPOINT_RADIUS (384)
|
||||||
|
|
||||||
typedef struct waypoint_s
|
typedef struct waypoint_s
|
||||||
{
|
{
|
||||||
mobj_t *mobj;
|
mobj_t *mobj;
|
||||||
|
|
|
||||||
49
src/p_mobj.c
49
src/p_mobj.c
|
|
@ -1248,29 +1248,45 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Less gravity underwater.
|
// Less gravity underwater.
|
||||||
if (mo->eflags & MFE_UNDERWATER && !goopgravity)
|
if ((mo->eflags & MFE_UNDERWATER) && !goopgravity)
|
||||||
gravityadd = gravityadd/3;
|
{
|
||||||
|
if (mo->momz * P_MobjFlip(mo) <= 0)
|
||||||
|
{
|
||||||
|
gravityadd = 4*gravityadd/3;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gravityadd = gravityadd/3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mo->player)
|
if (mo->player)
|
||||||
{
|
{
|
||||||
//if ((mo->player->pflags & PF_GLIDING)
|
|
||||||
//|| (mo->player->charability == CA_FLY && (mo->player->powers[pw_tailsfly]
|
|
||||||
// || (mo->state >= &states[S_PLAY_SPC1] && mo->state <= &states[S_PLAY_SPC4]))))
|
|
||||||
// gravityadd = gravityadd/3; // less gravity while flying/gliding
|
|
||||||
if (mo->player->climbing || (mo->player->pflags & PF_NIGHTSMODE))
|
if (mo->player->climbing || (mo->player->pflags & PF_NIGHTSMODE))
|
||||||
|
{
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!(mo->flags2 & MF2_OBJECTFLIP) != !(mo->player->powers[pw_gravityboots])) // negated to turn numeric into bool - would be double negated, but not needed if both would be
|
if (!(mo->flags2 & MF2_OBJECTFLIP) != !(mo->player->powers[pw_gravityboots])) // negated to turn numeric into bool - would be double negated, but not needed if both would be
|
||||||
{
|
{
|
||||||
gravityadd = -gravityadd;
|
gravityadd = -gravityadd;
|
||||||
mo->eflags ^= MFE_VERTICALFLIP;
|
mo->eflags ^= MFE_VERTICALFLIP;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (wasflip == !(mo->eflags & MFE_VERTICALFLIP)) // note!! == ! is not equivalent to != here - turns numeric into bool this way
|
if (wasflip == !(mo->eflags & MFE_VERTICALFLIP)) // note!! == ! is not equivalent to != here - turns numeric into bool this way
|
||||||
|
{
|
||||||
P_PlayerFlip(mo);
|
P_PlayerFlip(mo);
|
||||||
|
}
|
||||||
|
|
||||||
if (mo->player->kartstuff[k_pogospring])
|
if (mo->player->kartstuff[k_pogospring])
|
||||||
|
{
|
||||||
gravityadd = (5*gravityadd)/2;
|
gravityadd = (5*gravityadd)/2;
|
||||||
|
}
|
||||||
|
|
||||||
if (mo->player->kartstuff[k_waterskip])
|
if (mo->player->kartstuff[k_waterskip])
|
||||||
|
{
|
||||||
gravityadd = (4*gravityadd)/3;
|
gravityadd = (4*gravityadd)/3;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -1278,10 +1294,15 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
if (mo->flags2 & MF2_OBJECTFLIP)
|
if (mo->flags2 & MF2_OBJECTFLIP)
|
||||||
{
|
{
|
||||||
mo->eflags |= MFE_VERTICALFLIP;
|
mo->eflags |= MFE_VERTICALFLIP;
|
||||||
|
|
||||||
if (mo->z + mo->height >= mo->ceilingz)
|
if (mo->z + mo->height >= mo->ceilingz)
|
||||||
|
{
|
||||||
gravityadd = 0;
|
gravityadd = 0;
|
||||||
|
}
|
||||||
else if (gravityadd < 0) // Don't sink, only rise up
|
else if (gravityadd < 0) // Don't sink, only rise up
|
||||||
gravityadd *= -1;
|
{
|
||||||
|
gravityadd = -gravityadd;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else //Otherwise, sort through the other exceptions.
|
else //Otherwise, sort through the other exceptions.
|
||||||
{
|
{
|
||||||
|
|
@ -1316,7 +1337,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MT_WATERDROP:
|
case MT_WATERDROP:
|
||||||
gravityadd >>= 1;
|
gravityadd /= 2;
|
||||||
break;
|
break;
|
||||||
case MT_BANANA:
|
case MT_BANANA:
|
||||||
case MT_EGGMANITEM:
|
case MT_EGGMANITEM:
|
||||||
|
|
@ -1341,7 +1362,9 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
|
||||||
|
|
||||||
// Goop has slower, reversed gravity
|
// Goop has slower, reversed gravity
|
||||||
if (goopgravity)
|
if (goopgravity)
|
||||||
|
{
|
||||||
gravityadd = -gravityadd/5;
|
gravityadd = -gravityadd/5;
|
||||||
|
}
|
||||||
|
|
||||||
gravityadd = FixedMul(gravityadd, mo->scale);
|
gravityadd = FixedMul(gravityadd, mo->scale);
|
||||||
|
|
||||||
|
|
@ -12665,9 +12688,17 @@ ML_NOCLIMB : Direction not controllable
|
||||||
break;
|
break;
|
||||||
case MT_WAYPOINT:
|
case MT_WAYPOINT:
|
||||||
{
|
{
|
||||||
|
const fixed_t mobjscale =
|
||||||
|
mapheaderinfo[gamemap-1]->default_waypoint_radius;
|
||||||
|
|
||||||
// Just like MT_SPINMACEPOINT, this now works here too!
|
// Just like MT_SPINMACEPOINT, this now works here too!
|
||||||
INT32 line = P_FindSpecialLineFromTag(2000, mthing->angle, -1);
|
INT32 line = P_FindSpecialLineFromTag(2000, mthing->angle, -1);
|
||||||
mobj->radius = 384*FRACUNIT;
|
|
||||||
|
if (mobjscale == 0)
|
||||||
|
mobj->radius = DEFAULT_WAYPOINT_RADIUS * mapobjectscale;
|
||||||
|
else
|
||||||
|
mobj->radius = mobjscale;
|
||||||
|
|
||||||
// Set the radius, mobj z, and mthing z to match what the parameters want
|
// Set the radius, mobj z, and mthing z to match what the parameters want
|
||||||
if (line != -1)
|
if (line != -1)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -258,6 +258,8 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
||||||
//mapheaderinfo[num]->automap = false;
|
//mapheaderinfo[num]->automap = false;
|
||||||
DEH_WriteUndoline("MOBJSCALE", va("%d", mapheaderinfo[num]->mobj_scale), UNDO_NONE);
|
DEH_WriteUndoline("MOBJSCALE", va("%d", mapheaderinfo[num]->mobj_scale), UNDO_NONE);
|
||||||
mapheaderinfo[num]->mobj_scale = FRACUNIT;
|
mapheaderinfo[num]->mobj_scale = FRACUNIT;
|
||||||
|
DEH_WriteUndoline("DEFAULTWAYPOINTRADIUS", va("%d", mapheaderinfo[num]->default_waypoint_radius), UNDO_NONE);
|
||||||
|
mapheaderinfo[num]->default_waypoint_radius = 0;
|
||||||
// an even further impossibility, delfile custom opts support
|
// an even further impossibility, delfile custom opts support
|
||||||
mapheaderinfo[num]->customopts = NULL;
|
mapheaderinfo[num]->customopts = NULL;
|
||||||
mapheaderinfo[num]->numCustomOptions = 0;
|
mapheaderinfo[num]->numCustomOptions = 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue