Пример #1
0
        public bool MarkAutoSelectItems()
        {
            bool ItemStateChanged = false;

            foreach (var CheckedObject in AutoSelect)
            {
                if (CheckedObject.ID < -1)
                {
                    continue;
                }
                if (CheckedObject.RandomizedItem > -2)
                {
                    CheckedObject.RandomizedItem = -2;
                    ItemStateChanged             = true;
                    continue;
                }
                if (CheckedObject.SpoilerRandom > -2)
                {
                    CheckedObject.RandomizedItem = CheckedObject.SpoilerRandom;
                    ItemStateChanged             = true;
                    continue;
                }
                if (CheckedObject.RandomizedState() == 2)
                {
                    CheckedObject.RandomizedItem = CheckedObject.ID;
                    ItemStateChanged             = true;
                    continue;
                }
            }
            return(ItemStateChanged);
        }
Пример #2
0
        //Automatic Checks

        public bool CheckAutoSelectItems()
        {
            bool ItemStateChanged = false;

            foreach (var CheckedObject in AutoSelect)
            {
                //Check if the items checked status has been changed, most likely by CheckEntrancePair.
                if (ActionDic.ContainsKey(CheckedObject.ID) && ActionDic[CheckedObject.ID] != CheckedObject.Checked && CheckedObject.IsEntrance())
                {
                    continue;
                }
                if (CheckedObject.ID < -1)
                {
                    continue;
                }
                if (CheckedObject.Checked && CheckedObject.RandomizedItem > -2)
                {
                    if (Instance.ItemInRange(CheckedObject.RandomizedItem) && !Tools.SameItemMultipleChecks(CheckedObject.RandomizedItem, Instance) && CheckedObject.ItemBelongsToMe())
                    {
                        Instance.Logic[CheckedObject.RandomizedItem].Aquired = false;
                        LogicEditing.CheckEntrancePair(CheckedObject, Instance, false);
                    }
                    CheckedObject.Checked = false;
                    if (!KeepChecked)
                    {
                        CheckedObject.RandomizedItem = -2;
                    }
                    ItemStateChanged = true;
                    continue;
                }
                if (CheckedObject.SpoilerRandom > -2 || CheckedObject.RandomizedItem > -2 || CheckedObject.RandomizedState() == 2)
                {
                    CheckedObject.Checked = true;
                    if (CheckedObject.RandomizedState() == 2)
                    {
                        CheckedObject.RandomizedItem = CheckedObject.ID;
                    }
                    if (CheckedObject.SpoilerRandom > -2)
                    {
                        CheckedObject.RandomizedItem = CheckedObject.SpoilerRandom;
                    }
                    if (CheckedObject.RandomizedItem < 0)
                    {
                        CheckedObject.RandomizedItem = -1;
                        ItemStateChanged             = true;
                        continue;
                    }
                    if (CheckedObject.ItemBelongsToMe())
                    {
                        Instance.Logic[CheckedObject.RandomizedItem].Aquired = true;
                    }
                    Instance.Logic[CheckedObject.RandomizedItem].PlayerData.ItemCameFromPlayer = FromNetPlayer;
                    LogicEditing.CheckEntrancePair(CheckedObject, Instance, true);
                    ItemStateChanged = true;
                    continue;
                }
            }
            return(ItemStateChanged);
        }