move stairjank particles into K_MoveKartPlayer

to where we also rotate the player
also means we now use K_AltFlip :p
also means the visual toggle now actually does prevent spawning them
This commit is contained in:
alufolie91 committed 2026-07-19 02:40:17 +02:00
1 parent 267a758447
commit 735c4b67dc
2 files changed
+22 -28

No files matched your search

+22
View File
@@ -7055,6 +7055,28 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
// "Stair jank" visuals akin to RR
if (cv_stairjank.value && player->stairjank > 0)
{
// only spawn em once
if (player->stairjank > 8)
{
// 90 degrees to direction you're facing
fixed_t dirx = -FINESINE(player->mo->angle>>ANGLETOFINESHIFT);
fixed_t diry = FINECOSINE(player->mo->angle>>ANGLETOFINESHIFT);
fixed_t offset = player->mo->radius;
dirx = K_AltFlip(-dirx, 4);
diry = K_AltFlip(-diry, 4);
mobj_t * spark = P_SpawnMobj(player->mo->x + FixedMul(dirx, offset), player->mo->y + FixedMul(diry, offset), player->mo->z, MT_DRIFTDUST);
spark->momx = FixedMul(dirx, FRACUNIT) + (6 + ((int)leveltime % 5))*(player->mo->momx)/10;
spark->momy = FixedMul(diry, FRACUNIT) + (6 + ((int)leveltime % 5))*(player->mo->momy)/10;
spark->momz = 5*FRACUNIT;
spark->scale = mapobjectscale/5;
spark->destscale = mapobjectscale/2;
spark->islocal = true;
spark->color = SKINCOLOR_WHITE;
P_SetTarget(&spark->target, player->mo);
}
player->mo->temprollangle += K_StairJankFlip(ANGLE_11hh / 2 / (17 / player->stairjank)); // TODO: make strength adjustable?
}
-28
View File
@@ -2614,34 +2614,6 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
S_StartSoundAtVolume(thing, (thing->player->stairjank >= 8 ? sfx_s23b : sfx_s268), 192); // dont blast this at full volume lul
// Can't spawn things during P_TryMove, because global variables :)
// TODO - move this elsewhere later, should probably be safe in K_KartPlayerThink or something
/*if (!thing->player->stairjank)
{
// 90 degrees to direction you're facing
fixed_t dirx = -FINESINE(thing->angle>>ANGLETOFINESHIFT);
fixed_t diry = FINECOSINE(thing->angle>>ANGLETOFINESHIFT);
fixed_t offset = thing->radius;
if (leveltime % 8 < 4)
{
dirx = -dirx;
diry = -diry;
}
mobj_t * spark = P_SpawnMobj(thing->x + FixedMul(dirx, offset), thing->y + FixedMul(diry, offset), thing->z, MT_DRIFTDUST);
spark->momx = FixedMul(dirx, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momx)/10;
spark->momy = FixedMul(diry, FRACUNIT) + (6 + ((int)leveltime % 5))*(thing->momy)/10;
spark->momz = 5*FRACUNIT;
spark->scale = mapobjectscale/5;
spark->destscale = mapobjectscale/2;
spark->islocal = true;
//spark->fuse = 9;
spark->color = SKINCOLOR_WHITE;
//spark->cusval = K_StairJankFlip(ANGLE_90);
P_SetTarget(&spark->target, thing);
//P_SetTarget(&spark->owner, thing);
//spark->renderflags |= RF_REDUCEVFX;
}*/
thing->player->stairjank = 9;
//thing->player->stairjank = 17;