mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Item box autospin
This commit is contained in:
parent
7cdf8fbfdd
commit
fbfc75df71
17 changed files with 185 additions and 70 deletions
|
|
@ -1061,6 +1061,7 @@ void D_RegisterClientCommands(void)
|
|||
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
|
||||
{
|
||||
CV_RegisterVar(&cv_kickstartaccel[i]);
|
||||
CV_RegisterVar(&cv_autospin[i]);
|
||||
CV_RegisterVar(&cv_shrinkme[i]);
|
||||
CV_RegisterVar(&cv_deadzone[i]);
|
||||
CV_RegisterVar(&cv_rumble[i]);
|
||||
|
|
@ -1815,6 +1816,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
|
|||
enum {
|
||||
WP_KICKSTARTACCEL = 1<<0,
|
||||
WP_SHRINKME = 1<<1,
|
||||
WP_AUTOSPIN = 1<<2,
|
||||
};
|
||||
|
||||
void WeaponPref_Send(UINT8 ssplayer)
|
||||
|
|
@ -1824,6 +1826,9 @@ void WeaponPref_Send(UINT8 ssplayer)
|
|||
if (cv_kickstartaccel[ssplayer].value)
|
||||
prefs |= WP_KICKSTARTACCEL;
|
||||
|
||||
if (cv_autospin[ssplayer].value)
|
||||
prefs |= WP_AUTOSPIN;
|
||||
|
||||
if (cv_shrinkme[ssplayer].value)
|
||||
prefs |= WP_SHRINKME;
|
||||
|
||||
|
|
@ -1839,6 +1844,9 @@ void WeaponPref_Save(UINT8 **cp, INT32 playernum)
|
|||
if (player->pflags & PF_KICKSTARTACCEL)
|
||||
prefs |= WP_KICKSTARTACCEL;
|
||||
|
||||
if (player->pflags & PF_AUTOSPIN)
|
||||
prefs |= WP_AUTOSPIN;
|
||||
|
||||
if (player->pflags & PF_SHRINKME)
|
||||
prefs |= WP_SHRINKME;
|
||||
|
||||
|
|
@ -1851,17 +1859,20 @@ void WeaponPref_Parse(UINT8 **cp, INT32 playernum)
|
|||
|
||||
UINT8 prefs = READUINT8(*cp);
|
||||
|
||||
player->pflags &= ~(PF_KICKSTARTACCEL|PF_SHRINKME);
|
||||
player->pflags &= ~(PF_KICKSTARTACCEL|PF_SHRINKME|PF_AUTOSPIN);
|
||||
|
||||
if (prefs & WP_KICKSTARTACCEL)
|
||||
player->pflags |= PF_KICKSTARTACCEL;
|
||||
|
||||
if (prefs & WP_AUTOSPIN)
|
||||
player->pflags |= PF_AUTOSPIN;
|
||||
|
||||
if (prefs & WP_SHRINKME)
|
||||
player->pflags |= PF_SHRINKME;
|
||||
|
||||
if (leveltime < 2)
|
||||
{
|
||||
// BAD HACK: No other place I tried to slot this in
|
||||
// BAD HACK: No other place I ried to slot this in
|
||||
// made it work for the host when they initally host,
|
||||
// so this will have to do.
|
||||
K_UpdateShrinkCheat(player);
|
||||
|
|
|
|||
|
|
@ -64,7 +64,9 @@ typedef enum
|
|||
{
|
||||
PF_GODMODE = 1<<0, // Immortal. No lightsnake from pits either
|
||||
|
||||
// free: 1<<1 and 1<<2
|
||||
// free: 1<<1
|
||||
|
||||
PF_AUTOSPIN = 1<<2, // Accessibility: Non-deterministic item box, no manual stop.
|
||||
|
||||
// Look back VFX has been spawned
|
||||
// TODO: Is there a better way to track this?
|
||||
|
|
@ -437,6 +439,7 @@ struct itemroulette_t
|
|||
|
||||
boolean eggman;
|
||||
boolean ringbox;
|
||||
boolean autospin;
|
||||
};
|
||||
|
||||
// enum for bot item priorities
|
||||
|
|
|
|||
|
|
@ -5931,7 +5931,7 @@ const char *const PLAYERFLAG_LIST[] = {
|
|||
|
||||
// free: 1<<1 and 1<<2 (name un-matchable)
|
||||
"\x01",
|
||||
"\x01",
|
||||
"AUTOSPIN", // Item box accessibility
|
||||
|
||||
// Look back VFX has been spawned
|
||||
// TODO: Is there a better way to track this?
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@ demoghost *ghosts = NULL;
|
|||
#define DEMO_KICKSTART 0x02
|
||||
#define DEMO_SHRINKME 0x04
|
||||
#define DEMO_BOT 0x08
|
||||
#define DEMO_AUTOSPIN 0x10
|
||||
|
||||
// For demos
|
||||
#define ZT_FWD 0x0001
|
||||
|
|
@ -2474,6 +2475,8 @@ void G_BeginRecording(void)
|
|||
i |= DEMO_SPECTATOR;
|
||||
if (player->pflags & PF_KICKSTARTACCEL)
|
||||
i |= DEMO_KICKSTART;
|
||||
if (player->pflags & PF_AUTOSPIN)
|
||||
i |= DEMO_AUTOSPIN;
|
||||
if (player->pflags & PF_SHRINKME)
|
||||
i |= DEMO_SHRINKME;
|
||||
if (player->bot == true)
|
||||
|
|
@ -3436,6 +3439,11 @@ void G_DoPlayDemo(const char *defdemoname)
|
|||
else
|
||||
players[p].pflags &= ~PF_KICKSTARTACCEL;
|
||||
|
||||
if (flags & DEMO_AUTOSPIN)
|
||||
players[p].pflags |= PF_AUTOSPIN;
|
||||
else
|
||||
players[p].pflags &= ~PF_AUTOSPIN;
|
||||
|
||||
if (flags & DEMO_SHRINKME)
|
||||
players[p].pflags |= PF_SHRINKME;
|
||||
else
|
||||
|
|
|
|||
|
|
@ -408,6 +408,13 @@ consvar_t cv_kickstartaccel[MAXSPLITSCREENPLAYERS] = {
|
|||
CVAR_INIT ("kickstartaccel4", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange4)
|
||||
};
|
||||
|
||||
consvar_t cv_autospin[MAXSPLITSCREENPLAYERS] = {
|
||||
CVAR_INIT ("autospin", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange),
|
||||
CVAR_INIT ("autospin2", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange2),
|
||||
CVAR_INIT ("autospin3", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange3),
|
||||
CVAR_INIT ("autospin4", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange4)
|
||||
};
|
||||
|
||||
consvar_t cv_shrinkme[MAXSPLITSCREENPLAYERS] = {
|
||||
CVAR_INIT ("shrinkme", "Off", CV_CALL, CV_OnOff, weaponPrefChange),
|
||||
CVAR_INIT ("shrinkme2", "Off", CV_CALL, CV_OnOff, weaponPrefChange2),
|
||||
|
|
@ -2216,7 +2223,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
|
|||
totalring = players[player].totalring;
|
||||
xtralife = players[player].xtralife;
|
||||
|
||||
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL|PF_SHRINKME|PF_SHRINKACTIVE));
|
||||
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL|PF_SHRINKME|PF_SHRINKACTIVE|PF_AUTOSPIN));
|
||||
|
||||
// SRB2kart
|
||||
memcpy(&itemRoulette, &players[player].itemRoulette, sizeof (itemRoulette));
|
||||
|
|
|
|||
|
|
@ -95,6 +95,7 @@ extern consvar_t cv_songcredits;
|
|||
extern consvar_t cv_pauseifunfocused;
|
||||
|
||||
extern consvar_t cv_kickstartaccel[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_autospin[MAXSPLITSCREENPLAYERS];
|
||||
extern consvar_t cv_shrinkme[MAXSPLITSCREENPLAYERS];
|
||||
|
||||
extern consvar_t cv_deadzone[MAXSPLITSCREENPLAYERS];
|
||||
|
|
|
|||
154
src/k_hud.c
154
src/k_hud.c
|
|
@ -193,6 +193,8 @@ static patch_t *kp_bossret[4];
|
|||
|
||||
static patch_t *kp_trickcool[2];
|
||||
|
||||
patch_t *kp_autospin;
|
||||
|
||||
patch_t *kp_capsuletarget_arrow[2][2];
|
||||
patch_t *kp_capsuletarget_icon[2];
|
||||
patch_t *kp_capsuletarget_far[2];
|
||||
|
|
@ -710,6 +712,8 @@ void K_LoadKartHUDGraphics(void)
|
|||
HU_UpdatePatch(&kp_trickcool[0], "K_COOL1");
|
||||
HU_UpdatePatch(&kp_trickcool[1], "K_COOL2");
|
||||
|
||||
HU_UpdatePatch(&kp_autospin, "A11YITEM");
|
||||
|
||||
sprintf(buffer, "K_BOSB0x");
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
|
|
@ -2743,70 +2747,92 @@ static void K_drawRingCounter(boolean gametypeinfoshown)
|
|||
|
||||
static void K_drawKartAccessibilityIcons(boolean gametypeinfoshown, INT32 fx)
|
||||
{
|
||||
INT32 fy = LAPS_Y-14;
|
||||
INT32 splitflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_SPLITSCREEN;
|
||||
//INT32 step = 1; -- if there's ever more than one accessibility icon
|
||||
|
||||
fx += LAPS_X;
|
||||
|
||||
if (r_splitscreen < 2) // adjust to speedometer height
|
||||
{
|
||||
if (gametypeinfoshown)
|
||||
{
|
||||
fy -= 11;
|
||||
|
||||
if ((gametyperules & (GTR_BUMPERS|GTR_CIRCUIT)) == GTR_BUMPERS)
|
||||
fy -= 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
fy += 9;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fx = LAPS_X+43;
|
||||
fy = LAPS_Y;
|
||||
if (!(stplyr == &players[displayplayers[0]] || stplyr == &players[displayplayers[2]])) // If we are not P1 or P3...
|
||||
{
|
||||
splitflags ^= (V_SNAPTOLEFT|V_SNAPTORIGHT);
|
||||
fx = (BASEVIDWIDTH/2) - (fx + 10);
|
||||
//step = -step;
|
||||
}
|
||||
}
|
||||
|
||||
if (stplyr->pflags & PF_KICKSTARTACCEL) // just KICKSTARTACCEL right now, maybe more later
|
||||
{
|
||||
SINT8 col = 0, wid, fil, ofs;
|
||||
UINT8 i = 7;
|
||||
ofs = (stplyr->kickstartaccel == ACCEL_KICKSTART) ? 1 : 0;
|
||||
fil = i-(stplyr->kickstartaccel*i)/ACCEL_KICKSTART;
|
||||
|
||||
V_DrawFill(fx+4, fy+ofs-1, 2, 1, 31|V_SLIDEIN|splitflags);
|
||||
V_DrawFill(fx, (fy+ofs-1)+8, 10, 1, 31|V_SLIDEIN|splitflags);
|
||||
|
||||
while (i--)
|
||||
{
|
||||
wid = (i/2)+1;
|
||||
V_DrawFill(fx+4-wid, fy+ofs+i, 2+(wid*2), 1, 31|V_SLIDEIN|splitflags);
|
||||
if (fil > 0)
|
||||
{
|
||||
if (i < fil)
|
||||
col = 23;
|
||||
else if (i == fil)
|
||||
col = 3;
|
||||
else
|
||||
col = 5 + (i-fil)*2;
|
||||
}
|
||||
else if ((leveltime % 7) == i)
|
||||
col = 0;
|
||||
else
|
||||
col = 3;
|
||||
V_DrawFill(fx+5-wid, fy+ofs+i, (wid*2), 1, col|V_SLIDEIN|splitflags);
|
||||
}
|
||||
|
||||
//fx += step*12;
|
||||
}
|
||||
INT32 fy = LAPS_Y-14;
|
||||
INT32 splitflags = V_SNAPTOLEFT|V_SNAPTOBOTTOM|V_SPLITSCREEN;
|
||||
|
||||
boolean mirror = false;
|
||||
|
||||
fx += LAPS_X;
|
||||
|
||||
if (r_splitscreen < 2) // adjust to speedometer height
|
||||
{
|
||||
if (gametypeinfoshown)
|
||||
{
|
||||
fy -= 11;
|
||||
|
||||
if ((gametyperules & (GTR_BUMPERS|GTR_CIRCUIT)) == GTR_BUMPERS)
|
||||
fy -= 4;
|
||||
}
|
||||
else
|
||||
{
|
||||
fy += 9;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fx = LAPS_X+44;
|
||||
fy = LAPS_Y;
|
||||
if (!(stplyr == &players[displayplayers[0]] || stplyr == &players[displayplayers[2]])) // If we are not P1 or P3...
|
||||
{
|
||||
splitflags ^= (V_SNAPTOLEFT|V_SNAPTORIGHT);
|
||||
fx = (BASEVIDWIDTH/2) - fx;
|
||||
mirror = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Kickstart Accel
|
||||
if (stplyr->pflags & PF_KICKSTARTACCEL)
|
||||
{
|
||||
if (mirror)
|
||||
fx -= 10;
|
||||
|
||||
SINT8 col = 0, wid, fil, ofs;
|
||||
UINT8 i = 7;
|
||||
ofs = (stplyr->kickstartaccel == ACCEL_KICKSTART) ? 1 : 0;
|
||||
fil = i-(stplyr->kickstartaccel*i)/ACCEL_KICKSTART;
|
||||
|
||||
V_DrawFill(fx+4, fy+ofs-1, 2, 1, 31|V_SLIDEIN|splitflags);
|
||||
V_DrawFill(fx, (fy+ofs-1)+8, 10, 1, 31|V_SLIDEIN|splitflags);
|
||||
|
||||
while (i--)
|
||||
{
|
||||
wid = (i/2)+1;
|
||||
V_DrawFill(fx+4-wid, fy+ofs+i, 2+(wid*2), 1, 31|V_SLIDEIN|splitflags);
|
||||
if (fil > 0)
|
||||
{
|
||||
if (i < fil)
|
||||
col = 23;
|
||||
else if (i == fil)
|
||||
col = 3;
|
||||
else
|
||||
col = 5 + (i-fil)*2;
|
||||
}
|
||||
else if ((leveltime % 7) == i)
|
||||
col = 0;
|
||||
else
|
||||
col = 3;
|
||||
V_DrawFill(fx+5-wid, fy+ofs+i, (wid*2), 1, col|V_SLIDEIN|splitflags);
|
||||
}
|
||||
|
||||
if (mirror)
|
||||
fx--;
|
||||
else
|
||||
fx += 10 + 1;
|
||||
}
|
||||
|
||||
// Auto Roulette
|
||||
if (stplyr->pflags & PF_AUTOSPIN)
|
||||
{
|
||||
if (mirror)
|
||||
fx -= 12;
|
||||
|
||||
V_DrawScaledPatch(fx, fy-1, V_SLIDEIN|splitflags, kp_autospin);
|
||||
|
||||
if (mirror)
|
||||
fx--;
|
||||
else
|
||||
fx += 12 + 1;
|
||||
}
|
||||
}
|
||||
|
||||
static void K_drawKartSpeedometer(boolean gametypeinfoshown)
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ extern patch_t *kp_capsuletarget_near[8];
|
|||
|
||||
extern patch_t *kp_superflickytarget[4];
|
||||
|
||||
extern patch_t *kp_autospin;
|
||||
|
||||
extern patch_t *kp_button_a[2][2];
|
||||
extern patch_t *kp_button_b[2][2];
|
||||
extern patch_t *kp_button_c[2][2];
|
||||
|
|
|
|||
|
|
@ -981,6 +981,7 @@ extern INT16 controlleroffsets[][2];
|
|||
extern consvar_t cv_dummyprofilename;
|
||||
extern consvar_t cv_dummyprofileplayername;
|
||||
extern consvar_t cv_dummyprofilekickstart;
|
||||
extern consvar_t cv_dummyprofileautospin;
|
||||
extern consvar_t cv_dummyprofilerumble;
|
||||
|
||||
void M_ResetOptions(void);
|
||||
|
|
|
|||
|
|
@ -1215,6 +1215,7 @@ void M_Init(void)
|
|||
CV_RegisterVar(&cv_dummyprofilename);
|
||||
CV_RegisterVar(&cv_dummyprofileplayername);
|
||||
CV_RegisterVar(&cv_dummyprofilekickstart);
|
||||
CV_RegisterVar(&cv_dummyprofileautospin);
|
||||
CV_RegisterVar(&cv_dummyprofilerumble);
|
||||
|
||||
CV_RegisterVar(&cv_dummygpdifficulty);
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ profile_t* PR_MakeProfile(
|
|||
strcpy(new->follower, fname);
|
||||
new->followercolor = fcol;
|
||||
new->kickstartaccel = false;
|
||||
new->autospin = false;
|
||||
|
||||
// Copy from gamecontrol directly as we'll be setting controls up directly in the profile.
|
||||
memcpy(new->controls, controlarray, sizeof(new->controls));
|
||||
|
|
@ -84,6 +85,7 @@ profile_t* PR_MakeProfileFromPlayer(const char *prname, const char *pname, const
|
|||
|
||||
// Player bound cvars:
|
||||
new->kickstartaccel = cv_kickstartaccel[pnum].value;
|
||||
new->autospin = cv_autospin[pnum].value;
|
||||
new->rumble = cv_rumble[pnum].value;
|
||||
|
||||
return new;
|
||||
|
|
@ -270,6 +272,7 @@ void PR_SaveProfiles(void)
|
|||
|
||||
// Consvars.
|
||||
WRITEUINT8(save.p, profilesList[i]->kickstartaccel);
|
||||
WRITEUINT8(save.p, profilesList[i]->autospin);
|
||||
WRITEUINT8(save.p, profilesList[i]->rumble);
|
||||
|
||||
// Controls.
|
||||
|
|
@ -407,6 +410,18 @@ void PR_LoadProfiles(void)
|
|||
|
||||
// Consvars.
|
||||
profilesList[i]->kickstartaccel = (boolean)READUINT8(save.p);
|
||||
|
||||
// 6->7, add autospin
|
||||
if (version < 7)
|
||||
{
|
||||
profilesList[i]->autospin = false;
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
profilesList[i]->autospin = (boolean)READUINT8(save.p);
|
||||
}
|
||||
|
||||
if (version < 4)
|
||||
{
|
||||
profilesList[i]->rumble = true;
|
||||
|
|
@ -459,6 +474,7 @@ static void PR_ApplyProfile_Settings(profile_t *p, UINT8 playernum)
|
|||
{
|
||||
// toggles
|
||||
CV_StealthSetValue(&cv_kickstartaccel[playernum], p->kickstartaccel);
|
||||
CV_StealthSetValue(&cv_autospin[playernum], p->autospin);
|
||||
|
||||
// set controls...
|
||||
memcpy(&gamecontrol[playernum], p->controls, sizeof(gamecontroldefault));
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ extern "C" {
|
|||
#define SKINNAMESIZE 16
|
||||
|
||||
#define PROFILENAMELEN 6
|
||||
#define PROFILEVER 6
|
||||
#define PROFILEVER 7
|
||||
#define MAXPROFILES 16
|
||||
#define PROFILESFILE "ringprofiles.prf"
|
||||
#define PROFILE_GUEST 0
|
||||
|
|
@ -74,6 +74,7 @@ struct profile_t
|
|||
// Player-specific consvars.
|
||||
// @TODO: List all of those
|
||||
boolean kickstartaccel; // cv_kickstartaccel
|
||||
boolean autospin; // cv_autospin
|
||||
boolean rumble; // cv_rumble
|
||||
|
||||
// Finally, control data itself
|
||||
|
|
|
|||
|
|
@ -1074,6 +1074,7 @@ static void K_InitRoulette(itemroulette_t *const roulette)
|
|||
roulette->active = true;
|
||||
roulette->eggman = false;
|
||||
roulette->ringbox = false;
|
||||
roulette->autospin = false;
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; i++)
|
||||
{
|
||||
|
|
@ -1235,6 +1236,12 @@ static void K_CalculateRouletteSpeed(itemroulette_t *const roulette)
|
|||
return;
|
||||
}
|
||||
|
||||
if (roulette->autospin == true)
|
||||
{
|
||||
roulette->speed = ROULETTE_SPEED_FASTEST;
|
||||
return;
|
||||
}
|
||||
|
||||
if (K_TimeAttackRules() == true)
|
||||
{
|
||||
// Time Attack rules; use a consistent speed.
|
||||
|
|
@ -1296,6 +1303,10 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet
|
|||
if (player != NULL)
|
||||
{
|
||||
roulette->baseDist = K_UndoMapScaling(player->distancetofinish);
|
||||
|
||||
if (player->pflags & PF_AUTOSPIN)
|
||||
roulette->autospin = true;
|
||||
|
||||
K_CalculateRouletteSpeed(roulette);
|
||||
}
|
||||
|
||||
|
|
@ -1456,6 +1467,9 @@ void K_StartItemRoulette(player_t *const player, boolean ringbox)
|
|||
|
||||
K_FillItemRouletteData(player, roulette, ringbox);
|
||||
|
||||
if (roulette->autospin)
|
||||
roulette->index = P_RandomRange(PR_AUTOSPIN, 0, roulette->itemListLen - 1);
|
||||
|
||||
if (K_PlayerUsesBotMovement(player) == true)
|
||||
{
|
||||
K_BotPickItemPriority(player);
|
||||
|
|
@ -1586,6 +1600,10 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
|
|||
// Waited way too long, forcefully confirm the item.
|
||||
confirmItem = true;
|
||||
}
|
||||
else if (roulette->autospin)
|
||||
{
|
||||
confirmItem = (roulette->speed > 15);
|
||||
}
|
||||
else
|
||||
{
|
||||
// We can stop our item when we choose.
|
||||
|
|
@ -1616,6 +1634,10 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
|
|||
{
|
||||
// D2 fudge factor. Roulette was originally designed and tested with this delay.
|
||||
UINT8 fudgedDelay = (player->cmd.latency <= 2) ? 0 : player->cmd.latency - 2;
|
||||
|
||||
if (roulette->autospin)
|
||||
fudgedDelay = 0; // We didn't manually stop this, you jackwagon
|
||||
|
||||
while (fudgedDelay > 0)
|
||||
{
|
||||
UINT8 gap = (roulette->speed - roulette->tics); // How long has the roulette been on this entry?
|
||||
|
|
@ -1671,6 +1693,9 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
|
|||
|
||||
roulette->elapsed++;
|
||||
|
||||
if (roulette->autospin && (roulette->elapsed % 5 == 0) && (roulette->elapsed > TICRATE))
|
||||
roulette->speed++;
|
||||
|
||||
if (roulette->tics == 0)
|
||||
{
|
||||
roulette->index = (roulette->index + 1) % roulette->itemListLen;
|
||||
|
|
|
|||
|
|
@ -78,6 +78,8 @@ typedef enum
|
|||
|
||||
PR_BOTS, // Bot spawning
|
||||
|
||||
PR_AUTOSPIN, // Item box accessibility
|
||||
|
||||
PRNUMCLASS
|
||||
} pr_class_t;
|
||||
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ menu_t OPTIONS_ProfilesDef = {
|
|||
consvar_t cv_dummyprofilename = CVAR_INIT ("dummyprofilename", "", CV_HIDDEN, NULL, NULL);
|
||||
consvar_t cv_dummyprofileplayername = CVAR_INIT ("dummyprofileplayername", "", CV_HIDDEN, NULL, NULL);
|
||||
consvar_t cv_dummyprofilekickstart = CVAR_INIT ("dummyprofilekickstart", "Off", CV_HIDDEN, CV_OnOff, NULL);
|
||||
consvar_t cv_dummyprofileautospin = CVAR_INIT ("dummyprofileautospin", "Off", CV_HIDDEN, CV_OnOff, NULL);
|
||||
consvar_t cv_dummyprofilerumble = CVAR_INIT ("dummyprofilerumble", "On", CV_HIDDEN, CV_OnOff, NULL);
|
||||
|
||||
void M_ProfileSelectInit(INT32 choice)
|
||||
|
|
@ -93,6 +94,7 @@ static void M_StartEditProfile(INT32 c)
|
|||
CV_StealthSet(&cv_dummyprofilename, optionsmenu.profile->profilename);
|
||||
CV_StealthSet(&cv_dummyprofileplayername, optionsmenu.profile->playername);
|
||||
CV_StealthSetValue(&cv_dummyprofilekickstart, optionsmenu.profile->kickstartaccel);
|
||||
CV_StealthSetValue(&cv_dummyprofileautospin, optionsmenu.profile->kickstartaccel);
|
||||
CV_StealthSetValue(&cv_dummyprofilerumble, optionsmenu.profile->rumble);
|
||||
}
|
||||
else
|
||||
|
|
@ -100,6 +102,7 @@ static void M_StartEditProfile(INT32 c)
|
|||
CV_StealthSet(&cv_dummyprofilename, "");
|
||||
CV_StealthSet(&cv_dummyprofileplayername, "");
|
||||
CV_StealthSetValue(&cv_dummyprofilekickstart, 0); // off
|
||||
CV_StealthSetValue(&cv_dummyprofileautospin, 0); // off
|
||||
CV_StealthSetValue(&cv_dummyprofilerumble, 1); // on
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ menuitem_t OPTIONS_ProfileControls[] = {
|
|||
{IT_CONTROL | IT_CVAR, "KICKSTART ACCEL", "Hold A to auto-accel. Tap it to cancel.",
|
||||
NULL, {.cvar = &cv_dummyprofilekickstart}, 0, 0},
|
||||
|
||||
{IT_CONTROL | IT_CVAR, "AUTO SPIN", "Automatically stop the item box on a random result.",
|
||||
NULL, {.cvar = &cv_dummyprofileautospin}, 0, 0},
|
||||
|
||||
{IT_HEADER, "EXTRA", "",
|
||||
NULL, {NULL}, 0, 0},
|
||||
|
||||
|
|
@ -187,6 +190,7 @@ static void M_ProfileControlSaveResponse(INT32 choice)
|
|||
SINT8 belongsto = PR_ProfileUsedBy(optionsmenu.profile);
|
||||
// Save the profile
|
||||
optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value;
|
||||
optionsmenu.profile->autospin = cv_dummyprofileautospin.value;
|
||||
optionsmenu.profile->rumble = cv_dummyprofilerumble.value;
|
||||
memcpy(&optionsmenu.profile->controls, optionsmenu.tempcontrols, sizeof(gamecontroldefault));
|
||||
|
||||
|
|
@ -196,6 +200,7 @@ static void M_ProfileControlSaveResponse(INT32 choice)
|
|||
{
|
||||
memcpy(&gamecontrol[belongsto], optionsmenu.tempcontrols, sizeof(gamecontroldefault));
|
||||
CV_SetValue(&cv_kickstartaccel[belongsto], cv_dummyprofilekickstart.value);
|
||||
CV_SetValue(&cv_autospin[belongsto], cv_dummyprofileautospin.value);
|
||||
CV_SetValue(&cv_rumble[belongsto], cv_dummyprofilerumble.value);
|
||||
}
|
||||
|
||||
|
|
@ -213,6 +218,7 @@ void M_ProfileControlsConfirm(INT32 choice)
|
|||
M_ProfileControlSaveResponse(MA_YES);
|
||||
|
||||
optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value; // Make sure to save kickstart accel.
|
||||
optionsmenu.profile->autospin = cv_dummyprofileautospin.value; // We should really just rip this entire construct out at some point
|
||||
optionsmenu.profile->rumble = cv_dummyprofilerumble.value; // And rumble too!
|
||||
|
||||
// Reapply player 1's real profile.
|
||||
|
|
|
|||
|
|
@ -623,6 +623,7 @@ static void P_NetArchivePlayers(savebuffer_t *save)
|
|||
WRITEUINT32(save->p, players[i].itemRoulette.elapsed);
|
||||
WRITEUINT8(save->p, players[i].itemRoulette.eggman);
|
||||
WRITEUINT8(save->p, players[i].itemRoulette.ringbox);
|
||||
WRITEUINT8(save->p, players[i].itemRoulette.autospin);
|
||||
|
||||
// sonicloopsvars_t
|
||||
WRITEFIXED(save->p, players[i].loop.radius);
|
||||
|
|
@ -1058,6 +1059,7 @@ static void P_NetUnArchivePlayers(savebuffer_t *save)
|
|||
players[i].itemRoulette.elapsed = (tic_t)READUINT32(save->p);
|
||||
players[i].itemRoulette.eggman = (boolean)READUINT8(save->p);
|
||||
players[i].itemRoulette.ringbox = (boolean)READUINT8(save->p);
|
||||
players[i].itemRoulette.autospin = (boolean)READUINT8(save->p);
|
||||
|
||||
// sonicloopsvars_t
|
||||
players[i].loop.radius = READFIXED(save->p);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue