add colourized speedlines
smth i had laying around in lugstuff
This commit is contained in:
1 parent
dd7a861280
commit
4acf6d336b
3 files changed
+72
-23
No files matched your search
+58
-11
@@ -74,6 +74,9 @@ IMPL_HUD_OFFSET(stat); // Stats
|
||||
#undef IMPL_HUD_OFFSET_X
|
||||
#undef IMPL_HUD_OFFSET_Y
|
||||
|
||||
static CV_PossibleValue_t colorspeedlines_cons_t[] = {{0, "Off"}, {1, "Normal"}, {2, "+Driftcharge"}, {0, NULL}};
|
||||
consvar_t cv_coloredspeedlines = {"colorizedspeedlines", "Off", CV_SAVE, colorspeedlines_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
//extra hud things
|
||||
consvar_t cv_showstats = {"showstats", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
consvar_t cv_showinput = {"showinput", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -766,6 +769,8 @@ void K_RegisterKartStuff(void)
|
||||
#undef REG_HUD_OFFSET_X
|
||||
#undef REG_HUD_OFFSET_Y
|
||||
|
||||
CV_RegisterVar(&cv_coloredspeedlines);
|
||||
|
||||
CV_RegisterVar(&cv_showstats);
|
||||
CV_RegisterVar(&cv_showinput);
|
||||
|
||||
@@ -5123,6 +5128,57 @@ void K_KartPlayerHUDUpdate(player_t *player)
|
||||
player->kartstuff[k_cardanimation] = 0;
|
||||
}
|
||||
|
||||
static inline void K_SpawnNormalSpeedLines(player_t *player)
|
||||
{
|
||||
mobj_t *fast = P_SpawnMobj(player->mo->x + (P_RandomRange(-36,36) * player->mo->scale),
|
||||
player->mo->y + (P_RandomRange(-36,36) * player->mo->scale),
|
||||
player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale),
|
||||
MT_FASTLINE);
|
||||
|
||||
fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
|
||||
fast->momx = 3*player->mo->momx/4;
|
||||
fast->momy = 3*player->mo->momy/4;
|
||||
fast->momz = 3*player->mo->momz/4;
|
||||
P_SetTarget(&fast->target, player->mo); // easier lua access
|
||||
|
||||
K_MatchGenericExtraFlags(fast, player->mo);
|
||||
|
||||
if (cv_coloredspeedlines.value)
|
||||
{
|
||||
const boolean goodSpeed = (player->speed >= (3*K_GetKartSpeed(player, false))/4);
|
||||
|
||||
// cant have nice shit cause of synched rng
|
||||
if (player->kartstuff[k_eggmanexplode])
|
||||
{
|
||||
// Make it red when you have the eggman speed boost
|
||||
fast->color = SKINCOLOR_RED;
|
||||
fast->colorized = true;
|
||||
}
|
||||
else if (player->kartstuff[k_invincibilitytimer])
|
||||
{
|
||||
fast->color = player->mo->color;
|
||||
fast->colorized = true;
|
||||
}
|
||||
else if (goodSpeed)
|
||||
{
|
||||
UINT8 driftcolor = SKINCOLOR_NONE;
|
||||
|
||||
if (cv_coloredspeedlines.value == 2 && player->kartstuff[k_driftboost])
|
||||
{
|
||||
if (player->kartstuff[k_driftboost] <= 20)
|
||||
driftcolor = SKINCOLOR_SAPPHIRE;
|
||||
else if (player->kartstuff[k_driftboost] <= 50)
|
||||
driftcolor = SKINCOLOR_RASPBERRY;
|
||||
else if (player->kartstuff[k_driftboost] <= 125)
|
||||
driftcolor = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
|
||||
}
|
||||
|
||||
fast->color = (leveltime & 1) ? player->mo->color : driftcolor;
|
||||
fast->colorized = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** \brief Decreases various kart timers and powers per frame. Called in P_PlayerThink in p_user.c
|
||||
|
||||
\param player player object passed from P_PlayerThink
|
||||
@@ -5142,18 +5198,9 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd)
|
||||
K_GetKartBoostPower(player);
|
||||
|
||||
// Speed lines
|
||||
if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_driftboost] || player->kartstuff[k_startboost]) && player->speed > 0)
|
||||
if ((player->kartstuff[k_sneakertimer] || player->kartstuff[k_driftboost] || player->kartstuff[k_startboost] /*|| player->kartstuff[k_eggmanexplode]*/) && player->speed > 0) // gotta love the speedlines calling synched rng :chaosleep:
|
||||
{
|
||||
mobj_t *fast = P_SpawnMobj(player->mo->x + (P_RandomRange(-36,36) * player->mo->scale),
|
||||
player->mo->y + (P_RandomRange(-36,36) * player->mo->scale),
|
||||
player->mo->z + (player->mo->height/2) + (P_RandomRange(-20,20) * player->mo->scale),
|
||||
MT_FASTLINE);
|
||||
fast->angle = R_PointToAngle2(0, 0, player->mo->momx, player->mo->momy);
|
||||
fast->momx = 3*player->mo->momx/4;
|
||||
fast->momy = 3*player->mo->momy/4;
|
||||
fast->momz = 3*player->mo->momz/4;
|
||||
P_SetTarget(&fast->target, player->mo); // easier lua access
|
||||
K_MatchGenericExtraFlags(fast, player->mo);
|
||||
K_SpawnNormalSpeedLines(player);
|
||||
}
|
||||
|
||||
if (player->playerstate == PST_DEAD || player->kartstuff[k_respawn] > 1) // Ensure these are set correctly here
|
||||
|
||||
+3
-5
@@ -22,14 +22,12 @@ boolean K_UseColorHud(void);
|
||||
|
||||
void K_RegisterKartStuff(void);
|
||||
|
||||
extern consvar_t cv_colorizedhud;
|
||||
extern consvar_t cv_colorizeditembox;
|
||||
extern consvar_t cv_colorizedhudcolor;
|
||||
extern consvar_t cv_coloredspeedlines;
|
||||
extern consvar_t cv_colorizedhud, cv_colorizeditembox, cv_colorizedhudcolor;
|
||||
extern consvar_t cv_darkitembox;
|
||||
extern consvar_t cv_biglaps;
|
||||
extern consvar_t cv_highresportrait;
|
||||
extern consvar_t cv_stat_xoffset;
|
||||
extern consvar_t cv_stat_yoffset;
|
||||
extern consvar_t cv_stat_xoffset, cv_stat_yoffset;
|
||||
extern consvar_t cv_showstats;
|
||||
extern consvar_t cv_showlaptimes;
|
||||
extern consvar_t cv_battlespeedo;
|
||||
|
||||
+11
-7
@@ -2194,16 +2194,18 @@ static menuitem_t OP_SaturnMenu[] =
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Skin Select Spinning Speed", &cv_skinselectspin, 20},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Show Localskin Menus", &cv_showlocalskinmenus, 30},
|
||||
{IT_STRING | IT_CVAR, NULL, "Uppercase Menu", &cv_menucaps, 35},
|
||||
{IT_STRING | IT_CVAR, NULL, "Colourized Speedlines", &cv_coloredspeedlines, 30},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Keyboard Layout", &cv_keyboardlayout, 45},
|
||||
{IT_STRING | IT_CVAR, NULL, "Show Localskin Menus", &cv_showlocalskinmenus, 40},
|
||||
{IT_STRING | IT_CVAR, NULL, "Uppercase Menu", &cv_menucaps, 45},
|
||||
|
||||
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 55},
|
||||
{IT_STRING | IT_CVAR, NULL, "Keyboard Layout", &cv_keyboardlayout, 55},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Hud...", &OP_SaturnHudDef, 65},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Sprite Distortion...", &OP_PlayerDistortDef, 70},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 80}, // uwu
|
||||
{IT_STRING | IT_CVAR, NULL, "Less Midnight Channel Flicker", &cv_lessflicker, 65},
|
||||
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Hud...", &OP_SaturnHudDef, 75},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Sprite Distortion...", &OP_PlayerDistortDef, 80},
|
||||
{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 90}, // uwu
|
||||
};
|
||||
|
||||
static const char* OP_SaturnTooltips[] =
|
||||
@@ -2211,6 +2213,7 @@ static const char* OP_SaturnTooltips[] =
|
||||
NULL,
|
||||
"How long can the game wait before it kicks you out from the server\nconnecting screen.",
|
||||
"How much speen do you want?",
|
||||
"Colourize the speedlines in your skincolor if you go fast enough!",
|
||||
"Show Localskin Menus.",
|
||||
"Force menu to only use uppercase.",
|
||||
"Use your desired Keyboard Layout for Text Input\nthis is either the Default, Native or Azerty\nNative does not affect Gameplay only Text!",
|
||||
@@ -2225,6 +2228,7 @@ enum
|
||||
sm_header,
|
||||
sm_waittime,
|
||||
sm_skinselspeed,
|
||||
sm_colorlines,
|
||||
sm_showlocalskin,
|
||||
op_uppercase_menu,
|
||||
sm_nativkey,
|
||||
|
||||
Reference in new issue
Block a user