Esempio n. 1
0
        public static void revieve()
        {
            activity dogreborn   = methods.newactivity("dog", 50, 50, 50, 50, 50);
            activity catreborn   = methods.newactivity("cat", 35, 35, 60, 60, 60);
            activity fishreborn  = methods.newactivity("fish", 35, 35, 60, 60, 60);
            activity snakereborn = methods.newactivity("snake", 55, 55, 30, 55, 55);
            pet      revieved    = returnpet();

            switch (revieved.type)
            {
            case "Dog":
                activitystatsupdate(revieved, dogreborn);
                break;

            case "Cat":
                activitystatsupdate(revieved, catreborn);
                break;

            case "Fish":
                activitystatsupdate(revieved, fishreborn);
                break;

            case "Snake":
                activitystatsupdate(revieved, snakereborn);
                break;
            }
        }
Esempio n. 2
0
 public static void savepet(pet tomogatchi)
 {
     using (System.IO.StreamWriter file = new System.IO.StreamWriter(@"C:\Users\vivek\Documents\Vs Projects\Tomogatchi\Tomagtachi\Tomagtachi\Properties\current pet.txt"))
     {
         file.WriteLine(tomogatchi.name + "," + tomogatchi.type + "," + tomogatchi.health + "," + tomogatchi.happiness + "," + tomogatchi.boredom + "," + tomogatchi.hunger + "," + tomogatchi.sleep);
         file.Close();
     }
 }
Esempio n. 3
0
 public static Boolean petdead(pet tomogatchi)
 {
     if (tomogatchi.health <= 0 | tomogatchi.happiness <= 0 | tomogatchi.boredom <= 0 | tomogatchi.hunger <= 0 | tomogatchi.sleep <= 0)
     {
         uploaddeadpet(tomogatchi);
         return(true);
     }
     else
     {
         return(false);
     }
 }
Esempio n. 4
0
 private void TimeDamadger_Tick(object sender, EventArgs e)
 {
     methods.savepet(actualpet);
     if (methods.petdead(methods.returnpet()) == false)
     {
         methods.pettimedamadge(actualpet); actualpet = methods.returnpet();
     }
     else
     {
         GameTimer.Stop(); TimeDamadger.Stop(); Gameover();
     }
 }
Esempio n. 5
0
        public static pet newpet(string name, string type, int health, int happiness, int bordem, int hunger, int sleep)
        {
            pet tomogachi = new pet();

            {
                tomogachi.name      = name;
                tomogachi.type      = type;
                tomogachi.health    = health;
                tomogachi.happiness = happiness;
                tomogachi.boredom   = bordem;
                tomogachi.hunger    = hunger;
                tomogachi.sleep     = sleep;
            }
            return(tomogachi);
        }
Esempio n. 6
0
        private void button1_Click(object sender, EventArgs e)

        {
            try
            {
                switch (comboBox1.SelectedItem.ToString())
                {
                case "Dog":
                    pet      Dog     = methods.newpet(textBox1.Text, "Dog", 0, 0, 0, 0, 0);
                    activity dogborn = methods.newactivity("dog", 50, 50, 50, 50, 50);
                    methods.activitystatsupdate(Dog, dogborn);
                    methods.savepet(Dog);
                    break;

                case "Cat":
                    pet      Cat     = methods.newpet(textBox1.Text, "Cat", 0, 0, 0, 0, 0);
                    activity catborn = methods.newactivity("cat", 35, 35, 60, 60, 60);
                    methods.activitystatsupdate(Cat, catborn);
                    methods.savepet(Cat);
                    break;

                case "Fish":
                    pet      Fish     = methods.newpet(textBox1.Text, "Fish", 0, 0, 0, 0, 0);
                    activity fishborn = methods.newactivity("fish", 35, 35, 60, 60, 60);
                    methods.activitystatsupdate(Fish, fishborn);
                    methods.savepet(Fish);
                    break;

                case "Snake":
                    pet      snake     = methods.newpet(textBox1.Text, "Snake", 0, 0, 0, 0, 0);
                    activity snakeborn = methods.newactivity("snake", 55, 55, 30, 55, 55);
                    methods.activitystatsupdate(snake, snakeborn);
                    methods.savepet(snake);
                    break;

                default:
                    //MessageBox.Show("test");
                    break;
                }
                Form2 form2 = new Form2();
                form2.Show();
                //this.Hide();
            }
            catch { MessageBox.Show("Well Done idiot you forgot to select the type of pet from the drop down list"); }
        }
Esempio n. 7
0
 public static void activitystatsupdate(pet tomogatchi, activity act)
 {
     tomogatchi.health += act.healthvaluechange; tomogatchi.happiness += act.happinessvaluechange; tomogatchi.boredom += act.boredomvaluechange; tomogatchi.hunger += act.hungervaluechange; tomogatchi.sleep += act.sleepvaluechange; savepet(tomogatchi);
 }
Esempio n. 8
0
 public static void pettimedamadge(pet tomogatchi)
 {
     tomogatchi.health += -1; tomogatchi.happiness += -1; tomogatchi.boredom += -1; tomogatchi.hunger += -1; tomogatchi.sleep += -1; savepet(tomogatchi);
 }
Esempio n. 9
0
 private void button2_Click_1(object sender, EventArgs e)
 {
     methods.activitystatsupdate(actualpet, eat);
     actualpet = methods.returnpet();
 }