예제 #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);
        }
예제 #2
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);
        }