static void RANDOMIZE_ENEMY_ATTACK_SPEEDS(string inputSeed) { MOD_PATH = GetGameDir(); if (MOD_PATH == null) { Console.WriteLine("No EXE selected. Cancelling attack speed randomization."); return; } Random random; random = inputSeed == "" ? new Random() : new Random(inputSeed.GetHashCode()); SoulsMod mod = new SoulsMod(MOD_PATH, ".rsbak"); mod.LoadNonPlayerCharacters(); EnemyAnimationGenerator animSetup = new EnemyAnimationGenerator(mod, random); #if DEBUG Console.WriteLine("Running animation setup..."); #else Console.WriteLine("Stepping into time vortex..."); #endif animSetup.AddSpeedEffects(noParamEdit: true); // just registers effect IDs in setup animSetup.AddAttackDamageEffects(noParamEdit: true); // just registers effect IDs in setup animSetup.RandomizeAllEnemySpeeds(); mod.InstallAnimations(skipPlayer: true); Thread.CurrentThread.Join(0); Console.WriteLine("\nEnemy attack speeds randomized successfully! Press ENTER to return to the prompt."); Console.ReadLine(); }
static void INSTALL(string inputSeed, bool skipAnimRandomizer = false) { Random random; if (inputSeed == "") { random = new Random(); } else { random = new Random(inputSeed.GetHashCode()); } if (MOD_PATH == null) { MOD_PATH = AskForDir(); } else { Console.WriteLine("\nUse previously-specified game directory? (Y/N)"); bool yes = ReadKey(ConsoleKey.Y, ConsoleKey.N) == ConsoleKey.Y; if (!yes) { MOD_PATH = AskForDir(); } } if (MOD_PATH == null) { Console.WriteLine("No EXE selected. Cancelling installation."); return; } DateTime startTime = DateTime.Now; Console.WriteLine("\nBeginning installation... This will take about one minute."); Console.WriteLine("\n" + SoyPuns.PopRandomElement(random) + "\n"); SoulsMod mod = new SoulsMod( MOD_PATH, ".smbak", Resources.GameData.GameParam_parambnd, Resources.GameData.paramdef_paramdefbnd, Resources.GameData.item_msgbnd, Resources.GameData.menu_msgbnd); mod.LoadPlayerCharacter(); mod.LoadNonPlayerCharacters(); InstallInterrootFolder("event", mod); InstallInterrootFolder("map", mod); InstallInterrootFolder("script", mod); InstallInterrootFolder("sfx", mod); InstallInterrootFolder("sound", mod); PlayerGenerator playerSetup = new PlayerGenerator(mod); #if DEBUG Console.WriteLine("Running player setup..."); #endif playerSetup.Install(); Thread.CurrentThread.Join(0); TextGenerator textSetup = new TextGenerator(mod); #if DEBUG Console.WriteLine("Running text setup..."); #endif textSetup.Install(); Thread.CurrentThread.Join(0); SpEffectGenerator spEffectSetup = new SpEffectGenerator(mod); #if DEBUG Console.WriteLine("Running SpEffect setup..."); #endif spEffectSetup.Install(); Thread.CurrentThread.Join(0); GoodsGenerator goodsSetup = new GoodsGenerator(mod); #if DEBUG Console.WriteLine("Running goods setup..."); #endif goodsSetup.Install(); Thread.CurrentThread.Join(0); SpellGenerator spellSetup = new SpellGenerator(mod, random); #if DEBUG Console.WriteLine("Running spell setup..."); #endif spellSetup.Install(); Thread.CurrentThread.Join(0); WeaponGenerator weaponSetup = new WeaponGenerator(mod, random); #if DEBUG Console.WriteLine("Running weapon setup..."); #endif weaponSetup.Install(); Thread.CurrentThread.Join(0); ArmorGenerator armorSetup = new ArmorGenerator(mod, random); #if DEBUG Console.WriteLine("Running armor setup..."); #endif armorSetup.Install(); Thread.CurrentThread.Join(0); EnemyGenerator enemySetup = new EnemyGenerator(mod, random, weaponSetup, armorSetup); #if DEBUG Console.WriteLine("Running enemy setup..."); #endif enemySetup.Install(); Thread.CurrentThread.Join(0); MapItemLotsGenerator itemLotsSetup = new MapItemLotsGenerator(mod, weaponSetup, armorSetup, random); #if DEBUG Console.WriteLine("Running item lot setup..."); #endif itemLotsSetup.Install(); Thread.CurrentThread.Join(0); EnemyAnimationGenerator animSetup = new EnemyAnimationGenerator(mod, random); #if DEBUG Console.WriteLine("Running animation setup..."); #endif animSetup.Install(skipAnimRandomizer); Thread.CurrentThread.Join(0); // Must be run AFTER weapon/armor setup. CharacterGenerator chrSetup = new CharacterGenerator(mod, random); #if DEBUG Console.WriteLine("Running chr setup..."); #endif chrSetup.Install(); Thread.CurrentThread.Join(0); Console.WriteLine(SoyPuns.PopRandomElement(random) + "\n"); #if DEBUG Console.WriteLine("Installing mod..."); #endif mod.Install(); Thread.CurrentThread.Join(0); #if DEBUG Console.WriteLine($"Installation time: {(DateTime.Now - startTime).TotalSeconds}"); #endif }
static void INSTALL(string inputSeed) { Random random; random = inputSeed == "" ? new Random() : new Random(inputSeed.GetHashCode()); MOD_PATH = GetGameDir(); if (MOD_PATH == null) { Console.WriteLine("No EXE selected. Cancelling installation."); return; } DateTime startTime = DateTime.Now; Console.WriteLine("\nBeginning installation... This will take about one minute."); Console.WriteLine("\n" + SoyPuns.PopRandomElement(random) + "\n"); SoulsMod mod = new SoulsMod( MOD_PATH, ".rsbak", Resources.GameData.GameParam_parambnd, Resources.GameData.paramdef_paramdefbnd, Resources.GameData.item_msgbnd, Resources.GameData.menu_msgbnd); mod.LoadPlayerCharacter(); mod.LoadNonPlayerCharacters(); InstallInterrootFolder("event", mod); InstallInterrootFolder("map", mod); InstallInterrootFolder("script", mod); InstallInterrootFolder("sfx", mod); InstallInterrootFolder("sound", mod); TextGenerator textSetup = new TextGenerator(mod); #if DEBUG Console.WriteLine("Running text setup..."); #else Console.WriteLine("Studying the ancient texts..."); #endif textSetup.Install(); Thread.CurrentThread.Join(0); PlayerGenerator playerSetup = new PlayerGenerator(mod); #if DEBUG Console.WriteLine("Running player setup..."); #else Console.WriteLine("Putting the party together..."); #endif playerSetup.Install(); Thread.CurrentThread.Join(0); SpEffectGenerator spEffectSetup = new SpEffectGenerator(mod); #if DEBUG Console.WriteLine("Running SpEffect setup..."); #else Console.WriteLine("Channeling the powers that be..."); #endif spEffectSetup.Install(); Thread.CurrentThread.Join(0); GoodsGenerator goodsSetup = new GoodsGenerator(mod); #if DEBUG Console.WriteLine("Running goods setup..."); #else Console.WriteLine("Documenting the artifacts..."); #endif goodsSetup.Install(); Thread.CurrentThread.Join(0); SpellGenerator spellSetup = new SpellGenerator(mod, random); #if DEBUG Console.WriteLine("Running spell setup..."); #else Console.WriteLine("Messing with forces beyond our control..."); #endif spellSetup.Install(); Thread.CurrentThread.Join(0); WeaponGenerator weaponSetup = new WeaponGenerator(mod, random); #if DEBUG Console.WriteLine("Running weapon setup..."); #else Console.WriteLine("Spinning up the whetstone..."); #endif #if SKIP_BEHAVIORS Console.WriteLine("WARNING: Skipping weapon behaviors/attacks!"); weaponSetup.SkipBehaviors = true; #endif weaponSetup.Install(); Thread.CurrentThread.Join(0); ArmorGenerator armorSetup = new ArmorGenerator(mod, random); #if DEBUG Console.WriteLine("Running armor setup..."); #else Console.WriteLine("Polishing the armor..."); #endif armorSetup.Install(); Thread.CurrentThread.Join(0); EnemyGenerator enemySetup = new EnemyGenerator(mod, random, weaponSetup, armorSetup); #if DEBUG Console.WriteLine("Running enemy setup..."); #else Console.WriteLine("Opening the bestiary..."); #endif enemySetup.Install(); Thread.CurrentThread.Join(0); EnemyAnimationGenerator animSetup = new EnemyAnimationGenerator(mod, random); #if DEBUG Console.WriteLine("Modifying enemy animations..."); #else Console.WriteLine("Rousing the rabble..."); #endif animSetup.Install(); Thread.CurrentThread.Join(0); MapItemLotsGenerator itemLotsSetup = new MapItemLotsGenerator(mod, weaponSetup, armorSetup, random); #if DEBUG Console.WriteLine("Running item lot setup..."); #else Console.WriteLine("Burying the treasures..."); #endif itemLotsSetup.Install(); Thread.CurrentThread.Join(0); // Must be run AFTER weapon/armor setup. CharacterGenerator chrSetup = new CharacterGenerator(mod, random); #if DEBUG Console.WriteLine("Running character setup..."); #else Console.WriteLine("Assembling the party..."); #endif chrSetup.Install(); Thread.CurrentThread.Join(0); #if DEBUG Console.WriteLine("Installing mod..."); #else Console.WriteLine("Heading forth..."); #endif mod.Install(); Thread.CurrentThread.Join(0); Console.WriteLine("\nInstallation successful! Press ENTER to return to the prompt."); #if DEBUG Console.WriteLine($"Installation time: {(DateTime.Now - startTime).TotalSeconds} seconds"); #endif Console.ReadLine(); }