Skip to content

Commit

Permalink
Merge pull request #84 from Die4Ever/develop
Browse files Browse the repository at this point in the history
v1.4.8 improvements to rearranged levels / randomize stats for augmentations, weapons, and skills / randomize strength and lockpick strength for doors / randomize hack strength for keypads
  • Loading branch information
Die4Ever authored Jan 16, 2021
2 parents 3e2cdb6 + eb0c2aa commit 44dec47
Show file tree
Hide file tree
Showing 20 changed files with 819 additions and 55 deletions.
Binary file modified DeusEx.u
Binary file not shown.
12 changes: 12 additions & 0 deletions DeusEx/Classes/Augmentation.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class DXRAugmentation merges Augmentation;

function PostBeginPlay()
{
local DXRAugmentations a;
Super.PostBeginPlay();

foreach AllActors(class'DXRAugmentations', a) {
a.RandoAug(self);
break;
}
}
36 changes: 36 additions & 0 deletions DeusEx/Classes/DXRAugmentations.uc
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
class DXRAugmentations extends DXRBase;

var config float min_aug_str;
var config float max_aug_str;

function CheckConfig()
{
if( config_version < class'DXRFlags'.static.VersionToInt(1,4,8) ) {
min_aug_str = 0.5;
max_aug_str = 1.5;
}
Super.CheckConfig();
}

function FirstEntry()
{
local Augmentation anAug;
Expand All @@ -17,6 +29,16 @@ function FirstEntry()
RandomizeAugCannisters();
}

function AnyEntry()
{
local Augmentation a;
Super.AnyEntry();

foreach AllActors(class'Augmentation', a) {
RandoAug(a);
}
}

function RandomizeAugCannisters()
{
local AugmentationCannister a;
Expand All @@ -40,6 +62,10 @@ function static RandomizeAugCannister(DXRando dxr, AugmentationCannister a)
{
a.AddAugs[1] = PickRandomAug(dxr);
}

if( a.AddAugs[0] == 'AugSpeed' || a.AddAugs[1] == 'AugSpeed' ) {
dxr.Player.ClientMessage("Speed Enhancement is in this area.");
}
}

function static Name PickRandomAug(DXRando dxr)
Expand All @@ -57,3 +83,13 @@ function static Name PickRandomAug(DXRando dxr)
log("Picked Aug "$ slot $"/"$numAugs$" " $ dxr.Player.AugmentationSystem.augClasses[slot].Name, 'DXRAugmentations');
return dxr.Player.AugmentationSystem.augClasses[slot].Name;
}
function RandoAug(Augmentation a)
{
local string s;
if( AugSpeed(a) != None || AugLight(a) != None ) return;
dxr.SetSeed( dxr.Crc(dxr.seed $ "RandoAug " $ a.class.name ) );
s = RandoLevelValues(a.LevelValues, a.default.LevelValues, min_aug_str, max_aug_str);
if( InStr(a.Description, s) == -1 )
a.Description = a.Description $ "|n|n" $ s;
}
65 changes: 65 additions & 0 deletions DeusEx/Classes/DXRBacktracking.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
class DXRBacktracking extends DXRActorsBase;
// backtracking specific fixes that might be too extreme for the more generic DXRFixup? or move the stuff from DXRFixup into here?

function FirstEntry()
{
local Teleporter t;
local DynamicTeleporter dt;
local BlockPlayer bp;
Super.FirstEntry();

switch(dxr.localURL) {
case "10_PARIS_METRO":
foreach AllActors(class'BlockPlayer', bp) {
if( bp.Name == 'BlockPlayer0' ) {
bp.bBlockPlayers=false;
}
}
dt = Spawn(class'DynamicTeleporter',,'sewers_backtrack',vect(1599.971558, -4694.342773, 13.399302));
dt.URL = "10_PARIS_CATACOMBS_TUNNELS#?toname=AmbientSound10";
dt.Radius = 160;
AddSwitch(vect(1602.826904, -4318.841309, -250.365067), rot(0, 16384, 0), 'sewers_backtrack');
break;
case "15_AREA51_ENTRANCE":
dt = Spawn(class'DynamicTeleporter',,,vect(4384.407715, -2483.292236, -41.900017));
dt.URL = "15_area51_bunker#?toname=Light188";
dt.Radius = 160;
break;
case "15_AREA51_FINAL":
dt = Spawn(class'DynamicTeleporter',,,vect(-5714.406250, -1977.827881, -1358.711304));
dt.URL = "15_area51_entrance#?toname=Light73";
dt.Radius = 160;
break;
}
}

function AnyEntry()
{
local string tonamestring;
local name toname;
local Actor a;
Super.AnyEntry();

//need to make sure this doesn't happen when loading a save
if (! dxr.flags.f.GetBool('PlayerTraveling')) return;

tonamestring = Level.game.ParseOption( "?" $ Level.GetLocalURL(), "toname" );
if( InStr(tonamestring, "#") >=0 ) {
tonamestring = Left(tonamestring,InStr(tonamestring,"#"));
}
if( tonamestring != "" ) {
toname = dxr.Player.rootWindow.StringToName(tonamestring);
foreach AllActors(class'Actor', a) {
if( a.Name == toname ) {
dxr.Player.SetLocation(a.Location);
dxr.Player.UpdateURL("toname", "", false);
break;
}
}
}
}

function DeusExDecoration AddSwitch(vector loc, rotator rotate, name Event)
{
return class'DXRFixup'.static._AddSwitch(Self, loc, rotate, Event);
}
26 changes: 26 additions & 0 deletions DeusEx/Classes/DXRBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,32 @@ function float rngfn()
return rngf() * 2.0 - 1.0;
}

function float rngrange(float val, float min, float max)
{
local float mult;
mult = max - min;
return val * (rngf() * mult + min);
}

function string RandoLevelValues(out float LevelValues[4], float DefaultLevelValues[4], float min, float max)
{
local int i;
local float min_val;
local string s;

s = "(Values: ";
for(i=0; i<ArrayCount(LevelValues); i++) {
LevelValues[i] = rngrange(DefaultLevelValues[i], min, max);
if( i>0 && DefaultLevelValues[i-1] < DefaultLevelValues[i] && LevelValues[i] < min_val ) LevelValues[i] = min_val;
else if( i>0 && DefaultLevelValues[i-1] > DefaultLevelValues[i] && LevelValues[i] > min_val ) LevelValues[i] = min_val;
min_val = LevelValues[i];
if( i>0 ) s = s $ ", ";
s = s $ int(LevelValues[i]/DefaultLevelValues[i]*100.0) $ "%";
}
s = s $ ")";
return s;
}
function static int staticrng(DXRando dxr, int max)
{
return dxr.rng(max);
Expand Down
40 changes: 28 additions & 12 deletions DeusEx/Classes/DXREntranceRando.uc
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,10 @@ function CheckConfig()
}
if( config_version < class'DXRFlags'.static.VersionToInt(1,4,5) ) {
min_connections_selfconnect = 999;
dead_ends[0] = "03_NYC_AirfieldHeliBase#FromOcean";
dead_ends[1] = "06_HONGKONG_WANCHAI_GARAGE#Teleporter";
//dead_ends[2] = "12_VANDENBERG_CMD#storage";//it's actually backwards from this...
i = 0;
//dead_ends[i++] = "03_NYC_AirfieldHeliBase#FromOcean";
dead_ends[i++] = "06_HONGKONG_WANCHAI_GARAGE#Teleporter";
//dead_ends[i++] = "12_VANDENBERG_CMD#storage";//it's actually backwards from this...
}
for(i=0; i < ArrayCount(BannedConnections); i++) {
BannedConnections[i].map_a = Caps(BannedConnections[i].map_a);
Expand Down Expand Up @@ -465,7 +466,8 @@ function _GenerateConnections(int missionNum)
}
}
if( i >= maxAttempts ) {
l("failed to find valid connection");
l("failed to find valid connection for " $ xfers[nextAvailIdx].mapname $ "#" $ xfers[nextAvailIdx].inTag $ " / #" $ xfers[nextAvailIdx].outTag );
return;
}
xfers[destIdx].used = True;
xfersUsed++;
Expand Down Expand Up @@ -607,12 +609,12 @@ function RandoMission10()
{
AddFixedConn("10_PARIS_CATACOMBS","x", "10_PARIS_CATACOMBS","x");
AddDoubleXfer("10_PARIS_CATACOMBS","spiralstair","10_Paris_Catacombs_Tunnels","spiralstair");//same tag on both sides?
AddFixedConn("10_PARIS_CATACOMBS_TUNNELS","","10_Paris_Metro","sewer");//one way
AddFixedConn("10_PARIS_CATACOMBS_TUNNELS","?toname=AmbientSound10","10_Paris_Metro","sewer");//one way, I could maybe use separate teleporters for each side of the sewers to make more options?
AddFixedConn("10_Paris_Metro","","10_PARIS_CHATEAU","x");//one way
AddDoubleXfer("10_PARIS_CHATEAU","","11_Paris_Cathedral","cathedralstart");//one way
//AddDoubleXfer("10_PARIS_CHATEAU","","11_Paris_Cathedral","cathedralstart");//one way
AddDoubleXfer("10_PARIS_CLUB","Paris_Club1","10_Paris_Metro","Paris_Metro1");
AddDoubleXfer("10_PARIS_CLUB","Paris_Club2","10_Paris_Metro","Paris_Metro2");
AddDoubleXfer("11_PARIS_CATHEDRAL","Paris_Underground","11_Paris_Underground","Paris_Underground");
//AddDoubleXfer("11_PARIS_CATHEDRAL","Paris_Underground","11_Paris_Underground","Paris_Underground");
//AddDoubleXfer("11_PARIS_EVERETT","","12_Vandenberg_cmd");
GenerateConnections(10);
Expand All @@ -629,10 +631,24 @@ function RandoMission11()
function RandoMission12()
{
local DeusExMover d;
AddFixedConn("12_VANDENBERG_CMD","x","12_VANDENBERG_CMD", "x");
AddDoubleXfer("12_VANDENBERG_CMD","commstat","12_vandenberg_tunnels","start");
AddDoubleXfer("12_VANDENBERG_CMD","storage","12_vandenberg_tunnels","end");
AddDoubleXfer("12_VANDENBERG_CMD","hall","12_vandenberg_computer","computer");//this might be dangerous because of the locked key-only door?
AddDoubleXfer("12_VANDENBERG_CMD","hall","12_vandenberg_computer","computer");
if( dxr.localURL == "12_VANDENBERG_CMD" ) {
foreach AllActors(class'DeusExMover', d) {
switch(d.Tag) {
case 'door_controlroom':
case 'security_tunnels':
class'DXRKeys'.static.MakePickable(d);
class'DXRKeys'.static.MakeDestructible(d);
break;
}
}
}
//AddDoubleXfer("12_VANDENBERG_CMD","","12_Vandenberg_gas","");
//AddDoubleXfer("12_VANDENBERG_GAS","gas_start","","");
//AddDoubleXfer("12_VANDENBERG_GAS","","14_Vandenberg_sub","");
Expand Down Expand Up @@ -664,8 +680,8 @@ function RandoMission15()
{
AddFixedConn("15_AREA51_BUNKER","x","15_AREA51_BUNKER", "x");
//AddDoubleXfer("15_AREA51_BUNKER","commstat","","");
AddDoubleXfer("15_AREA51_BUNKER","","15_Area51_entrance","start");
AddDoubleXfer("15_Area51_entrance","","15_AREA51_FINAL","start");
AddDoubleXfer("15_AREA51_BUNKER","?toname=Light188","15_Area51_entrance","start");
AddDoubleXfer("15_Area51_entrance","?toname=Light73","15_AREA51_FINAL","start");
AddDoubleXfer("15_AREA51_FINAL","final_end","15_Area51_page","page_start");
//AddDoubleXfer("15_AREA51_FINAL","Start","");
Expand All @@ -677,7 +693,7 @@ function EntranceRando(int missionNum)
numConns = 0;
numXfers = 0;
numFixedConns = 0;
if( missionNum == 11 ) missionNum = 10;//combine 10 and 11
//if( missionNum == 11 ) missionNum = 10;//combine paris 10 and 11
//if( missionNum == 14 ) missionNum = 12;//combine vandenberg and oceanlab?
dxr.SetSeed( dxr.seed + dxr.Crc("entrancerando") + missionNum );
Expand Down Expand Up @@ -705,7 +721,7 @@ function EntranceRando(int missionNum)
RandoMission10();
break;
case 11:
RandoMission11();
//RandoMission11();
break;
case 12:
RandoMission12();
Expand Down
Loading

0 comments on commit 44dec47

Please sign in to comment.