예제 #1
0
        public async Task SpawnMon([Remainder] string str)
        {
            ContextIds  idList = new ContextIds(Context);
            UserAccount user   = UserHandler.GetUser(idList.UserId);

            //Tests each case to make sure all circumstances for the execution of this command are valid (character exists, in correct location)
            try
            {
                await UserHandler.CharacterExists(idList);

                await UserHandler.ValidCharacterLocation(idList);
            }
            catch (InvalidCharacterStateException)
            {
                return;
            }

            if (!user.Char.IsPartyFull())
            {
                BasicMon mon = MonRegister.StringToMonRegister(str);
                mon.CatcherID = user.UserId;
                mon.OwnerID   = user.UserId;
                user.Char.Party.Add(mon);
                await MessageHandler.SendMessage(idList, $"{mon.Nickname} has been added to your party.");
            }
            else
            {
                await MessageHandler.SendMessage(idList, "Your party is full!");
            }
        }
예제 #2
0
        public async Task QuickDuel(string mon, string mon2, SocketGuildUser target)
        {
            var        fromUser = UserHandler.GetUser(Context.User.Id);
            var        toUser   = UserHandler.GetUser(target.Id);
            ContextIds ids      = new ContextIds(Context);

            fromUser.Char = new Character(true);
            fromUser.Char.CurrentGuildId   = ids.GuildId;
            fromUser.Char.CurrentGuildName = Context.Guild.Name;
            fromUser.Char.Name             = fromUser.Name;
            mon = mon.ToLower();
            BasicMon m = MonRegister.StringToMonRegister(mon);

            m.CatcherID = fromUser.UserId;
            m.OwnerID   = fromUser.UserId;
            fromUser.Char.Party.Add(m);
            fromUser.HasCharacter = true;
            await MessageHandler.SendMessage(ids, $"{fromUser.Mention}, you have chosen {m.Nickname} as your partner! Good luck on your adventure.");

            fromUser.PromptState = -1;

            toUser.Char = new Character(true);
            toUser.Char.CurrentGuildId   = ids.GuildId;
            toUser.Char.CurrentGuildName = target.Guild.Name;
            toUser.Char.Name             = toUser.Name;
            mon2 = mon2.ToLower();
            BasicMon m2 = MonRegister.StringToMonRegister(mon2);

            m2.CatcherID = toUser.UserId;
            m2.OwnerID   = toUser.UserId;
            toUser.Char.Party.Add(m2);
            toUser.HasCharacter = true;
            await MessageHandler.SendMessage(ids, $"{toUser.Mention}, you have chosen {m2.Nickname} as your partner! Good luck on your adventure.");

            toUser.PromptState = -1;

            CombatInstance2 combat = new CombatInstance2(ids, fromUser, toUser);

            CombatHandler2.StoreInstance(CombatHandler2.NumberOfInstances(), combat);
            await combat.StartCombat();
        }
예제 #3
0
        public async Task QuickStart([Remainder] string text)
        {
            ContextIds ids  = new ContextIds(Context);
            var        user = UserHandler.GetUser(ids.UserId);

            user.Char = new Character(true);
            user.Char.CurrentGuildId   = ids.GuildId;
            user.Char.CurrentGuildName = Context.Guild.Name;
            user.Char.Name             = user.Name;

            text = text.ToLower();

            BasicMon mon = MonRegister.StringToMonRegister(text);

            mon.CatcherID = user.UserId;
            mon.OwnerID   = user.UserId;
            user.Char.Party.Add(mon);
            user.HasCharacter = true;
            await MessageHandler.SendMessage(ids, $"{user.Mention}, you have chosen {mon.Nickname} as your partner! Good luck on your adventure.");

            user.PromptState = -1;
        }