diff --git a/source/duke3d/src/_functio.h b/source/duke3d/src/_functio.h index ad1685f40..ad8168556 100644 --- a/source/duke3d/src/_functio.h +++ b/source/duke3d/src/_functio.h @@ -109,12 +109,13 @@ char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN] = "Show_Multiplayer_Scores", #endif "Dpad_Select", - "Dpad_Aiming" + "Dpad_Aiming", + "Alternate_Weapon", }; #ifdef __SETUP__ -#define NUMKEYENTRIES 56 +#define NUMKEYENTRIES 57 const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] = { @@ -174,6 +175,7 @@ const char keydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] = "", "", "", "", "", "", + "", "", }; const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] = @@ -234,6 +236,7 @@ const char oldkeydefaults[NUMGAMEFUNCTIONS*2][MAXGAMEFUNCLEN] = "", "", "", "", "", "", + "", "", }; static const char * mousedefaults[MAXMOUSEBUTTONS] = diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index b03303388..2da2bb77d 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -140,6 +140,7 @@ enum GameEvent_t { EVENT_ENDLEVELSCREEN, EVENT_EXITGAMESCREEN, EVENT_EXITPROGRAMSCREEN, + EVENT_ALTWEAPON, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/function.h b/source/duke3d/src/function.h index 2b27cb16d..d4ad5fc36 100644 --- a/source/duke3d/src/function.h +++ b/source/duke3d/src/function.h @@ -34,8 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. extern "C" { #endif -#define NUMKEYENTRIES 56 -#define NUMGAMEFUNCTIONS 56 +#define NUMKEYENTRIES 57 +#define NUMGAMEFUNCTIONS 57 #define MAXGAMEFUNCLEN 32 extern char gamefunctions[NUMGAMEFUNCTIONS][MAXGAMEFUNCLEN]; @@ -99,7 +99,8 @@ enum GameFunction_t gamefunc_Show_Console, gamefunc_Show_DukeMatch_Scores, gamefunc_Dpad_Select, - gamefunc_Dpad_Aiming + gamefunc_Dpad_Aiming, + gamefunc_Alt_Weapon, }; #ifdef __cplusplus } diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index e59e148c8..a3dc416df 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -7169,4 +7169,5 @@ static void G_SetupGameButtons(void) CONTROL_DefineFlag(gamefunc_Quick_Kick,FALSE); CONTROL_DefineFlag(gamefunc_Next_Weapon,FALSE); CONTROL_DefineFlag(gamefunc_Previous_Weapon,FALSE); + CONTROL_DefineFlag(gamefunc_Alt_Weapon,FALSE); } diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 8f613c869..9e7b4b686 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -736,6 +736,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_ENDLEVELSCREEN", "EVENT_EXITGAMESCREEN", "EVENT_EXITPROGRAMSCREEN", + "EVENT_ALTWEAPON", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 62befe2b4..9d8707305 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -2971,6 +2971,9 @@ void P_GetInput(int playerNum) if (BUTTON(gamefunc_Next_Weapon) || (BUTTON(gamefunc_Dpad_Select) && staticInput.fvel > 0)) weaponSelection = 12; + if (BUTTON(gamefunc_Alt_Weapon)) + weaponSelection = 13; + if (BUTTON(gamefunc_Jump) && pPlayer->on_ground) g_emuJumpTics = 4; diff --git a/source/duke3d/src/sector.cpp b/source/duke3d/src/sector.cpp index 39619da27..d783e5f7a 100644 --- a/source/duke3d/src/sector.cpp +++ b/source/duke3d/src/sector.cpp @@ -2552,6 +2552,9 @@ CHECKINV1: case 11: weaponNum = VM_OnEventWithReturn(EVENT_NEXTWEAPON,pPlayer->i,playerNum, weaponNum); break; + case 12: + weaponNum = VM_OnEventWithReturn(EVENT_ALTWEAPON,pPlayer->i,playerNum, weaponNum); + break; } // NOTE: it is assumed that the above events return either -1 or a @@ -2644,6 +2647,22 @@ CHECKINV1: pPlayer->subweapon |= (1<curr_weapon) + { + case HANDREMOTE_WEAPON: + weaponNum = HANDBOMB_WEAPON; + break; + case GROW_WEAPON: + weaponNum = SHRINKER_WEAPON; + break; + default: + weaponNum = pPlayer->curr_weapon; + break; + } + } + P_SetWeaponGamevars(playerNum, pPlayer); weaponNum = VM_OnEventWithReturn(EVENT_SELECTWEAPON,pPlayer->i,playerNum, weaponNum);