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;
- using System.Media;
- namespace MainForm
- {
- public partial class Form1 : Form
- {
- Random rnd = new Random();
- public static double buyprice1 = 1;
- public static double buyprice10 = 0;
- public static double smhp = 10;
- public static double gold = 0;
- public static double mhp = smhp;
- public static double attack = 1;
- public static int kill = 0;
- public string map = "";
- public void mob()
- {
- if (map == "Forest")
- {
- switch (rnd.Next(3))
- {
- case 0:
- Image myimage = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlers\Imp.png");
- this.pictureBox1.BackgroundImage = myimage;
- break;
- case 1:
- Image myimage2 = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlers\Behemoth.png");
- this.pictureBox1.BackgroundImage = myimage2;
- break;
- case 2:
- Image myimage3 = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlers\Delf_m.png");
- this.pictureBox1.BackgroundImage = myimage3;
- break;
- }
- }
- else if (map == "Crystal")
- {
- switch (rnd.Next(3))
- {
- case 0:
- Image myimage4 = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlers\Assassin.png");
- this.pictureBox1.BackgroundImage = myimage4;
- break;
- case 1:
- Image myimage5 = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlers\Captain.png");
- this.pictureBox1.BackgroundImage = myimage5;
- break;
- case 2:
- Image myimage6 = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlers\Cleric_f.png");
- this.pictureBox1.BackgroundImage = myimage6;
- break;
- }
- }
- }
- public void mapp()
- {
- switch (rnd.Next(2))
- {
- case 0:
- map = "Forest";
- Image back1 = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlebacks2\Forest2.png");
- this.BackgroundImage = back1;
- break;
- case 1:
- map = "Crystal";
- Image back2 = new Bitmap(@"D:\Projects\Iconscollection\Graphics\Battlebacks2\Crystal.png");
- this.BackgroundImage = back2;
- break;
- }
- }
- public Form1()
- {
- InitializeComponent();
- ExitBut.Hide();
- attacklab.Text = attack.ToString();
- mapp();
- mob();
- hplab.Text = String.Format("{0:F2}", mhp);
- Color Colour = ColorTranslator.FromHtml("#282c35");
- errorlab.BackColor = Colour;
- buyprice10 = buyprice1 * 1.1;
- for (int i = 1; i < 10; i++)
- {
- buyprice10 = buyprice10 * 1.1;
- }
- }
- private void Form1_Load(object sender, EventArgs e)
- {
- }
- private void button1_Click_1(object sender, EventArgs e)
- {
- }
- private void ExitBut_Click(object sender, EventArgs e)
- {
- Environment.Exit(0);
- }
- private void UpgradeBut_Click(object sender, EventArgs e)
- {
- ExitBut.Hide();
- autobut.Show();
- attackbut.Show();
- stealbut.Show();
- defbut.Show();
- autospeedbut.Show();
- }
- private void InfoBut_Click_1(object sender, EventArgs e)
- {
- ExitBut.Hide();
- autobut.Hide();
- attackbut.Hide();
- stealbut.Hide();
- defbut.Hide();
- autospeedbut.Hide();
- buy1but.Hide();
- pricebut.Hide();
- buy10but.Hide();
- price10but.Hide();
- }
- private void SetBut_Click(object sender, EventArgs e)
- {
- ExitBut.Show();
- autobut.Hide();
- attackbut.Hide();
- stealbut.Hide();
- defbut.Hide();
- autospeedbut.Hide();
- buy1but.Hide();
- pricebut.Hide();
- buy10but.Hide();
- price10but.Hide();
- }
- private void pictureBox1_Click(object sender, EventArgs e)
- {
- mhp = (mhp - attack);
- if (mhp <= 0)
- {
- kill++;
- if (kill % 10 == 0)
- {
- mapp();
- }
- gold = gold + (kill * 5);
- mob();
- smhp = smhp * 1.1;
- mhp = smhp;
- if (gold >= 1000)
- {
- double thousand = gold / 1000;
- goldlab.Text = String.Format("{0:F2}", thousand)+"K";
- }
- else goldlab.Text = String.Format("{0:F2}", gold);
- killlab.Text = kill.ToString();
- hplab.Text = String.Format("{0:F2}", mhp);
- }
- }
- private void goldlab_Click(object sender, EventArgs e)
- {
- }
- private void killlab_Click(object sender, EventArgs e)
- {
- }
- private void buy1but_Click(object sender, EventArgs e)
- {
- errorlab.Text = "";
- if (gold >= buyprice1)
- {
- gold = gold - buyprice1;
- buyprice1 = buyprice1 * 1.1;
- if (gold>=1000000000)
- {
- double billion = gold / 1000000000;
- goldlab.Text = String.Format("{0:F2}", billion) + "B";
- }
- else if (gold>=1000000)
- {
- double million = gold / 1000000;
- goldlab.Text = String.Format("{0:F2}", million) + "M";
- }
- else if (gold >= 1000)
- {
- double thousand = gold / 1000;
- goldlab.Text = String.Format("{0:F2}", thousand) + "K";
- }
- else goldlab.Text = String.Format("{0:F2}", gold);
- attack = attack * 1.09999;
- attacklab.Text = String.Format("{0:F2}", attack);
- if (buyprice1 >= 1000000000)
- {
- double billion = buyprice1 / 1000000000;
- pricebut.Text = String.Format("{0:F2}", billion) + "B";
- }
- else if (buyprice1 >= 1000000)
- {
- double million = buyprice1/ 1000000;
- pricebut.Text = String.Format("{0:F2}", million) + "M";
- }
- else if (buyprice1 >= 1000)
- {
- double thousand = buyprice1 / 1000;
- pricebut.Text = String.Format("{0:F2}", thousand) + "K";
- }
- else pricebut.Text = String.Format("{0:F2}", buyprice1);
- }
- else
- {
- errorlab.Text = "Not Enough Gold";
- errorlab.Show();
- }
- }
- private void attackbut_Click(object sender, EventArgs e)
- {
- buy1but.Show();
- pricebut.Show();
- price10but.Show();
- buy10but.Show();
- if (buyprice1 >= 1000000000)
- {
- double billion = buyprice1 / 1000000000;
- pricebut.Text = String.Format("{0:F2}", billion) + "B";
- }
- else if (buyprice1 >= 1000000)
- {
- double million = buyprice1 / 1000000;
- pricebut.Text = String.Format("{0:F2}", million) + "M";
- }
- else if (buyprice1 >= 1000)
- {
- double thousand = buyprice1 / 1000;
- pricebut.Text = String.Format("{0:F2}", thousand) + "K";
- }
- else pricebut.Text = String.Format("{0:F2}", buyprice1);
- if (buyprice10 >= 1000000000)
- {
- double billion = buyprice10 / 1000000000;
- price10but.Text = String.Format("{0:F2}", billion) + "B";
- }
- else if (buyprice10 >= 1000000)
- {
- double million = buyprice10 / 1000000;
- price10but.Text = String.Format("{0:F2}", million) + "M";
- }
- else if (buyprice10 >= 1000)
- {
- double thousand = buyprice10 / 1000;
- price10but.Text = String.Format("{0:F2}", thousand) + "K";
- }
- else price10but.Text = String.Format("{0:F2}", buyprice10);
- }
- private void UI_Click(object sender, EventArgs e)
- {
- }
- private void buy10but_Click(object sender, EventArgs e)
- {
- errorlab.Text = "";
- if (gold >= buyprice10)
- {
- gold = gold - buyprice10;
- buyprice1 = buyprice10 * 1.1;
- buyprice10 = buyprice1 * 1.1;
- for (int i = 0; i < 9; i++)
- {
- buyprice10 = buyprice10 * 1.1;
- }
- if (gold >= 1000000000)
- {
- double billion = gold / 1000000000;
- goldlab.Text = String.Format("{0:F2}", billion) + "B";
- }
- else if (gold >= 1000000)
- {
- double million = gold / 1000000;
- goldlab.Text = String.Format("{0:F2}", million) + "M";
- }
- else if (gold >= 1000)
- {
- double thousand = gold / 1000;
- goldlab.Text = String.Format("{0:F2}", thousand) + "K";
- }
- else goldlab.Text = String.Format("{0:F2}", gold);
- for (int i = 0; i < 10; i++)
- {
- attack = attack * 1.099;
- }
- attacklab.Text = String.Format("{0:F2}", attack);
- if (buyprice10 >= 1000000000)
- {
- double billion = buyprice10 / 1000000000;
- price10but.Text = String.Format("{0:F2}", billion) + "B";
- }
- else if (buyprice10 >= 1000000)
- {
- double million = buyprice10 / 1000000;
- price10but.Text = String.Format("{0:F2}", million) + "M";
- }
- else if (buyprice10 >= 1000)
- {
- double thousand = buyprice10 / 1000;
- price10but.Text = String.Format("{0:F2}", thousand) + "K";
- }
- else price10but.Text = String.Format("{0:F2}", buyprice10);
- if (buyprice1 >= 1000000000)
- {
- double billion = buyprice1 / 1000000000;
- pricebut.Text = String.Format("{0:F2}", billion) + "B";
- }
- else if (buyprice1 >= 1000000)
- {
- double million = buyprice1 / 1000000;
- pricebut.Text = String.Format("{0:F2}", million) + "M";
- }
- else if (buyprice1 >= 1000)
- {
- double thousand = buyprice1 / 1000;
- pricebut.Text = String.Format("{0:F2}", thousand) + "K";
- }
- else pricebut.Text = String.Format("{0:F2}", buyprice1);
- }
- else
- {
- errorlab.Text = "Not Enough Gold";
- errorlab.Show();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement