コード例 #1
0
        private void DoAdventure()
        {
            // TODO remove dungeon restriction when more is implemented
            if (_current == null || _currentAdventureType != AdventureType.Dungeon)
            {
                return;
            }
            var str    = $"{_mogwai.Name} be prepared to travel into a '{_currentAdventureType}' adventure, it might be '{_currentDifficultyType}' for you?";
            var dialog = new MogwaiDialog("Adventure", $"[c:g b:darkred:black:darkred:black:darkred:{str.Length}]" + str, 40, 8);

            dialog.AddButton("ok", true);
            dialog.Button.Click += (btn, args) =>
            {
                (Parent as PlayScreen)?.LogInConsole(
                    _controller.Interaction(new AdventureAction(_currentAdventureType, _currentDifficultyType,
                                                                _mogwai.CurrentLevel))
                        ? $"Successful sent mogwai to {_currentAdventureType}! Wait for interaction locks."
                        : $"Failed to send mogwai to {_currentAdventureType}!");
                dialog.Hide();
            };
            dialog.Show(true);
        }
コード例 #2
0
        private void DoInteraction(string actionStr)
        {
            switch (actionStr)
            {
            case "testroom":
                LogInConsole(
                    _controller.Interaction(new AdventureAction(AdventureType.TestRoom, DifficultyType.Average,
                                                                _mogwai.CurrentLevel))
                            ? "Successful sent mogwai to test room! Wait for interaction locks."
                            : "Failed to send mogwai to test room!");
                break;

            case "dungeon":
                LogInConsole(
                    _controller.Interaction(new AdventureAction(AdventureType.Dungeon, DifficultyType.Average,
                                                                _mogwai.CurrentLevel))
                            ? "Successful sent mogwai to dungeon! Wait for interaction locks."
                            : "Failed to send mogwai to test room!");
                break;

            case "levelclass":
                var dialog = new MogwaiOptionDialog("Leveling", "Currently up for leveling?", DoClassLevel, 40, 17);
                dialog.AddRadioButtons("levelingAction", new List <string[]> {
                    new[] { "Barbarian", "Barbarian" },
                    new[] { "Bard", "Bard" },
                    new[] { "Cleric", "Cleric" },
                    new[] { "Druid", "Druid" },
                    new[] { "Fighter", "Fighter" },
                    new[] { "Monk", "Monk" },
                    new[] { "Paladin", "Paladin" },
                    new[] { "Ranger", "Ranger" },
                    new[] { "Rogue", "Rogue" },
                    new[] { "Sorcerer", "Sorcerer" },
                    new[] { "Wizard", "Wizard" }
                });
                dialog.Show(true);
                break;

            case "heal":
                LogInConsole(
                    _controller.Interaction(new SpecialAction(SpecialType.Heal, SpecialSubType.None, CostType.Medium))
                            ? "Successful made prayer for divine healing! Wait for interaction locks."
                            : "Failed to pray for mogwai divine heal!");
                break;

            case "reviving":
                LogInConsole(
                    _controller.Interaction(new SpecialAction(SpecialType.Reviving, SpecialSubType.None, CostType.High))
                            ? "Successful made prayer for divine reviving! Wait for interaction locks."
                            : "Failed to pray for mogwai divine reviving!");
                break;

            default:
                var warning = new MogwaiDialog("NotImplemented", $"DoInteraction {actionStr}!", 40, 6);
                warning.AddButton("ok");
                warning.Button.Click += (btn, args) =>
                {
                    warning.Hide();
                };
                warning.Show(true);
                break;
            }
        }