public Battle(Player p, Monster m) { User = p; Mon = m; InitializeComponent(); txt_PlayerHP.Text = User.Health.ToString(); txt_EnemyHP.Text = Mon.Health.ToString(); lbl_EnemyName.Text = Mon.Name; foreach (var i in User.Inventory) { if (!i.Equipable) { lbo_Items.Items.Add(i.Name); } } }
private void HubUI_Load(object sender, EventArgs e) { txtCash.Text = User.Cash.ToString(); txtHealth.Text = User.Health.ToString(); txtMaxHealth.Text = Convert.ToString(100 + (User.Constitution * 10)+(User.Level*5)); XElement element = XElement.Load("..\\..\\Resources\\Monster.xml"); foreach (XElement item in element.Elements("Monster")) { string n = (string)item.Element("Name"); int lvl = (int)item.Element("Level"); int str = (int)item.Element("Strength"); int diff = (int)item.Element("Difficulty"); int con = (int)item.Element("Constitution"); int dex = (int)item.Element("Dexterity"); int ap = (int)item.Element("AttkPower"); double init = (double)item.Element("Initiative"); Monster mon = new Monster(n, diff, lvl, str, con, dex, ap, init); monArray.Add(mon); } }