Skip to content

Commit

Permalink
v2.6.3.9 Beta Merge pull request #711 from Die4Ever/develop
Browse files Browse the repository at this point in the history
* fix unrandomized title screen logo and music

* pause and tilde on customize keys screen

* rando music improvements: removed some invalid combat songs, remember 20 skipped songs, when skipping a song correctly use the stable seed

* bump version to v2.6.3.8 Alpha for DXRMusic config

* Use new DXR carcass naming scheme for pre-existing carcasses (#710)

* use DXR carcass naming scheme for pre-existing carcasses

* use randomized names for pre-existing animal carcasses

* fix some possible Accessed None warnings

* DXRVanillaFixer instead of "Zero Changes mode"

* Zero Rando now gets a random seed, allowing 50% mirrored maps to work correctly, advanced settings, randomized music, etc
we just need to be careful to not allow random elements for Zero Rando

* fix rounding for AugBallistic and AugShield

---------

Co-authored-by: Jeffrey Thomas Piercy <mqduck@mqduck.net>
  • Loading branch information
Die4Ever and MQDuck authored Apr 21, 2024
2 parents 288ce1f + 7e1b590 commit dba72a9
Show file tree
Hide file tree
Showing 22 changed files with 131 additions and 85 deletions.
2 changes: 2 additions & 0 deletions DXRBalance/DeusEx/Classes/AugBallistic.uc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class DXRAugBallistic injects AugBallistic;

// vanilla level 1 is 0.80 (20%) but rounding causes it to show as 19%
defaultproperties
{
bAutomatic=true
LevelValues(0)=0.799999
}
2 changes: 2 additions & 0 deletions DXRBalance/DeusEx/Classes/AugShield.uc
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
class DXRAugShield injects AugShield;

// vanilla level 1 is 0.80 (20%) but rounding causes it to show as 19%
defaultproperties
{
bAutomatic=true
LevelValues(0)=0.799999
}
2 changes: 1 addition & 1 deletion DXRCore/DeusEx/Classes/DXRVersion.uc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ simulated static function CurrentVersion(optional out int major, optional out in
major=2;
minor=6;
patch=3;
build=7;//build can't be higher than 99
build=9;//build can't be higher than 99
}

simulated static function bool VersionIsStable()
Expand Down
2 changes: 2 additions & 0 deletions DXRModules/DeusEx/Classes/DXREnemiesPatrols.uc
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ function bool _GivePatrol(ScriptedPawn pawn)
function LinkPoints(DynamicPatrolPoint prev, DynamicPatrolPoint next)
{
local rotator lookAngle;
if(prev==None || next==None) return;

prev.Nextpatrol = next.Tag;
prev.NextPatrolPoint = next;

Expand Down
3 changes: 0 additions & 3 deletions DXRModules/DeusEx/Classes/DXRFlags.uc
Original file line number Diff line number Diff line change
Expand Up @@ -539,9 +539,6 @@ function FlagsSettings SetDifficulty(int new_difficulty)
settings.health = 100;
settings.energy = 100;
if(IsZeroRando()) {
seed = 0;
dxr.seed = seed;
bSetSeed = 1;
settings.passwordsrandomized = 0;
settings.enemystats = 0;
settings.bot_stats = 0;
Expand Down
2 changes: 2 additions & 0 deletions DXRModules/DeusEx/Classes/DXRGrenades.uc
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ function #var(prefix)ThrownProjectile SpawnNewPlantedGrenade(class<#var(prefix)T
local #var(prefix)ThrownProjectile gren;

gren = Spawn(type,owner,tag,loc,rot);
if(gren == None) return gren;

gren.PlayAnim('Open');
gren.SetPhysics(PHYS_None);
Expand Down Expand Up @@ -114,6 +115,7 @@ function FirstEntry()
oldTag = grens[i].tag;
oldEvent=grens[i].event;
oldOwner=grens[i].owner;
grens[i].SetCollision(false,false,false);
grens[i].Destroy();

gren = SpawnNewPlantedGrenade(PickRandomGrenade(),loc,rot,oldTag,oldEvent,oldOwner);
Expand Down
73 changes: 39 additions & 34 deletions DXRModules/DeusEx/Classes/DXRMemes.uc
Original file line number Diff line number Diff line change
Expand Up @@ -261,12 +261,12 @@ function AnyEntry()
local #var(prefix)IonStormLogo islogo;
local #var(prefix)EidosLogo elogo;
local #var(prefix)ElectricityEmitter elec;
local #var(prefix)DXText text;
local Actor a;
local Rotator r;
local Vector v;

Super.AnyEntry();
TitleScreenRandoLogo();// do this even when memes disabled
if(!class'MenuChoice_ToggleMemes'.static.IsEnabled(dxr.flags)) return;

switch(dxr.localURL)
Expand Down Expand Up @@ -341,39 +341,6 @@ function AnyEntry()
elec.move(v);
}


//Add me back in once we have "Randomizer" name textures! Just change the textures below
foreach AllActors(class'#var(prefix)DXText',text)
{
text.bHidden=True; //Hide all the original text
}
if (dxr.localURL=="DX"){
text = Spawn(class'DXRText',,,vectm(-60.979568,57.046417,-137.022430),rotm(0,32768,0,0));
text.Skin = None;
text = Spawn(class'DXRText',,,vectm(138.886353,57.125278,-137.022430),rotm(0,32768,0,0));
text.Skin = Texture'DeusExDeco.Skins.DXTextTex2';

// Randomizer logo
v = vect(10, 57.15, -177.66);// midpoint
text = Spawn(class'DXRText',,,vectm(v.X - 100, v.Y, v.Z),rotm(0,32768,0,0));
text.Skin = Texture'RandomizerTextTex1'; //Left half of "Randomizer" text texture
text = Spawn(class'DXRText',,,vectm(v.X + 100, v.Y, v.Z),rotm(0,32768,0,0));
text.Skin = Texture'RandomizerTextTex2'; //Right half of "Randomizer" text texture
} else if (dxr.localURL=="DXONLY"){
text = Spawn(class'DXRText',,,vectm(-62.015648,-55.260841,-139.022430),rotm(0,49136,0,0));
text.Skin = None;
text = Spawn(class'DXRText',,,vectm(-61.787956,144.605042,-139.022430),rotm(0,49136,0,0));
text.Skin = Texture'DeusExDeco.Skins.DXTextTex2';

// Randomizer logo
v = vect(-62, 10, -178.990417);// midpoint
text = Spawn(class'DXRText',,,vectm(v.X, v.Y - 100, v.Z),rotm(0,49136,0,0));
text.Skin = Texture'RandomizerTextTex1'; //Left half of "Randomizer" text texture
text = Spawn(class'DXRText',,,vectm(v.X, v.Y + 100, v.Z),rotm(0,49136,0,0));
text.Skin = Texture'RandomizerTextTex2'; //Right half of "Randomizer" text texture
}


break;

case "INTRO":
Expand All @@ -391,6 +358,44 @@ function AnyEntry()
}
}

function TitleScreenRandoLogo()
{
local #var(prefix)DXText text;
local vector v;

if(dxr.localURL == "DXONLY" || dxr.localURL == "DX") {
foreach AllActors(class'#var(prefix)DXText',text)
{
text.bHidden=True; //Hide all the original text
}
}
if (dxr.localURL=="DX"){
text = Spawn(class'DXRText',,,vectm(-60.979568,57.046417,-137.022430),rotm(0,32768,0,0));
text.Skin = None;
text = Spawn(class'DXRText',,,vectm(138.886353,57.125278,-137.022430),rotm(0,32768,0,0));
text.Skin = Texture'DeusExDeco.Skins.DXTextTex2';

// Randomizer logo
v = vect(10, 57.15, -177.66);// midpoint
text = Spawn(class'DXRText',,,vectm(v.X - 100, v.Y, v.Z),rotm(0,32768,0,0));
text.Skin = Texture'RandomizerTextTex1'; //Left half of "Randomizer" text texture
text = Spawn(class'DXRText',,,vectm(v.X + 100, v.Y, v.Z),rotm(0,32768,0,0));
text.Skin = Texture'RandomizerTextTex2'; //Right half of "Randomizer" text texture
} else if (dxr.localURL=="DXONLY"){
text = Spawn(class'DXRText',,,vectm(-62.015648,-55.260841,-139.022430),rotm(0,49136,0,0));
text.Skin = None;
text = Spawn(class'DXRText',,,vectm(-61.787956,144.605042,-139.022430),rotm(0,49136,0,0));
text.Skin = Texture'DeusExDeco.Skins.DXTextTex2';

// Randomizer logo
v = vect(-62, 10, -178.990417);// midpoint
text = Spawn(class'DXRText',,,vectm(v.X, v.Y - 100, v.Z),rotm(0,49136,0,0));
text.Skin = Texture'RandomizerTextTex1'; //Left half of "Randomizer" text texture
text = Spawn(class'DXRText',,,vectm(v.X, v.Y + 100, v.Z),rotm(0,49136,0,0));
text.Skin = Texture'RandomizerTextTex2'; //Right half of "Randomizer" text texture
}
}

function FixEndgameEndCamera()
{
local CameraPoint cp;
Expand Down
48 changes: 26 additions & 22 deletions DXRModules/DeusEx/Classes/DXRMusic.uc
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ struct SongChoice {
var config bool allowCombat;
var config SongChoice choices[300];// keep size in sync with _GetLevelSong tchoices[]

var string skipped_songs[10];// copied back to defaults, so they get remembered across loading screens but not when you close the program, otherwise use the disable button instead of the change song button
var string skipped_songs[20];// copied back to defaults, so they get remembered across loading screens but not when you close the program, otherwise use the disable button instead of the change song button
var int last_skipped_song;

function CheckConfig()
{
local int i, g;
local string gamesongs[100];

if( ConfigOlderThan(2,6,2,2) ) {
if( ConfigOlderThan(2,6,3,8) ) {
allowCombat = default.allowCombat;

for(i=0; i<ArrayCount(choices); i++) {
Expand All @@ -37,8 +37,8 @@ function CheckConfig()
choices[i++] = MakeSongChoice("Area51_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("Area51Bunker_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("BatteryPark_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("HKClub_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("HKClub2_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("HKClub_Music", 0, 0, 0, 4, 0); // only has ambient and convo
choices[i++] = MakeSongChoice("HKClub2_Music", 0, 0, 0, 0, 0); // only ambient
choices[i++] = MakeSongChoice("HongKong_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("HongKongCanal_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("HongKongHelipad_Music", 0, 1, 3, 4, 5);
Expand All @@ -54,8 +54,8 @@ function CheckConfig()
choices[i++] = MakeSongChoice("OceanLab2_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("ParisCathedral_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("ParisChateau_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("ParisClub_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("ParisClub2_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("ParisClub_Music", 0, 0, 0, 0, 0); // has ambient and a single section combat song
choices[i++] = MakeSongChoice("ParisClub2_Music", 0, 0, 0, 0, 0); // has ambient and a single section combat song
choices[i++] = MakeSongChoice("Tunnels_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("UNATCO_Music", 0, 1, 3, 4, 5);
choices[i++] = MakeSongChoice("UNATCOReturn_Music", 0, 1, 3, 4, 5);
Expand Down Expand Up @@ -323,7 +323,18 @@ function SongChoice MakeSongChoice(string song, optional int ambient, optional i
return s;
}

function _GetLevelSong(string oldSong, out string newSong, out byte LevelSongSection, out byte DyingSection, out byte CombatSection, out byte ConvSection, out byte OutroSection)
function MarkSkippedSong(string oldSong)
{
// remember skipped songs
if(oldSong != "") {
last_skipped_song = last_skipped_song % ArrayCount(skipped_songs);
skipped_songs[last_skipped_song] = oldSong;
default.skipped_songs[last_skipped_song] = skipped_songs[last_skipped_song];
default.last_skipped_song = ++last_skipped_song;
}
}

function _GetLevelSong(out string newSong, out byte LevelSongSection, out byte DyingSection, out byte CombatSection, out byte ConvSection, out byte OutroSection)
{
local SongChoice tchoices[300], s;
local int i, j, num;
Expand All @@ -348,31 +359,24 @@ function _GetLevelSong(string oldSong, out string newSong, out byte LevelSongSec
if(s.enabled == false) continue;
if(s.song == "") continue;
if(s.cutscene_only && !cutscene) continue;
tchoices[num++] = s;
}

// remember skipped songs
if(oldSong != "") {
last_skipped_song = last_skipped_song % ArrayCount(skipped_songs);
skipped_songs[last_skipped_song] = oldSong;
default.skipped_songs[last_skipped_song] = skipped_songs[last_skipped_song];
default.last_skipped_song = ++last_skipped_song;
}

// choose the song
for(j=0; j<100; j++) {
i = rng(num);
s = tchoices[i];
goodSong = true;
for(i=0; i<ArrayCount(skipped_songs); i++) {
if(s.song ~= skipped_songs[i]) {
goodSong = false;
break;
}
}
if(goodSong) break;

if(goodSong) tchoices[num++] = s;
}

// choose the song
// if we don't put the num into the seed then skipping songs causes you to get the same rng result, which means you skip songs in order
BranchSeed(num);
i = rng(num);
s = tchoices[i];

newSong = s.song;
LevelSongSection = s.ambient;
DyingSection = s.dying;
Expand Down
27 changes: 22 additions & 5 deletions DXRModules/DeusEx/Classes/DXRMusicPlayer.uc
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,12 @@ function ClientSetMusic( playerpawn NewPlayer, music NewSong, byte NewSection, b
function AnyEntry()
{
local DXRMusic music;

if(p == None) {
p = player();
ClientSetMusic(p, Level.Song, Level.SongSection, Level.CdTrack, MTRAN_Fade );
}

music = DXRMusic(dxr.FindModule(class'DXRMusic'));
if(music != None) {
allowCombat = music.allowCombat;
Expand All @@ -161,7 +167,7 @@ function string GetCurrentSongName()

function GetLevelSong(bool setseed)
{
local string oldSong, newSong;
local string newSong;
local DXRMusic music;

if(setseed) {
Expand All @@ -170,14 +176,13 @@ function GetLevelSong(bool setseed)
SetGlobalSeed("NYCStreets2_Music");
} else {
SetGlobalSeed(FRand());
oldSong = GetCurrentSongName();
}

music = DXRMusic(dxr.FindModule(class'DXRMusic'));
if(music == None) {
return;
}
music._GetLevelSong(oldSong, newSong, LevelSongSection, DyingSection, CombatSection, ConvSection, OutroSection);
music._GetLevelSong(newSong, LevelSongSection, DyingSection, CombatSection, ConvSection, OutroSection);

l("GetLevelSong() "$newSong@LevelSongSection@DyingSection@CombatSection@ConvSection@OutroSection);

Expand Down Expand Up @@ -210,11 +215,12 @@ function PlayRandomSong(bool setseed)
local bool rando_music_setting;
local int continuous_setting;

l("PlayRandomSong " $ setseed @ p);
if(p == None) return;

continuous_setting = class'MenuChoice_ContinuousMusic'.default.value;
rando_music_setting = class'MenuChoice_RandomMusic'.static.IsEnabled(dxr.flags);
l("AnyEntry 1: "$p@dxr@dxr.dxInfo.missionNumber@continuous_setting@rando_music_setting);
l("PlayRandomSong 1: "$p@dxr@dxr.dxInfo.missionNumber@continuous_setting@rando_music_setting);
if( p == None || dxr == None || (continuous_setting == c.default.disabled && rando_music_setting==false) )
return;

Expand All @@ -226,7 +232,7 @@ function PlayRandomSong(bool setseed)
NewCdTrack = 255;
NewTransition = MTRAN_Fade;

l("AnyEntry 2: "$NewSong@NewSection@NewCdTrack@NewTransition@PrevSong@PrevSongSection@PrevSavedSection@PrevMusicMode);
l("PlayRandomSong 2: "$NewSong@NewSection@NewCdTrack@NewTransition@PrevSong@PrevSongSection@PrevSavedSection@PrevMusicMode);

// ensure musicMode defaults to ambient, to fix combat music re-entry
musicMode = MUS_Ambient;
Expand Down Expand Up @@ -281,6 +287,17 @@ function PlayRandomSong(bool setseed)
Enable('Tick');
}

function SkipSong()
{
local DXRMusic music;

music = DXRMusic(dxr.FindModule(class'DXRMusic'));
if(music != None) {
music.MarkSkippedSong(GetCurrentSongName());
}
PlayRandomSong(true);
}

// ----------------------------------------------------------------------
// UpdateDynamicMusic() copied from DeusExPlayer, but Level.Song was changed to LevelSong, and Level.SongSection changed to LevelSongSection
//
Expand Down
14 changes: 9 additions & 5 deletions DXRModules/DeusEx/Classes/DXRNames.uc
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ function FirstEntry()
foreach AllActors(class'#var(DeusExPrefix)Carcass', c)
#endif
{
if ( c.itemName != "Dead Body" && c.itemName != "Unconscious" && c.itemName != "Animal Carcass" )
continue;
if ( c.BindName == "PaulDentonCarcass" )
continue;
c.itemName = c.itemName $ " (" $ RandomName(dxr) $ ")";
if (c.itemName == "Dead Body" || c.itemName == "Animal Carcass") { // this is apparently always true in the vanilla maps
if (c.BindName == "PaulDentonCarcass") {
c.itemName = "Paul Denton (Dead)";
} else {
c.itemName = RandomName(dxr) $ " (Dead)";
}
} else if (c.itemName == "Unconscious") {
c.itemName = RandomName(dxr) $ " (Unconscious)";
}
}
foreach AllActors(class'#var(prefix)BoneSkull', skull) {
Expand Down
6 changes: 3 additions & 3 deletions DXRModules/DeusEx/Classes/DXRTelemetry.uc
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ function ReceivedData(string data)
j.StartParse(data);
} else {
tjs = class'Json'.static.parse(Level, data);
CheckNotification(j);
CheckDeaths(j, 0);
class'DXRStats'.static.CheckLeaderboard(dxr, j);
CheckNotification(tjs);
CheckDeaths(tjs, 0);
class'DXRStats'.static.CheckLeaderboard(dxr, tjs);
}
data = "";
}
Expand Down
7 changes: 6 additions & 1 deletion DXRVanilla/DeusEx/Classes/Player.uc
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ function ClientSetMusic( music NewSong, byte NewSection, byte NewCdTrack, EMusic
local DXRMusicPlayer m;
GetDXR();
if (dxr==None){ //Probably only during ENDGAME4?
log("Couldn't find a DXR so we can set the music");
log("Couldn't find a DXR so we can set the music to " $ NewSong);
return;
}
m = DXRMusicPlayer(dxr.LoadModule(class'DXRMusicPlayer'));
Expand Down Expand Up @@ -1437,6 +1437,11 @@ event PlayerInput( float DeltaTime )
}
}

exec function RemoveBeltItem()
{
RemoveObjectFromBelt(InHand);
}

defaultproperties
{
LastBrowsedAugPage=-1 //OAT, 1/12/24: Hack so backtracking levels doesn't sometimes forget which page you saved last.
Expand Down
Loading

0 comments on commit dba72a9

Please sign in to comment.