toggable stair "jank" visuals
akin to RR, just toned down for smaller kart chars also toggable ofc theres not that many stairs in kart but this looks cute with smol bumps in the road wish this would work on slopes but theyre kinda messed up lol
This commit is contained in:
1 parent
18df3b895d
commit
95fdb52f06
8 files changed
+82
-1
No files matched your search
@@ -566,6 +566,8 @@ typedef struct player_s
|
||||
fixed_t fovadd; // adjust FOV for hw rendering
|
||||
|
||||
SINT8 driftlevel; // just for controller rumble for now
|
||||
|
||||
UINT8 stairjank;
|
||||
} player_t;
|
||||
|
||||
#endif
|
||||
@@ -118,6 +118,7 @@ extern consvar_t cv_driftsparkpulse;
|
||||
extern consvar_t cv_gravstretch;
|
||||
extern consvar_t cv_sloperoll;
|
||||
extern consvar_t cv_sliptideroll;
|
||||
extern consvar_t cv_stairjank;
|
||||
extern consvar_t cv_slamsound;
|
||||
extern consvar_t cv_sloperolldist;
|
||||
extern consvar_t cv_sparkroll;
|
||||
|
||||
@@ -1139,6 +1139,12 @@ void G_DeviceRumbleTick(void)
|
||||
if (leveltime & 1) // this is actually funny lel
|
||||
high = RUMBLE_MODERATE;
|
||||
}
|
||||
/*else if ((player->stairjank > 8) // this is kinda cool but prob gets annoying after a while
|
||||
&& player->speed != 0
|
||||
&& P_IsObjectOnGround(player->mo))
|
||||
{
|
||||
low = high = RUMBLE_WEAK;
|
||||
}*/
|
||||
|
||||
if (player->kartstuff[k_brakedrift])
|
||||
{
|
||||
|
||||
@@ -110,6 +110,7 @@ static CV_PossibleValue_t sloperoll_cons_t[] = {{0, "Off"}, {1, "Players"}, {2,
|
||||
consvar_t cv_sloperoll = {"sloperoll", "Off", CV_SAVE|CV_CALL, sloperoll_cons_t, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_sparkroll = {"sparkroll", "Off", CV_SAVE|CV_CALL, CV_OnOff, PDistort_menu_Onchange, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_sliptideroll = {"sliptideroll", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_stairjank = {"stairjank", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
//hardcode saltyhop mhhm
|
||||
static void saltyhop_onchange(void);
|
||||
@@ -3556,6 +3557,16 @@ boolean K_ShouldSlopeRoll(mobj_t *mobj)
|
||||
return K_CheckSlopeRollDist(mobj);
|
||||
}
|
||||
|
||||
static INT32 K_AltFlip(INT32 n, tic_t tics)
|
||||
{
|
||||
return leveltime % (2 * tics) < tics ? n : -(n);
|
||||
}
|
||||
|
||||
static INT32 K_StairJankFlip(INT32 value)
|
||||
{
|
||||
return K_AltFlip(value, 2);
|
||||
}
|
||||
|
||||
// reset banan and eggbox rollangle when they´re on the ground
|
||||
// if not cv_bananthrowroll option "+Onground"
|
||||
static void K_ResetBananaRollangle(mobj_t* mo)
|
||||
@@ -7320,6 +7331,12 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
|
||||
|
||||
K_RollMobjBySlopes(player->mo, player->mo->standingslope);
|
||||
|
||||
// "Stair jank" visuals akin to RR
|
||||
if (cv_stairjank.value && player->stairjank > 0)
|
||||
{
|
||||
player->mo->temprollangle += K_StairJankFlip(ANGLE_11hh / 2 / (17 / player->stairjank)); // TODO: make strength adjustable?
|
||||
}
|
||||
|
||||
////
|
||||
|
||||
// Quick Turning
|
||||
|
||||
+45
-1
@@ -2375,8 +2375,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||
fixed_t tryx = thing->x;
|
||||
fixed_t tryy = thing->y;
|
||||
fixed_t radius = thing->radius;
|
||||
fixed_t thingtop ;//= thing->z + thing->height;
|
||||
fixed_t thingtop;//= thing->z + thing->height;
|
||||
fixed_t startingonground = P_IsObjectOnGround(thing);
|
||||
fixed_t stairjank = 0;
|
||||
pslope_t *oldslope = thing->standingslope;
|
||||
INT32 special = -1;
|
||||
floatok = false;
|
||||
|
||||
@@ -2450,11 +2452,19 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||
|
||||
thingtop = thing->z + thing->height;
|
||||
|
||||
const boolean flipped =
|
||||
(thing->eflags & MFE_VERTICALFLIP) != 0;
|
||||
|
||||
// Step up
|
||||
if (thing->z < tmfloorz)
|
||||
{
|
||||
if (tmfloorz - thing->z <= maxstep)
|
||||
{
|
||||
if (maxstep > 0 && !flipped)
|
||||
{
|
||||
stairjank = (tmfloorz - thing->z);
|
||||
}
|
||||
|
||||
thing->z = thing->floorz = tmfloorz;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
@@ -2467,6 +2477,11 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||
{
|
||||
if (thingtop - tmceilingz <= maxstep)
|
||||
{
|
||||
if (maxstep > 0 && flipped)
|
||||
{
|
||||
stairjank = (thingtop - tmceilingz);
|
||||
}
|
||||
|
||||
thing->z = ( thing->ceilingz = tmceilingz ) - thing->height;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
@@ -2483,11 +2498,21 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||
|
||||
if (thingtop == thing->ceilingz && tmceilingz > thingtop && tmceilingz - thingtop <= maxstep)
|
||||
{
|
||||
if (flipped)
|
||||
{
|
||||
stairjank = (tmceilingz - thingtop);
|
||||
}
|
||||
|
||||
thing->z = (thing->ceilingz = tmceilingz) - thing->height;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
else if (thing->z == thing->floorz && tmfloorz < thing->z && thing->z - tmfloorz <= maxstep)
|
||||
{
|
||||
if (!flipped)
|
||||
{
|
||||
stairjank = (thing->z - tmfloorz);
|
||||
}
|
||||
|
||||
thing->z = thing->floorz = tmfloorz;
|
||||
thing->eflags |= MFE_JUSTSTEPPEDDOWN;
|
||||
}
|
||||
@@ -2563,6 +2588,25 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff)
|
||||
else // don't set standingslope if you're not going to clip against it
|
||||
thing->standingslope = NULL;
|
||||
|
||||
/* FIXME: slope step down (even up) has some false
|
||||
positives, so just ignore them entirely. */
|
||||
if (stairjank && !oldslope && !thing->standingslope && thing->player && !thing->player->spectator)
|
||||
{
|
||||
// TODO: maybe spawn smol dust effect similar to RR?
|
||||
/*if (!thing->player->stairjank)
|
||||
{
|
||||
mobj_t * spark = P_SpawnMobjFromMobj(thing, 0, 0, 0, MT_JANKSPARK);
|
||||
spark->fuse = 9;
|
||||
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;
|
||||
}
|
||||
|
||||
thing->x = x;
|
||||
thing->y = y;
|
||||
|
||||
|
||||
@@ -901,6 +901,11 @@ void P_SlopeLaunch(mobj_t *mo)
|
||||
|
||||
//CONS_Printf("Launched off of slope.\n");
|
||||
mo->standingslope = NULL;
|
||||
|
||||
if (mo->player)
|
||||
{
|
||||
mo->player->stairjank = 0; // fuck you
|
||||
}
|
||||
}
|
||||
|
||||
// Function to help handle landing on slopes
|
||||
|
||||
@@ -5090,6 +5090,11 @@ void P_PlayerThink(player_t *player)
|
||||
player->squishdance.time = 0;
|
||||
}
|
||||
|
||||
if (player->stairjank > 0)
|
||||
{
|
||||
player->stairjank--;
|
||||
}
|
||||
|
||||
// Flash player after being hit.
|
||||
if (!(player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should.
|
||||
|| player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either.
|
||||
|
||||
@@ -1598,6 +1598,7 @@ void R_RegisterEngineStuff(void)
|
||||
CV_RegisterVar(&cv_sliptideroll);
|
||||
CV_RegisterVar(&cv_sloperolldist);
|
||||
CV_RegisterVar(&cv_sparkroll);
|
||||
CV_RegisterVar(&cv_stairjank);
|
||||
|
||||
CV_RegisterVar(&cv_showhud);
|
||||
CV_RegisterVar(&cv_translucenthud);
|
||||
|
||||
Reference in new issue
Block a user