Exemplo n.º 1
0
        private async Task AskForTribute()
        {
            if (Player.HP >= Player.MaxHP)
            {
                await TextArea.PrintLine("We're not asking for tribute now.");

                return;
            }

            await TextArea.PrintLine("Please offer tribute.");

            var choice = await NumberPicker.ChooseNumber(Player.Gold);

            var max = (int)((Player.MaxHP - Player.HP) * 0.75 + 1);

            if (choice > max)
            {
                choice = max;
                await TextArea.PrintLine("I only want " + choice + " gold.");
            }
            int hp = choice * 4 / 3;

            Player.HP += hp;

            await TextArea.PrintLine("   HP  +  " + hp);

            SoundMan.PlaySound(LotaSound.Good);
            await TextArea.FlashLinesWhile(() => SoundMan.IsAnyPlaying(), XleColor.White, XleColor.LightGreen, 50, 4);
        }
Exemplo n.º 2
0
        public async Task ChooseByKeyboard()
        {
            SetKeys(Keys.D2, Keys.D3, Keys.D4, Keys.Enter);

            var result = await picker.ChooseNumber(2000);

            result.Should().Be(234);
        }
Exemplo n.º 3
0
        private Task <int> GetAskingPrice()
        {
            BuybackFormatter.ClearTextArea();

            return(NumberPicker.ChooseNumber(32767));
        }
Exemplo n.º 4
0
        private async Task <int> GetAskingPrice()
        {
            TextArea.Clear();

            return(await NumberPicker.ChooseNumber(32767));
        }