mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-05-10 10:51:42 +00:00
QUAAAAAAAAKE
This commit is contained in:
parent
65d5fd0784
commit
a8fe25dd41
3 changed files with 38 additions and 0 deletions
|
|
@ -134,6 +134,7 @@ extern consvar_t cv_cam_speed[MAXSPLITSCREENPLAYERS], cv_cam_rotate[MAXSPLITSCRE
|
||||||
|
|
||||||
extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS];
|
extern fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS], t_cam_height[MAXSPLITSCREENPLAYERS], t_cam_rotate[MAXSPLITSCREENPLAYERS];
|
||||||
extern consvar_t cv_inverseslope;
|
extern consvar_t cv_inverseslope;
|
||||||
|
extern consvar_t cv_quaketilt;
|
||||||
|
|
||||||
void P_AddPlayerScore(player_t *player, UINT32 amount);
|
void P_AddPlayerScore(player_t *player, UINT32 amount);
|
||||||
void P_ResetCamera(player_t *player, camera_t *thiscam);
|
void P_ResetCamera(player_t *player, camera_t *thiscam);
|
||||||
|
|
|
||||||
36
src/p_user.c
36
src/p_user.c
|
|
@ -2726,6 +2726,7 @@ consvar_t cv_cam_rotate[MAXSPLITSCREENPLAYERS] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
consvar_t cv_inverseslope = {"inverseslope", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_inverseslope = {"inverseslope", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
consvar_t cv_quaketilt = {"quaketilt", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
|
|
||||||
fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
fixed_t t_cam_dist[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
||||||
fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
fixed_t t_cam_height[MAXSPLITSCREENPLAYERS] = {-42,-42,-42,-42};
|
||||||
|
|
@ -4164,6 +4165,38 @@ static void P_HandleFollower(player_t *player)
|
||||||
|
|
||||||
/* gaysed script from me, based on Golden's sprite slope roll */
|
/* gaysed script from me, based on Golden's sprite slope roll */
|
||||||
|
|
||||||
|
// holy SHIT
|
||||||
|
static INT32
|
||||||
|
Quaketilt (player_t *player)
|
||||||
|
{
|
||||||
|
angle_t tilt;
|
||||||
|
fixed_t lowb; // this threshold for speed
|
||||||
|
angle_t moma = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
|
||||||
|
angle_t delta = (INT32)( player->mo->angle - moma );
|
||||||
|
fixed_t speed;
|
||||||
|
// Hi! I'm "not a math guy"!
|
||||||
|
if (abs(delta) > ANGLE_90)
|
||||||
|
delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle );
|
||||||
|
if (P_IsObjectOnGround(player->mo))
|
||||||
|
{
|
||||||
|
tilt = ANGLE_11hh;
|
||||||
|
lowb = 15*FRACUNIT;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
tilt = ANGLE_45;
|
||||||
|
lowb = 10*FRACUNIT;
|
||||||
|
}
|
||||||
|
moma = FixedMul(FixedDiv(delta, ANGLE_90), tilt);
|
||||||
|
speed = abs( player->mo->momx + player->mo->momy );
|
||||||
|
if (speed < lowb)
|
||||||
|
{
|
||||||
|
// ease out tilt as we slow...
|
||||||
|
moma = FixedMul(moma, FixedDiv(speed, lowb));
|
||||||
|
}
|
||||||
|
return moma;
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
DoABarrelRoll (player_t *player)
|
DoABarrelRoll (player_t *player)
|
||||||
{
|
{
|
||||||
|
|
@ -4181,6 +4214,9 @@ DoABarrelRoll (player_t *player)
|
||||||
else
|
else
|
||||||
slope = 0;
|
slope = 0;
|
||||||
|
|
||||||
|
if (cv_quaketilt.value)
|
||||||
|
slope += Quaketilt(player);
|
||||||
|
|
||||||
delta = (INT32)( slope - player->viewrollangle )/ 16;
|
delta = (INT32)( slope - player->viewrollangle )/ 16;
|
||||||
|
|
||||||
if (delta)
|
if (delta)
|
||||||
|
|
|
||||||
|
|
@ -1706,6 +1706,7 @@ void R_RegisterEngineStuff(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
CV_RegisterVar(&cv_inverseslope);
|
CV_RegisterVar(&cv_inverseslope);
|
||||||
|
CV_RegisterVar(&cv_quaketilt);
|
||||||
|
|
||||||
CV_RegisterVar(&cv_showhud);
|
CV_RegisterVar(&cv_showhud);
|
||||||
CV_RegisterVar(&cv_translucenthud);
|
CV_RegisterVar(&cv_translucenthud);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue