Beispiel #1
0
        private async Task SellItem()
        {
            titlePrompt.Visible = false;

            TextArea.Clear();
            await TextArea.PrintLine("      what will you sell me?");

            await TextArea.PrintLine();

            Equipment eq = await PickItemToSell();

            if (eq == null)
            {
                await NoTransactionMessage();

                return;
            }

            int sellPrice = ComputeSellPrice(eq.Price(Data));
            await TextArea.PrintLine("I'll pay you exactly " + sellPrice + " gold");

            await TextArea.PrintLine("for your " + eq.NameWithQuality(Data) + ".");

            await TextArea.PrintLine();

            var choice = await QuickMenuService.QuickMenuYesNo(true);

            if (choice == 1)
            {
                await NoTransactionMessage();

                return;
            }

            TextArea.Clear();
            await TextArea.PrintLine("It's a deal!");

            await TextArea.PrintLine(eq.BaseName(Data) + " sold for " + sellPrice + " gold.");

            Player.RemoveEquipment(eq);

            Player.Gold += sellPrice;

            await StoreSound(LotaSound.Sale);

            await TextArea.PrintLine();
        }
Beispiel #2
0
        private async Task <int> MakeOffer(Equipment item, int offer, bool finalOffer)
        {
            var ta = TextArea;

            ta.Clear();
            await ta.PrintLine("I'll give " + offer + " gold for your");

            await ta.Print(item.NameWithQuality(Data));

            if (finalOffer)
            {
                await ta.PrintLine(" -final offer!!!", XleColor.Yellow);
            }
            else
            {
                await ta.PrintLine(".");
            }

            return(await QuickMenuService.QuickMenuYesNo(true));
        }