From 88c883dc9b0028ceade73e045dc76dd47d409c29 Mon Sep 17 00:00:00 2001 From: ps Date: Sun, 28 Jan 2018 17:46:14 +0100 Subject: [PATCH] final fixes for second release --- README.md | 8 +++++--- code/server/sv_client.cpp | 2 -- code/ui/globalShuffledTiers.h | 4 ++-- code/ui/ui_main.cpp | 6 ++---- code/ui/ui_shared.cpp | 8 +++----- files/randomizerOptions.json | 4 ++-- 6 files changed, 14 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 492f496223..886f25c37c 100644 --- a/README.md +++ b/README.md @@ -32,11 +32,13 @@ After that, add `NO_OVERWRITE` at the start of the line: NO_OVERWRITE t1_surprise t2_trip t2_dpred t1_danger t1_sour t3_hevil t2_wedge t3_stamp t3_byss t2_rogue t2_rancor t3_rift t1_fatal t1_rail t3_bounty ``` +Please note that for yavin1b, the force powers currently won't get randomized. Starting from yavin2, randomizations kicks in. + For additional configuration, check out the following sections and the supplied configuration file `randomizerOptions.json`. # Force randomization In the file `randomizerOptions.json` you can choose the following force modes with `forceRandomizationMode`: -- `0`: Progression mode: As you complete missions, you gain additional force points. You can spend exactly one force point for each mission - the rest will be randomized, including the core force powers like force jump. +- `0`: Progression mode: As you complete missions, you gain additional force points. You can spend exactly one force point for each mission - the rest will be randomized, including the core force powers like force jump. As you progress, the maximum points that can be spent randomly increase. However, RNG decides whether all points actually will be used. - `1`: Chaos mode: Every force power will be randomized, you can gain from zero to the maximum amount of force points. One user selectable force power can be chosen freely. @@ -47,8 +49,8 @@ Additionally, the required force *levels* can be selected for each map and force This works comparable to the force randomization. The values in `randomizerOptions.json` range from 0 (weapon not required) to 1 (weapon required). The amount of ammo will always be random for weapons you didn't choose via the selection menu. In the file `randomizerOptions.json` you can choose the weapon modes with `weaponRandomizationMode`: -- `0`: You can choose two weapons from a random pool -- `1`: Chaos mode: Every weapon will be randomized +- `0`: You can choose two shootable weapons and one throwable weapon from a random pool +- `1`: Chaos mode: Like mode `0` but on top of that, random weapons will be added # Map loading diff --git a/code/server/sv_client.cpp b/code/server/sv_client.cpp index 8b1491af58..4c33a76236 100644 --- a/code/server/sv_client.cpp +++ b/code/server/sv_client.cpp @@ -267,7 +267,6 @@ void SV_ClientEnterWorld( client_t *client, usercmd_t *cmd, SavedGameJustLoaded_ // Randomizer hack: New map loaded, player about to be able to control character --> restore force from loading screen // only if we don't come from a load --> quickloads don't alter the force powers - client_t* _cl = &svs.clients[0]; playerState_t* pState = nullptr; @@ -313,7 +312,6 @@ void SV_ClientEnterWorld( client_t *client, usercmd_t *cmd, SavedGameJustLoaded_ WAS_QUICKLOAD = false; randomizeForcePowersDoOnce = false; randomizeWeaponsDoOnce = false; - } /* diff --git a/code/ui/globalShuffledTiers.h b/code/ui/globalShuffledTiers.h index 7db0c3879e..411aa4efff 100644 --- a/code/ui/globalShuffledTiers.h +++ b/code/ui/globalShuffledTiers.h @@ -604,7 +604,7 @@ static void randomizeForcePowers(playerState_t* pState, std::string mapname="") // finished if(corePointsToSpend <= 0) { break; } - int randomLevel = Q_min(GET_RANDOM(0, 3), corePointsToSpend); + int randomLevel = Q_min(GET_RANDOM(1, 3), corePointsToSpend); // don't make it too easy ;) if (fp == FP_LEVITATION) { @@ -645,7 +645,7 @@ static void randomizeForcePowers(playerState_t* pState, std::string mapname="") // finished if(playerPointsToSpend <= 0) { break; } - int randomLevel = Q_min(GET_RANDOM(0, 3), playerPointsToSpend); + int randomLevel = Q_min(GET_RANDOM(1, 3), playerPointsToSpend); playerPointsToSpend -= randomLevel; pState->forcePowerLevel[fp] = randomLevel; diff --git a/code/ui/ui_main.cpp b/code/ui/ui_main.cpp index 95a133d566..034a8dd640 100644 --- a/code/ui/ui_main.cpp +++ b/code/ui/ui_main.cpp @@ -2928,7 +2928,7 @@ void UI_ParseMenu(const char *menuFile) //Randomizer hack: Use our menu and apply force powers - // if we injected our own randomized menu or not + // if we injected our own randomized menu or not for maximum memory leeeks bool injected = false; // to display message on main menu @@ -2952,9 +2952,7 @@ void UI_ParseMenu(const char *menuFile) } if (strcmp(menuFile, "ui/ingameWpnSelect.menu") == 0 && WEAPON_TMPLT.length() > 0) { - if (SETTINGS_JSON.at("weaponRandomizationMode") == 0) { - injected = true; - } + injected = true; } holdBuffer = buffer; diff --git a/code/ui/ui_shared.cpp b/code/ui/ui_shared.cpp index 5b072ea9bc..85064e1f81 100644 --- a/code/ui/ui_shared.cpp +++ b/code/ui/ui_shared.cpp @@ -5914,12 +5914,10 @@ int PC_StartParseSession(const char *fileName,char **buffer) } - // maybe randomize the menu - based on the settings file + // randomize the weapons menu if(strcmp(fileName, "ui/ingameWpnSelect.menu") == 0) { - if(SETTINGS_JSON.at("weaponRandomizationMode") == 0) { - generateRandomWeaponMenu(); - *buffer = &CURRENT_WEAPON_MENU[0]; - } + generateRandomWeaponMenu(); + *buffer = &CURRENT_WEAPON_MENU[0]; } diff --git a/files/randomizerOptions.json b/files/randomizerOptions.json index dbe39fb6e8..a1e02b0772 100644 --- a/files/randomizerOptions.json +++ b/files/randomizerOptions.json @@ -598,8 +598,8 @@ "FP_SABERTHROW": 0, "FP_SABER_DEFENSE": 0, "FP_SABER_OFFENSE": 0, - "FP_SENSE": 0, - "FP_SPEED": 1, + "FP_SENSE": 1, + "FP_SPEED": 0, "FP_HEAL": 0, "FP_MINDTRICK": 0, "FP_GRIP": 0,