public override void ExecuteCommand(IChatChannel channel, StreamCommand command)
        {
            Player player = module.GetExistingPlayer(command.Service, command.User);

            if (player == null)
            {
                SendMessage(channel, command.User, "No character data found for your user.");
                return;
            }

            PlayerAscension ascension = module.GetPlayerAscension(player.UserID);

            SendMessage(channel, command.User, $"You're level {player.Level} with {player.Experience.ToString("F0")}/{ascension?.NextLevel.ToString("F0")} experience. HP {player.CurrentHP}/{player.MaximumHP}, MP {player.CurrentMP}/{player.MaximumMP}. Strength {player.Strength}, Dexterity {player.Dexterity}, Fitness {player.Fitness}, Luck {player.Luck}. {player.Gold} Gold");
        }
        public override void ExecuteCommand(IChatChannel channel, StreamCommand command)
        {
            if (command.Arguments.Length == 0)
            {
                ProvideHelp(channel, command.User);
                return;
            }

            int gold;

            try
            {
                gold = command.Arguments.Length < 2 ? 1 : int.Parse(command.Arguments[1]);
            }
            catch (Exception e)
            {
                Logger.Error(this, $"{command.Arguments[1]} is no valid bet amount", e);
                SendMessage(channel, command.User, $"{command.Arguments[1]} is no valid bet amount");
                return;
            }

            if (gold <= 0)
            {
                gold = 1;
            }

            if (playermodule.GetPlayerGold(playermodule.GetExistingPlayer(command.Service, command.User).UserID) < gold)
            {
                SendMessage(channel, command.User, $"You don't have {gold} gold");
                return;
            }

            if (command.Arguments[0].All(c => char.IsDigit(c)))
            {
                int field = int.Parse(command.Arguments[0]);
                if (field < 0 || field > 36)
                {
                    SendMessage(channel, command.User, $"Field {field} is not part of the board.");
                    return;
                }

                module.Bet(command.Service, command.User, gold, BetType.Plein, field);
                return;
            }

            switch (command.Arguments[0].ToLower())
            {
            case "r":
            case "red":
            case "rouge":
                module.Bet(command.Service, command.User, gold, BetType.Color, 0);
                SendMessage(channel, command.User, $"You bet {gold} on red for the next roulette round");
                break;

            case "b":
            case "black":
            case "noir":
                module.Bet(command.Service, command.User, gold, BetType.Color, 1);
                SendMessage(channel, command.User, $"You bet {gold} on black for the next roulette round");
                break;

            case "o":
            case "odd":
                module.Bet(command.Service, command.User, gold, BetType.OddEven, 1);
                SendMessage(channel, command.User, $"You bet {gold} on odds for the next roulette round");
                break;

            case "e":
            case "even":
                module.Bet(command.Service, command.User, gold, BetType.OddEven, 0);
                SendMessage(channel, command.User, $"You bet {gold} on evens for the next roulette round");
                break;

            case "dozen1":
                module.Bet(command.Service, command.User, gold, BetType.Douzaines, 0);
                SendMessage(channel, command.User, $"You bet {gold} on the first dozen for the next roulette round");
                break;

            case "row1":
                module.Bet(command.Service, command.User, gold, BetType.Colonnes, 0);
                SendMessage(channel, command.User, $"You bet {gold} on the first row for the next roulette round");
                break;

            case "dozen2":
                module.Bet(command.Service, command.User, gold, BetType.Douzaines, 1);
                SendMessage(channel, command.User, $"You bet {gold} on the second dozen for the next roulette round");
                break;

            case "row2":
                module.Bet(command.Service, command.User, gold, BetType.Colonnes, 1);
                SendMessage(channel, command.User, $"You bet {gold} on the second row for the next roulette round");
                break;

            case "dozen3":
                module.Bet(command.Service, command.User, gold, BetType.Douzaines, 2);
                SendMessage(channel, command.User, $"You bet {gold} on the third dozen for the next roulette round");
                break;

            case "row3":
                module.Bet(command.Service, command.User, gold, BetType.Colonnes, 2);
                SendMessage(channel, command.User, $"You bet {gold} on the third row for the next roulette round");
                break;

            case "half1":
                module.Bet(command.Service, command.User, gold, BetType.HalfBoard, 0);
                SendMessage(channel, command.User, $"You bet {gold} on 1-18 for the next roulette round");
                break;

            case "half2":
                module.Bet(command.Service, command.User, gold, BetType.HalfBoard, 1);
                SendMessage(channel, command.User, $"You bet {gold} on 19-36 for the next roulette round");
                break;

            case "history":
                SendMessage(channel, command.User, $"History of roulette fields: {string.Join(",", module.History)}");
                break;
            }
        }
Пример #3
0
 public override void ExecuteCommand(IChatChannel channel, StreamCommand command)
 {
     module.AddAdventurer(playermodule.GetExistingPlayer(command.Service, command.User));
 }