Skip to content

Commit

Permalink
adjustable medkit spawn %
Browse files Browse the repository at this point in the history
  • Loading branch information
Die4Ever committed Jul 6, 2020
1 parent dd30688 commit 8c2f3d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
3 changes: 3 additions & 0 deletions DeusEx/Classes/MenuSetupRando.uc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ var MenuUIEditWindow editAmmo;
var MenuUIEditWindow editMultitools;
var MenuUIEditWindow editLockpicks;
var MenuUIEditWindow editBioCells;
var MenuUIEditWindow editMedkits;
var MenuUIEditWindow editSpeedLevel;

event InitWindow()
Expand Down Expand Up @@ -80,6 +81,7 @@ function CreateControls()
editMultitools = CreateSlider(row++, "Multitools Drops %", 70);
editLockpicks = CreateSlider(row++, "Lockpicks Drops %", 70);
editBioCells = CreateSlider(row++, "Bioelectric Cells Drops %", 80);
editMedkits = CreateSlider(row++, "Medkit Drops %", 80);
editSpeedLevel = CreateSlider(row++, "Speed Aug Level", 1, 0, 3);
}

Expand Down Expand Up @@ -278,6 +280,7 @@ function ProcessAction(String actionKey)
ms.multitools = GetSliderValue(editMultitools);
ms.lockpicks = GetSliderValue(editLockpicks);
ms.biocells = GetSliderValue(editBioCells);
ms.medkits = GetSliderValue(editMedkits);
ms.speedlevel = GetSliderValue(editSpeedLevel);

if( keys == "Off" ) ms.keysrando = 0;
Expand Down
10 changes: 8 additions & 2 deletions DeusEx/Classes/MissionScript.uc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ var DeusExNote lastCheckedNote;
//rando flags
var int seed;
var int flagsversion;//if you load an old game with a newer version of the randomizer, we'll need to set defaults for new flags
var int brightness, minskill, maxskill, ammo, multitools, lockpicks, biocells, speedlevel;
var int brightness, minskill, maxskill, ammo, multitools, lockpicks, biocells, medkits, speedlevel;
var int keysrando;//0=off, 1=dumb, 2=smart, 3=copies
var int doorspickable, doorsdestructible, deviceshackable, passwordsrandomized, gibsdropkeys;//could be bools, but int is more flexible, especially so I don't have to change the flag type

Expand Down Expand Up @@ -253,6 +253,7 @@ function LoadFlags()
multitools = flags.GetInt('Rando_multitools');
lockpicks = flags.GetInt('Rando_lockpicks');
biocells = flags.GetInt('Rando_biocells');
medkits = flags.GetInt('Rando_medkits');
speedlevel = flags.GetInt('Rando_speedlevel');
keysrando = flags.GetInt('Rando_keys');
doorspickable = flags.GetInt('Rando_doorspickable');
Expand All @@ -277,13 +278,16 @@ function LoadFlags()
deviceshackable = 100;
passwordsrandomized = 100;
gibsdropkeys = 1;
}
if(flagsversion < 2) {
medkits = 80;
SaveFlags();
}
}

function SaveFlags()
{
flagsversion = 1;
flagsversion = 2;
flags.SetInt('Rando_seed', seed,, 999);

flags.SetInt('Rando_version', flagsversion,, 999);
Expand All @@ -294,6 +298,7 @@ function SaveFlags()
flags.SetInt('Rando_multitools', multitools,, 999);
flags.SetInt('Rando_lockpicks', lockpicks,, 999);
flags.SetInt('Rando_biocells', biocells,, 999);
flags.SetInt('Rando_medkits', medkits,, 999);
flags.SetInt('Rando_speedlevel', speedlevel,, 999);
flags.SetInt('Rando_keys', keysrando,, 999);
flags.SetInt('Rando_doorspickable', doorspickable,, 999);
Expand Down Expand Up @@ -341,6 +346,7 @@ function Rando()
ReduceSpawns('Multitool', multitools);
ReduceSpawns('Lockpick', lockpicks);
ReduceSpawns('BioelectricCell', biocells);
ReduceSpawns('MedKit', medkits);

RandoPasswords(passwordsrandomized);

Expand Down

0 comments on commit 8c2f3d5

Please sign in to comment.