Example #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;
            }
        }
Example #2
0
 public static activity newactivity(string name, int health, int happiness, int boredom, int hunger, int sleep)
 {
     activity action = new activity();
     {
         action.name = name;
         action.healthvaluechange    = health;
         action.happinessvaluechange = happiness;
         action.boredomvaluechange   = boredom;
         action.hungervaluechange    = hunger;
         action.sleepvaluechange     = sleep;
         return(action);
     }
 }
Example #3
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"); }
        }
Example #4
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);
 }