コード例 #1
0
ファイル: UI.cs プロジェクト: Eivlisskiv/Discord_Zihativa
        public async Task ChooseRace(SocketReaction reaction, IUserMessage msg)
        {
            bool selected = true;

            switch (reaction.Emote.ToString())
            {
            case "🇭":
            {
                player.race = ReferenceData.HumanoidRaces.Human;
                player.perks.Add(PerkLoad.Load("Human Adaptation"));
            }
            break;

            case "🇹":
            {
                player.race = ReferenceData.HumanoidRaces.Tsiun;
                player.perks.Add(PerkLoad.Load("Tsiun Trickery"));
            }
            break;

            case "🇺":
            {
                player.race = ReferenceData.HumanoidRaces.Uskavian;
                player.perks.Add(PerkLoad.Load("Uskavian Learning"));
            }
            break;

            case "🇲":
            {
                player.race = ReferenceData.HumanoidRaces.Miganan;
                player.perks.Add(PerkLoad.Load("Migana Skin"));
            }
            break;

            case "🇮":
            {
                player.race = ReferenceData.HumanoidRaces.Ireskian;
                player.perks.Add(PerkLoad.Load("Ireskian Talent"));
            }
            break;

            default: selected = false; break;
            }
            if (selected)
            {
                player.SaveFileMongo();
                await TryMSGDel(msg);

                await CharacterCommands.StarterAbilities(player, reaction.Channel, 0);
            }
        }
コード例 #2
0
ファイル: UI.cs プロジェクト: Eivlisskiv/Discord_Zihativa
        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);
            }
        }
コード例 #3
0
        internal static async Task <bool> SpecialExceptions(NeitsilliaError error, IMessageChannel chan, Player player)
        {
            switch (error.ErrorType)
            {
            case NeitsilliaErrorType.ReplyError:
                await chan.SendMessageAsync(error.ExtraMessage);

                return(true);

            case NeitsilliaErrorType.ReplyUI:
            {
                await chan.SendMessageAsync(error.ExtraMessage);

                switch (error.uitype)
                {
                case MsgType.CardGame:
                {
                    Type type = Neitsillia.Gambling.Games.GamblingGame.GetGameType(player.ui.data);
                    Neitsillia.Gambling.Games.IGamblingGame game = Neitsillia.Gambling.Games.GamblingGame.CreateInstance(type, player);
                    var embed = ((Neitsillia.Gambling.Games.GamblingGame)game).GetEmbed(player).Build();
                    await player.NewUI(null, embed, await player.DMChannel(), player.ui.type, player.ui.data);
                }
                break;
                }
                return(true);
            }

            case NeitsilliaErrorType.CharacterIsNotSetUp:
                if (player != null)
                {
                    if (player.ui.type == MsgType.AutoNewCharacter)
                    {
                        await CharacterCommands.AutoCharacter(player, chan, true);
                    }
                    else if (player.ui.type == MsgType.SetSkill ||
                             player.ui.type == MsgType.ConfirmSkills)
                    {
                        string[] arrays = player.ui.data.Split(';');
                        await CharacterCommands.SetSkills(player, chan, 0, Utils.JSON <int[]>(arrays[0]), Utils.JSON <bool[]>(arrays[1]));
                    }
                    else if (!await CharacterCommands.Set_Race(chan, player))
                    {
                        await CharacterCommands.StarterAbilities(player, chan, 1);
                    }
                    return(true);
                }
                return(false);

            case NeitsilliaErrorType.CharacterAdventuring:
                if (player != null)
                {
                    await Areas.AdventureStat(player, chan);

                    return(true);
                }
                return(false);

            case NeitsilliaErrorType.CharacterIsResting:
                if (player != null)
                {
                    await Areas.RestStat(player, chan);

                    return(true);
                }
                return(false);

            default: return(false);
            }
        }