diff --git a/src/cvars.cpp b/src/cvars.cpp index 173ba956a..2ea673fdc 100644 --- a/src/cvars.cpp +++ b/src/cvars.cpp @@ -974,6 +974,7 @@ consvar_t cv_dummymenuplayer = MenuDummy("dummymenuplayer", "P1").onchange(Dummy consvar_t cv_dummyprofileautoroulette = MenuDummy("dummyprofileautoroulette", "Off").on_off(); consvar_t cv_dummyprofilefov = MenuDummy("dummyprofilefov", "100").min_max(70, 110); consvar_t cv_dummyprofilelitesteer = MenuDummy("dummyprofilelitesteer", "Off").on_off(); +consvar_t cv_dummyprofilestrictfastfall = MenuDummy("dummprofilestrictfastfall", "Off").on_off(); consvar_t cv_dummyprofiledescriptiveinput = Player("dummyprofiledescriptiveinput", "Modern").values(descriptiveinput_cons_t); consvar_t cv_dummyprofileautoring = MenuDummy("dummyprofileautoring", "Off").on_off(); consvar_t cv_dummyprofilekickstart = MenuDummy("dummyprofilekickstart", "Off").on_off(); @@ -1085,6 +1086,13 @@ consvar_t cv_litesteer[MAXSPLITSCREENPLAYERS] = { Player("litesteer4", "Off").on_off().onchange(weaponPrefChange4), }; +consvar_t cv_strictfastfall[MAXSPLITSCREENPLAYERS] = { + Player("strictfastfall", "Off").on_off().onchange(weaponPrefChange), + Player("strictfastfall2", "Off").on_off().onchange(weaponPrefChange2), + Player("strictfastfall3", "Off").on_off().onchange(weaponPrefChange3), + Player("strictfastfall4", "Off").on_off().onchange(weaponPrefChange4), +}; + consvar_t cv_autoring[MAXSPLITSCREENPLAYERS] = { Player("autoring", "Off").on_off().onchange(weaponPrefChange), Player("autoring2", "Off").on_off().onchange(weaponPrefChange2), diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b10215e50..b902cadb3 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1176,7 +1176,8 @@ enum { WP_ANALOGSTICK = 1<<3, WP_AUTORING = 1<<4, WP_SELFMUTE = 1<<5, - WP_SELFDEAFEN = 1<<6 + WP_SELFDEAFEN = 1<<6, + WP_STRICTFASTFALL = 1<<7, }; void WeaponPref_Send(UINT8 ssplayer) @@ -1207,6 +1208,9 @@ void WeaponPref_Send(UINT8 ssplayer) prefs |= WP_SELFDEAFEN; } + if (cv_strictfastfall[ssplayer].value) + prefs |= WP_STRICTFASTFALL; + UINT8 buf[2]; buf[0] = prefs; buf[1] = cv_mindelay.value; @@ -1246,7 +1250,7 @@ size_t WeaponPref_Parse(const UINT8 *bufstart, INT32 playernum) UINT8 prefs = READUINT8(p); player->pflags &= ~(PF_KICKSTARTACCEL|PF_SHRINKME|PF_AUTOROULETTE|PF_AUTORING); - player->pflags2 &= ~(PF2_SELFMUTE | PF2_SELFDEAFEN); + player->pflags2 &= ~(PF2_SELFMUTE | PF2_SELFDEAFEN | PF2_STRICTFASTFALL); if (prefs & WP_KICKSTARTACCEL) player->pflags |= PF_KICKSTARTACCEL; @@ -1271,6 +1275,9 @@ size_t WeaponPref_Parse(const UINT8 *bufstart, INT32 playernum) if (prefs & WP_SELFDEAFEN) player->pflags2 |= PF2_SELFDEAFEN; + if (prefs & WP_STRICTFASTFALL) + player->pflags2 |= PF2_STRICTFASTFALL; + if (leveltime < 2) { // BAD HACK: No other place I tried to slot this in diff --git a/src/d_player.h b/src/d_player.h index 7f286400c..aecf3caaf 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -138,6 +138,7 @@ typedef enum PF2_SELFDEAFEN = 1<<2, PF2_SERVERMUTE = 1<<3, PF2_SERVERDEAFEN = 1<<4, + PF2_STRICTFASTFALL = 1<<5, } pflags2_t; typedef enum diff --git a/src/d_ticcmd.h b/src/d_ticcmd.h index 88ad11c6e..f0c5f4f28 100644 --- a/src/d_ticcmd.h +++ b/src/d_ticcmd.h @@ -34,11 +34,12 @@ typedef enum BT_LOOKBACK = 1<<5, // Look Backward BT_RESPAWN = 1<<6, // Respawn BT_VOTE = 1<<7, // Vote + BT_SPINDASH = 1<<8, // Spindash - BT_EBRAKEMASK = (BT_ACCELERATE|BT_BRAKE), - BT_SPINDASHMASK = (BT_ACCELERATE|BT_BRAKE|BT_DRIFT), + BT_EBRAKEMASK = (BT_ACCELERATE|BT_BRAKE), + BT_SPINDASHMASK = (BT_ACCELERATE|BT_BRAKE|BT_DRIFT), - // free: 1<<8 to 1<<12 + // free: 1<<9 to 1<<12 // Lua garbage, replace with freeslottable buttons some day BT_LUAA = 1<<13, diff --git a/src/deh_tables.c b/src/deh_tables.c index 44195a340..a6c2719cf 100644 --- a/src/deh_tables.c +++ b/src/deh_tables.c @@ -5005,6 +5005,7 @@ struct int_const_s const INT_CONST[] = { {"BT_LOOKBACK",BT_LOOKBACK}, {"BT_RESPAWN",BT_RESPAWN}, {"BT_VOTE",BT_VOTE}, + {"BT_SPINDASH",BT_SPINDASH}, // Real button now, but triggers the macro same as always. {"BT_EBRAKEMASK",BT_EBRAKEMASK}, // Macro button {"BT_SPINDASHMASK",BT_SPINDASHMASK}, // Macro button {"BT_LUAA",BT_LUAA}, // Lua customizable diff --git a/src/g_build_ticcmd.cpp b/src/g_build_ticcmd.cpp index df036eab8..b8d45e3dc 100644 --- a/src/g_build_ticcmd.cpp +++ b/src/g_build_ticcmd.cpp @@ -400,7 +400,7 @@ class TiccmdBuilder }; map(gc_drift, BT_DRIFT); // drift - map(gc_spindash, BT_SPINDASHMASK); // C + map(gc_spindash, BT_SPINDASH|BT_SPINDASHMASK); // C map(gc_item, BT_ATTACK); // fire map(gc_lookback, BT_LOOKBACK); // rear view diff --git a/src/g_demo.cpp b/src/g_demo.cpp index 1d36dcb7e..88828fee6 100644 --- a/src/g_demo.cpp +++ b/src/g_demo.cpp @@ -207,6 +207,7 @@ boolean G_CompatLevel(UINT16 level) #define DEMO_BOT 0x08 #define DEMO_AUTOROULETTE 0x10 #define DEMO_AUTORING 0x20 +#define DEMO_STRICTFASTFALL 0x40 // For demos #define ZT_FWD 0x0001 @@ -2336,6 +2337,8 @@ void G_BeginRecording(void) i |= DEMO_SPECTATOR; if (player->pflags & PF_KICKSTARTACCEL) i |= DEMO_KICKSTART; + if (player->pflags & PF2_STRICTFASTFALL) + i |= DEMO_STRICTFASTFALL; if (player->pflags & PF_AUTOROULETTE) i |= DEMO_AUTOROULETTE; if (player->pflags & PF_AUTORING) @@ -3453,6 +3456,11 @@ void G_DoPlayDemoEx(const char *defdemoname, lumpnum_t deflumpnum) else players[p].pflags &= ~PF_KICKSTARTACCEL; + if (flags & DEMO_STRICTFASTFALL) + players[p].pflags |= PF2_STRICTFASTFALL; + else + players[p].pflags &= ~PF2_STRICTFASTFALL; + if (flags & DEMO_AUTOROULETTE) players[p].pflags |= PF_AUTOROULETTE; else diff --git a/src/g_game.h b/src/g_game.h index f19f819da..14ee6494a 100644 --- a/src/g_game.h +++ b/src/g_game.h @@ -100,6 +100,7 @@ extern consvar_t cv_pauseifunfocused; extern consvar_t cv_kickstartaccel[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_autoroulette[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_litesteer[MAXSPLITSCREENPLAYERS]; +extern consvar_t cv_strictfastfall[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_autoring[MAXSPLITSCREENPLAYERS]; extern consvar_t cv_shrinkme[MAXSPLITSCREENPLAYERS]; diff --git a/src/hud/input-display.cpp b/src/hud/input-display.cpp index fbfd03ee2..c3dab0a53 100644 --- a/src/hud/input-display.cpp +++ b/src/hud/input-display.cpp @@ -111,7 +111,7 @@ void K_DrawInputDisplay(float x, float y, INT32 flags, char mode, UINT8 pid, boo box.patch(gfx("PAD{}", analog ? "N" : dpad_suffix(dpad))); box.patch(but('A', gc_a, BT_ACCELERATE)); box.patch(but('B', gc_b, BT_LOOKBACK)); - box.patch(but('C', gc_c, BT_SPINDASHMASK)); + box.patch(but('C', gc_c, BT_SPINDASH)); box.patch(but('X', gc_x, BT_BRAKE)); box.patch(but('Y', gc_y, BT_RESPAWN)); box.patch(but('Z', gc_z, BT_VOTE)); diff --git a/src/k_kart.c b/src/k_kart.c index 5099b6747..e464b08c6 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -12614,6 +12614,10 @@ static void K_KartSpindash(player_t *player) if (player->pflags & PF_NOFASTFALL) return; + if (player->pflags2 & PF2_STRICTFASTFALL) + if (!(player->cmd.buttons & BT_SPINDASH)) + return; + if (player->fastfall == 0) { // Factors 3D momentum. diff --git a/src/k_menu.h b/src/k_menu.h index bd2973ff1..21cef5fa5 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -1130,6 +1130,7 @@ extern consvar_t cv_dummyprofileplayername; extern consvar_t cv_dummyprofilekickstart; extern consvar_t cv_dummyprofileautoroulette; extern consvar_t cv_dummyprofilelitesteer; +extern consvar_t cv_dummyprofilestrictfastfall; extern consvar_t cv_dummyprofiledescriptiveinput; extern consvar_t cv_dummyprofileautoring; extern consvar_t cv_dummyprofilerumble; diff --git a/src/k_profiles.cpp b/src/k_profiles.cpp index 8ccab2229..06febe5c7 100644 --- a/src/k_profiles.cpp +++ b/src/k_profiles.cpp @@ -85,6 +85,7 @@ profile_t* PR_MakeProfile( newprofile->kickstartaccel = false; newprofile->autoroulette = false; newprofile->litesteer = false; + newprofile->strictfastfall = false; newprofile->descriptiveinput = 1; newprofile->autoring = false; newprofile->rumble = true; @@ -108,6 +109,7 @@ profile_t* PR_MakeProfileFromPlayer(const char *prname, const char *pname, const newprofile->kickstartaccel = cv_kickstartaccel[pnum].value; newprofile->autoroulette = cv_autoroulette[pnum].value; newprofile->litesteer = cv_litesteer[pnum].value; + newprofile->strictfastfall = cv_strictfastfall[pnum].value; newprofile->descriptiveinput = cv_descriptiveinput[pnum].value; newprofile->autoring = cv_autoring[pnum].value; newprofile->rumble = cv_rumble[pnum].value; @@ -305,6 +307,7 @@ void PR_SaveProfiles(void) jsonprof.preferences.kickstartaccel = cprof->kickstartaccel; jsonprof.preferences.autoroulette = cprof->autoroulette; jsonprof.preferences.litesteer = cprof->litesteer; + jsonprof.preferences.strictfastfall = cprof->strictfastfall; jsonprof.preferences.descriptiveinput = cprof->descriptiveinput; jsonprof.preferences.autoring = cprof->autoring; jsonprof.preferences.rumble = cprof->rumble; @@ -493,6 +496,7 @@ void PR_LoadProfiles(void) newprof->kickstartaccel = jsprof.preferences.kickstartaccel; newprof->autoroulette = jsprof.preferences.autoroulette; newprof->litesteer = jsprof.preferences.litesteer; + newprof->strictfastfall = jsprof.preferences.strictfastfall; newprof->descriptiveinput = jsprof.preferences.descriptiveinput; newprof->autoring = jsprof.preferences.autoring; newprof->rumble = jsprof.preferences.rumble; @@ -597,6 +601,7 @@ static void PR_ApplyProfile_Settings(profile_t *p, UINT8 playernum) CV_StealthSetValue(&cv_kickstartaccel[playernum], p->kickstartaccel); CV_StealthSetValue(&cv_autoroulette[playernum], p->autoroulette); CV_StealthSetValue(&cv_litesteer[playernum], p->litesteer); + CV_StealthSetValue(&cv_strictfastfall[playernum], p->strictfastfall); CV_StealthSetValue(&cv_descriptiveinput[playernum], p->descriptiveinput); CV_StealthSetValue(&cv_autoring[playernum], p->autoring); CV_StealthSetValue(&cv_rumble[playernum], p->rumble); diff --git a/src/k_profiles.h b/src/k_profiles.h index 4c71ee074..9572bd973 100644 --- a/src/k_profiles.h +++ b/src/k_profiles.h @@ -46,6 +46,7 @@ struct ProfilePreferencesJson bool kickstartaccel; bool autoroulette; bool litesteer; + bool strictfastfall; uint8_t descriptiveinput; bool autoring; bool rumble; @@ -56,6 +57,7 @@ struct ProfilePreferencesJson kickstartaccel, autoroulette, litesteer, + strictfastfall, descriptiveinput, autoring, rumble, @@ -164,6 +166,7 @@ struct profile_t boolean kickstartaccel; // cv_kickstartaccel boolean autoroulette; // cv_autoroulette boolean litesteer; // cv_litesteer + boolean strictfastfall; // cv_strictfastfall UINT8 descriptiveinput; // cv_descriptiveinput boolean autoring; // cv_autoring boolean rumble; // cv_rumble diff --git a/src/menus/options-profiles-1.c b/src/menus/options-profiles-1.c index 0fc2a0de8..8f61f01cd 100644 --- a/src/menus/options-profiles-1.c +++ b/src/menus/options-profiles-1.c @@ -102,6 +102,7 @@ void M_StartEditProfile(INT32 c) CV_StealthSetValue(&cv_dummyprofilekickstart, optionsmenu.profile->kickstartaccel); CV_StealthSetValue(&cv_dummyprofileautoroulette, optionsmenu.profile->autoroulette); CV_StealthSetValue(&cv_dummyprofilelitesteer, optionsmenu.profile->litesteer); + CV_StealthSetValue(&cv_dummyprofilestrictfastfall, optionsmenu.profile->strictfastfall); CV_StealthSetValue(&cv_dummyprofiledescriptiveinput, optionsmenu.profile->descriptiveinput); CV_StealthSetValue(&cv_dummyprofileautoring, optionsmenu.profile->autoring); CV_StealthSetValue(&cv_dummyprofilerumble, optionsmenu.profile->rumble); @@ -114,6 +115,7 @@ void M_StartEditProfile(INT32 c) CV_StealthSetValue(&cv_dummyprofilekickstart, 0); // off CV_StealthSetValue(&cv_dummyprofileautoroulette, 0); // off CV_StealthSetValue(&cv_dummyprofilelitesteer, 1); // on + CV_StealthSetValue(&cv_dummyprofilestrictfastfall, 0); // off CV_StealthSetValue(&cv_dummyprofiledescriptiveinput, 1); // Modern CV_StealthSetValue(&cv_dummyprofileautoring, 0); // on CV_StealthSetValue(&cv_dummyprofilerumble, 1); // on diff --git a/src/menus/options-profiles-edit-1.c b/src/menus/options-profiles-edit-1.c index f432c24ef..fa5eb661c 100644 --- a/src/menus/options-profiles-edit-1.c +++ b/src/menus/options-profiles-edit-1.c @@ -98,6 +98,7 @@ static void M_ProfileEditApply(void) optionsmenu.profile->kickstartaccel = cv_dummyprofilekickstart.value; optionsmenu.profile->autoroulette = cv_dummyprofileautoroulette.value; optionsmenu.profile->litesteer = cv_dummyprofilelitesteer.value; + optionsmenu.profile->strictfastfall = cv_dummyprofilestrictfastfall.value; optionsmenu.profile->descriptiveinput = cv_dummyprofiledescriptiveinput.value; optionsmenu.profile->autoring = cv_dummyprofileautoring.value; optionsmenu.profile->rumble = cv_dummyprofilerumble.value; diff --git a/src/menus/options-profiles-edit-accessibility.cpp b/src/menus/options-profiles-edit-accessibility.cpp index bbb09f97a..d347b3ca4 100644 --- a/src/menus/options-profiles-edit-accessibility.cpp +++ b/src/menus/options-profiles-edit-accessibility.cpp @@ -114,6 +114,9 @@ menuitem_t OPTIONS_ProfileAccessibility[] = { {IT_STRING | IT_CVAR, "Lite Steer", "Hold DOWN on d-pad/keyboard for shallow turns.", NULL, {.cvar = &cv_dummyprofilelitesteer}, 0, 0}, + {IT_STRING | IT_CVAR, "Strict Fastfall", "Fastfall only with the Spindash button.", + NULL, {.cvar = &cv_dummyprofilestrictfastfall}, 0, 0}, + {IT_STRING | IT_CVAR, "Field of View", "Higher FOV lets you see more.", NULL, {.cvar = &cv_dummyprofilefov}, 0, 0}, @@ -144,7 +147,7 @@ menu_t OPTIONS_ProfileAccessibilityDef = { &OPTIONS_EditProfileDef, 0, OPTIONS_ProfileAccessibility, - 145, 41, + 145, 31, SKINCOLOR_ULTRAMARINE, 0, MBF_DRAWBGWHILEPLAYING, "FILE",