Auto Spin -> Auto Roulette

This commit is contained in:
AJ Martinez 2023-08-20 16:26:34 -07:00
parent 88f54b298e
commit 3900189199
17 changed files with 65 additions and 65 deletions

View file

@ -1061,7 +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_autoroulette[i]);
CV_RegisterVar(&cv_shrinkme[i]);
CV_RegisterVar(&cv_deadzone[i]);
CV_RegisterVar(&cv_rumble[i]);
@ -1816,7 +1816,7 @@ static void Got_NameAndColor(UINT8 **cp, INT32 playernum)
enum {
WP_KICKSTARTACCEL = 1<<0,
WP_SHRINKME = 1<<1,
WP_AUTOSPIN = 1<<2,
WP_AUTOROULETTE = 1<<2,
};
void WeaponPref_Send(UINT8 ssplayer)
@ -1826,8 +1826,8 @@ void WeaponPref_Send(UINT8 ssplayer)
if (cv_kickstartaccel[ssplayer].value)
prefs |= WP_KICKSTARTACCEL;
if (cv_autospin[ssplayer].value)
prefs |= WP_AUTOSPIN;
if (cv_autoroulette[ssplayer].value)
prefs |= WP_AUTOROULETTE;
if (cv_shrinkme[ssplayer].value)
prefs |= WP_SHRINKME;
@ -1844,8 +1844,8 @@ 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_AUTOROULETTE)
prefs |= WP_AUTOROULETTE;
if (player->pflags & PF_SHRINKME)
prefs |= WP_SHRINKME;
@ -1859,13 +1859,13 @@ void WeaponPref_Parse(UINT8 **cp, INT32 playernum)
UINT8 prefs = READUINT8(*cp);
player->pflags &= ~(PF_KICKSTARTACCEL|PF_SHRINKME|PF_AUTOSPIN);
player->pflags &= ~(PF_KICKSTARTACCEL|PF_SHRINKME|PF_AUTOROULETTE);
if (prefs & WP_KICKSTARTACCEL)
player->pflags |= PF_KICKSTARTACCEL;
if (prefs & WP_AUTOSPIN)
player->pflags |= PF_AUTOSPIN;
if (prefs & WP_AUTOROULETTE)
player->pflags |= PF_AUTOROULETTE;
if (prefs & WP_SHRINKME)
player->pflags |= PF_SHRINKME;

View file

@ -66,7 +66,7 @@ typedef enum
// free: 1<<1
PF_AUTOSPIN = 1<<2, // Accessibility: Non-deterministic item box, no manual stop.
PF_AUTOROULETTE = 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?
@ -439,7 +439,7 @@ struct itemroulette_t
boolean eggman;
boolean ringbox;
boolean autospin;
boolean autoroulette;
};
// enum for bot item priorities

View file

@ -5931,7 +5931,7 @@ const char *const PLAYERFLAG_LIST[] = {
// free: 1<<1 and 1<<2 (name un-matchable)
"\x01",
"AUTOSPIN", // Item box accessibility
"AUTOROULETTE", // Item box accessibility
// Look back VFX has been spawned
// TODO: Is there a better way to track this?

View file

@ -133,11 +133,11 @@ demoghost *ghosts = NULL;
#define DF_ENCORE 0x40
#define DF_MULTIPLAYER 0x80 // This demo was recorded in multiplayer mode!
#define DEMO_SPECTATOR 0x01
#define DEMO_KICKSTART 0x02
#define DEMO_SHRINKME 0x04
#define DEMO_BOT 0x08
#define DEMO_AUTOSPIN 0x10
#define DEMO_SPECTATOR 0x01
#define DEMO_KICKSTART 0x02
#define DEMO_SHRINKME 0x04
#define DEMO_BOT 0x08
#define DEMO_AUTOROULETTE 0x10
// For demos
#define ZT_FWD 0x0001
@ -2475,8 +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_AUTOROULETTE)
i |= DEMO_AUTOROULETTE;
if (player->pflags & PF_SHRINKME)
i |= DEMO_SHRINKME;
if (player->bot == true)
@ -3439,10 +3439,10 @@ void G_DoPlayDemo(const char *defdemoname)
else
players[p].pflags &= ~PF_KICKSTARTACCEL;
if (flags & DEMO_AUTOSPIN)
players[p].pflags |= PF_AUTOSPIN;
if (flags & DEMO_AUTOROULETTE)
players[p].pflags |= PF_AUTOROULETTE;
else
players[p].pflags &= ~PF_AUTOSPIN;
players[p].pflags &= ~PF_AUTOROULETTE;
if (flags & DEMO_SHRINKME)
players[p].pflags |= PF_SHRINKME;

View file

@ -408,11 +408,11 @@ 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_autoroulette[MAXSPLITSCREENPLAYERS] = {
CVAR_INIT ("autoroulette", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange),
CVAR_INIT ("autoroulette2", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange2),
CVAR_INIT ("autoroulette3", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange3),
CVAR_INIT ("autoroulette4", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange4)
};
consvar_t cv_shrinkme[MAXSPLITSCREENPLAYERS] = {
@ -2223,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|PF_AUTOSPIN));
pflags = (players[player].pflags & (PF_WANTSTOJOIN|PF_KICKSTARTACCEL|PF_SHRINKME|PF_SHRINKACTIVE|PF_AUTOROULETTE));
// SRB2kart
memcpy(&itemRoulette, &players[player].itemRoulette, sizeof (itemRoulette));

View file

@ -95,7 +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_autoroulette[MAXSPLITSCREENPLAYERS];
extern consvar_t cv_shrinkme[MAXSPLITSCREENPLAYERS];
extern consvar_t cv_deadzone[MAXSPLITSCREENPLAYERS];

View file

@ -193,7 +193,7 @@ static patch_t *kp_bossret[4];
static patch_t *kp_trickcool[2];
patch_t *kp_autospin;
patch_t *kp_autoroulette;
patch_t *kp_capsuletarget_arrow[2][2];
patch_t *kp_capsuletarget_icon[2];
@ -712,7 +712,7 @@ void K_LoadKartHUDGraphics(void)
HU_UpdatePatch(&kp_trickcool[0], "K_COOL1");
HU_UpdatePatch(&kp_trickcool[1], "K_COOL2");
HU_UpdatePatch(&kp_autospin, "A11YITEM");
HU_UpdatePatch(&kp_autoroulette, "A11YITEM");
sprintf(buffer, "K_BOSB0x");
for (i = 0; i < 8; i++)
@ -2821,12 +2821,12 @@ static void K_drawKartAccessibilityIcons(boolean gametypeinfoshown, INT32 fx)
}
// Auto Roulette
if (stplyr->pflags & PF_AUTOSPIN)
if (stplyr->pflags & PF_AUTOROULETTE)
{
if (mirror)
fx -= 12;
V_DrawScaledPatch(fx, fy-1, V_SLIDEIN|splitflags, kp_autospin);
V_DrawScaledPatch(fx, fy-1, V_SLIDEIN|splitflags, kp_autoroulette);
if (mirror)
fx--;

View file

@ -61,7 +61,7 @@ extern patch_t *kp_capsuletarget_near[8];
extern patch_t *kp_superflickytarget[4];
extern patch_t *kp_autospin;
extern patch_t *kp_autoroulette;
extern patch_t *kp_button_a[2][2];
extern patch_t *kp_button_b[2][2];

View file

@ -981,7 +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_dummyprofileautoroulette;
extern consvar_t cv_dummyprofilerumble;
void M_ResetOptions(void);

View file

@ -1215,7 +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_dummyprofileautoroulette);
CV_RegisterVar(&cv_dummyprofilerumble);
CV_RegisterVar(&cv_dummygpdifficulty);

View file

@ -68,7 +68,7 @@ profile_t* PR_MakeProfile(
strcpy(new->follower, fname);
new->followercolor = fcol;
new->kickstartaccel = false;
new->autospin = false;
new->autoroulette = false;
// Copy from gamecontrol directly as we'll be setting controls up directly in the profile.
memcpy(new->controls, controlarray, sizeof(new->controls));
@ -85,7 +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->autoroulette = cv_autoroulette[pnum].value;
new->rumble = cv_rumble[pnum].value;
return new;
@ -272,7 +272,7 @@ void PR_SaveProfiles(void)
// Consvars.
WRITEUINT8(save.p, profilesList[i]->kickstartaccel);
WRITEUINT8(save.p, profilesList[i]->autospin);
WRITEUINT8(save.p, profilesList[i]->autoroulette);
WRITEUINT8(save.p, profilesList[i]->rumble);
// Controls.
@ -411,15 +411,15 @@ void PR_LoadProfiles(void)
// Consvars.
profilesList[i]->kickstartaccel = (boolean)READUINT8(save.p);
// 6->7, add autospin
// 6->7, add autoroulette
if (version < 7)
{
profilesList[i]->autospin = false;
profilesList[i]->autoroulette = false;
}
else
{
profilesList[i]->autospin = (boolean)READUINT8(save.p);
profilesList[i]->autoroulette = (boolean)READUINT8(save.p);
}
if (version < 4)
@ -474,7 +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);
CV_StealthSetValue(&cv_autoroulette[playernum], p->autoroulette);
// set controls...
memcpy(&gamecontrol[playernum], p->controls, sizeof(gamecontroldefault));

View file

@ -74,7 +74,7 @@ struct profile_t
// Player-specific consvars.
// @TODO: List all of those
boolean kickstartaccel; // cv_kickstartaccel
boolean autospin; // cv_autospin
boolean autoroulette; // cv_autoroulette
boolean rumble; // cv_rumble
// Finally, control data itself

View file

@ -1074,7 +1074,7 @@ static void K_InitRoulette(itemroulette_t *const roulette)
roulette->active = true;
roulette->eggman = false;
roulette->ringbox = false;
roulette->autospin = false;
roulette->autoroulette = false;
for (i = 0; i < MAXPLAYERS; i++)
{
@ -1236,7 +1236,7 @@ static void K_CalculateRouletteSpeed(itemroulette_t *const roulette)
return;
}
if (roulette->autospin == true)
if (roulette->autoroulette == true)
{
roulette->speed = ROULETTE_SPEED_FASTEST;
return;
@ -1304,8 +1304,8 @@ void K_FillItemRouletteData(const player_t *player, itemroulette_t *const roulet
{
roulette->baseDist = K_UndoMapScaling(player->distancetofinish);
if (player->pflags & PF_AUTOSPIN)
roulette->autospin = true;
if (player->pflags & PF_AUTOROULETTE)
roulette->autoroulette = true;
K_CalculateRouletteSpeed(roulette);
}
@ -1467,8 +1467,8 @@ 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 (roulette->autoroulette)
roulette->index = P_RandomRange(PR_AUTOROULETTE, 0, roulette->itemListLen - 1);
if (K_PlayerUsesBotMovement(player) == true)
{
@ -1595,12 +1595,12 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
if (roulette->elapsed > TICRATE>>1) // Prevent accidental immediate item confirm
{
if (roulette->elapsed > TICRATE<<4 || (roulette->eggman && !roulette->autospin && roulette->elapsed > TICRATE*4))
if (roulette->elapsed > TICRATE<<4 || (roulette->eggman && !roulette->autoroulette && roulette->elapsed > TICRATE*4))
{
// Waited way too long, forcefully confirm the item.
confirmItem = true;
}
else if (roulette->autospin)
else if (roulette->autoroulette)
{
confirmItem = (roulette->speed > 15);
}
@ -1635,7 +1635,7 @@ 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)
if (roulette->autoroulette)
fudgedDelay = 0; // We didn't manually stop this, you jackwagon
while (fudgedDelay > 0)
@ -1693,7 +1693,7 @@ void K_KartItemRoulette(player_t *const player, ticcmd_t *const cmd)
roulette->elapsed++;
if (roulette->autospin && (roulette->elapsed % 5 == 0) && (roulette->elapsed > TICRATE))
if (roulette->autoroulette && (roulette->elapsed % 5 == 0) && (roulette->elapsed > TICRATE))
roulette->speed++;
if (roulette->tics == 0)

View file

@ -78,7 +78,7 @@ typedef enum
PR_BOTS, // Bot spawning
PR_AUTOSPIN, // Item box accessibility
PR_AUTOROULETTE, // Item box accessibility
PRNUMCLASS
} pr_class_t;

View file

@ -30,7 +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_dummyprofileautoroulette = CVAR_INIT ("dummyprofileautoroulette", "Off", CV_HIDDEN, CV_OnOff, NULL);
consvar_t cv_dummyprofilerumble = CVAR_INIT ("dummyprofilerumble", "On", CV_HIDDEN, CV_OnOff, NULL);
void M_ProfileSelectInit(INT32 choice)
@ -94,7 +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->autospin);
CV_StealthSetValue(&cv_dummyprofileautoroulette, optionsmenu.profile->autoroulette);
CV_StealthSetValue(&cv_dummyprofilerumble, optionsmenu.profile->rumble);
}
else
@ -102,7 +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_dummyprofileautoroulette, 0); // off
CV_StealthSetValue(&cv_dummyprofilerumble, 1); // on
}

View file

@ -91,8 +91,8 @@ 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", "Item roulette auto-stops on a random result.",
NULL, {.cvar = &cv_dummyprofileautospin}, 0, 0},
{IT_CONTROL | IT_CVAR, "AUTO ROULETTE", "Item roulette auto-stops on a random result.",
NULL, {.cvar = &cv_dummyprofileautoroulette}, 0, 0},
{IT_HEADER, "EXTRA", "",
NULL, {NULL}, 0, 0},
@ -190,7 +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->autoroulette = cv_dummyprofileautoroulette.value;
optionsmenu.profile->rumble = cv_dummyprofilerumble.value;
memcpy(&optionsmenu.profile->controls, optionsmenu.tempcontrols, sizeof(gamecontroldefault));
@ -200,7 +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_autoroulette[belongsto], cv_dummyprofileautoroulette.value);
CV_SetValue(&cv_rumble[belongsto], cv_dummyprofilerumble.value);
}
@ -218,7 +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->autoroulette = cv_dummyprofileautoroulette.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.

View file

@ -623,7 +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);
WRITEUINT8(save->p, players[i].itemRoulette.autoroulette);
// sonicloopsvars_t
WRITEFIXED(save->p, players[i].loop.radius);
@ -1059,7 +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);
players[i].itemRoulette.autoroulette = (boolean)READUINT8(save->p);
// sonicloopsvars_t
players[i].loop.radius = READFIXED(save->p);