mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 02:00:11 +00:00
Merge branch 'milk-terrain' into 'master'
Milky Way terrain See merge request KartKrew/Kart!1289
This commit is contained in:
commit
55cd73e25c
6 changed files with 45 additions and 17 deletions
|
|
@ -752,6 +752,8 @@ struct player_t
|
|||
|
||||
boolean markedfordeath;
|
||||
|
||||
fixed_t outrun; // Milky Way road effect
|
||||
|
||||
uint8_t public_key[PUBKEYLENGTH];
|
||||
|
||||
#ifdef HWRENDER
|
||||
|
|
|
|||
43
src/k_kart.c
43
src/k_kart.c
|
|
@ -3301,6 +3301,7 @@ fixed_t K_GetKartSpeedFromStat(UINT8 kartspeed)
|
|||
fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower, boolean dorubberband)
|
||||
{
|
||||
const boolean mobjValid = (player->mo != NULL && P_MobjWasRemoved(player->mo) == false);
|
||||
const fixed_t physicsScale = mobjValid ? K_GrowShrinkSpeedMul(player) : FRACUNIT;
|
||||
fixed_t finalspeed = 0;
|
||||
|
||||
if (K_PodiumSequence() == true)
|
||||
|
|
@ -3337,22 +3338,26 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower, boolean dorubberb
|
|||
|
||||
finalspeed = FixedMul(finalspeed, mapobjectscale);
|
||||
|
||||
if (doboostpower == true)
|
||||
{
|
||||
if (mobjValid == true)
|
||||
{
|
||||
// Scale with the player.
|
||||
finalspeed = FixedMul(finalspeed, K_GrowShrinkSpeedMul(player));
|
||||
}
|
||||
|
||||
finalspeed = FixedMul(finalspeed, player->boostpower + player->speedboost);
|
||||
}
|
||||
|
||||
if (dorubberband == true && K_PlayerUsesBotMovement(player) == true)
|
||||
{
|
||||
finalspeed = FixedMul(finalspeed, player->botvars.rubberband);
|
||||
}
|
||||
|
||||
if (doboostpower == true)
|
||||
{
|
||||
// Scale with the player.
|
||||
finalspeed = FixedMul(finalspeed, physicsScale);
|
||||
|
||||
// Add speed boosts.
|
||||
finalspeed = FixedMul(finalspeed, player->boostpower + player->speedboost);
|
||||
}
|
||||
|
||||
if (player->outrun != 0)
|
||||
{
|
||||
// Milky Way's roads
|
||||
finalspeed += FixedMul(player->outrun, physicsScale);
|
||||
}
|
||||
|
||||
return finalspeed;
|
||||
}
|
||||
|
||||
|
|
@ -3369,18 +3374,22 @@ fixed_t K_GetKartAccel(player_t *player)
|
|||
|
||||
k_accel += 17 * stat; // 121 - 257
|
||||
|
||||
if (K_PodiumSequence() == true)
|
||||
{
|
||||
return FixedMul(k_accel, FRACUNIT / 4);
|
||||
}
|
||||
|
||||
// Marble Garden Top gets 1200% accel
|
||||
if (player->curshield == KSHIELD_TOP)
|
||||
{
|
||||
k_accel *= 12;
|
||||
}
|
||||
|
||||
return FixedMul(k_accel, (FRACUNIT + player->accelboost) / 4);
|
||||
if (K_PodiumSequence() == true)
|
||||
{
|
||||
k_accel = FixedMul(k_accel, FRACUNIT / 4);
|
||||
}
|
||||
else
|
||||
{
|
||||
k_accel = FixedMul(k_accel, (FRACUNIT + player->accelboost) / 4);
|
||||
}
|
||||
|
||||
return k_accel;
|
||||
}
|
||||
|
||||
UINT16 K_GetKartFlashing(player_t *player)
|
||||
|
|
|
|||
|
|
@ -455,6 +455,9 @@ void K_ProcessTerrainEffect(mobj_t *mo)
|
|||
return;
|
||||
}
|
||||
|
||||
// Milky Way road effect
|
||||
player->outrun = terrain->outrun;
|
||||
|
||||
// Damage effects
|
||||
if (terrain->damageType > 0)
|
||||
{
|
||||
|
|
@ -1688,6 +1691,10 @@ static void K_ParseTerrainParameter(size_t i, char *param, char *val)
|
|||
{
|
||||
terrain->springStarColor = get_number(val);
|
||||
}
|
||||
else if (stricmp(param, "outrun") == 0 || stricmp(param, "speedIncrease") == 0)
|
||||
{
|
||||
terrain->outrun = FLOAT_TO_FIXED(atof(val));
|
||||
}
|
||||
else if (stricmp(param, "floorClip") == 0)
|
||||
{
|
||||
terrain->floorClip = FLOAT_TO_FIXED(atof(val));
|
||||
|
|
|
|||
|
|
@ -122,6 +122,7 @@ struct terrain_t
|
|||
angle_t speedPadAngle; // Speed pad angle
|
||||
fixed_t springStrength; // Spring strength
|
||||
UINT16 springStarColor; // Spring star color
|
||||
fixed_t outrun; // Raise top speed by this amount, for super fast road.
|
||||
fixed_t floorClip; // Offset for sprites on this ground
|
||||
UINT32 flags; // Flag values (see: terrain_flags_t)
|
||||
};
|
||||
|
|
|
|||
|
|
@ -433,6 +433,8 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
|
||||
WRITEUINT8(save->p, players[i].markedfordeath);
|
||||
|
||||
WRITEFIXED(save->p, players[i].outrun);
|
||||
|
||||
// respawnvars_t
|
||||
WRITEUINT8(save->p, players[i].respawn.state);
|
||||
WRITEUINT32(save->p, K_GetWaypointHeapIndex(players[i].respawn.wp));
|
||||
|
|
@ -828,6 +830,8 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
|
||||
players[i].markedfordeath = READUINT8(save->p);
|
||||
|
||||
players[i].outrun = READFIXED(save->p);
|
||||
|
||||
// respawnvars_t
|
||||
players[i].respawn.state = READUINT8(save->p);
|
||||
players[i].respawn.wp = (waypoint_t *)(size_t)READUINT32(save->p);
|
||||
|
|
|
|||
|
|
@ -4609,6 +4609,11 @@ void P_PlayerAfterThink(player_t *player)
|
|||
}
|
||||
#endif
|
||||
|
||||
if (P_IsObjectOnGround(player->mo) == true)
|
||||
{
|
||||
player->outrun = 0;
|
||||
}
|
||||
|
||||
#ifdef SECTORSPECIALSAFTERTHINK
|
||||
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
||||
player->onconveyor = 0;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue