Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- namespace Automat
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
- {
- int PenizeNaKredit = Convert.ToInt32(cmbPenizeNaKredit.SelectedItem);
- lblCenaZaKredit.Text = (PenizeNaKredit * 2).ToString();
- }
- int Kredity = 0;
- private void button1_Click(object sender, EventArgs e)
- {
- int Penize = Convert.ToInt32(lblPenizeVPenezence.Text);
- int PenizeNaKredit = Convert.ToInt32(cmbPenizeNaKredit.SelectedItem) * 2;
- if (Penize < PenizeNaKredit)
- {
- MessageBox.Show("Nemáš dostatek peněz, začni makat a až pak hazarduj !");
- }
- else
- {
- lblPenizeVPenezence.Text = (Penize - PenizeNaKredit).ToString();
- lblKredity.Text = (Kredity + Convert.ToInt32(cmbPenizeNaKredit.SelectedItem)).ToString();
- Kredity = Convert.ToInt32(lblKredity.Text);
- MessageBox.Show("Právě sis úspěšně koupil " + cmbPenizeNaKredit.SelectedItem + " kreditů za " + PenizeNaKredit + " Kč.\n Tvůj aktuální pozůstatek činí " + lblPenizeVPenezence.Text + " Kč.");
- }
- }
- private void button2_Click(object sender, EventArgs e)
- {
- Form2 ProdejRudy = new Form2();
- ProdejRudy.Show();
- }
- private void button2_Click_1(object sender, EventArgs e)
- {
- Form3 Hazard = new Form3();
- Hazard.Show();
- }
- int Cobblestone = 0;
- int Stone = 0;
- int Gravel = 0;
- int Sand = 0;
- int Iron = 0;
- int Gold = 0;
- int Diamond = 0;
- int Emerald = 0;
- private void button3_Click(object sender, EventArgs e)
- {
- int Kredity = Convert.ToInt32(lblKredity.Text);
- if(Kredity >= 5) {
- lblKredity.Text = (Convert.ToInt32(lblKredity.Text) - 5).ToString();
- Random Nahoda = new Random();
- int NahodneCislo = Nahoda.Next(0, 101);
- string[] inventar = new string[] { lblInventar0.Text, lblInventar1.Text, lblInventar2.Text, lblInventar3.Text, lblPaty.Text};
- if (NahodneCislo == 1)
- {
- Emerald++;
- MessageBox.Show("Gratuluju, vyhrál jsi emerald !");
- return;
- }
- if ((NahodneCislo > 1) && (NahodneCislo <= 5))
- {
- Diamond++;
- MessageBox.Show("Gratuluju, vyhrál jsi diamond !");
- for(int i = 0; i >= inventar.Length; i++)
- {
- if(lblInventar[i].Text == "")
- {
- lblInventar[i].Text = Diamond + "x Diamant";
- if (Diamond > 1) { lblInventar[i].Text = Diamond + "x Diamantů"; }
- }
- }
- return;
- }
- if ((NahodneCislo > 5) && (NahodneCislo <= 10))
- {
- Gold++;
- MessageBox.Show("Gratuluju, vyhrál jsi Gold Ingot !");
- return;
- }
- if ((NahodneCislo > 10) && (NahodneCislo <= 15))
- {
- Iron++;
- MessageBox.Show("Gratuluju, vyhrál jsi Iron ingot !");
- return;
- }
- if ((NahodneCislo > 15) && (NahodneCislo <= 25))
- {
- Sand++;
- MessageBox.Show("Gratuluju, vyhrál jsi písek !");
- return;
- }
- if ((NahodneCislo > 25) && (NahodneCislo <= 35))
- {
- Gravel++;
- MessageBox.Show("Gratuluju, vyhrál jsi štěrk !");
- return;
- }
- if ((NahodneCislo > 35) && (NahodneCislo <= 60))
- {
- Stone++;
- MessageBox.Show("Gratuluju, vyhrál jsi kámen !");
- return;
- }
- if ((NahodneCislo > 60) && (NahodneCislo <= 100))
- {
- Cobblestone++;
- MessageBox.Show("Gratuluju, vyhrál jsi ... Cobblestone ...");
- return;
- }
- }
- else { MessageBox.Show("Nemáš dostatek kreditů na hraní !");
- return; }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement