Пример #1
0
        internal static async Task AutoCharacter(Player player, IMessageChannel channel, bool ask)
        {
            if (ask)
            {
                EmbedBuilder em = DUtils.BuildEmbed("Character Creation",
                                                    $"{EUI.ok} - Randomize {Environment.NewLine} {EUI.next} - Manual (Advanced)"
                                                    + Environment.NewLine + Environment.NewLine + $"{EUI.info} - More Info", null, default);
                await player.NewUI(null, em.Build(), channel, MsgType.AutoNewCharacter);
            }
            else
            {
                int[] rolls = GetRolls();
                var   s     = player.stats;
                s.endurance    = rolls[0];
                s.intelligence = rolls[1];
                s.strength     = rolls[2];
                s.charisma     = rolls[3];
                s.dexterity    = rolls[4];
                s.perception   = rolls[5];
                //
                player.abilities.Add(Ability.Load("Strike"));
                player.abilities.Add(Ability.Load("Shelter"));
                //
                player.race = Utils.RandomElement <ReferenceData.HumanoidRaces>();
                switch (player.race)
                {
                case ReferenceData.HumanoidRaces.Human:
                    player.perks.Add(PerkLoad.Load("Human Adaptation"));
                    break;

                case ReferenceData.HumanoidRaces.Tsiun:
                    player.perks.Add(PerkLoad.Load("Tsiun Trickery"));
                    break;

                case ReferenceData.HumanoidRaces.Uskavian:
                    player.perks.Add(PerkLoad.Load("Uskavian Learning"));
                    break;

                case ReferenceData.HumanoidRaces.Miganan:
                    player.perks.Add(PerkLoad.Load("Migana Skin"));
                    break;

                case ReferenceData.HumanoidRaces.Ireskian:
                    player.perks.Add(PerkLoad.Load("Ireskian Talent"));
                    break;
                }
                //
                player.level   = 0;
                player.health  = player.Health();
                player.stamina = player.Stamina();
                player.SaveFileMongo();
                await GameCommands.StatsDisplay(player, channel);

                await channel.SendMessageAsync("Welcome to Neitsillia, Traveler. To guide you, you've been given the \"Tutorial\" Quest line."
                                               + Environment.NewLine + "Use the `Quest` command to view your quest list and inspect the quest using the assigned emote. Follow the Tutorial quest to learn to play.");
            }
        }
Пример #2
0
        public async Task Adventure(SocketReaction reaction, IUserMessage msg)
        {
            string e = reaction.Emote.ToString();
            int    i = EUI.GetNum(e);

            if (i > -1)
            {
                if (data[0] == 'Q') //Select a quest
                {
                    await Adventures.Adventure.SelectIntensity(player, reaction.Channel, i);
                }
                else //Select difficulty
                {
                    int.TryParse(data, out int quest);
                    await Adventures.Adventure.StartAdventure(player, Channel,
                                                              ((Adventures.Adventure.Intensity[])Enum.GetValues(typeof(Adventures.Adventure.Intensity)))[i - 1],
                                                              quest > 0?Adventures.Adventure.currentQuests[quest - 1] : null);
                }
                return;
            }
            switch (e)
            {
            case EUI.ok:
                await Adventures.Adventure.SelectIntensity(player, reaction.Channel, 0);

                break;

            case EUI.sideQuest:
                await Adventures.Adventure.SelectQuest(player, reaction.Channel);

                break;

            case EUI.cycle:
                await player.Adventure.Display(player, reaction.Channel, true);

                break;

            case EUI.cancel:
                if (player.IsInAdventure)
                {
                    await player.Adventure.End(player, reaction.Channel, true);
                }
                else
                {
                    await GameCommands.StatsDisplay(player, reaction.Channel);
                }
                break;
            }
        }
Пример #3
0
        public async Task StarterAbilities(SocketReaction reaction, IUserMessage msg)
        {
            string[] split = data.Split('/');
            int      p     = int.Parse(split[0]);
            int      x     = int.Parse(split[1]);
            int      z     = int.Parse(split[2]);
            int      index = GetNum(reaction.Emote.ToString());

            if (index > -1)
            {
                Ability a = Ability.Load(LoadAbility.Starters[p, index]);
                if (player.abilities.Count < 3)
                {
                    player.abilities.Add(a);
                }
                if (x > -1)
                {
                    string prefix = CommandHandler.GetPrefix(reaction.Channel);
                    player.level = 0;
                    await EditMessage("Character creation completed");

                    await GameCommands.StatsDisplay(player, reaction.Channel);

                    await reaction.Channel.SendMessageAsync("Welcome to Neitsillia, Traveler. To guide you, you've been given the \"Tutorial\" Quest line."
                                                            + Environment.NewLine + "Use the `Quest` command to view your quest list and inspect the quest using the assigned emote. Follow the Tutorial quest to learn to play.");
                }
                else
                {
                    await CharacterCommands.StarterAbilities(player, reaction.Channel, p);
                }
                player.SaveFileMongo();
            }
            else if (reaction.Emote.ToString() == next)
            {
                await CharacterCommands.StarterAbilities(player, reaction.Channel, p + 1, x, z);
            }
            else if (reaction.Emote.ToString() == prev)
            {
                await CharacterCommands.StarterAbilities(player, reaction.Channel, p - 1, x, z);
            }
        }