Ejemplo n.º 1
0
 public AutoSplit(AutoSplit other)
 {
     Name       = other.Name;
     Type       = other.Type;
     Value      = other.Value;
     Difficulty = other.Difficulty;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Automatically fill in sequential quests such as Andariel to Duriel.
        /// Also handles difficulty levels.
        /// </summary>
        /// <param name="previous">The previous autosplit in the list. May be null.</param>
        /// <returns>A sequenced auto split.</returns>
        public AutoSplit CreateSequential(AutoSplit previous)
        {
            if (previous == null)
            {
                return(new AutoSplit("Game Start", AutoSplit.SplitType.Special, (short)AutoSplit.Special.GameStart, 0));
            }

            // Follow up with Andariel after game start.
            if (previous.Type == AutoSplit.SplitType.Special && previous.Value == (int)AutoSplit.Special.GameStart)
            {
                return(CreateForQuest(QuestId.Andariel, 0));
            }

            // Sequence bosses.
            if (previous.Type == AutoSplit.SplitType.Quest)
            {
                short   difficulty = previous.Difficulty;
                QuestId quest;

                switch ((QuestId)previous.Value)
                {
                case QuestId.DenOfEvil:
                    quest = QuestId.Andariel; break;

                case QuestId.Andariel:
                    quest = QuestId.Duriel; break;

                case QuestId.Duriel:
                    quest = QuestId.Mephisto; break;

                case QuestId.Mephisto:
                    quest = QuestId.Diablo; break;

                case QuestId.Diablo:
                    quest = QuestId.Baal; break;

                case QuestId.Baal:
                    // If we reached the last quest in hell, return an auto split with
                    // the default values.
                    if (++difficulty > 2)
                    {
                        return(CreateDefault());
                    }
                    quest = QuestId.Andariel;
                    break;

                // Unsequenced quest.
                default: return(CreateDefault());
                }

                return(CreateForQuest(quest, (GameDifficulty)difficulty));
            }

            return(CreateDefault());
        }