Пример #1
0
        public void Update(int charX, int charY, Growalone that)
        {
            if (this.anim == 0)
            {
                this.anim = 1;
            }
            else if (this.anim == 1)
            {
                this.anim = -1;
            }
            else if (this.anim == -1)
            {
                this.anim = 0;
            }
            int num  = (int)Math.Floor(this.PosX / 32m);
            int num2 = (int)Math.Ceiling(this.PosY / 32m);
            int num3 = (charX + 16) / 32;
            int num4 = (int)Math.Ceiling(charY / 32m);

            if (num == num3 && num2 == num4)
            {
                bool flag = that.AddItem(this.ID, (int)this.amount);
                that.PickupEffect.Play();
                if (flag)
                {
                    this.ID     = 0;
                    this.amount = 0;
                    this.PosX   = -100;
                    this.PosY   = -100;
                }
                else
                {
                    that.ShowDialog2("Backpack full!", 200);
                }
            }
        }
Пример #2
0
 public static void SpliceItem(int SeedToUse, Block tree, Growalone th)
 {
     if (SeedToUse == 3 && tree.IntData[0] == 6)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(4),
             " tree!"
         }), 1000);
         tree.IntData[0] = 4;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
     }
     else if (SeedToUse == 7 && tree.IntData[0] == 2)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(4),
             " tree!"
         }), 1000);
         tree.IntData[0] = 4;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 7 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(12),
             " tree!"
         }), 1000);
         tree.IntData[0] = 12;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 6)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(12),
             " tree!"
         }), 1000);
         tree.IntData[0] = 12;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 4)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(14),
             " tree!"
         }), 1000);
         tree.IntData[0] = 14;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 5 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(14),
             " tree!"
         }), 1000);
         tree.IntData[0] = 14;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 3 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(16),
             " tree!"
         }), 1000);
         tree.IntData[0] = 16;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 2)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(16),
             " tree!"
         }), 1000);
         tree.IntData[0] = 16;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 12)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(18),
             " tree!"
         }), 1000);
         tree.IntData[0] = 18;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 13 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(18),
             " tree!"
         }), 1000);
         tree.IntData[0] = 18;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 5 && tree.IntData[0] == 6)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(20),
             " tree!"
         }), 1000);
         tree.IntData[0] = 20;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 7 && tree.IntData[0] == 4)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(20),
             " tree!"
         }), 1000);
         tree.IntData[0] = 20;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 17 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(22),
             " tree!"
         }), 1000);
         tree.IntData[0] = 22;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 16)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(22),
             " tree!"
         }), 1000);
         tree.IntData[0] = 22;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 5 && tree.IntData[0] == 18)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(24),
             " tree!"
         }), 1000);
         tree.IntData[0] = 24;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 19 && tree.IntData[0] == 4)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(24),
             " tree!"
         }), 1000);
         tree.IntData[0] = 24;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 17 && tree.IntData[0] == 18)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(40),
             " tree!"
         }), 1000);
         tree.IntData[0] = 40;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 19 && tree.IntData[0] == 16)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(40),
             " tree!"
         }), 1000);
         tree.IntData[0] = 40;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 17 && tree.IntData[0] == 14)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(42),
             " tree!"
         }), 1000);
         tree.IntData[0] = 42;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 15 && tree.IntData[0] == 16)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(42),
             " tree!"
         }), 1000);
         tree.IntData[0] = 42;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 25 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(44),
             " tree!"
         }), 1000);
         tree.IntData[0] = 44;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 24)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(44),
             " tree!"
         }), 1000);
         tree.IntData[0] = 44;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 13 && tree.IntData[0] == 22)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(46),
             " tree!"
         }), 1000);
         tree.IntData[0] = 46;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 23 && tree.IntData[0] == 12)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(46),
             " tree!"
         }), 1000);
         tree.IntData[0] = 46;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 45 && tree.IntData[0] == 2)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(50),
             " tree!"
         }), 1000);
         tree.IntData[0] = 50;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 3 && tree.IntData[0] == 44)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(50),
             " tree!"
         }), 1000);
         tree.IntData[0] = 50;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 41 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(52),
             " tree!"
         }), 1000);
         tree.IntData[0] = 52;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 40)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(52),
             " tree!"
         }), 1000);
         tree.IntData[0] = 52;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 46)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(56),
             " tree!"
         }), 1000);
         tree.IntData[0] = 56;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 47 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(56),
             " tree!"
         }), 1000);
         tree.IntData[0] = 56;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 3 && tree.IntData[0] == 14)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(54),
             " tree!"
         }), 1000);
         tree.IntData[0] = 54;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 15 && tree.IntData[0] == 2)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(54),
             " tree!"
         }), 1000);
         tree.IntData[0] = 54;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 19 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(58),
             " tree!"
         }), 1000);
         tree.IntData[0] = 58;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 18)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(58),
             " tree!"
         }), 1000);
         tree.IntData[0] = 58;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 19 && tree.IntData[0] == 24)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(60),
             " tree!"
         }), 1000);
         tree.IntData[0] = 58;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 25 && tree.IntData[0] == 18)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(60),
             " tree!"
         }), 1000);
         tree.IntData[0] = 58;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 49 && tree.IntData[0] == 18)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(60),
             " tree!"
         }), 1000);
         tree.IntData[0] = 60;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 19 && tree.IntData[0] == 48)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(60),
             " tree!"
         }), 1000);
         tree.IntData[0] = 60;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 25 && tree.IntData[0] == 18)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(62),
             " tree!"
         }), 1000);
         tree.IntData[0] = 64;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 19 && tree.IntData[0] == 24)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(62),
             " tree!"
         }), 1000);
         tree.IntData[0] = 64;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 49 && tree.IntData[0] == 20)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(64),
             " tree!"
         }), 1000);
         tree.IntData[0] = 62;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 21 && tree.IntData[0] == 48)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(64),
             " tree!"
         }), 1000);
         tree.IntData[0] = 62;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 25 && tree.IntData[0] == 22)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(70),
             " tree!"
         }), 1000);
         tree.IntData[0] = 70;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 23 && tree.IntData[0] == 24)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(70),
             " tree!"
         }), 1000);
         tree.IntData[0] = 70;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 49 && tree.IntData[0] == 24)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(70),
             " tree!"
         }), 1000);
         tree.IntData[0] = 70;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else if (SeedToUse == 25 && tree.IntData[0] == 48)
     {
         th.ShowDialog(string.Concat(new string[]
         {
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed have\nbeen spliced to create a ",
             ItemData.ReturnItemName(72),
             " tree!"
         }), 1000);
         tree.IntData[0] = 72;
         tree.IntData[1] = 1000;
         tree.IntData[2] = 0;
         tree.IntData[4] = 1;
     }
     else
     {
         th.ShowDialog(string.Concat(new string[]
         {
             "Uhm, ",
             ItemData.ReturnItemName(SeedToUse),
             " and ",
             ItemData.ReturnItemName(tree.IntData[0]),
             " Seed can't be spliced."
         }), 1000);
         if (th.AddItem(SeedToUse))
         {
         }
     }
 }
Пример #3
0
        public static void BuyItem(PlayerData playerData, Item[] inventory, Rectangle[] craftRectangles, MouseState mouseState, Growalone growalone)
        {
            Point value = new Point(mouseState.X, mouseState.Y);

            if (craftRectangles[1].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying a Small Lock costs 50 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 50)
                    {
                        if (!growalone.AddItem(26))
                        {
                            MessageBox.Show("You can't buy a Small Lock for 50 gems :(. You will need to trash some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 50;
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Small Lock.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[2].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying a Medium Lock costs 100 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 100)
                    {
                        if (!growalone.AddItem(28))
                        {
                            MessageBox.Show("You can't buy a Medium Lock for 100 Coins :(. You will need to trash some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 100;
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Medium Lock.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[3].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying a Large Lock costs 200 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 200)
                    {
                        if (!growalone.AddItem(30))
                        {
                            MessageBox.Show("You can't buy a Large Lock for 200 gems :(. You will need to trash some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 200;
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Large Lock.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[4].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying a World Lock costs 500 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 500)
                    {
                        if (!growalone.AddItem(38))
                        {
                            MessageBox.Show("You can't buy a World Lock for 500 Coins :(. You will need to trash some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 500;
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 World Lock.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[0].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Getting an Inventory Upgrade costs 50 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 50 && playerData.BackPackSlotsUpgraded < 8)
                    {
                        Shop.UpgradeBackpack(growalone, playerData);
                        playerData.Gems -= 50;
                        MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Inventory Upgrade.", "Purchase Successful!");
                    }
                    else if (playerData.Gems >= 50 && playerData.BackPackSlotsUpgraded >= 8)
                    {
                        MessageBox.Show("You can't upgrade your backpack anymore! Why would you need more space in the first place?!", "Purchase Failed");
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[5].Contains(value))
            {
                if (DateTime.Now.Month == 10 && DateTime.Now.Day == 5)
                {
                    DialogResult dialogResult = MessageBox.Show("Buying a Cake costs 1 Coin. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        if (playerData.Gems >= 1)
                        {
                            if (!growalone.AddItem(96))
                            {
                                MessageBox.Show("You can't buy a Cake for 1 Coin :(. You will need to trash or drop some items before continuing.", "Not enough space!");
                            }
                            else
                            {
                                playerData.Gems--;
                                MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Cake.", "Purchase Successful!");
                            }
                        }
                        else
                        {
                            MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                        }
                    }
                }
                else
                {
                    MessageBox.Show("No more cakes! I guess you had enough! This shop is closed!", "Purchase Failed");
                }
            }
            else if (craftRectangles[6].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying a Crown costs 600 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 600)
                    {
                        if (!growalone.AddItem(102))
                        {
                            MessageBox.Show("You can't buy a Crown for 600 Coins :(. You will need to trash or drop some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 600;
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Crown.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[7].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying a pair of devil wings costs 2,000 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 2000)
                    {
                        if (!growalone.AddItem(88))
                        {
                            MessageBox.Show("You can't buy a pair of devil wings for 2,000 Coins :(. You will need to trash or drop some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 2000;
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Devil Wings.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[8].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying the Nature pack costs 50 Coins.\r\n\r\nThe pack contains:\r\n- 50 Roses\r\n- 50 Dandelions\r\n- 50 Bushes\r\n- 50 Saplings\r\n\r\nAre you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 50)
                    {
                        byte amountOfFreeSlots = growalone.GetAmountOfFreeSlots();
                        if (amountOfFreeSlots < 4)
                        {
                            MessageBox.Show("You can't buy the Nature pack for 50 Coins :(. You will need to trash or drop some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 50;
                            growalone.AddItem(14, 50);
                            growalone.AddItem(100, 50);
                            growalone.AddItem(128, 50);
                            growalone.AddItem(116, 50);
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot: 50 Roses, 50 Dandelions, 50 Bushes and 50 Saplings.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[9].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying the Furniture pack costs 150 Coins. \r\n\r\nYou will get 4 random items in different amounts.\r\nThe items you can get are shown here:\r\n\r\n- Wooden Chair\r\n- Wooden Table\r\n- Sign\r\n- Holographic Sign\r\n- Desktop PC\r\n- Beachy Painting\r\n- Chest\r\n- Coinbox\r\n\r\nAre you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 100)
                    {
                        byte amountOfFreeSlots = growalone.GetAmountOfFreeSlots();
                        if (amountOfFreeSlots < 4)
                        {
                            MessageBox.Show("You can't buy the Furniture pack for 150 Coins :(. You will need to trash or drop some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            int[] array = new int[]
                            {
                                40,
                                42,
                                46,
                                98,
                                118,
                                114,
                                18,
                                112
                            };
                            int   amount = 10;
                            int[] array2 = new int[4];
                            int[] array3 = array2;
                            for (int i = 0; i < array3.Length; i++)
                            {
                                array3[i] = new Random().Next(0, array.Length);
                                Thread.Sleep(20);
                            }
                            for (int i = 0; i < array3.Length; i++)
                            {
                                growalone.AddItem(array[array3[i]], amount);
                            }
                            playerData.Gems -= 100;
                            MessageBox.Show(string.Concat(new string[]
                            {
                                "You now have ",
                                playerData.Gems.ToString(),
                                " Coins left.\r\nGot: ",
                                amount.ToString(),
                                " ",
                                ItemData.ReturnItemNamePlural(array[array3[0]]),
                                ", \n",
                                amount.ToString(),
                                " ",
                                ItemData.ReturnItemNamePlural(array[array3[1]]),
                                ", \n",
                                amount.ToString(),
                                " ",
                                ItemData.ReturnItemNamePlural(array[array3[2]]),
                                ", \n",
                                amount.ToString(),
                                " ",
                                ItemData.ReturnItemNamePlural(array[array3[3]]),
                                ", \n."
                            }), "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
            else if (craftRectangles[10].Contains(value))
            {
                DialogResult dialogResult = MessageBox.Show("Buying a pair of devil wings costs 2,000 Coins. Are you sure you want to buy this?", "Purchase Confirmation", MessageBoxButtons.YesNo);
                if (dialogResult == DialogResult.Yes)
                {
                    if (playerData.Gems >= 100)
                    {
                        if (!growalone.AddItem(126))
                        {
                            MessageBox.Show("You can't buy the Dynamite for 100 Coins :(. You will need to trash or drop some items before continuing.", "Not enough space!");
                        }
                        else
                        {
                            playerData.Gems -= 2000;
                            MessageBox.Show("You now have " + playerData.Gems.ToString() + " Coins left.\nGot 1 Dynamite.", "Purchase Successful!");
                        }
                    }
                    else
                    {
                        MessageBox.Show("You don't have enough Coins to buy this! Go get more by smashing some blocks!", "Purchase Failed");
                    }
                }
            }
        }