Пример #1
0
        private void button2_Click(object sender, EventArgs e)
        {
            Random s = new Random();
            int    sum;

            sum = s.Next(1, 9) + info.TypingSpeed;
            if (sum >= 8)
            {
                MessageBox.Show("Success");

                ConferenceRoom n = new ConferenceRoom(info);
                n.Show();
                this.Hide();
            }
            else
            {
                info.Energy = info.Energy - 3;

                if (info.Energy <= 0)
                {
                    LoseScreen x = new LoseScreen();
                }
                else
                {
                    MessageBox.Show("Your fingers are fatigued.\n\nYour proposal is badly typed and you do not have time to finish it.");

                    ConferenceRoom n = new ConferenceRoom(info);
                    n.Show();
                    this.Hide();
                }
            }
            //what happens when button 2 is clicked
        }
Пример #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            Random s = new Random();
            int    sum;

            sum = s.Next(1, 9) + info.Strength;
            if (sum >= 7)
            {
                MessageBox.Show("Success");

                ConferenceRoom n = new ConferenceRoom(info);
                n.Show();
                this.Hide();
            }
            else
            {
                info.Energy = info.Energy - 2;
                if (info.Energy <= 0)
                {
                    LoseScreen x = new LoseScreen();
                }
                else
                {
                    MessageBox.Show("Your keyboard malfunctions.\n\nYou are forced to include many grammatical errors in your presentation.");

                    ConferenceRoom n = new ConferenceRoom(info);
                    n.Show();
                    this.Hide();
                }
            }
            //what happens if button 1 is clicked
        }