From f4c63d74262eb8668ee60d3daf554d21f4134990 Mon Sep 17 00:00:00 2001 From: "theastropath@gmail.com" Date: Sun, 6 Aug 2023 21:07:43 -0400 Subject: [PATCH] Make generic datacube spawning functions and modify existing spawns to use the appropriate ones --- DXRCore/DeusEx/Classes/DXRActorsBase.uc | 53 +++++++++++++++++++- DXRMapFixups/DeusEx/Classes/DXRFixupM06.uc | 7 +-- DXRMapFixups/DeusEx/Classes/DXRFixupM15.uc | 27 +++------- DXRMissions/DeusEx/Classes/DXRMissionsM01.uc | 2 +- DXRMissions/DeusEx/Classes/DXRMissionsM05.uc | 2 +- DXRMissions/DeusEx/Classes/DXRMissionsM06.uc | 2 +- DXRMissions/DeusEx/Classes/DXRMissionsM15.uc | 2 +- DXRModules/DeusEx/Classes/DXRMachines.uc | 2 +- 8 files changed, 64 insertions(+), 33 deletions(-) diff --git a/DXRCore/DeusEx/Classes/DXRActorsBase.uc b/DXRCore/DeusEx/Classes/DXRActorsBase.uc index 2e7b02c42..cbc8d1a8e 100644 --- a/DXRCore/DeusEx/Classes/DXRActorsBase.uc +++ b/DXRCore/DeusEx/Classes/DXRActorsBase.uc @@ -764,7 +764,11 @@ function #var(prefix)Containers AddBox(class<#var(prefix)Containers> c, vector l return box; } -function #var(prefix)InformationDevices SpawnDatacube(vector loc, rotator rot, string text, optional bool dont_move) +#ifdef injections +function #var(prefix)InformationDevices SpawnDatacube(vector loc, rotator rot, optional bool dont_move) +#else +function DXRInformationDevices SpawnDatacube(vector loc, rotator rot, optional bool dont_move) +#endif { #ifdef injections local #var(prefix)DataCube dc; @@ -775,7 +779,6 @@ function #var(prefix)InformationDevices SpawnDatacube(vector loc, rotator rot, s #endif if(dc != None) { - dc.plaintext = text; dc.bIsSecretGoal = dont_move; info("SpawnDatacube "$dc$" at ("$loc$"), ("$rot$")"); if(dxr.flags.settings.infodevices > 0) @@ -786,6 +789,52 @@ function #var(prefix)InformationDevices SpawnDatacube(vector loc, rotator rot, s return dc; } + +function #var(prefix)InformationDevices SpawnDatacubePlaintext(vector loc, rotator rot, string text, optional bool dont_move) +{ +#ifdef injections + local #var(prefix)InformationDevices dc; +#else + local DXRInformationDevices dc; +#endif + dc = SpawnDatacube(loc,rot,dont_move); + + if(dc != None) { + dc.plaintext = text; + } + return dc; +} + +function #var(prefix)InformationDevices SpawnDatacubeTextTag(vector loc, rotator rot, name texttag, optional bool dont_move) +{ +#ifdef injections + local #var(prefix)InformationDevices dc; +#else + local DXRInformationDevices dc; +#endif + dc = SpawnDatacube(loc,rot,dont_move); + + if(dc != None) { + dc.textTag = texttag; + } + return dc; +} + +function #var(prefix)InformationDevices SpawnDatacubeImage(vector loc, rotator rot, class imageClass, optional bool dont_move) +{ +#ifdef injections + local #var(prefix)InformationDevices dc; +#else + local DXRInformationDevices dc; +#endif + dc = SpawnDatacube(loc,rot,dont_move); + + if(dc != None) { + dc.imageClass = imageClass; + } + return dc; +} + // used by DXRReplaceActors function Actor SpawnReplacement(Actor a, class newclass, optional bool dont_copy_appearance) { diff --git a/DXRMapFixups/DeusEx/Classes/DXRFixupM06.uc b/DXRMapFixups/DeusEx/Classes/DXRFixupM06.uc index fcb87ad17..7f2b5c178 100644 --- a/DXRMapFixups/DeusEx/Classes/DXRFixupM06.uc +++ b/DXRMapFixups/DeusEx/Classes/DXRFixupM06.uc @@ -200,12 +200,7 @@ function PreFirstEntryMapFixes() pad.bHidden = False; } -#ifdef injections - dc = Spawn(class'#var(prefix)DataCube',,, vectm(-1194.700195,-789.460266,-750.628357), rotm(0,0,0)); -#else - dc = Spawn(class'DXRInformationDevices',,, vectm(-1194.700195,-789.460266,-750.628357), rotm(0,0,0)); -#endif - dc.imageClass=Class'DeusEx.Image15_GrayDisection'; + SpawnDatacubeImage(vectm(-1194.700195,-789.460266,-750.628357), rotm(0,0,0),Class'DeusEx.Image15_GrayDisection'); Spawn(class'PlaceholderItem',,, vectm(-1.95,1223.1,810.3)); //Table over entrance Spawn(class'PlaceholderItem',,, vectm(1022.24,-1344.15,450.3)); //Bathroom counter diff --git a/DXRMapFixups/DeusEx/Classes/DXRFixupM15.uc b/DXRMapFixups/DeusEx/Classes/DXRFixupM15.uc index e663aa309..755b7aca4 100644 --- a/DXRMapFixups/DeusEx/Classes/DXRFixupM15.uc +++ b/DXRMapFixups/DeusEx/Classes/DXRFixupM15.uc @@ -247,11 +247,7 @@ function PreFirstEntryMapFixes_Page() local ComputerPersonal comp_per; local int i; local vector cloneCubeLoc[4]; -#ifdef injections - local #var(prefix)DataCube dc[4]; -#else - local DXRInformationDevices dc[4]; -#endif + local string cloneCubeText[4]; foreach AllActors(class'ComputerSecurity', c) { if( c.UserList[0].userName != "graytest" || c.UserList[0].Password != "Lab12" ) continue; @@ -281,27 +277,18 @@ function PreFirstEntryMapFixes_Page() } } - //Spawn dupes of the clone cubes + //Rather than duplicating the existing cubes, add new clone text so there are more possibilities cloneCubeLoc[0]=vectm(6197.620117,-8455.201172,-5117.649902); //Weird little window near broken door (on Page side) cloneCubeLoc[1]=vectm(5663.339355,-7955.502441,-5557.624512); //On boxes outside middle level UC door cloneCubeLoc[2]=vectm(6333.112305,-7241.149414,-5557.636719); //On boxes right near middle level blue fusion reactor cloneCubeLoc[3]=vectm(7687.463867,-8845.201172,-5940.627441); //On control panel that has flame button in coolant area + cloneCubeText[0]="SUBJECT MJID-5493OP2702|nINCEPT DATE: 3/19/65|nASSIGNED BIRTH DATE: 7/20/41|nASSIGNED BIRTH NAME: Stan Carnegie|nBASE GENETIC SAMPLE: SIMONSWALTON32A|nPROFILE: AABCAAB|nVITALS: 45/80/0.89/33/1.2|n|n [[[[[PENDING]]]]]"; + cloneCubeText[1]="SUBJECT MJID-2938BU3209|nINCEPT DATE: 7/30/66|nASSIGNED BIRTH DATE: 9/07/40|nASSIGNED BIRTH NAME: Greg Pequod|nBASE GENETIC SAMPLE: |nPAGEBOB86G|nPROFILE: BAABACA|nVITALS: 51/72/1.02/20/2.1|n|n [[[[[PENDING]]]]]"; + cloneCubeText[2]="SUBJECT MJID-3209FG2938|nINCEPT DATE: 7/30/66|nASSIGNED BIRTH DATE: 9/07/40|nASSIGNED BIRTH NAME: Jacob Queequeg|nBASE GENETIC SAMPLE: STRONGHOWARD52L|nPROFILE: CAAGATA|nVITALS: 52/73/1.01/20/2.2|n|n [[[[[PENDING]]]]]"; + cloneCubeText[3]="SUBJECT MJID-3209FG2938|nINCEPT DATE: 6/17/54|nASSIGNED BIRTH DATE: 11/30/35|nASSIGNED BIRTH NAME: Jason Frudnick|nBASE GENETIC SAMPLE: GARDNERKANE88J|nPROFILE: BABTAGA|nVITALS: 51/81/1.13/20/2.0|n|n [[[[[PENDING]]]]]"; for(i=0;i<4;i++){ -#ifdef injections - dc[i] = Spawn(class'#var(prefix)DataCube',,, cloneCubeLoc[i], rotm(0,0,0)); -#else - dc[i] = Spawn(class'DXRInformationDevices',,, cloneCubeLoc[i], rotm(0,0,0)); -#endif + SpawnDatacubePlaintext(cloneCubeLoc[i],rotm(0,0,0),cloneCubeText[i]); } - //dc[0].textTag='15_Datacube02'; - //dc[1].textTag='15_Datacube03'; - //dc[2].textTag='15_Datacube04'; - //dc[3].textTag='15_Datacube05'; - //Rather than duplicating the existing cubes, add new clone text so there are more possibilities - dc[0].plaintext="SUBJECT MJID-5493OP2702|nINCEPT DATE: 3/19/65|nASSIGNED BIRTH DATE: 7/20/41|nASSIGNED BIRTH NAME: Stan Carnegie|nBASE GENETIC SAMPLE: SIMONSWALTON32A|nPROFILE: AABCAAB|nVITALS: 45/80/0.89/33/1.2|n|n [[[[[PENDING]]]]]"; - dc[1].plaintext="SUBJECT MJID-2938BU3209|nINCEPT DATE: 7/30/66|nASSIGNED BIRTH DATE: 9/07/40|nASSIGNED BIRTH NAME: Greg Pequod|nBASE GENETIC SAMPLE: |nPAGEBOB86G|nPROFILE: BAABACA|nVITALS: 51/72/1.02/20/2.1|n|n [[[[[PENDING]]]]]"; - dc[2].plaintext="SUBJECT MJID-3209FG2938|nINCEPT DATE: 7/30/66|nASSIGNED BIRTH DATE: 9/07/40|nASSIGNED BIRTH NAME: Jacob Queequeg|nBASE GENETIC SAMPLE: STRONGHOWARD52L|nPROFILE: CAAGATA|nVITALS: 52/73/1.01/20/2.2|n|n [[[[[PENDING]]]]]"; - dc[3].plaintext="SUBJECT MJID-3209FG2938|nINCEPT DATE: 6/17/54|nASSIGNED BIRTH DATE: 11/30/35|nASSIGNED BIRTH NAME: Jason Frudnick|nBASE GENETIC SAMPLE: GARDNERKANE88J|nPROFILE: BABTAGA|nVITALS: 51/81/1.13/20/2.0|n|n [[[[[PENDING]]]]]"; } function PreFirstEntryMapFixes() diff --git a/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc b/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc index 7bf8a69cf..629515d5f 100644 --- a/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc +++ b/DXRMissions/DeusEx/Classes/DXRMissionsM01.uc @@ -109,6 +109,6 @@ function AfterMoveGoalToLocation(Goal g, GoalLocation Loc) $ "|n|nPS: You can see all my possible locations by clicking the Goal Locations button on your Goals screen." $ "|nIf you get really stuck then click on Show Spoilers, Show Nanokeys, or Show Datacubes."; - SpawnDatacube(vectm(2801.546387, 171.028091, 2545.382813), rotm(0,0,0), text, true); + SpawnDatacubePlaintext(vectm(2801.546387, 171.028091, 2545.382813), rotm(0,0,0), text, true); } } diff --git a/DXRMissions/DeusEx/Classes/DXRMissionsM05.uc b/DXRMissions/DeusEx/Classes/DXRMissionsM05.uc index 6db495a6d..a159349fb 100644 --- a/DXRMissions/DeusEx/Classes/DXRMissionsM05.uc +++ b/DXRMissions/DeusEx/Classes/DXRMissionsM05.uc @@ -86,7 +86,7 @@ function AfterShuffleGoals(int goalsToLocations[32]) dctext = dctext $ "|n|nBoth using the DEMIURGE username. JC will never find them!"; - SpawnDatacube(vectm(243.288742, -104.183029, 289.368256), rotm(0,0,0), dctext, true); + SpawnDatacubePlaintext(vectm(243.288742, -104.183029, 289.368256), rotm(0,0,0), dctext, true); } function PreFirstEntryMapFixes() diff --git a/DXRMissions/DeusEx/Classes/DXRMissionsM06.uc b/DXRMissions/DeusEx/Classes/DXRMissionsM06.uc index 71788858a..4c6c88643 100644 --- a/DXRMissions/DeusEx/Classes/DXRMissionsM06.uc +++ b/DXRMissions/DeusEx/Classes/DXRMissionsM06.uc @@ -105,7 +105,7 @@ function DeleteGoal(Goal g, GoalLocation Loc) function GenerateDTSHintCube(Goal g, GoalLocation Loc) { - SpawnDatacube(vectm(-1857.841064, -158.911865, 2051.345459), rotm(0,0,0), + SpawnDatacubePlaintext(vectm(-1857.841064, -158.911865, 2051.345459), rotm(0,0,0), "I borrowed the sword but forgot it somewhere... Maybe "$Loc.name$"?", true); } diff --git a/DXRMissions/DeusEx/Classes/DXRMissionsM15.uc b/DXRMissions/DeusEx/Classes/DXRMissionsM15.uc index f69a92852..bfbbf9192 100644 --- a/DXRMissions/DeusEx/Classes/DXRMissionsM15.uc +++ b/DXRMissions/DeusEx/Classes/DXRMissionsM15.uc @@ -126,7 +126,7 @@ function AfterMoveGoalToLocation(Goal g, GoalLocation Loc) dctext = dctext $ "\"a51\" and the password is \"xx15yz\".|n|n"; dctext = dctext $ "BTW, be careful -- a squad made it out before I managed to lock the doors: they headed for the warehouse and then I lost contact with them.|n|n--Hawkins"; - dc2 = SpawnDatacube(dc1.Location, dc1.Rotation, dctext); + dc2 = SpawnDatacubePlaintext(dc1.Location, dc1.Rotation, dctext); if( dc2 != None ){ l("DXRMissions spawned "$ dc2 @ dctext @ dc2.Location); dc1.Destroy(); diff --git a/DXRModules/DeusEx/Classes/DXRMachines.uc b/DXRModules/DeusEx/Classes/DXRMachines.uc index 4d496a082..a141033c5 100644 --- a/DXRModules/DeusEx/Classes/DXRMachines.uc +++ b/DXRModules/DeusEx/Classes/DXRMachines.uc @@ -341,7 +341,7 @@ function #var(prefix)InformationDevices SpawnDatacubeForComputer(vector loc, #va distrange.max = 16*50; NearestFloor(locnorm, distrange); - d = SpawnDatacube(locnorm.loc, Rotator(locnorm.norm), + d = SpawnDatacubePlaintext(locnorm.loc, Rotator(locnorm.norm), c.UserList[0].userName $ " password is " $ c.UserList[0].Password); #ifdef injections d.new_passwords[0] = c.UserList[0].Password;