123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System.Windows;
- using System.Windows.Input;
- namespace Clicker
- {
- public partial class MainWindow : Window
- {
- public long point = 0;
- public int click = 10;
- public int[] sol_b = new int[] { 100, 500, 1000, 1500 };//цены
- public int[] increased_b = new int[] { 10, 50, 100, 150 };//модификаторы
- public MainWindow() { InitializeComponent(); Update(); }
- public string Update()
- {
- helmets.Content = point.ToString();
- heat.Content = click.ToString();
- helmets2.Content = point.ToString();
- heat2.Content = click.ToString();
- B1.Content = "+" + increased_b[0].ToString() + " за\n" + sol_b[0].ToString() + " шлемов";
- B2.Content = "+" + increased_b[1].ToString() + " за\n" + sol_b[1].ToString() + " шлемов";
- B3.Content = "+" + increased_b[2].ToString() + " за\n" + sol_b[2].ToString() + " шлемов";
- B4.Content = "+" + increased_b[3].ToString() + " за\n" + sol_b[3].ToString() + " шлемов";
- return helmets.Content.ToString() + heat.Content.ToString() + helmets2.Content.ToString()
- + heat2.Content.ToString() + B1.Content + B2.Content + B3.Content + B4.Content;
- }
- private void Image_MouseDown(object sender, MouseButtonEventArgs e)
- { I_MD(ref point); Update(); }
- public long I_MD(ref long point) { return point += click; }
- private void Upgrade1(object sender, RoutedEventArgs e)
- { Upgrade(ref point, 0); Update(); }
- private void Upgrade2(object sender, RoutedEventArgs e)
- { Upgrade(ref point, 1); Update(); }
- private void Upgrade3(object sender, RoutedEventArgs e)
- { Upgrade(ref point, 2); Update(); }
- private void Upgrade4(object sender, RoutedEventArgs e)
- { Upgrade(ref point, 3); Update(); }
-
- public long Upgrade(ref long point, int i)
- {
- if (point >= sol_b[i])
- {
- point -= sol_b[i]; click += increased_b[i];
- return click;
- }
- return 0;
- }
- private void Exit(object sender, MouseButtonEventArgs e)
- { Application.Current.Shutdown(); }
- }
- }
|