From 51a08fbaf34e86f9eb8ab69f4fc836ecf9c91b98 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 29 Aug 2020 21:27:58 +1000 Subject: [PATCH] - Duke: Implement `WeaponSel_Alt` for Duke and RR. --- source/games/duke/src/player_d.cpp | 13 ++++++++++++- source/games/duke/src/player_r.cpp | 31 +++++++++++++++++++++++++++++- wadsrc/static/engine/menudef.txt | 4 ++-- 3 files changed, 44 insertions(+), 4 deletions(-) diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index be6cd69a9..8d44d5b7b 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -1109,7 +1109,18 @@ void selectweapon_d(int snum, int weap) // playernum, weaponnum { if (weap == WeaponSel_Alt) { - // todo + switch (p->curr_weapon) + { + case SHRINKER_WEAPON: + j = PLUTOPAK ? GROW_WEAPON : p->curr_weapon; + break; + case GROW_WEAPON: + j = SHRINKER_WEAPON; + break; + default: + j = p->curr_weapon; + break; + } } else if (weap == WeaponSel_Next || weap == WeaponSel_Prev) { diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index f0543c108..ebe7d4748 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -957,7 +957,36 @@ void selectweapon_r(int snum, int weap) { if (weap == WeaponSel_Alt) { - // todo + switch (p->curr_weapon) + { + case THROWSAW_WEAPON: + j = BUZZSAW_WEAPON; + break; + case BUZZSAW_WEAPON: + j = THROWSAW_WEAPON; + break; + case POWDERKEG_WEAPON: + j = BOWLING_WEAPON; + break; + case BOWLING_WEAPON: + j = POWDERKEG_WEAPON; + break; + case KNEE_WEAPON: + j = isRRRA() ? SLINGBLADE_WEAPON : p->curr_weapon; + break; + case SLINGBLADE_WEAPON: + j = KNEE_WEAPON; + break; + case DYNAMITE_WEAPON: + j = isRRRA() ? CHICKEN_WEAPON : p->curr_weapon; + break; + case CHICKEN_WEAPON: + j = DYNAMITE_WEAPON; + break; + default: + j = p->curr_weapon; + break; + } } else if (weap == WeaponSel_Next || weap == WeaponSel_Prev) { diff --git a/wadsrc/static/engine/menudef.txt b/wadsrc/static/engine/menudef.txt index 14af5aa80..dbd584c15 100644 --- a/wadsrc/static/engine/menudef.txt +++ b/wadsrc/static/engine/menudef.txt @@ -481,9 +481,9 @@ OptionMenu "ActionControlsMenu"// protected { Control "$CNTRLMNU_ALTATTACK" , "+alt_fire" } - ifgame(ShadowWarrior) + ifgame(ShadowWarrior, Duke, Redneck) { - Control "$CNTRLMNU_ALTWEAPON" , "+alt_weapon" + Control "$CNTRLMNU_ALTWEAPON" , "weapalt" } StaticText ""