Example #1
0
        public static string SetSOTName(LogicObjects.TrackerInstance Instance, LogicObjects.MapPoint stop)
        {
            var StartName = Instance.Logic[stop.CurrentExit].DictionaryName;
            var entName   = Instance.Logic[stop.EntranceToTake].DictionaryName;

            if (entName == "EntranceSouthClockTownFromClockTowerInterior")
            {
                if (StartName == "EntranceClockTowerInteriorFromBeforethePortaltoTermina" || StartName == "EntranceClockTowerInteriorFromSouthClockTown")
                {
                    return(Instance.Logic[stop.EntranceToTake].LocationName);
                }
                else
                {
                    return("Song of Time");
                }
            }
            return(Instance.Logic[stop.EntranceToTake].LocationName);;
        }
Example #2
0
        public static List <List <LogicObjects.MapPoint> > FindLogicalEntranceConnections(LogicObjects.TrackerInstance Instance, LogicObjects.LogicEntry startinglocation)
        {
            //Result[0] = A map of all available exit from each entrance, Result[1] = A map of all available entrances from each exit as long as the result of that entrance is known.
            var result = new List <List <LogicObjects.MapPoint> > {
                new List <LogicObjects.MapPoint>(), new List <LogicObjects.MapPoint>()
            };

            var logicTemplate = new LogicObjects.TrackerInstance
            {
                Logic   = Utility.CloneLogicList(Instance.Logic),
                Options = Instance.Options
            };

            UnmarkEntrances(logicTemplate.Logic);

            AddRequirementstoClocktower(logicTemplate);

            //Add all available owl warps as valid exits from our starting point.
            foreach (LogicObjects.LogicEntry OwlEntry in Instance.Logic.Where(x => x.IsWarpSong() && x.Available))
            {
                var newEntry = new LogicObjects.MapPoint
                {
                    CurrentExit    = startinglocation.ID,
                    EntranceToTake = OwlEntry.ID,
                    ResultingExit  = OwlEntry.RandomizedItem
                };
                result[0].Add(newEntry);
                if (newEntry.ResultingExit > -1)
                {
                    result[1].Add(newEntry);
                }
            }

            //For each entrance, mark it Aquired and check what entrances (and item locations if they are included) become avalable.
            foreach (LogicObjects.LogicEntry entry in Instance.Logic.Where(x => x.RandomizedItem > -1 && x.IsEntrance() && x.Checked))
            {
                var ExitToCheck = logicTemplate.Logic[entry.RandomizedItem];
                //There are no valid exits from majoras lair. Logic uses it to make sure innaccessable exits don't lock something needed to beat the game.
                if (ExitToCheck.DictionaryName == "EntranceMajorasLairFromTheMoon")
                {
                    continue;
                }
                ExitToCheck.Aquired = true;
                LogicEditing.CalculateItems(logicTemplate);
                foreach (var dummyEntry in logicTemplate.Logic.Where(x => EntranceConnectionValid(x, ExitToCheck, logicTemplate)))
                {
                    var newEntry = new LogicObjects.MapPoint
                    {
                        CurrentExit    = ExitToCheck.ID,
                        EntranceToTake = dummyEntry.ID,
                        ResultingExit  = dummyEntry.RandomizedItem
                    };
                    result[0].Add(newEntry);
                    if (newEntry.ResultingExit > -1)
                    {
                        result[1].Add(newEntry);
                    }
                }
                UnmarkEntrances(logicTemplate.Logic);
            }
            return(result);
        }