Skip to content

Commit

Permalink
final fixes for second release
Browse files Browse the repository at this point in the history
  • Loading branch information
ps committed Jan 28, 2018
1 parent 6583fc4 commit 88c883d
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 18 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.


Expand All @@ -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

Expand Down
2 changes: 0 additions & 2 deletions code/server/sv_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -313,7 +312,6 @@ void SV_ClientEnterWorld( client_t *client, usercmd_t *cmd, SavedGameJustLoaded_
WAS_QUICKLOAD = false;
randomizeForcePowersDoOnce = false;
randomizeWeaponsDoOnce = false;

}

/*
Expand Down
4 changes: 2 additions & 2 deletions code/ui/globalShuffledTiers.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 2 additions & 4 deletions code/ui/ui_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down
8 changes: 3 additions & 5 deletions code/ui/ui_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}


Expand Down
4 changes: 2 additions & 2 deletions files/randomizerOptions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 88c883d

Please sign in to comment.