Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
4.4 kB
5
Indexable
Never
                //Buy

                if(cmd.Contains(commandlist[3]))
                {
                    Console.WriteLine("");
                    Console.WriteLine("Shoplist:");
                    Console.WriteLine("");
                    Console.WriteLine("No 0. " + shoplist[0] + " Price: 100$");
                    Console.WriteLine("No 1 " + shoplist[1] + " Price: 50$");
                    Console.WriteLine("No 2 " + shoplist[2] + " Price: 25$");
                    Console.WriteLine("No 3 " + shoplist[3] + " Price: 15$");
                    Console.WriteLine("No 4 " + shoplist[4] + " Price: 40$");
                    Console.WriteLine("");

                    Console.WriteLine("What do you want to buy? Buying command: buy {itemNumber} eg. buy 1");
                    String[] buyCmds = {"buy 0", "buy 1", "buy 2", "buy 3", "buy 4"};
                    Console.WriteLine("");
                    String buyInput = Console.ReadLine();
                    
                    try
                    {

                        
                        if(buyInput.Equals(buyCmds[0]) && bal >= 100 && !inventory.Contains("HitBlast's Refurbished M1 Mac"))
                        {
                            Console.WriteLine("");
                            Console.WriteLine("Succesfully bought " + shoplist[0] + "!") ;
                            bal = bal-100;
                            inventory = inventory.Append("HitBlast's Refurbished M1 Mac").ToArray();
                            Console.WriteLine("");

                            Console.WriteLine("Current balance: " + bal + currency);
                            Console.WriteLine("");

                        }
                        if(buyInput.Equals(buyCmds[1]) && bal >= 50 && !inventory.Contains("+100 Chetona"))
                        {
                            Console.WriteLine("");
                            Console.WriteLine("Succesfully bought " + shoplist[1] + "!") ;
                            bal = bal-50;
                            inventory = inventory.Append("+100 Chetona").ToArray();
                            Console.WriteLine("");
                            Console.WriteLine("Current balance: " + bal + currency);
                            Console.WriteLine("");

                        }
                        if(buyInput.Equals(buyCmds[2]) && bal >= 25 && !inventory.Contains("Bleach"))
                        {
                            Console.WriteLine("");
                            Console.WriteLine("Succesfully bought " + shoplist[2] + "!") ;
                            bal = bal-25;
                            inventory = inventory.Append("Bleach").ToArray();
                            Console.WriteLine("");
                            Console.WriteLine("Current balance: " + bal + currency);
                            Console.WriteLine("");

                        }
                        if(buyInput.Equals(buyCmds[3]) && bal >= 15 && !inventory.Contains("HFC Chicken"))
                        {
                            Console.WriteLine("");
                            Console.WriteLine("Succesfully bought " + shoplist[3] + "!") ;
                            bal = bal-15;
                            inventory = inventory.Append("HFC Chicken").ToArray();
                            Console.WriteLine("");
                            Console.WriteLine("Current balance: " + bal + currency);
                            Console.WriteLine("");

                        }
                        if(buyInput.Equals(buyCmds[4]) && bal >= 40 && !inventory.Contains("Pickaxe"))
                        {
                            Console.WriteLine("");
                            Console.WriteLine("Succesfully bought " + shoplist[4] + "!") ;
                            bal = bal-40;
                            inventory = inventory.Append("Pickaxe").ToArray();
                            Console.WriteLine("");
                            Console.WriteLine("Current balance: " + bal + currency);
                            Console.WriteLine("");

                        }

                    }
                    catch
                    {

                    }

                

                }