Ejemplo n.º 1
0
        public override void Run(BotMain bot, BotCommandController commandController, string[] rawTerms, string[] terms, string characterName, string channel, UserGeneratedCommand command)
        {
            string characterDrawName = commandController.GetCharacterDrawNameFromCommandTerms(characterName, terms);

            DeckType deckType = commandController.GetDeckTypeFromCommandTerms(terms);

            string customDeckName = Utils.GetCustomDeckName(characterName);
            string deckTypeString = Utils.GetDeckTypeStringHidePlaying(deckType, customDeckName);
            Hand   h = bot.DiceBot.GetHand(channel, deckType, characterDrawName);

            string displayName = characterDrawName;

            if (displayName.Contains(DiceBot.PlaySuffix))
            {
                displayName = displayName.Replace(DiceBot.PlaySuffix, "");
            }

            string outputString = "[i]" + deckTypeString + "Showing [user]" + displayName + "[/user]'s " + h.GetCollectionName() + ": [/i]" + h.ToString();

            if (characterDrawName == DiceBot.BurnCardsName)
            {
                outputString = "[i]" + deckTypeString + "Showing burned cards: [/i]" + h.ToString();
            }
            else if (characterDrawName == DiceBot.DealerName)
            {
                outputString = "[i]" + deckTypeString + "Showing the dealer's hand: [/i]" + h.ToString();
            }
            else if (characterDrawName == DiceBot.DiscardName)
            {
                outputString = "[i]" + deckTypeString + "Showing discarded cards: [/i]" + h.ToString();
            }

            bot.SendMessageInChannel(outputString, channel);
        }
Ejemplo n.º 2
0
        public override void Run(BotMain bot, BotCommandController commandController, string[] rawTerms, string[] terms, string characterName, string channel, UserGeneratedCommand command)
        {
            DeckType deckType = commandController.GetDeckTypeFromCommandTerms(terms);

            string customDeckString = Utils.GetCustomDeckName(characterName);
            string deckTypeString   = Utils.GetDeckTypeStringHidePlaying(deckType, customDeckString);

            bot.DiceBot.EndHand(channel, deckType);
            bot.SendMessageInChannel("[i]" + deckTypeString + "All hands have been emptied.[/i]", channel);
        }
Ejemplo n.º 3
0
        public CardCommandOptions(BotCommandController commandController, string[] terms, string characterName)
        {
            deckDraw          = true;
            all               = false;
            redraw            = false;
            secretDraw        = false;
            characterDrawName = commandController.GetCharacterDrawNameFromCommandTerms(characterName, terms);
            if (characterDrawName == DiceBot.DiscardName)
            {
                characterDrawName = characterName;
            }

            if (terms != null && terms.Length >= 1 && terms.Contains("all"))
            {
                all = true;
            }
            if (terms != null && terms.Length >= 1 && terms.Contains("redraw"))
            {
                redraw = true;
            }
            if (terms != null && terms.Length >= 1 && (terms.Contains("s") || terms.Contains("secret")))
            {
                secretDraw = true;
            }
            if (terms != null && terms.Length >= 1 && terms.Contains("j"))
            {
                jokers = true;
            }
            if (terms != null && terms.Length >= 1 && terms.Contains("nodeck"))
            {
                deckDraw = false;
            }

            List <int> discardsTemp = Utils.GetAllNumbersFromInputs(terms);

            //decrease all the numbers by 1 to match array indexes, rather than the card position for a player
            if (discardsTemp.Count > 0)
            {
                foreach (int i in discardsTemp)
                {
                    moveCardsList.Add(i - 1);
                }
            }

            if (moveCardsList.Count > 1)
            {
                cardsS = "s";
            }

            deckType = commandController.GetDeckTypeFromCommandTerms(terms);
        }
Ejemplo n.º 4
0
        public override void Run(BotMain bot, BotCommandController commandController, string[] rawTerms, string[] terms, string characterName, string channel, UserGeneratedCommand command)
        {
            bool jokers = false;

            if (terms != null && terms.Length >= 1 && terms.Contains("j"))
            {
                jokers = true;
            }

            DeckType deckType = commandController.GetDeckTypeFromCommandTerms(terms);

            string customDeckName = Utils.GetCustomDeckName(characterName);
            string deckTypeString = Utils.GetDeckTypeStringHidePlaying(deckType, customDeckName);

            bot.DiceBot.ResetDeck(jokers, channel, deckType, customDeckName);
            bot.SendMessageInChannel("[i]" + deckTypeString + "Channel deck reset." + (jokers ? " (contains jokers)" : "") + "[/i]", channel);
        }
Ejemplo n.º 5
0
        public override void Run(BotMain bot, BotCommandController commandController, string[] rawTerms, string[] terms, string characterName, string channel, UserGeneratedCommand command)
        {
            bool fullShuffle = false;

            if (terms != null && terms.Length >= 1 && terms.Contains("eh"))
            {
                fullShuffle = true;
            }

            DeckType deckType = commandController.GetDeckTypeFromCommandTerms(terms);

            string deckTypeString = Utils.GetDeckTypeStringHidePlaying(deckType, characterName);

            string customDeckName = Utils.GetCustomDeckName(characterName);

            bot.DiceBot.ShuffleDeck(bot.DiceBot.random, channel, deckType, fullShuffle, customDeckName);
            bot.SendMessageInChannel("[i]" + deckTypeString + "Channel deck shuffled. " + (fullShuffle ? "Hands emptied." : "") + "[/i]", channel);
        }
Ejemplo n.º 6
0
        public override void Run(BotMain bot, BotCommandController commandController, string[] rawTerms, string[] terms, string characterName, string channel, UserGeneratedCommand command)
        {
            DeckType deckType = commandController.GetDeckTypeFromCommandTerms(terms);

            string customDeckName = Utils.GetCustomDeckName(characterName);
            string deckTypeString = Utils.GetDeckTypeStringHidePlaying(deckType, customDeckName);

            Deck   a          = bot.DiceBot.GetDeck(channel, deckType, customDeckName);
            string sendString = "";

            if (a != null)
            {
                sendString = "[i]" + deckTypeString + "Channel deck contents: [/i]" + a.ToString();
            }
            else
            {
                sendString = "[i]Error: " + deckTypeString + " deck not found[/i]";
            }

            bot.SendMessageInChannel(sendString, channel);
        }
Ejemplo n.º 7
0
        public override void Run(BotMain bot, BotCommandController commandController, string[] rawTerms, string[] terms, string characterName, string channel, UserGeneratedCommand command)
        {
            DeckType deckType = commandController.GetDeckTypeFromCommandTerms(terms);

            string customDeckName = Utils.GetCustomDeckName(characterName);
            string deckTypeString = Utils.GetDeckTypeStringHidePlaying(deckType, customDeckName);

            Deck a = bot.DiceBot.GetDeck(channel, deckType, customDeckName);

            string sendString = "";

            if (a != null)
            {
                string cardsString  = a.GetCardsRemaining() + " / " + a.GetTotalCards();
                string jokersString = a.ContainsJokers() ? " [i](contains jokers)[/i] " : "";
                sendString = "[i]" + deckTypeString + "Channel deck cards remaining: [/i]" + cardsString + jokersString;
            }
            else
            {
                sendString = "[i]Error: " + deckTypeString + " deck not found[/i]";
            }
            bot.SendMessageInChannel(sendString, channel);
        }