Example #1
0
        private IEnumerator DungeonGenerator2_GenerateDungeonCoroutine(On.DungeonGenerator2.orig_GenerateDungeonCoroutine orig, DungeonGenerator2 self, int level, Amplitude.StaticString shipName)
        {
            SeedData seeds = TASInput.seeds.GetSeedForShipLevel(shipName, level);

            if (seeds != null)
            {
                // Then we need to set the seed accordingly!
                seeds.SetSeedData();
                mod.Log("Set seed to: " + seeds + " for level: " + level);
            }
            else
            {
                // Add the seed!
                SeedData data = new SeedData();
                mod.Log("Creating new SeedData for level: " + level + " with data: " + data);
                TASInput.AddSeed(level, data);
            }
            yield return(orig(self, level, shipName));
        }
Example #2
0
        public static void ReadTAS(string path)
        {
            string[] lines = System.IO.File.ReadAllLines(path);
            int      level = -1;

            foreach (string s in lines)
            {
                if (s.StartsWith("#"))
                {
                    continue;
                }
                if (s.StartsWith(":"))
                {
                    string[] spl = s.Split(':');
                    level = Convert.ToInt32(spl[1]);
                    TASInput.AddSeed(level, new SeedData(spl[2]));
                    continue;
                }
                TASInput i = new TASInput(level, s);
            }
        }