Esempio n. 1
0
 private static void Main(string[] args)
 {
     try
     {
         using (Growalone growalone = new Growalone())
         {
             Window.FreeConsole();
             if (args.Length > 0)
             {
                 if (args[0] == "-debug")
                 {
                     Window.AllocConsole();
                     growalone.Run();
                 }
                 else
                 {
                     MessageBox.Show("The game didn't get the correct arguments! Please try running the game without any arguments!", "Error processing cmd arguments");
                     growalone.Run();
                 }
             }
             else
             {
                 growalone.Run();
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Whoops, Growalone crashed!\r\n\r\nThe error code is here:\r\n\r\n" + ex.ToString() + "\r\nPlease screenshot this error message and report this bug by sending a message at [email protected]!\r\nThanks for playing Growalone!", "Whoops, Growalone crashed!", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }
Esempio n. 2
0
 public WorldButton(Growalone growalone, string worldName, Rectangle btn)
 {
     this.Game = growalone;
     this.AssignedWorldName = worldName;
     this.ButtonRectangle   = btn;
     this.Initialized       = true;
 }
Esempio n. 3
0
        public static string ShowInputBox(string prompt, string title, Growalone game)
        {
            game.isRunning = false;
            string result = Interaction.InputBox(prompt, title, "", -1, -1);

            game.isRunning = true;
            return(result);
        }
 public void AddAchievement(string Achievement, Growalone game)
 {
     if (!this.AchievementsEarned[Achievement])
     {
         this.AchievementsEarned[Achievement] = true;
         this.AchievementPoints += (int)this.AchievementPointsGet[Achievement];
         game.StarCollected      = Achievement;
         PlayerData expr_46 = game.playerData;
         expr_46.Stars += 1;
         game.ShowMsgBox(new DefaultMsgAction(), Achievement.ToUpper() + " CLEAR!\n\n\nDo you want to Save?", "You Got a Star!");
     }
 }
Esempio n. 5
0
 public void DropItem(int ID, byte Amount, int X, int Y, Growalone growalone)
 {
     for (int i = 0; i < 1024; i++)
     {
         if (this.worldItems[i] == null || this.worldItems[i] == new WorldItem(0, 0, -100, -100))
         {
             this.worldItems[i] = new WorldItem(ID, Amount, X, Y);
             return;
         }
     }
     growalone.ShowDialog("World item limit reached!");
 }
 public void LoadContent(Growalone growalone)
 {
     try
     {
         this.spritesheet = growalone.Content.Load <Texture2D>("star");
     }
     catch
     {
         Color[]   data      = GraphicOptions.DrawMissingnoTexture();
         Texture2D texture2D = new Texture2D(growalone.graphics.GraphicsDevice, 75, 25);
         texture2D.SetData <Color>(data);
         this.spritesheet = texture2D;
     }
 }
Esempio n. 7
0
        public override void Draw(Growalone game)
        {
            SpriteEffects effects;

            if (this.facingLeft)
            {
                effects = SpriteEffects.FlipHorizontally;
            }
            else
            {
                effects = SpriteEffects.None;
            }
            game.spriteBatch.Draw(game.HorseTexture, new Rectangle(-game.cameraX + this.X - 32 + (game.GraphicsDevice.Viewport.Width - 800), -game.cameraY + this.Y + (game.GraphicsDevice.Viewport.Height - 480), 32, 32), new Rectangle?(new Rectangle(0, 0, 32, 32)), Color.White, 0f, Vector2.Zero, effects, 0f);
        }
Esempio n. 8
0
 public void SpawnEnemy(int ID, int X, int Y, Growalone growalone)
 {
     for (int i = 0; i < 1024; i++)
     {
         if (this.enemies[i] == null)
         {
             if (ID == 1)
             {
                 this.enemies[i] = new EnemyHorse(X, Y);
             }
             return;
         }
     }
     growalone.ShowDialog("Enemy limit reached!");
 }
Esempio n. 9
0
        public override void Update(Growalone game)
        {
            if (this.isBeingAttackedAlongWithPlayer)
            {
                this.isPlayerRiding          = false;
                game.enemyThatThePlayerRides = null;
                game.doesRideAnEnemy         = false;
            }
            if (this.isPlayerRiding)
            {
                this.X = game.guyX;
                this.Y = game.guyY;
            }
            int x    = this.X;
            int y    = this.Y;
            int num  = (int)Math.Round((double)this.X / 32.0);
            int num2 = (int)Math.Floor((double)this.Y / 32.0);

            try
            {
                Console.WriteLine(string.Concat(new object[]
                {
                    num.ToString(),
                    ",",
                    num2.ToString(),
                    "=",
                    game.world.Map[num, num2, 0].ID
                }));
                if (game.world.Map[num, num2, 0].ID == 86)
                {
                    this.Y += 4;
                }
                else if (game.collided[game.world.Map[num, num2, 0].ID] == 0)
                {
                    this.Y += 8;
                }
                else if (game.collided[game.world.Map[num, num2, 0].ID] != 3)
                {
                    if (game.collided[game.world.Map[num, num2, 0].ID] == 1)
                    {
                        this.Y -= 8;
                    }
                }
            }
            catch
            {
            }
        }
Esempio n. 10
0
        public static void UpgradeBackpack(Growalone growalone, PlayerData playerData)
        {
            Item[] array = new Item[growalone.Inventory.Length];
            playerData.BackPackSlotsUpgraded++;
            array = growalone.Inventory;
            growalone.Inventory = new Item[playerData.BackPackSlotsUpgraded * 10];
            for (int i = 0; i < growalone.Inventory.Length; i++)
            {
                growalone.Inventory[i] = new Item();
            }
            int num = Math.Min(array.Length, growalone.Inventory.Length);

            for (int i = 0; i < num; i++)
            {
                growalone.Inventory[i] = array[i];
            }
        }
Esempio n. 11
0
        public CharacterSprite(Growalone growalone)
        {
            this.LoadContent(growalone);
            this.game = growalone;
            for (int i = 0; i < 360; i++)
            {
                this.deadAnimFrameHeights[i] = 0;
            }
            int num  = 0;
            int num2 = 16;

            for (int i = 60; i < 360; i += 2)
            {
                this.deadAnimFrameHeights[i]     = num;
                this.deadAnimFrameHeights[i + 1] = num;
                num -= num2;
                num2--;
            }
        }
 public void Update(Statistics stats, Growalone game)
 {
     if (stats.BlocksBroken >= 100)
     {
         this.AddAchievement("Smasher", game);
     }
     if (stats.BlocksBroken >= 500)
     {
         this.AddAchievement("Awesome Smasher", game);
     }
     if (stats.BlocksBroken >= 1000)
     {
         this.AddAchievement("A Wrecking Ball", game);
     }
     if (stats.BlocksPlaced >= 100)
     {
         this.AddAchievement("Builder", game);
     }
     if (stats.BlocksPlaced >= 500)
     {
         this.AddAchievement("Strong Builder", game);
     }
     if (stats.BlocksPlaced >= 1000)
     {
         this.AddAchievement("Expert Builder", game);
     }
     if (stats.TreesPlanted >= 100)
     {
         this.AddAchievement("Farmer", game);
     }
     if (stats.TreesPlanted >= 500)
     {
         this.AddAchievement("Experienced Farmer", game);
     }
     if (stats.TreesPlanted >= 1000)
     {
         this.AddAchievement("Farmer in the Dell", game);
     }
 }
Esempio n. 13
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);
                }
            }
        }
Esempio n. 14
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");
                    }
                }
            }
        }
Esempio n. 15
0
 public void LoadContent(Growalone growalone)
 {
     this.spritesheet = growalone.Content.Load <Texture2D>("charanims");
 }
Esempio n. 16
0
 public void RegisterHit(int blockX, int blockY, Growalone that)
 {
 }
Esempio n. 17
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))
         {
         }
     }
 }
 public StoreCoinsAction(Growalone that, Block tile) : base(new ActionArgument[0])
 {
     this.game   = that;
     this.toEdit = tile;
     this.args   = new ActionArgument[1];
 }
Esempio n. 19
0
 public virtual void Draw(Growalone game)
 {
 }
        public static Texture2D connectTile(Block[,,] Map2, int BlockX, int BlockY, int ID, Growalone ga)
        {
            int[,,] array = new int[100, 60, 5];
            for (int i = 0; i < 100; i++)
            {
                for (int j = 0; j < 60; j++)
                {
                    for (int k = 0; k < 5; k++)
                    {
                    }
                }
            }
            int       num = 0;
            Texture2D result;

            if (num != 1)
            {
                Texture2D texture2D;
                if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 1];
                }
                else if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] != ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 2];
                }
                else if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] != ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 3];
                }
                else if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] != ID)
                {
                    texture2D = ga.tileTextures[ID, 4];
                }
                else if (array[BlockX, BlockY - 1, num] != ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 5];
                }
                else if (array[BlockX, BlockY - 1, num] != ID & array[BlockX - 1, BlockY, num] != ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] != ID)
                {
                    texture2D = ga.tileTextures[ID, 6];
                }
                else if (array[BlockX, BlockY - 1, num] != ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] != ID & array[BlockX, BlockY + 1, num] != ID)
                {
                    texture2D = ga.tileTextures[ID, 7];
                }
                else if (array[BlockX, BlockY - 1, num] != ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] != ID)
                {
                    texture2D = ga.tileTextures[ID, 8];
                }
                else if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] != ID & array[BlockX + 1, BlockY, num] != ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 9];
                }
                else if (array[BlockX, BlockY - 1, num] != ID & array[BlockX - 1, BlockY, num] != ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 10];
                }
                else if (array[BlockX, BlockY - 1, num] != ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] != ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 11];
                }
                else if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] != ID & array[BlockX + 1, BlockY, num] == ID & array[BlockX, BlockY + 1, num] != ID)
                {
                    texture2D = ga.tileTextures[ID, 12];
                }
                else if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] == ID & array[BlockX + 1, BlockY, num] != ID & array[BlockX, BlockY + 1, num] != ID)
                {
                    texture2D = ga.tileTextures[ID, 13];
                }
                else if (array[BlockX, BlockY - 1, num] == ID & array[BlockX - 1, BlockY, num] != ID & array[BlockX + 1, BlockY, num] != ID & array[BlockX, BlockY + 1, num] != ID)
                {
                    texture2D = ga.tileTextures[ID, 14];
                }
                else if (array[BlockX, BlockY - 1, num] != ID & array[BlockX - 1, BlockY, num] != ID & array[BlockX + 1, BlockY, num] != ID & array[BlockX, BlockY + 1, num] == ID)
                {
                    texture2D = ga.tileTextures[ID, 15];
                }
                else
                {
                    texture2D = ga.tileTextures[ID, num];
                }
                result = texture2D;
            }
            else
            {
                result = null;
            }
            return(result);
        }
        public static Texture2D ConnectLocked(byte[,] Map, int ID, Growalone ga, int BlockX, int BlockY)
        {
            Texture2D result;

            if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[1];
            }
            else if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] != ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[2];
            }
            else if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] != ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[3];
            }
            else if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] != ID)
            {
                result = ga.LockedTile[4];
            }
            else if ((int)Map[BlockX, BlockY - 1] != ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[5];
            }
            else if ((int)Map[BlockX, BlockY - 1] != ID & (int)Map[BlockX - 1, BlockY] != ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] != ID)
            {
                result = ga.LockedTile[6];
            }
            else if ((int)Map[BlockX, BlockY - 1] != ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] != ID & (int)Map[BlockX, BlockY + 1] != ID)
            {
                result = ga.LockedTile[7];
            }
            else if ((int)Map[BlockX, BlockY - 1] != ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] != ID)
            {
                result = ga.LockedTile[8];
            }
            else if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] != ID & (int)Map[BlockX + 1, BlockY] != ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[9];
            }
            else if ((int)Map[BlockX, BlockY - 1] != ID & (int)Map[BlockX - 1, BlockY] != ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[10];
            }
            else if ((int)Map[BlockX, BlockY - 1] != ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] != ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[11];
            }
            else if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] != ID & (int)Map[BlockX + 1, BlockY] == ID & (int)Map[BlockX, BlockY + 1] != ID)
            {
                result = ga.LockedTile[12];
            }
            else if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] == ID & (int)Map[BlockX + 1, BlockY] != ID & (int)Map[BlockX, BlockY + 1] != ID)
            {
                result = ga.LockedTile[13];
            }
            else if ((int)Map[BlockX, BlockY - 1] == ID & (int)Map[BlockX - 1, BlockY] != ID & (int)Map[BlockX + 1, BlockY] != ID & (int)Map[BlockX, BlockY + 1] != ID)
            {
                result = ga.LockedTile[14];
            }
            else if ((int)Map[BlockX, BlockY - 1] != ID & (int)Map[BlockX - 1, BlockY] != ID & (int)Map[BlockX + 1, BlockY] != ID & (int)Map[BlockX, BlockY + 1] == ID)
            {
                result = ga.LockedTile[15];
            }
            else
            {
                result = ga.LockedTile[0];
            }
            return(result);
        }
Esempio n. 22
0
        public void Draw(SpriteBatch spriteBatch, Growalone that, Vector2 posOfCam, int ActualCameraX)
        {
            int num  = (int)posOfCam.Y;
            int num2 = this.PosX - ActualCameraX + (that.GraphicsDevice.Viewport.Width - 800) / 2;
            int num3 = this.PosY - num + (that.GraphicsDevice.Viewport.Height - 480) / 2;

            if (ItemData.IsPlantable(this.ID))
            {
                Color[] array = new Color[that.tileTextures[this.ID - 1, 0].Width * that.tileTextures[this.ID - 1, 0].Height];
                that.tileTextures[this.ID - 1, 0].GetData <Color>(array);
                if (array[that.colorIndex1].A < 255 && array[that.colorIndex2].A < 255)
                {
                    spriteBatch.Draw(that.seedTexture, new Rectangle(num2, num3 + (int)this.anim, that.seedWidth, that.seedHeight), new Rectangle?(new Rectangle(0, 0, that.seedWidth, that.seedHeight)), array[that.colorIndex1]);
                    spriteBatch.Draw(that.seedTexture, new Rectangle(num2, num3 + (int)this.anim, that.seedWidth, that.seedHeight), new Rectangle?(new Rectangle(that.seedWidth, 0, that.seedWidth, that.seedHeight)), array[that.colorIndex2]);
                }
                else
                {
                    bool flag = false;
                    int  num4 = 0;
                    int  num5 = 0;
                    int  num6 = 0;
                    while (array[num4].A > 254 && array[num5].A > 254)
                    {
                        for (int i = 0; i < array.Length; i++)
                        {
                            if (array[i].A > 254 && !flag)
                            {
                                num4 = i;
                                i   += 100;
                                flag = true;
                            }
                            else if (array[i].A > 254 && flag)
                            {
                                num5 = i;
                                break;
                            }
                        }
                        if (num6 == 1)
                        {
                            break;
                        }
                        num6++;
                    }
                    if (num4 == 0)
                    {
                        num4 = 500;
                    }
                    if (num5 == 0)
                    {
                        num5 = 1000;
                    }
                    spriteBatch.Draw(that.seedTexture, new Rectangle(num2, num3 + (int)this.anim, that.seedWidth, that.seedHeight), new Rectangle?(new Rectangle(0, 0, that.seedWidth, that.seedHeight)), array[num4]);
                    spriteBatch.Draw(that.seedTexture, new Rectangle(num2, num3 + (int)this.anim, that.seedWidth, that.seedHeight), new Rectangle?(new Rectangle(that.seedWidth, 0, that.seedWidth, that.seedHeight)), array[num5]);
                }
            }
            else if (this.ID >= 0)
            {
                spriteBatch.Draw(that.tileTextures[this.ID, 0], new Rectangle(num2, num3 + (int)this.anim, 17, 17), Color.White);
            }
            spriteBatch.DrawString(that.defaultFont, this.amount.ToString(), new Vector2((float)num2, (float)(num3 + (int)this.anim)), Color.White, 0f, Vector2.Zero, 0.25f, SpriteEffects.None, 0f);
        }
Esempio n. 23
0
 public StarSprite(Growalone growalone)
 {
     this.game = growalone;
 }
Esempio n. 24
0
 public virtual void Update(Growalone game)
 {
 }
 public ExecuteCommandAction(Growalone growalone) : base(new ActionArgument[0])
 {
     this.growalone = growalone;
     this.args      = new ActionArgument[1];
 }