Beispiel #1
0
        public static void GiveSpecial(FileSource fieldSource, int encounterID, Reward reward)
        {
            var args = reward.Name == "angel wing" ? new int[] { 1 } : Array.Empty <int>();

            GiveFieldReward(fieldSource, encounterID, reward.ID, args, reward.Name + " unlocked!");
        }
Beispiel #2
0
        // update multiple files on 2nd pass
        private static void FinalOps(int seed, string seedString, SpoilerFile spoilerFile, State settings)
        {
            Debug.WriteLine("final ops start");
            while (true)
            {
                try
                {
                    // weapon shuffle
                    if (settings.UpgradeEnable)
                    {
                        var mainSource = new FileSource(Globals.MainPath);
                        var menuSource = new FileSource(Globals.MenuPath);

                        var shuffle = WeaponShuffle.Randomise(seed, settings);
                        if (settings.SpoilerFile)
                        {
                            spoilerFile.AddWeapons(mainSource, shuffle);
                        }
                        WeaponShuffle.Apply(menuSource, shuffle);

                        menuSource.Encode();
                    }

                    // free roam rewards
                    if (settings.FreeRoam || settings.BossEnable)
                    {
                        var battleSource = new FileSource(Globals.BattlePath);
                        var fieldSource  = new FileSource(Globals.FieldPath);

                        if (settings.FreeRoam)
                        {
                            Reward.SetRewards(battleSource, fieldSource, seed);
                        }
                        if (settings.BossEnable)
                        {
                            Boss.ApplyEdeaFix(battleSource, fieldSource);
                        }

                        battleSource.Encode();
                        fieldSource.Encode();
                    }
                    break;
                }
                catch (Exception x)
                {
                    if (x is IOException || x is UnauthorizedAccessException || x is FileNotFoundException)
                    {
                        if (HandleFileException(Globals.BattlePath) == false)
                        {
                            break;
                        }
                    }
                    else
                    {
                        throw;
                    }
                }
            }

            // save spoiler file
            if (settings.SpoilerFile)
            {
                // strip illegal chars from filename

                File.WriteAllText("spoilers." + SanitizeFileName(seedString) + ".txt", spoilerFile.ToString());
            }
            Debug.WriteLine("final ops end");
        }
Beispiel #3
0
 public static void GiveCharacter(FileSource fieldSource, int encounterID, Reward reward)
 {
     GiveFieldReward(fieldSource, encounterID, Field.FieldScript.OpCodesReverse["addmember"], new int[] { reward.ID }, reward.Name + " joined the party!");
 }