31 lines
1,006 B
C#
31 lines
1,006 B
C#
using System;
|
|
using System.Linq;
|
|
using System.Collections.Generic;
|
|
using Microsoft.VisualBasic;
|
|
|
|
class Program
|
|
{
|
|
static void Main()
|
|
{
|
|
List<Item> allItems = ItemLoader.LoadAllItems("data/items.json");
|
|
|
|
Player user = new("Tanner", [], 100, 90, 20, 20);
|
|
user.DisplayStats();
|
|
|
|
user.Inventory.Add(allItems.FirstOrDefault(m => m.Name == "Potion"));
|
|
user.Inventory.Add(allItems.FirstOrDefault(m => m.Name == "Super Potion"));
|
|
user.Inventory.Add(allItems.FirstOrDefault(m => m.Name == "Hyper Potion"));
|
|
user.Inventory.Add(allItems.FirstOrDefault(m => m.Name == "Elixir"));
|
|
|
|
Console.WriteLine("Do you want to use your Potion? (Y/N)");
|
|
string? input = Console.ReadLine().ToUpper();
|
|
Console.WriteLine("\n");
|
|
|
|
if (input == "Y")
|
|
{
|
|
user.UseHealingItem((HealingItem)user.Inventory.FirstOrDefault(m => m.Name == "Potion"));
|
|
}
|
|
|
|
user.DisplayStats();
|
|
}
|
|
}
|