diff --git a/src/k_menu.h b/src/k_menu.h index 116caa7936cb91e1206352736adf7b37c5d70ecf..6baf35384e95cc9f9520851e2bb15b8523a638fb 100644 --- a/src/k_menu.h +++ b/src/k_menu.h @@ -848,8 +848,10 @@ extern tic_t setup_animcounter; // for charsel pages. extern UINT8 setup_page; extern UINT8 setup_maxpage; +extern UINT8 rsel_randomsound; #define CSROTATETICS 6 +#define RSELDELAYTICS 5 // The selection spawns 3 explosions in 4 directions, and there's 4 players -- 3 * 4 * 4 = 48 #define CSEXPLOSIONS 48 @@ -876,6 +878,7 @@ boolean M_CharacterSelectForceInAction(void); boolean M_CharacterSelectHandler(INT32 choice); void M_CharacterSelectTick(void); boolean M_CharacterSelectQuit(void); +sfxenum_t M_RandomSelectSound(INT32 choice); void M_SetupPlayMenu(INT32 choice); void M_SetupGametypeMenu(INT32 choice); diff --git a/src/menus/play-char-select.c b/src/menus/play-char-select.c index ed8606ff02cd868a6272d683a5f329e7601a794f..bc3e0841750373707f3c9c4c96d1388149220ce7 100644 --- a/src/menus/play-char-select.c +++ b/src/menus/play-char-select.c @@ -20,6 +20,7 @@ #include "../m_cond.h" // Condition Sets #include "../k_color.h" #include "../z_zone.h" +#include "../m_random.h" //#define CHARSELECT_DEVICEDEBUG @@ -74,6 +75,7 @@ tic_t setup_animcounter = 0; UINT8 setup_page = 0; UINT8 setup_maxpage = 0; // For charsel page to identify alts easier... +UINT8 rsel_randomsound = 1; //For M_RandomSelectSound static void M_PushMenuColor(setup_player_colors_t *colors, UINT16 newColor) { @@ -846,7 +848,7 @@ static boolean M_HandleCharacterGrid(setup_player_t *p, UINT8 num) if (p->clonenum >= numclones) p->clonenum = 0; - + if (M_MenuConfirmPressed(num) /*|| M_MenuButtonPressed(num, MBT_START)*/) { if (forceskin) @@ -902,6 +904,15 @@ static boolean M_HandleCharacterGrid(setup_player_t *p, UINT8 num) } M_SetMenuDelay(num); } + else if (M_MenuButtonHeld(num, MBT_Z)) + { + p->gridx = M_RandomRange(0, 8); + p->gridy = M_RandomRange(0, 8); + p->delay = RSELDELAYTICS; + S_StartSound(NULL, M_RandomSelectSound(0)); + M_SetMenuDelay(num); + } + if (num == 0 && setup_numplayers == 1 && setup_maxpage && !forceskin) // ONLY one player. { @@ -965,10 +976,20 @@ static void M_HandleCharRotate(setup_player_t *p, UINT8 num) S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s M_SetMenuDelay(num); } + else if (M_MenuButtonHeld(num, MBT_Z)) + { + p->clonenum = M_RandomRange(0, (numclones-1)); + p->rotate = -CSROTATETICS; + p->delay = RSELDELAYTICS; + S_StartSound(NULL, M_RandomSelectSound(0)); + M_SetMenuDelay(num); + } } static void M_HandleColorRotate(setup_player_t *p, UINT8 num) -{ +{ + UINT8 randomcol = 0; + if (cv_splitdevice.value) num = 0; @@ -1010,6 +1031,15 @@ static void M_HandleColorRotate(setup_player_t *p, UINT8 num) M_SetMenuDelay(num); } } + else if (M_MenuButtonHeld(num, MBT_Z)) + { + randomcol = M_RandomRange(-512, 512); + p->color = M_GetColorAfter(&p->colors, p->color, randomcol); + p->rotate = CSROTATETICS; + p->delay = RSELDELAYTICS; + M_SetMenuDelay(num); //CSROTATETICS + S_StartSound(NULL, M_RandomSelectSound(0)); //sfx_s3kc3s + } } static void M_AnimateFollower(setup_player_t *p) @@ -1122,6 +1152,13 @@ static void M_HandleFollowerCategoryRotate(setup_player_t *p, UINT8 num) S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s M_SetMenuDelay(num); } + else if (M_MenuButtonHeld(num, MBT_Z)) + { + p->followercategory = M_RandomRange(0, setup_numfollowercategories-1); + p->rotate = CSROTATETICS; + p->delay = RSELDELAYTICS; + S_StartSound(NULL, M_RandomSelectSound(0)); + } } static void M_HandleFollowerRotate(setup_player_t *p, UINT8 num) @@ -1200,10 +1237,31 @@ static void M_HandleFollowerRotate(setup_player_t *p, UINT8 num) S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s M_SetMenuDelay(num); } + else if (M_MenuButtonHeld(num, MBT_Z)) + { + do + { + p->followern = M_RandomRange(0, numfollowers-1); + if (p->followern < 0) + p->followern = numfollowers-1; + if (p->followern == startfollowern) + break; + } + while (followers[p->followern].category != setup_followercategories[p->followercategory][1] || !K_FollowerUsable(p->followern)); + + M_GetFollowerState(p); + + p->rotate = CSROTATETICS; + p->delay = RSELDELAYTICS; + S_StartSound(NULL, M_RandomSelectSound(0)); + } } static void M_HandleFollowerColorRotate(setup_player_t *p, UINT8 num) { + UINT8 randomcol = 0; + UINT8 randomsound = 1; + if (cv_splitdevice.value) num = 0; @@ -1247,6 +1305,62 @@ static void M_HandleFollowerColorRotate(setup_player_t *p, UINT8 num) S_StartSound(NULL, sfx_s3k7b); //sfx_s3kc3s M_SetMenuDelay(num); } + else if (M_MenuButtonHeld(num, MBT_Z)) + { + randomcol = M_RandomRange(-512, 512); + p->followercolor = M_GetColorAfter(&p->colors, p->followercolor, randomcol); + p->rotate = -CSROTATETICS; + p->delay = RSELDELAYTICS; + M_SetMenuDelay(num); //CSROTATETICS + randomsound++; + S_StartSound(NULL, M_RandomSelectSound(0)); //sfx_s3kc3s + } +} + +sfxenum_t M_RandomSelectSound (INT32 choice) +{ + (void)choice; + sfxenum_t chosensound = sfx_itrol1; + switch (rsel_randomsound) + { + case 0: + case 1: + rsel_randomsound++; + chosensound = sfx_itrol1; + break; + case 2: + rsel_randomsound++; + chosensound = sfx_itrol2; + break; + case 3: + rsel_randomsound++; + chosensound = sfx_itrol3; + break; + case 4: + rsel_randomsound++; + chosensound = sfx_itrol4; + break; + case 5: + rsel_randomsound++; + chosensound = sfx_itrol5; + break; + case 6: + rsel_randomsound++; + chosensound = sfx_itrol6; + break; + case 7: + rsel_randomsound++; + chosensound = sfx_itrol7; + break; + case 8: + rsel_randomsound = 1; + chosensound = sfx_itrol8; + break; + default: + rsel_randomsound = 2; + chosensound = sfx_itrol1; + } + return chosensound; } boolean M_CharacterSelectHandler(INT32 choice)