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(); }
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)); }
protected override async Task <bool> SpeakImplAsync() { int choice; robbing = false; Screen.ClearWindows(); Title = "Convenience Bank"; var promptWindow = new TextWindow(); promptWindow.Location = new Point(14, 3); promptWindow.WriteLine("Our Services"); promptWindow.WriteLine("---------------"); var optionsWindow = new TextWindow(); optionsWindow.Location = new Point(10, 7); optionsWindow.WriteLine("1. Deposit Funds"); optionsWindow.WriteLine(); optionsWindow.WriteLine("2. Withdraw Funds"); optionsWindow.WriteLine(); optionsWindow.WriteLine("3. Balance Inquiry"); Screen.AddWindow(promptWindow); Screen.AddWindow(optionsWindow); await TextArea.PrintLine(); await TextArea.PrintLine(); await TextArea.PrintLine("Make choice (Hit 0 to cancel)"); await TextArea.PrintLine(); MenuItemList theList = new MenuItemList("0", "1", "2", "3"); choice = await QuickMenuService.QuickMenu(theList, 2, 0); switch (choice) { case 1: await MakeDeposit(); break; case 2: await MakeWithdrawal(); break; case 3: await PrintBalance(); break; } return(true); }