Ejemplo n.º 1
0
        public async Task CheckCard(SocketGuildUser target)
        {
            ContextIds idList = new ContextIds(Context);
            var        user   = UserHandler.GetUser(idList.UserId);
            var        other  = UserHandler.GetUser(target.Id);

            try
            {
                await UserHandler.OtherUserHasNoCards(idList, user, other);
            }
            catch (InvalidUserStateException)
            {
                return;
            }

            if (other.CombatID == -1)
            {
                foreach (BasicCard card in other.ActiveCards)
                {
                    await MessageHandler.SendEmbedMessage(idList, "", OsirisEmbedBuilder.CardList(card));
                }
            }
            else
            {
                foreach (BasicCard card in other.ActiveCards)
                {
                    await MessageHandler.SendEmbedMessage(idList, "", OsirisEmbedBuilder.PlayerTurnStatus(card, CombatHandler.GetInstance(user.CombatID).RoundNumber));
                }
            }
        }
Ejemplo n.º 2
0
        public async Task ListCards()
        {
            ContextIds idList = new ContextIds(Context);
            var        user   = UserHandler.GetUser(idList.UserId);

            foreach (BasicCard card in user.ActiveCards)
            {
                await MessageHandler.SendEmbedMessage(idList, "", OsirisEmbedBuilder.CardList(card));
            }
        }
Ejemplo n.º 3
0
        public async Task Blind(SocketGuildChannel channel)
        {
            ContextIds idList = new ContextIds(Context);
            var        user   = UserHandler.GetUser(idList.UserId);

            idList.ChannelId = channel.Id;

            for (int i = 0; i < 10; i++)
            {
                await MessageHandler.SendEmbedMessage(idList, "", OsirisEmbedBuilder.Blinder());
            }
        }
Ejemplo n.º 4
0
        public async Task CheckCardInfo([Remainder] string str)
        {
            ContextIds idList = new ContextIds(Context);
            var        user   = UserHandler.GetUser(idList.UserId);

            var card = CardRegistration.RegisterCard(str);

            if (card.Hidden && !user.Celestial)
            {
                card = CardRegistration.RegisterCard("vrfamily");
            }

            await MessageHandler.SendEmbedMessage(idList, "", OsirisEmbedBuilder.CardList(card));
        }
Ejemplo n.º 5
0
        public async Task CheckCard()
        {
            ContextIds idList = new ContextIds(Context);
            var        user   = UserHandler.GetUser(idList.UserId);

            if (user.CombatID == -1)
            {
                foreach (BasicCard card in user.ActiveCards)
                {
                    await MessageHandler.SendEmbedMessage(idList, "", OsirisEmbedBuilder.CardList(card));
                }
            }
            else
            {
                foreach (BasicCard card in user.ActiveCards)
                {
                    await MessageHandler.SendEmbedMessage(idList, "", OsirisEmbedBuilder.PlayerTurnStatus(card, CombatHandler.GetInstance(user.CombatID).RoundNumber));
                }
            }
        }
Ejemplo n.º 6
0
        public async Task RoundUpdate()
        {
            ContextIds idList = new ContextIds(Context);
            var        user   = UserHandler.GetUser(Context.User.Id);

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

            var inst   = CombatHandler.GetInstance(user.CombatID);
            var embeds = OsirisEmbedBuilder.RoundStart(inst);

            for (int i = 0; i < embeds.Count; i++)
            {
                await MessageHandler.SendEmbedMessage(inst.Location, "", embeds[i]);
            }
        }