From 277782a157e5b10a42411d98806ba49f2d049516 Mon Sep 17 00:00:00 2001 From: Mgamerz Date: Thu, 29 Aug 2019 22:33:05 -0600 Subject: [PATCH] Fix some randomization options not firing due to short circuit in the randomiztion loop. Fix AI randomizer always choosing Charge AI. --- MassEffectRandomizer/Classes/Randomizer.cs | 25 ++++++++----------- .../Properties/AssemblyInfo.cs | 4 +-- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/MassEffectRandomizer/Classes/Randomizer.cs b/MassEffectRandomizer/Classes/Randomizer.cs index adf2ff4..392e143 100644 --- a/MassEffectRandomizer/Classes/Randomizer.cs +++ b/MassEffectRandomizer/Classes/Randomizer.cs @@ -500,7 +500,7 @@ private void PerformRandomization(object sender, DoWorkEventArgs e) if (mainWindow.RANDSETTING_CHARACTER_ICONICFACE && export.ClassName == "BioMorphFace" && export.ObjectName.StartsWith("Player_")) { - Log.Information("Randomizing iconic female shepard face by "+ mainWindow.RANDSETTING_CHARACTER_ICONICFACE_AMOUNT); + Log.Information("Randomizing iconic female shepard face by " + mainWindow.RANDSETTING_CHARACTER_ICONICFACE_AMOUNT); RandomizeBioMorphFace(export, random, mainWindow.RANDSETTING_CHARACTER_ICONICFACE_AMOUNT); } } @@ -652,15 +652,15 @@ private void PerformRandomization(object sender, DoWorkEventArgs e) } } } - else if (mainWindow.RANDSETTING_MISC_STARCOLORS) + else if ((exp.ClassName == "BioSunFlareComponent" || exp.ClassName == "BioSunFlareStreakComponent" || exp.ClassName == "BioSunActor") && mainWindow.RANDSETTING_MISC_STARCOLORS) { + if (!loggedFilename) + { + Log.Information("Randomizing map file: " + files[i]); + loggedFilename = true; + } if (exp.ClassName == "BioSunFlareComponent" || exp.ClassName == "BioSunFlareStreakComponent") { - if (!loggedFilename) - { - Log.Information("Randomizing map file: " + files[i]); - loggedFilename = true; - } var tint = exp.GetProperty("FlareTint"); if (tint != null) { @@ -670,11 +670,6 @@ private void PerformRandomization(object sender, DoWorkEventArgs e) } else if (exp.ClassName == "BioSunActor") { - if (!loggedFilename) - { - Log.Information("Randomizing map file: " + files[i]); - loggedFilename = true; - } var tint = exp.GetProperty("SunTint"); if (tint != null) { @@ -2719,9 +2714,9 @@ private void MakeTextPossiblyScottish(List Tlks, Random random, bool u scottishVowelOrdering = new List(new char[] { 'a', 'e', 'i', 'o', 'u' }); scottishVowelOrdering.Shuffle(random); upperScottishVowelOrdering = new List(); - foreach(var c in scottishVowelOrdering) + foreach (var c in scottishVowelOrdering) { - upperScottishVowelOrdering.Add(char.ToUpper(c,CultureInfo.InvariantCulture)); + upperScottishVowelOrdering.Add(char.ToUpper(c, CultureInfo.InvariantCulture)); } } @@ -4615,7 +4610,7 @@ private void RandomizeMusic(IExportEntry export, Random random, string randomizi private void RandomizeAINames(ME1Package pacakge, Random random) { - bool forcedCharge = random.Next(1) == 0; + bool forcedCharge = random.Next(8) == 0; for (int i = 0; i < pacakge.NameCount; i++) { NameReference n = pacakge.getNameEntry(i); diff --git a/MassEffectRandomizer/Properties/AssemblyInfo.cs b/MassEffectRandomizer/Properties/AssemblyInfo.cs index 210fb30..2bac995 100644 --- a/MassEffectRandomizer/Properties/AssemblyInfo.cs +++ b/MassEffectRandomizer/Properties/AssemblyInfo.cs @@ -14,7 +14,7 @@ [assembly: AssemblyCulture("")] // Version informationr( -[assembly: AssemblyVersion("1.0.0.999")] -[assembly: AssemblyFileVersion("1.0.0.999")] +[assembly: AssemblyVersion("1.0.1.1002")] +[assembly: AssemblyFileVersion("1.0.1.1002")] [assembly: NeutralResourcesLanguageAttribute( "en-US" )]