WIP - Overdrive polish

This commit is contained in:
Antonio Martinez 2024-07-22 20:35:28 -07:00
parent 199a92ebb2
commit 2b61497536
12 changed files with 58 additions and 39 deletions

View file

@ -1033,7 +1033,7 @@ struct player_t
UINT8 ampsounds; UINT8 ampsounds;
UINT8 ampspending; UINT8 ampspending;
UINT16 overdriveboost; UINT16 overdrive;
fixed_t overdrivepower; fixed_t overdrivepower;
UINT8 itemflags; // holds IF_ flags (see itemflags_t) UINT8 itemflags; // holds IF_ flags (see itemflags_t)

View file

@ -22093,7 +22093,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
S_NULL, // deathstate S_NULL, // deathstate
S_NULL, // xdeathstate S_NULL, // xdeathstate
sfx_None, // deathsound sfx_None, // deathsound
0, // speed 1, // speed
32*FRACUNIT, // radius 32*FRACUNIT, // radius
32*FRACUNIT, // height 32*FRACUNIT, // height
0, // dispoffset 0, // dispoffset

View file

@ -1194,6 +1194,7 @@ boolean K_PvPTouchDamage(mobj_t *t1, mobj_t *t2)
auto doStumble = [](mobj_t *t1, mobj_t *t2) auto doStumble = [](mobj_t *t1, mobj_t *t2)
{ {
K_StumblePlayer(t2->player); K_StumblePlayer(t2->player);
K_SpawnAmps(t1->player, 20, t2);
}; };
if (forEither(shouldStumble, doStumble)) if (forEither(shouldStumble, doStumble))

View file

@ -3170,7 +3170,7 @@ static void K_drawRingCounter(boolean gametypeinfoshown)
.width(uselives ? (stplyr->lives >= 10 ? 70 : 64) : 33) .width(uselives ? (stplyr->lives >= 10 ? 70 : 64) : 33)
.small_sticker(); .small_sticker();
if (stplyr->overdriveboost) if (stplyr->overdrive)
{ {
V_DrawMappedPatch(LAPS_X+7-8, fy-5-8, V_HUDTRANS|V_SLIDEIN|splitflags, kp_overdrive[leveltime%32], R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolornum_t>(stplyr->skincolor), GTC_CACHE)); V_DrawMappedPatch(LAPS_X+7-8, fy-5-8, V_HUDTRANS|V_SLIDEIN|splitflags, kp_overdrive[leveltime%32], R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolornum_t>(stplyr->skincolor), GTC_CACHE));
} }

View file

@ -2012,7 +2012,7 @@ static void K_SpawnGenericSpeedLines(player_t *player, boolean top)
fast->color = SKINCOLOR_WHITE; fast->color = SKINCOLOR_WHITE;
fast->colorized = true; fast->colorized = true;
} }
else if (player->overdriveboost) else if (player->overdrive)
{ {
fast->color = player->skincolor; fast->color = player->skincolor;
fast->renderflags |= RF_ADD; fast->renderflags |= RF_ADD;
@ -3518,7 +3518,7 @@ static void K_GetKartBoostPower(player_t *player)
); // + 80% top speed (peak), +400% acceleration (peak), +20% handling ); // + 80% top speed (peak), +400% acceleration (peak), +20% handling
} }
if (player->overdriveboost) if (player->overdrive)
{ {
ADDBOOST( ADDBOOST(
Easing_InCubic( Easing_InCubic(
@ -3599,7 +3599,7 @@ static void K_GetKartBoostPower(player_t *player)
if (player->ringboost) // Ring Boost if (player->ringboost) // Ring Boost
{ {
fixed_t ringboost_base = FRACUNIT/4; fixed_t ringboost_base = FRACUNIT/4;
if (player->overdriveboost) if (player->overdrive)
ringboost_base += FRACUNIT/2; ringboost_base += FRACUNIT/2;
// This one's a little special: we add extra top speed per tic of ringboost stored up, to allow for Ring Box to really rocket away. // This one's a little special: we add extra top speed per tic of ringboost stored up, to allow for Ring Box to really rocket away.
// (We compensate when decrementing ringboost to avoid runaway exponential scaling hell.) // (We compensate when decrementing ringboost to avoid runaway exponential scaling hell.)
@ -4018,15 +4018,31 @@ void K_SpawnAmps(player_t *player, UINT8 amps, mobj_t *impact)
void K_AwardPlayerAmps(player_t *player, UINT8 amps) void K_AwardPlayerAmps(player_t *player, UINT8 amps)
{ {
UINT16 getamped = player->amps + amps; UINT16 getamped = player->amps + amps;
UINT8 oldamps = player->amps;
if (getamped > 200) if (getamped > 200)
player->amps = 200; player->amps = 200;
else else
player->amps = getamped; player->amps = getamped;
player->ampsounds++; player->ampsounds = 1;
player->ampspending--; player->ampspending--;
if (oldamps/AMPLEVEL != player->amps/AMPLEVEL)
{
UINT8 amplevel = player->amps / AMPLEVEL;
static sfxenum_t bwips[7] = {sfx_mbs4c,
sfx_mbs4d, sfx_mbs4e, sfx_mbs4f, sfx_mbs50,
sfx_mbs51, sfx_mbs52};
amplevel = min(amplevel, 6);
if (P_IsDisplayPlayer(player))
{
S_StartSound(NULL, bwips[amplevel]);
S_StartSound(NULL, bwips[amplevel]);
}
}
if (player->rings <= 0 && player->ampspending == 0) if (player->rings <= 0 && player->ampspending == 0)
{ {
K_Overdrive(player); K_Overdrive(player);
@ -4068,7 +4084,7 @@ boolean K_Overdrive(player_t *player)
S_StartSound(player->mo, sfx_cdfm35); S_StartSound(player->mo, sfx_cdfm35);
S_StartSound(player->mo, sfx_cdfm13); S_StartSound(player->mo, sfx_cdfm13);
player->overdriveboost += (player->amps)*6; player->overdrive += (player->amps)*6;
player->overdrivepower = FRACUNIT; player->overdrivepower = FRACUNIT;
player->amps = 0; player->amps = 0;
@ -9070,9 +9086,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
player->wavedashboost--; player->wavedashboost--;
} }
if (player->overdriveboost > 0 && onground == true) if (player->overdrive > 0 && onground == true)
{ {
player->overdriveboost--; player->overdrive--;
} }
if (player->wavedashboost == 0 || player->wavedashpower > FRACUNIT) if (player->wavedashboost == 0 || player->wavedashpower > FRACUNIT)
@ -9138,21 +9154,6 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
S_StartSoundAtVolume(NULL, sfx_mbs43, 127); S_StartSoundAtVolume(NULL, sfx_mbs43, 127);
} }
player->ampsounds--; player->ampsounds--;
if (player->ampsounds == 0)
{
UINT8 amplevel = player->amps / AMPLEVEL;
static sfxenum_t bwips[7] = {sfx_mbs4c,
sfx_mbs4d, sfx_mbs4e, sfx_mbs4f, sfx_mbs50,
sfx_mbs51, sfx_mbs52};
amplevel = min(amplevel, 6);
if (P_IsDisplayPlayer(player))
{
S_StartSound(NULL, bwips[amplevel]);
S_StartSound(NULL, bwips[amplevel]);
}
}
} }
@ -9816,7 +9817,7 @@ void K_KartResetPlayerColor(player_t *player)
goto finalise; goto finalise;
} }
if (player->overdriveboost && (leveltime & 1)) if (player->overdrive && (leveltime & 1))
{ {
player->mo->colorized = true; player->mo->colorized = true;
fullbright = true; fullbright = true;
@ -9824,7 +9825,7 @@ void K_KartResetPlayerColor(player_t *player)
goto finalise; goto finalise;
} }
else if (player->overdriveboost) else if (player->overdrive)
{ {
player->mo->colorized = true; player->mo->colorized = true;
fullbright = true; fullbright = true;
@ -11955,7 +11956,7 @@ static void K_KartSpindashWind(mobj_t *parent)
if (parent->player && parent->player->wavedashboost) if (parent->player && parent->player->wavedashboost)
P_SetScale(wind, wind->scale * 2); P_SetScale(wind, wind->scale * 2);
if (parent->player && parent->player->overdriveboost) if (parent->player && parent->player->overdrive)
P_SetScale(wind, wind->scale * 2); P_SetScale(wind, wind->scale * 2);
if (parent->momx || parent->momy) if (parent->momx || parent->momy)
@ -12025,7 +12026,7 @@ static void K_KartSpindash(player_t *player)
K_KartSpindashWind(player->mo); K_KartSpindashWind(player->mo);
} }
if ((player->overdriveboost > 0) && (spawnWind == true)) if ((player->overdrive > 0) && (spawnWind == true))
{ {
K_KartSpindashWind(player->mo); K_KartSpindashWind(player->mo);
} }

View file

@ -364,8 +364,8 @@ static int player_get(lua_State *L)
lua_pushinteger(L, plr->wavedashdelay); lua_pushinteger(L, plr->wavedashdelay);
else if (fastcmp(field,"wavedashboost")) else if (fastcmp(field,"wavedashboost"))
lua_pushinteger(L, plr->wavedashboost); lua_pushinteger(L, plr->wavedashboost);
else if (fastcmp(field,"overdriveboost")) else if (fastcmp(field,"overdrive"))
lua_pushinteger(L, plr->overdriveboost); lua_pushinteger(L, plr->overdrive);
else if (fastcmp(field,"wavedashpower")) else if (fastcmp(field,"wavedashpower"))
lua_pushinteger(L, plr->wavedashpower); lua_pushinteger(L, plr->wavedashpower);
else if (fastcmp(field,"overdrivepower")) else if (fastcmp(field,"overdrivepower"))
@ -934,8 +934,8 @@ static int player_set(lua_State *L)
plr->wavedashdelay = luaL_checkinteger(L, 3); plr->wavedashdelay = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedashboost")) else if (fastcmp(field,"wavedashboost"))
plr->wavedashboost = luaL_checkinteger(L, 3); plr->wavedashboost = luaL_checkinteger(L, 3);
else if (fastcmp(field,"overdriveboost")) else if (fastcmp(field,"overdrive"))
plr->overdriveboost = luaL_checkinteger(L, 3); plr->overdrive = luaL_checkinteger(L, 3);
else if (fastcmp(field,"wavedashpower")) else if (fastcmp(field,"wavedashpower"))
plr->wavedashpower = luaL_checkinteger(L, 3); plr->wavedashpower = luaL_checkinteger(L, 3);
else if (fastcmp(field,"overdrivepower")) else if (fastcmp(field,"overdrivepower"))

View file

@ -51,6 +51,10 @@ void Obj_AmpsThink (mobj_t *amps)
if (amps->extravalue1) if (amps->extravalue1)
amps->extravalue1--; amps->extravalue1--;
amps->extravalue2++;
speed += amps->extravalue1 * amps->scale/2;
fakez = mo->z + (vert * amps->extravalue1 / AMP_ARCTIME); fakez = mo->z + (vert * amps->extravalue1 / AMP_ARCTIME);
damper = 1; damper = 1;
} }
@ -63,6 +67,11 @@ void Obj_AmpsThink (mobj_t *amps)
fakez = mo->z + vert; fakez = mo->z + vert;
} }
if (mo->flags & MFE_VERTICALFLIP)
fakez -= mo->height/2;
else
fakez += mo->height/2;
hang = R_PointToAngle2(amps->x, amps->y, mo->x, mo->y); hang = R_PointToAngle2(amps->x, amps->y, mo->x, mo->y);
vang = R_PointToAngle2(amps->z, 0, fakez, dist); vang = R_PointToAngle2(amps->z, 0, fakez, dist);
@ -71,7 +80,7 @@ void Obj_AmpsThink (mobj_t *amps)
amps->momy += FixedMul(FINESINE(vang>>ANGLETOFINESHIFT), FixedMul(FINESINE(hang>>ANGLETOFINESHIFT), speed)); amps->momy += FixedMul(FINESINE(vang>>ANGLETOFINESHIFT), FixedMul(FINESINE(hang>>ANGLETOFINESHIFT), speed));
amps->momz += FixedMul(FINECOSINE(vang>>ANGLETOFINESHIFT), speed); amps->momz += FixedMul(FINECOSINE(vang>>ANGLETOFINESHIFT), speed);
if (dist < (120 * amps->scale) && amps->extravalue2) if (dist < (120 * amps->scale) && amps->extravalue2 && !player->ampsounds)
{ {
K_AwardPlayerAmps(player, 2); K_AwardPlayerAmps(player, 2);
P_RemoveMobj(amps); P_RemoveMobj(amps);

View file

@ -36,6 +36,8 @@ void Obj_BlockRingThink (mobj_t *ring)
fixed_t baseScale = mo->scale / 2; fixed_t baseScale = mo->scale / 2;
baseScale += (mo->scale / 30) * player->spheres; baseScale += (mo->scale / 30) * player->spheres;
if (player->overdrive)
baseScale += mo->scale;
P_SetScale(ring, baseScale); P_SetScale(ring, baseScale);
// Twirl // Twirl
@ -48,7 +50,7 @@ void Obj_BlockRingThink (mobj_t *ring)
else else
ring->renderflags |= RF_DONTDRAW; ring->renderflags |= RF_DONTDRAW;
if (K_PowerUpRemaining(player, POWERUP_BARRIER) || !K_PlayerGuard(player)) if (K_PowerUpRemaining(player, POWERUP_BARRIER) || !(K_PlayerGuard(player) || player->overdrive))
ring->renderflags |= RF_DONTDRAW; ring->renderflags |= RF_DONTDRAW;
} }
} }
@ -69,6 +71,8 @@ void Obj_BlockBodyThink (mobj_t *body)
fixed_t baseScale = mo->scale / 2; fixed_t baseScale = mo->scale / 2;
baseScale += (mo->scale / 30) * player->spheres; baseScale += (mo->scale / 30) * player->spheres;
if (player->overdrive)
baseScale += mo->scale;
P_SetScale(body, baseScale); P_SetScale(body, baseScale);
P_MoveOrigin(body, mo->x, mo->y, mo->z + mo->height/2); P_MoveOrigin(body, mo->x, mo->y, mo->z + mo->height/2);
@ -83,7 +87,7 @@ void Obj_BlockBodyThink (mobj_t *body)
else else
body->renderflags |= RF_DONTDRAW; body->renderflags |= RF_DONTDRAW;
if (K_PowerUpRemaining(player, POWERUP_BARRIER) || !K_PlayerGuard(player)) if (K_PowerUpRemaining(player, POWERUP_BARRIER) || !(K_PlayerGuard(player) || player->overdrive))
body->renderflags |= RF_DONTDRAW; body->renderflags |= RF_DONTDRAW;
} }
} }

View file

@ -601,6 +601,8 @@ hyudoro_patrol_hit_player
P_SetTarget(&hyudoro_target(hyu), master); P_SetTarget(&hyudoro_target(hyu), master);
K_SpawnAmps(master->player, 20, toucher);
if (center) if (center)
P_RemoveMobj(center); P_RemoveMobj(center);

View file

@ -3006,7 +3006,8 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
sfx = sfx_s3k3a; sfx = sfx_s3k3a;
clash = true; clash = true;
} }
else if (player->overdriveboost) else if (player->overdrive &&
(type != DMG_EXPLODE || inflictor->type != MT_SPBEXPLOSION || !inflictor->movefactor))
{ {
clash = true; clash = true;
} }

View file

@ -581,7 +581,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
WRITEUINT16(save->p, players[i].wavedash); WRITEUINT16(save->p, players[i].wavedash);
WRITEUINT8(save->p, players[i].wavedashdelay); WRITEUINT8(save->p, players[i].wavedashdelay);
WRITEUINT16(save->p, players[i].wavedashboost); WRITEUINT16(save->p, players[i].wavedashboost);
WRITEUINT16(save->p, players[i].overdriveboost); WRITEUINT16(save->p, players[i].overdrive);
WRITEFIXED(save->p, players[i].wavedashpower); WRITEFIXED(save->p, players[i].wavedashpower);
WRITEFIXED(save->p, players[i].overdrivepower); WRITEFIXED(save->p, players[i].overdrivepower);
WRITEUINT16(save->p, players[i].speedpunt); WRITEUINT16(save->p, players[i].speedpunt);
@ -1191,7 +1191,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
players[i].wavedash = READUINT16(save->p); players[i].wavedash = READUINT16(save->p);
players[i].wavedashdelay = READUINT8(save->p); players[i].wavedashdelay = READUINT8(save->p);
players[i].wavedashboost = READUINT16(save->p); players[i].wavedashboost = READUINT16(save->p);
players[i].overdriveboost = READUINT16(save->p); players[i].overdrive = READUINT16(save->p);
players[i].wavedashpower = READFIXED(save->p); players[i].wavedashpower = READFIXED(save->p);
players[i].overdrivepower = READFIXED(save->p); players[i].overdrivepower = READFIXED(save->p);
players[i].speedpunt = READUINT16(save->p); players[i].speedpunt = READUINT16(save->p);

View file

@ -2048,6 +2048,7 @@ static void K_HandleLapIncrement(player_t *player)
K_SpawnDriftBoostExplosion(player, 4); K_SpawnDriftBoostExplosion(player, 4);
K_SpawnDriftElectricSparks(player, SKINCOLOR_SILVER, false); K_SpawnDriftElectricSparks(player, SKINCOLOR_SILVER, false);
K_SpawnAmps(player, 50, player->mo);
rainbowstartavailable = false; rainbowstartavailable = false;
} }