Ejemplo n.º 1
0
        public static bool RandomizeWeapons(RandomizationOption option)
        {
            var me2rbioweapon = CoalescedHandler.GetIniFile("BIOWeapon.ini");

            // We must manually fetch game files cause MERFS will return the ini from the dlc mod instead.
            ME2Coalesced me2basegamecoalesced = new ME2Coalesced(MERFileSystem.GetSpecificFile(@"BioGame\Config\PC\Cooked\Coalesced.ini"));

            MERLog.Information("Randomizing basegame weapon ini");
            var bioweapon = me2basegamecoalesced.Inis.FirstOrDefault(x => Path.GetFileName(x.Key) == "BIOWeapon.ini").Value;

            RandomizeWeaponIni(bioweapon, me2rbioweapon);

            var weaponInis = Directory.GetFiles(MEDirectories.GetDLCPath(MERFileSystem.Game), "BIOWeapon.ini", SearchOption.AllDirectories).ToList();

            foreach (var wi in weaponInis)
            {
                if (wi.Contains($"DLC_MOD_{MERFileSystem.Game}Randomizer"))
                {
                    continue; // Skip randomizer folders
                }
                MERLog.Information($@"Randomizing weapon ini {wi}");
                //Log.Information("Randomizing weapons in ini: " + wi);
                var dlcWeapIni = DuplicatingIni.LoadIni(wi);
                RandomizeWeaponIni(dlcWeapIni, me2rbioweapon);
                //if (!MERFileSystem.UsingDLCModFS)
                //{
                //    Log.Information("Writing DLC BioWeapon: " + wi);
                //    File.WriteAllText(wi, dlcWeapIni.ToString());
                //}
            }

            return(true);
        }
Ejemplo n.º 2
0
        private static bool CompletelyRandomizeAudio()
        {
            var g2LocIntF = MERFileSystem.GetSpecificFile(@"BioGame\DLC\DLC_DHME1\CookedPC\BioD_ProNor_LOC_int.pcc");

            if (g2LocIntF != null && File.Exists(g2LocIntF))
            {
                var g2LocIntP = MEPackageHandler.OpenMEPackage(g2LocIntF);

                RandomizeAudio(g2LocIntP, 3317, true);
                RandomizeAudio(g2LocIntP, 3318, false);

                MERFileSystem.SavePackage(g2LocIntP);
            }
            return(false);
        }