예제 #1
0
        public override async Task Battlecry(GameHandler gameHandler, int curPlayer, int enemy)
        {
            if (gameHandler.AlivePlayers() <= 1)
            {
                return;
            }

            string defaultAns = string.Empty;

            List <string> playerNames = new List <string>();

            for (int i = 0; i < gameHandler.players.Count(); i++)
            {
                if (i == curPlayer)
                {
                    playerNames.Add(string.Empty);
                }
                else
                {
                    playerNames.Add(gameHandler.players[i].name.ToLower());
                    defaultAns = gameHandler.players[i].name;
                }
            }

            var prompt = new PlayerInteraction("Name a Player other than yourself", "The name needs to be exactly written.", "Capitalisation is ignored", AnswerType.StringAnswer);

            string ret = (await prompt.SendInteractionAsync(curPlayer, (x, y, z) => playerNames.Contains(x.ToLower()), defaultAns)).ToLower();

            this.bet = playerNames.IndexOf(ret);

            this.writtenEffect      = $"You have bet on {gameHandler.players[this.bet].name}! If they win their next fight, you'll gain 5 Mana next turn.";
            this.showEffectInCombat = false;
        }