private void statThrowButton1_Click(object sender, RoutedEventArgs e) { Random r = new Random(); int value = r.Next(0, 100); statThrowResultBox1.Text = $"{Selected1.Stat(statThrow1.Text)}/{value + 1}"; if (Selected1.Stat(statThrow1.Text) > value) { statThrowResultBox1.Foreground = new SolidColorBrush(Colors.Lime); } else { statThrowResultBox1.Foreground = new SolidColorBrush(Colors.Red); } }
private void tradeButton_Click(object sender, RoutedEventArgs e) { Selected1.Coins += (int)givenCoins2.Value; Selected2.Coins += (int)givenCoins1.Value; Selected1.Coins -= (int)givenCoins1.Value; Selected2.Coins -= (int)givenCoins2.Value; foreach (Item i in GiveItemList1) { Selected2.Inventory.Add(i); Selected1.Inventory.Remove(i); } foreach (Item i in GiveItemList2) { Selected1.Inventory.Add(i); Selected2.Inventory.Remove(i); } Selected1.InventoryChanged(); Selected2.InventoryChanged(); cancel(); }