Skip to content

Commit

Permalink
Merge pull request #107 from Die4Ever/develop
Browse files Browse the repository at this point in the history
v1.5.3 fix for datacube name conflicts, jittered positions for turrets/cameras, fixed silent first line of dialog in intro, delete game's local DXRando.ini file before and after running tests, datacube logic improvements, hacking ATMs uses energy, fix -1 expiration FlagTriggers, default reroll skills every 5 missions, cheaper swimming/enviro/demolition skills, fixes for CC physics/gravity
  • Loading branch information
Die4Ever authored Mar 10, 2021
2 parents 3c5e5e8 + 3909bd8 commit a14dc35
Show file tree
Hide file tree
Showing 22 changed files with 620 additions and 236 deletions.
Binary file modified DeusEx.u
Binary file not shown.
1 change: 1 addition & 0 deletions DeusEx/Classes/BalanceHacking.uc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function Tick(float deltaTime)
if (bHacking)
{
p = DeusExPlayer(winTerm.compOwner.Owner);
if( p == None ) p = Player;// ATMs don't set the Owner
if( p != None ) {
p.Energy -= deltaTime * 3.0;
if( p.Energy <= 0 ) {
Expand Down
41 changes: 2 additions & 39 deletions DeusEx/Classes/Barrel1.uc
Original file line number Diff line number Diff line change
Expand Up @@ -2,58 +2,21 @@ class Barrel1 injects Barrel1;

event TravelPreAccept()
{
local string old_skin;
Super.TravelPreAccept();
if( HandleTravel() )
BeginPlay();
}

function bool HandleTravel()
{
local int old_skin;
local DeusExPlayer player;

foreach AllActors(class'DeusExPlayer', player) { break; }
if( player == None || player.CarriedDecoration != Self ) {
return false;
}

old_skin = int(Level.game.ParseOption( "?" $ Level.GetLocalURL(), "barrel1_skin" ));
switch(old_skin) {
case 0:
SkinColor = SC_Biohazard;
break;
case 1:
SkinColor = SC_Blue;
break;
case 2:
SkinColor = SC_Brown;
break;
case 3:
SkinColor = SC_Rusty;
break;
case 4:
SkinColor = SC_Explosive;
break;
case 5:
SkinColor = SC_FlammableLiquid;
break;
case 6:
SkinColor = SC_FlammableSolid;
break;
case 7:
SkinColor = SC_Poison;
break;
case 8:
SkinColor = SC_RadioActive;
break;
case 9:
SkinColor = SC_Wood;
break;
case 10:
SkinColor = SC_Yellow;
break;
}
SetPropertyText("SkinColor", Level.game.ParseOption( "?" $ Level.GetLocalURL(), "barrel1_skin" ));
player.UpdateURL("barrel1_skin", "", false);
return true;
}
Expand All @@ -63,7 +26,7 @@ function PreTravel()
local DeusExPlayer player;
foreach AllActors(class'DeusExPlayer', player) { break; }
if( player != None && player.CarriedDecoration == Self ) {
player.UpdateURL("barrel1_skin", string(SkinColor), false);
player.UpdateURL("barrel1_skin", GetPropertyText("SkinColor"), false);
}
}

Expand Down
22 changes: 22 additions & 0 deletions DeusEx/Classes/DXRActorsBase.uc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ struct FMinMax {
var float max;
};

struct safe_rule {
var string map;
var name item_name;
var vector min_pos;
var vector max_pos;
var bool allow;
};

function CheckConfig()
{
local class<Actor> temp_skipactor_types[6];
Expand Down Expand Up @@ -639,6 +647,20 @@ function Vector GetCenter(Actor test)
return (MinVect+MaxVect)/2;
}
function int GetSafeRule(safe_rule rules[32], name item_name, vector newpos)
{
local int i;
for(i=0; i<ArrayCount(rules); i++) {
if( item_name != rules[i].item_name ) continue;
if( dxr.localURL != rules[i].map ) continue;
if( AnyGreater( rules[i].min_pos, newpos ) ) continue;
if( AnyGreater( newpos, rules[i].max_pos ) ) continue;
return i;
}
return -1;
}
function bool _PositionIsSafeOctant(Vector oldloc, Vector TestPoint, Vector newloc)
{
local Vector distsold, diststest, distsoldtest;
Expand Down
10 changes: 5 additions & 5 deletions DeusEx/Classes/DXREnemies.uc
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ function RandomizeSP(ScriptedPawn p, int percent)
p.SetupWeapon(false);
}
function GiveRandomWeapon(Pawn p)
function GiveRandomWeapon(Pawn p, optional bool allow_dupes)
{
local class<DeusExWeapon> wclass;
local Ammo a;
Expand All @@ -396,7 +396,7 @@ function GiveRandomWeapon(Pawn p)
}
chance_remaining(r);
if( HasItem(p, wclass) )
if( (!allow_dupes) && HasItem(p, wclass) )
return;
if( wclass == None ) {
Expand All @@ -406,20 +406,20 @@ function GiveRandomWeapon(Pawn p)
GiveItem( p, wclass, true );
}
function GiveRandomMeleeWeapon(Pawn p)
function GiveRandomMeleeWeapon(Pawn p, optional bool allow_dupes)
{
local class<Weapon> wclass;
local int r, i;
if(HasMeleeWeapon(p))
if( (!allow_dupes) && HasMeleeWeapon(p))
return;
r = initchance();
for(i=0; i < ArrayCount(_randommelees); i++ ) {
if( _randommelees[i].type == None ) continue;
if( chance( _randommelees[i].chance, r ) ) wclass = _randommelees[i].type;
if( HasItem(p, _randommelees[i].type) ) {
if( (!allow_dupes) && HasItem(p, _randommelees[i].type) ) {
chance_remaining(r);
return;
}
Expand Down
17 changes: 16 additions & 1 deletion DeusEx/Classes/DXRFixup.uc
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ function FirstEntry()

IncreaseBrightness(dxr.flags.brightness);
OverwriteDecorations();
FixFlagTriggers();

switch(dxr.dxInfo.missionNumber) {
case 2:
Expand Down Expand Up @@ -224,6 +225,18 @@ function OverwriteDecorations()
}
}

function FixFlagTriggers()
{//the History Un-Eraser Button
local FlagTrigger f;

foreach AllActors(class'FlagTrigger', f) {
if( f.bSetFlag && f.flagExpiration == -1 ) {
f.flagExpiration = 999;
log(f @ f.FlagName @ f.flagValue $" changed expiration from -1 to 999");
}
}
}

function NYC_02_FirstEntry()
{
local DeusExMover d;
Expand Down Expand Up @@ -261,7 +274,9 @@ function Airfield_FirstEntry()
foreach AllActors(class'Actor', a) {
if( a.name == 'NanoKey0' ) {
a.Destroy();
break;
}
if( a.name == 'BookClosed2' ) {
InformationDevices(a).bAddToVault = true;
}
}
break;
Expand Down
6 changes: 3 additions & 3 deletions DeusEx/Classes/DXRFlags.uc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var int undefeatabledoors, alldoors, keyonlydoors, highlightabledoors, doormutua
function PreTravel()
{
Super.PreTravel();
if( dxr != None && dxr.localURL == "INTRO" && f.GetInt('Rando_version') == 0 ) {
if( dxr != None && f.GetInt('Rando_version') == 0 ) {
info("PreTravel "$dxr.localURL$" SaveFlags");
SaveFlags();
}
Expand Down Expand Up @@ -324,12 +324,12 @@ static function string VersionToString(int major, int minor, int patch)
static function int VersionNumber()
{
return VersionToInt(1, 5, 2);
return VersionToInt(1, 5, 3);
}
static function string VersionString()
{
return VersionToString(1, 5, 2) $ "";
return VersionToString(1, 5, 3) $ "";
}
function MaxRando()
Expand Down
Loading

0 comments on commit a14dc35

Please sign in to comment.