Skip to content

Commit

Permalink
Merge pull request #159 from Die4Ever/develop v1.5.8
Browse files Browse the repository at this point in the history
v1.5.8 fix doors and elevators getting stuck on items, entrance rando improvements for Hong Kong, mission 8 Stanton Dowd and Jock fixes, better Nanokey from corpse handling, DXRLoadouts destroying items, fix for Nanokeys in vanilla locations
  • Loading branch information
Die4Ever authored May 14, 2021
2 parents 0f14be6 + e705456 commit 844a77a
Show file tree
Hide file tree
Showing 24 changed files with 416 additions and 75 deletions.
12 changes: 12 additions & 0 deletions DXRBalance/DeusEx/Classes/DeusExMover.uc
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,15 @@ function float CalcDamage(float Damage, name damageType)
}
return Damage * 0.002;
}

function bool EncroachingOn( actor Other )
{
if( Inventory(Other) != None ) {
return false;
}
/*if( EncroachDamage < 1 && Pawn(Other) == None ) {
Other.TakeDamage( 1000, Instigator, Other.Location, vect(0,0,0), 'Crushed' );
Other.TakeDamage( 1000, Instigator, Other.Location, vect(0,0,0), 'Exploded' );
}*/
return Super.EncroachingOn(Other);
}
35 changes: 28 additions & 7 deletions DXRFixes/DeusEx/Classes/Carcass.uc
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,48 @@ function InitFor(Actor Other)
Super.InitFor(Other);
}

function DropKeys()
function bool _DropItem(Inventory item, Name classname)
{
if( Ammo(item) != None )
return false;
else if( item.IsA(classname) && item.bDisplayableInv )
return true;
else
return false;
}

function _DropItems(Name classname, vector offset, vector velocity)
{
local Inventory item, nextItem;
local bool drop;

item = Inventory;
while( item != None ) {
nextItem = item.Inventory;
drop = item.IsA('NanoKey') || item.bDisplayableInv;
if( Ammo(item) != None ) drop = false;
if( drop ) {
if( _DropItem(item, classname) ) {
DeleteInventory(item);
class'DXRActorsBase'.static.ThrowItem(self, item);
item.Velocity *= vect(-2, -2, 3);
item.SetLocation( item.Location + offset );
item.Velocity *= velocity;
}
item = nextItem;
}
}

function DropKeys()
{
_DropItems('NanoKey', vect(0,0,80), vect(-0.2, -0.2, 1) );
SetCollision(true,true,bBlockPlayers);
}

function Destroyed()
{
DropKeys();
_DropItems('Inventory', vect(0,0,0), vect(-2, -2, 3) );
Super.Destroyed();
}

defaultproperties
{
//bCollideActors=true
//bBlockActors=true
//bBlockPlayers=true
}
44 changes: 44 additions & 0 deletions DXRFixes/DeusEx/Classes/ElevatorMover.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
class ElevatorMover merges ElevatorMover;
// can't do injects because it uses a state

var float lastTime;

function bool EncroachingOn( actor Other )
{
if( Inventory(Other) != None ) {
return false;
}
if( EncroachDamage < 10 && #var PlayerPawn (Other) == None ) {
Other.TakeDamage( 1000, Instigator, Other.Location, vect(0,0,0), 'Crushed' );
Other.TakeDamage( 1000, Instigator, Other.Location, vect(0,0,0), 'Exploded' );
return false;
}
Super.EncroachingOn(Other);
return false;
}

function SetSeq(int seqnum)
{
local bool oldSeq;
local int prevKeyNum;
local float dist;

if( MoveTime/2 < Level.TimeSeconds-lastTime )
oldSeq = true;

if ( bIsMoving && !oldSeq )
return;

if (KeyNum != seqnum || oldSeq)
{
prevKeyNum = KeyNum;
KeyNum = seqnum;
dist = VSize(BasePos + KeyPos[seqnum] - Location);

GotoState('ElevatorMover', 'Next');

if( prevKeyNum == seqnum || dist < 16.0 )
bIsMoving = false;
else lastTime = Level.TimeSeconds;
}
}
16 changes: 12 additions & 4 deletions DXRModules/DeusEx/Classes/DXRAugmentations.uc
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,15 @@ simulated function string DescriptionLevel(Actor act, int i, out string word)

simulated function RemoveRandomAug(#var PlayerPawn p)
{
local Augmentation a, augs[64];
local Augmentation a, b, augs[64];
local AugmentationManager am;
local int numAugs, slot;

am = p.AugmentationSystem;

for( a = am.FirstAug; a != None; a = a.next ) {
if( !a.bHasIt ) continue;
if( a.AugmentationLocation == LOC_Default ) continue;

if( #var prefix AugSpeed(a) != None || #var prefix AugLight(a) != None
|| #var prefix AugIFF(a) != None || #var prefix AugDatalink(a) != None || AugNinja(a) != None
Expand All @@ -228,12 +229,19 @@ simulated function RemoveRandomAug(#var PlayerPawn p)
SetSeed( "RemoveRandomAug " $ numAugs );
slot = rng(numAugs);
a = augs[slot];
info("RemoveRandomAug("$p$") Removing aug "$a$", numAugs was "$numAugs);
am.AugLocs[a.AugmentationLocation].augCount--;
p.RemoveAugmentationDisplay(a);
info("RemoveRandomAug("$p$") Removing aug "$a$" from "$am$", numAugs was "$numAugs);
a.Deactivate();
a.CurrentLevel = 0;
a.bHasIt = false;
am.AugLocs[a.AugmentationLocation].augCount--;
p.RemoveAugmentationDisplay(a);

// walk back the hotkey numbers
slot = am.AugLocs[a.AugmentationLocation].KeyBase + 1;
for( b = am.FirstAug; b != None; b = b.next ) {
if( b.bHasIt && a.AugmentationLocation == b.AugmentationLocation )
b.HotKeyNum = slot++;
}
}

defaultproperties
Expand Down
22 changes: 15 additions & 7 deletions DXRModules/DeusEx/Classes/DXRBacktracking.uc
Original file line number Diff line number Diff line change
Expand Up @@ -106,16 +106,24 @@ function PreTravel()
function CheckNextMap(string nextMap)
{
local int oldMissionNum, newMissionNum;
local string combo;

oldMissionNum = dxr.dxInfo.missionNumber;
newMissionNum = class'DXRTestAllMaps'.static.GetMissionNumber(nextMap);

//do this for paris (10/11) and vandenberg (12/14)
if( (oldMissionNum == 10 && newMissionNum == 11) || (oldMissionNum == 11 && newMissionNum == 10)
||
(oldMissionNum == 12 && newMissionNum == 14) || (oldMissionNum == 14 && newMissionNum == 12) )
{
RetainSaves(oldMissionNum, newMissionNum, nextMap);

if( oldMissionNum == newMissionNum ) return;

combo = oldMissionNum $ " to " $ newMissionNum;
switch(combo) {
case "10 to 11":
case "11 to 10":
case "12 to 14":
case "14 to 12":
RetainSaves(oldMissionNum, newMissionNum, nextMap);
break;
default:
if( dxr.flags.gamemode == 3 )
RetainSaves(oldMissionNum, newMissionNum, nextMap);
}
}
Expand Down
5 changes: 5 additions & 0 deletions DXRModules/DeusEx/Classes/DXREnemies.uc
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,11 @@ function ScriptedPawn CloneScriptedPawn(ScriptedPawn p, optional class<ScriptedP
return None;
}
l("cloning "$ActorToString(p)$" into class "$newclass$" got "$ActorToString(n));
#ifdef hx
// HACK: HXThugMale is missing the CarcassType
if( n.class == class'HXThugMale' && n.CarcassType == None )
n.CarcassType = class'HXThugMaleCarcass';
#endif
if( IsHuman(p) && IsHuman(n) && p.BarkBindName != "" && n.BarkBindName == "" ) n.BarkBindName = p.BarkBindName;
class'DXRNames'.static.GiveRandomName(dxr, n);
Expand Down
62 changes: 36 additions & 26 deletions DXRModules/DeusEx/Classes/DXREntranceRando.uc
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ function CheckConfig()

min_connections_selfconnect = 999;
i = 0;
dead_ends[i++] = "06_HONGKONG_WANCHAI_GARAGE#Teleporter";
//dead_ends[i++] = "06_HONGKONG_WANCHAI_GARAGE#Teleporter";
dead_ends[i++] = "06_HONGKONG_Storage#waterpipe";
//dead_ends[i++] = "06_HONGKONG_MJ12LAB#tubeend";

/*i=0;
unreachable_conns[i++] = "12_VANDENBERG_CMD#storage";*/
Expand All @@ -101,6 +102,26 @@ function CheckConfig()
dependencies[i].dependency = "06_HongKong_WanChai_Street";
i++;

dependencies[i].dependent = "06_HongKong_WanChai_Market#Lobby";
dependencies[i].dependency = "06_HongKong_WanChai_Underworld";
i++;

dependencies[i].dependent = "06_HONGKONG_STORAGE#CANAL";
dependencies[i].dependency = "06_HongKong_WanChai_Underworld";
i++;

dependencies[i].dependent = "06_HONGKONG_MJ12LAB#basement";
dependencies[i].dependency = "06_HongKong_WanChai_Underworld";
i++;

/*dependencies[i].dependent = "06_HONGKONG_wanchai_garage#BackDoor";
dependencies[i].dependency = "06_HongKong_WanChai_Underworld";
i++;*/

dependencies[i].dependent = "06_HongKong_Storage#canal";
dependencies[i].dependency = "06_HongKong_WanChai_MJ12Lab";
i++;

dependencies[i].dependent = "12_VANDENBERG_CMD#gas_start";
dependencies[i].dependency = "12_VANDENBERG_COMPUTER";
i++;
Expand Down Expand Up @@ -801,8 +822,6 @@ function RandoMission2()
AddDoubleXfer("02_NYC_Underground","ToNYCSump","02_NYC_Street","FromNYCSump");
AddDoubleXfer("02_NYC_Warehouse","ToRoofTop","02_NYC_Street","FromRoofTop");
AddDoubleXfer("02_NYC_Warehouse","ToWarehouseAlley","02_NYC_Street","FromWarehouseAlley");

GenerateConnections(2);
}

function RandoMission3()
Expand All @@ -815,8 +834,6 @@ function RandoMission3()
AddDoubleXfer("03_NYC_AirfieldHeliBase","FromOcean","03_NYC_Airfield","ToOcean");
AddDoubleXfer("03_NYC_Airfield","HangarExit","03_NYC_Hangar","HangarEnt");
AddDoubleXfer("03_NYC_Hangar","747PassExit","03_NYC_747","747PassEnt");

GenerateConnections(3);
}

function RandoMission4()
Expand All @@ -832,8 +849,6 @@ function RandoMission4()
AddDoubleXfer("04_NYC_STREET","FromNSFHQ","04_NYC_NSFHQ","ToNSFHQ");
AddDoubleXfer("04_NYC_STREET","FromNYCUndergroundSewer2","04_NYC_Underground","ToNYCUndergroundSewer2");
AddDoubleXfer("04_NYC_STREET","FromNYCSump","04_NYC_Underground","ToNYCSump");

GenerateConnections(4);
}

function RandoMission6()
Expand All @@ -842,7 +857,6 @@ function RandoMission6()
AddDoubleXfer("06_HONGKONG_MJ12LAB","cathedral","06_HongKong_VersaLife","secret");
AddDoubleXfer("06_HONGKONG_MJ12LAB","tubeend","06_HongKong_Storage","basement");
AddDoubleXfer("06_HONGKONG_STORAGE","waterpipe","06_HongKong_WanChai_Canal","canal");
//AddDoubleXfer("06_HONGKONG_STORAGE","basement","06_HongKong_MJ12lab","tubeend");
//AddXfer("06_HongKong_Storage","BackDoor","06_HONGKONG_WANCHAI_GARAGE#Teleporter");//one way
//AddFixedConn("06_HONGKONG_TONGBASE","lab","06_HongKong_WanChai_Market","compound");
AddDoubleXfer("06_HONGKONG_VERSALIFE","Lobby","06_HongKong_WanChai_Market","market");
Expand All @@ -852,8 +866,6 @@ function RandoMission6()
AddDoubleXfer("06_HONGKONG_WANCHAI_GARAGE","market04","06_HongKong_WanChai_Market","garage01");
AddDoubleXfer("06_HONGKONG_WANCHAI_MARKET","canal03","06_HongKong_WanChai_Underworld","market03");
AddDoubleXfer("06_HongKong_WanChai_Street","alleyout","06_HongKong_WanChai_Canal","alleyin");

GenerateConnections(6);
}

function RandoMission8()
Expand All @@ -868,8 +880,6 @@ function RandoMission8()
AddDoubleXfer("08_NYC_SMUG","ToSmugBackDoor","08_NYC_Street","FromSmugBackDoor");
AddDoubleXfer("08_NYC_UNDERGROUND","ToNYCSump","08_NYC_Street","FromNYCSump");
AddDoubleXfer("08_NYC_UNDERGROUND","ToNYCUndergroundSewer2","08_NYC_Street","FromNYCUndergroundSewer2");

GenerateConnections(8);
}

function RandoMission9()
Expand All @@ -883,8 +893,6 @@ function RandoMission9()
AddDoubleXfer("09_NYC_SHIP","FromFanRoom","09_NYC_ShipFan","ToFanRoom");
AddDoubleXfer("09_NYC_SHIP","FromDuctRoom","09_NYC_ShipFan","ToDuctRoom");
AddDoubleXfer("09_NYC_SHIP","FromBelow","09_NYC_ShipBelow","FromAbove");

GenerateConnections(9);
}

function RandoMission10()
Expand All @@ -897,8 +905,6 @@ function RandoMission10()
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");

GenerateConnections(10);
}

function RandoMission12()
Expand All @@ -914,8 +920,6 @@ function RandoMission12()
AddDoubleXfer("14_OCEANLAB_LAB","Sunkentunnel","14_OceanLab_UC","UC");//we don't care about what map name the teleporter says, the real map name is what matters
AddDoubleXfer("14_OCEANLAB_LAB","Sunkenlab","14_Vandenberg_sub","subbay");
AddDoubleXfer("14_Vandenberg_Sub","?toname=InterpolationPoint39", "14_Oceanlab_silo","#frontgate");

GenerateConnections(12);
}

function RandoMission15()
Expand All @@ -926,17 +930,10 @@ function RandoMission15()
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","");

GenerateConnections(15);
}

function EntranceRando(int missionNum)
function GenerateXfers(int missionNum)
{
numConns = 0;
numXfers = 0;
numFixedConns = 0;
dxr.SetSeed( dxr.seed + dxr.Crc("entrancerando") + missionNum );

switch(missionNum)
{
case 2:
Expand Down Expand Up @@ -975,6 +972,19 @@ function EntranceRando(int missionNum)
}
}

function EntranceRando(int missionNum)
{
numConns = 0;
numXfers = 0;
numFixedConns = 0;
dxr.SetSeed( dxr.seed + dxr.Crc("entrancerando") + missionNum );

GenerateXfers(missionNum);

if( numXfers > 0 )
GenerateConnections(missionNum);
}

function BindEntrances(DataStorage ds, bool writing)
{
local int i;
Expand Down
Loading

0 comments on commit 844a77a

Please sign in to comment.